/* =========================
タイピングの学校
========================= */

:root {
  --sky:    #f0f7ff;
  --cream:  #fffbf2;
  --white:  #ffffff;
  --blue:   #3b82f6;
  --blue-l: #dbeafe;
  --blue-d: #1d4ed8;
  --yellow: #fbbf24;
  --yel-l:  #fef9c3;
  --yel-d:  #92400e;
  --green:  #22c55e;
  --grn-l:  #dcfce7;
  --orange: #f97316;
  --org-l:  #ffedd5;
  --pink:   #ec4899;
  --pnk-l:  #fce7f3;
  --text:   #1e293b;
  --muted:  #64748b;
  --radius: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-hover: 0 12px 40px rgba(0,0,0,0.14);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--cream);
  color: var(--text);
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}


/* HERO */
.hero {
  position: relative; z-index: 1;
  background: linear-gradient(160deg, #e0f2fe 0%, #fef9c3 60%, #fce7f3 100%);
  overflow: hidden;
  padding: 4rem 2rem 3rem;
  text-align: center;
}

.dot {
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
  animation: float 6s ease-in-out infinite;
}

.dot1 { width:60px;height:60px; background:var(--yellow); top:10%; left:5%; animation-delay:0s; }
.dot2 { width:30px;height:30px; background:var(--pink);   top:20%; right:8%; animation-delay:1s; }
.dot3 { width:45px;height:45px; background:var(--green);  bottom:15%; left:12%; animation-delay:2s; }
.dot4 { width:20px;height:20px; background:var(--blue);   bottom:20%; right:15%; animation-delay:0.5s; }
.dot5 { width:35px;height:35px; background:var(--orange); top:50%; left:2%; animation-delay:1.5s; }
@keyframes float {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-18px) rotate(10deg); }
}

.hero-eyebrow {
  display: inline-block;
  background: var(--white);
  border: 2px solid var(--blue);
  color: var(--blue-d);
  font-family: 'Nunito', sans-serif;
  font-weight: 900; 
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.35rem 1.1rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
  animation: popIn 0.5s cubic-bezier(.34,1.56,.64,1) both;
}

.hero-title {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  line-height: 1.5; color: var(--text);
  animation: popIn 0.5s 0.08s cubic-bezier(.34,1.56,.64,1) both;
}
.hero-title em {
  font-style: normal; position: relative; color: var(--blue-d);
}
.hero-title em::after {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 6px;
  background: var(--yellow);
  border-radius: 4px; z-index: -1;
}
.hero-sub {
  margin-top: 1.2rem;
  color: var(--muted);
  max-width: 520px; margin-inline: auto;
  line-height: 1.9;
  animation: popIn 0.5s 0.16s cubic-bezier(.34,1.56,.64,1) both;
}
.keyboard {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; margin: 2.2rem auto 0;
  width: fit-content;
  animation: popIn 0.5s 0.24s cubic-bezier(.34,1.56,.64,1) both;
}
.kb-row { display: flex; gap: 8px; }
.kb-row1 { display: flex; gap: 8px; margin-left: 12px;}
.kb-row2 { display: flex; gap: 8px; margin-left: 24px;}
.k {
  min-width: 42px; height: 42px; padding: 0 10px;
  background: var(--white);
  border: 2px solid #cbd5e1;
  border-bottom: 4px solid #94a3b8;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Nunito', sans-serif; font-weight: 800;
  color: var(--text);
  transition: transform 0.1s, border-bottom-width 0.1s;
  cursor: default; user-select: none;
}
.k.home {
  background: var(--blue-l);
  border-color: var(--blue);
  border-bottom-color: var(--blue-d);
  color: var(--blue-d);
}
.k.space { min-width: 220px; background: var(--yel-l); border-color: var(--yellow); border-bottom-color: #d97706; color: #92400e;}
.k:hover { transform: translateY(2px); border-bottom-width: 2px; }
.k.home.bounce { animation: keyBounce 2.4s ease-in-out infinite; }
.k.home.bounce:nth-child(n) {
  animation-delay: calc(var(--i) * 0.15s);
}
@keyframes keyBounce {
  0%,70%,100% { transform: translateY(0); border-bottom-width: 4px; }
  75% { transform: translateY(3px); border-bottom-width: 1px; }
}
@keyframes popIn {
  from { opacity:0; transform: scale(0.85) translateY(16px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}
	
@media (max-width:600px){

.k{
  min-width:30px;
  height:30px;
  font-size:14px;
  padding:0 6px;
}

.k.space{
  min-width:160px;
}

.kb-row{ gap:4px; }
.kb-row1{ gap:4px; margin-left:8px; }
.kb-row2{ gap:4px; margin-left:16px; }

}

/* RIBBON */
.ribbon {
  background: var(--yellow);
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
}
	
.kb-row3{
  display:grid;
  grid-template-columns: repeat(4, 1fr); /* 2列 */
  gap:8px;
  margin:12px 0;
}

/* タブレット（iPad） */
@media (max-width: 1024px){
  .kb-row3{
    grid-template-columns: repeat(2, 1fr);
  }
}

/* スマホ */
@media (max-width: 600px){
  .kb-row3{
    grid-template-columns: 1fr;
  }
  .k2{
    height:50px;
    font-size:15px;
  }
}
	
.ribbon-item{
  display:flex;
  width:100%;
  margin:0;
}
	
.k2 {
  width:100%;
  min-width:0;
  height:42px;
  padding:0 10px;
  background:var(--white);
  border:2px solid #cbd5e1;
  border-bottom:4px solid #94a3b8;
  border-radius:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-family:'Nunito', sans-serif;
  font-weight:800;
  color:var(--text);
  transition:transform 0.1s, border-bottom-width 0.1s;
  cursor:default;
  user-select:none;
  gap:8px;
}
	
.k2.blue{
  border-color:#93c5fd;
  border-bottom-color:#2563eb;
  color:#1d4ed8;
}

.k2.orange{
  border-color:#fdba74;
  border-bottom-color:#ea580c;
  color:#c2410c;
}
	
.k2.green{
  border-color:#86efac;
  border-bottom-color:#16a34a;
  color:#15803d;
}

.k2.pink{
  border-color:#f9a8d4;
  border-bottom-color:#db2777;
  color:#be185d;
}
	
.k2:hover{
  transform:translateY(2px);
  border-bottom-width:3px;
  background: var(--blue-l);
  border-color: var(--blue);
  border-bottom-color: var(--blue-d);
  color: var(--blue-d);
}

.k-item{
  display:flex;
  align-items:center;
  gap:8px;
}

.k-icon{
  width:20px;
  height:20px;
  object-fit:contain;
}

#typing-basic,
#typing-education{
  scroll-margin-top:100px;
}

/* MAIN */
main {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto;
  padding: 0 2rem 5rem;
}
.sec-head {
  display: flex; align-items: center; gap: 1rem;
  margin: 3rem 0 1.5rem;
}
.sec-badge {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 14px; flex-shrink: 0;
}
.sec-badge.blue   { background: var(--blue-l); }
.sec-badge.green  { background: var(--grn-l); }
.sec-head h2 { font-family: 'Nunito', sans-serif; font-weight: 900; color: var(--text); }
.sec-head .sec-count {
  margin-left: auto; font-weight: 700;
  color: var(--muted); background: var(--white);
  border: 2px solid #e2e8f0;
  padding: 0.25rem 0.8rem; border-radius: 100px;
}

.category-title1 {
    font-size: 1.6em;
    font-weight: bold;
    margin: 20px 0 20px;
    padding-left: 12px;
    border-left: 6px solid #f7d668;
}

.category-title2 {
    font-size: 1.6em;
    font-weight: bold;
    margin: 20px 0 20px;
    padding-left: 12px;
    border-left: 6px solid #85ea5b;
}

/* GRID */
.grid { 
	display: grid; 
	gap: 1.2rem; 
	grid-template-columns: 
	repeat(auto-fill, minmax(230px, 1fr)); 
	counter-reset: card-num; 
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  text-decoration: none; color: var(--text);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  border: 2px solid transparent;
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s, border-color 0.2s;
  animation: popIn 0.4s ease both;
  padding: 10px;
  counter-increment: card-num;
}
	
.card::after {
    content: counter(card-num);
    position: absolute;
    top: -30px;
    left: -12px;
    width: 45px;
    height: 51px;
    background: url(https://www.typing-gate.com/wordpress2/wp-content/themes/typing/img/item/typing-school/key1.svg) no-repeat center / contain;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}
	
.card:hover { transform: translateY(-8px) scale(1.01); box-shadow: var(--shadow-hover); }
.card:hover.card-blue   { border-color: var(--blue); }
.card:hover.card-yellow { border-color: var(--yellow); }
.card:hover.card-orange { border-color: var(--orange); }
.card:hover.card-pink   { border-color: var(--pink); }

.card-bar { height: 6px; }
.card-bar.blue   { background: linear-gradient(90deg, var(--blue), #60a5fa); }
.card-bar.yellow { background: linear-gradient(90deg, var(--yellow), #fde68a); }
.card-bar.green  { background: linear-gradient(90deg, var(--green), #86efac); }
.card-bar.orange { background: linear-gradient(90deg, var(--orange), #fdba74); }
.card-bar.pink   { background: linear-gradient(90deg, var(--pink), #f9a8d4); }

.card-img-wrap { position: relative; overflow: hidden; }
.card-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; transition: transform 0.4s; }
.card:hover .card-img { transform: scale(1.05); }

.card-label {
  position: absolute; top: 0.7rem; left: 0.7rem;
  font-family: 'Nunito', sans-serif; font-weight: 900;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.25rem 0.7rem; border-radius: 100px; color: #fff;
}
.card-label.blue   { background: var(--blue); }
.card-label.yellow { background: #d97706; }
.card-label.green  { background: #16a34a; }
.card-label.orange { background: var(--orange); }
.card-label.pink   { background: var(--pink); }

.card-body { padding: 1.1rem 1.2rem 1.3rem; flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.card-body h3 { font-family: 'Nunito', sans-serif; font-weight: 800; line-height: 1.5; color: #f97316;}
.card-body p  { color: var(--muted); line-height: 1.85; flex: 1; }

.card-cta {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-top: 0.7rem;
  font-family: 'Nunito', sans-serif; font-weight: 800;
  color: var(--yel-d); background: var(--yel-l);
  padding: 0.45rem 1rem; border-radius: 100px; width: fit-content;
  transition: background 0.2s, color 0.2s, gap 0.2s;
}
.card:hover .card-cta { background: var(--yellow); color: #fff; gap: 0.6rem; }

/* WIDE CARD */
.card-wide { grid-column: span 2; flex-direction: row; }
.card-wide .card-img-wrap { width: 42%; flex-shrink: 0; }
.card-wide .card-img { width: 100%; height: 100%; aspect-ratio: auto; }
.card-wide .card-body { padding: 1.8rem 2rem; justify-content: center; }
.card-wide .card-label { top: 1rem; left: 1rem; }
@media (max-width: 600px) {
  .card-wide { grid-column: span 1; flex-direction: column; }
  .card-wide .card-img-wrap { width: 100%; }
  .card-wide .card-img { aspect-ratio: 16/9; }
}

.edu-card-wrap{
  display: flex;
  flex-direction: column;
  gap: 15px;
  counter-reset: card-num;
}
	
/* EDU CARD */
.edu-card {
  background: var(--white); border-radius: var(--radius);
  text-decoration: none; color: var(--text); box-shadow: var(--shadow);
  display: flex; border: 2px solid transparent;
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s, border-color 0.2s;
  align-items: center;
  padding: 10px;
  animation: popIn 0.4s ease both;
  counter-increment: card-num;
}
	
.edu-card::after {
    content: counter(card-num);
    position: absolute;
    top: -30px;
    left: -12px;
    width: 45px;
    height: 51px;
    background: url(https://www.typing-gate.com/wordpress2/wp-content/themes/typing/img/item/typing-school/key2.svg) no-repeat center / contain;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}
	
.edu-card-img-wrap { position: relative; overflow: hidden;  flex-shrink: 0; }
.edu-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); border-color: var(--green); }
.edu-card-img { width: 300px; flex-shrink: 0; object-fit: cover; transition: transform 0.4s; display: block; }
.edu-card:hover .edu-card-img { transform: scale(1.04); }
.edu-card-body { 
	padding: 1.1rem 1.2rem 1.3rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem; 
}
.edu-label {
  display: inline-block;
  background: var(--grn-l); color: #16a34a;
  font-family: 'Nunito', sans-serif; font-weight: 900;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.25rem 0.8rem; border-radius: 100px; width: fit-content;
}
.edu-card-body h3 { font-family: 'Nunito', sans-serif; font-weight: 800; line-height: 1.6; color: var(--green);}
.edu-card-body p  { color: var(--muted); line-height: 1.9; }
.edu-cta {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: 'Nunito', sans-serif; font-weight: 800;
  color: #16a34a; background: var(--grn-l);
  padding: 0.5rem 1.1rem; border-radius: 100px; width: fit-content;
  transition: background 0.2s, color 0.2s, gap 0.2s;
}
.edu-card:hover .edu-cta { background: var(--green); color: #fff; gap: 0.6rem; }
@media (max-width: 640px) {
  .edu-card { flex-direction: column; }
  .edu-card-img { width: 100%; height: 180px; }
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.10s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.20s; }