/* 탭탭! 학교 키우기 홈페이지 — 게임과 같은 ✒️ 잉크 만화 톤
   종이 바탕 · 먹선 테두리 · 어긋난 그림자 · 옅은 망점 · 슬레이트 하늘 · 겨자색 버튼 (게임 web/next/skin-toon.css와 같은 색) */
:root {
  --bg: #ebe4d2;
  --paper: #f7f2e6;
  --paper-2: #ece4cf;
  --field: #fffdf7;
  --ink: #26221f;
  --ink-2: #554d45;
  --ink-3: #7c7367;
  --edge: #26221f;
  --drop: #26221f;
  --sky-1: #9fb2b6;
  --sky-2: #c2cdc8;
  --sky-3: #e2ddcd;
  --yellow: #e2b44a;
  --yellow-d: #a47a22;
  --yellow-s: #f3e6c2;
  --red: #b5492f;
  --green: #6f8f4a;
  --blue: #4f6b7d;
  --cloud: #fbf8f0;
  --cloud-shade: #d9d4c7;
  --dots: radial-gradient(rgba(38, 34, 31, .075) 1px, transparent 1.4px) 0 0 / 6px 6px;
  --display: "Black Han Sans", "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", sans-serif;
  --round: "Jua", "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1916;
    --paper: #26231f;
    --paper-2: #302c27;
    --field: #1f1c19;
    --ink: #f1e9d8;
    --ink-2: #c9bfad;
    --ink-3: #9a907f;
    --edge: #d9ceb6;
    --drop: #000;
    --sky-1: #2c3638;
    --sky-2: #232a2b;
    --sky-3: #1d1b18;
    --yellow-s: #3a3220;
    --cloud: #3a3732;
    --cloud-shade: #2c2a26;
    --dots: radial-gradient(rgba(241, 233, 216, .05) 1px, transparent 1.4px) 0 0 / 6px 6px;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1916;
  --paper: #26231f;
  --paper-2: #302c27;
  --field: #1f1c19;
  --ink: #f1e9d8;
  --ink-2: #c9bfad;
  --ink-3: #9a907f;
  --edge: #d9ceb6;
  --drop: #000;
  --sky-1: #2c3638;
  --sky-2: #232a2b;
  --sky-3: #1d1b18;
  --yellow-s: #3a3220;
  --cloud: #3a3732;
  --cloud-shade: #2c2a26;
  --dots: radial-gradient(rgba(241, 233, 216, .05) 1px, transparent 1.4px) 0 0 / 6px 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--dots), var(--bg);
  color: var(--ink);
  font: 16px/1.7 var(--body);
  word-break: keep-all;
  overflow-wrap: anywhere;
  overflow-x: clip;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; font-weight: 400; text-wrap: balance; }
p { margin: 0; }
p, li, label, summary { text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--ink); color: var(--paper); border-radius: 8px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }
/* 가로로 눕힌 아이폰의 노치·둥근 모서리 안쪽으로 */
.wrap { width: min(1080px, 100% - 2 * max(16px, env(safe-area-inset-left), env(safe-area-inset-right))); margin-inline: auto; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 버튼: 먹선 테두리 + 어긋난 그림자, 누르면 그림자 쪽으로 들어간다 */
.btn {
  --c: var(--yellow); --t: #26221f;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 10px 22px 12px;
  border: 2.5px solid var(--edge); border-radius: 12px;
  background: var(--c); color: var(--t);
  box-shadow: 4px 4px 0 var(--drop);
  font: 21px/1 var(--round); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
/* 터치 화면에선 탭한 뒤 hover가 눌어붙지 않게 마우스일 때만 */
@media (hover: hover) { .btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--drop); } }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--drop); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--play { min-height: 62px; padding-inline: 28px; font-size: 25px; }
.btn--ink { --c: var(--blue); --t: #f7f2e6; }
.btn--paper { --c: var(--paper); --t: var(--ink); }

/* ---------- 머리글: 로고와 언어만 */
.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--sky-1) 80%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background .2s ease, box-shadow .2s ease;
}
.top.is-scrolled { background: color-mix(in srgb, var(--paper) 92%, transparent); box-shadow: 0 2px 0 var(--edge); }
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand img { width: 36px; height: 36px; border-radius: 9px; border: 2px solid var(--edge); box-shadow: 2px 2px 0 var(--drop); }
.brand b { font: 21px/1 var(--display); font-weight: 400; white-space: nowrap; }
@media (max-width: 360px) { .brand b { font-size: 18px; } }

/* ---------- 첫 화면: 데스크톱은 왼쪽 제목·플레이·알림 신청, 오른쪽 영상. 900px 이하 한 줄일 때는 제목 → 영상 → 플레이·알림 신청 (HTML 순서도 이 순서) */
.hero {
  position: relative; isolation: isolate; overflow: clip;
  margin-top: -64px; padding-top: 64px;
  background: var(--dots), linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 38%, var(--sky-3) 72%, var(--bg) 100%);
}
.hero__in {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; grid-template-rows: auto 1fr;
  grid-template-areas: "head phone" "cta phone"; align-items: start; gap: 0 48px; padding: 44px 0 64px;
}
.hero__head { grid-area: head; }
.hero__cta { grid-area: cta; }
.hero h1 { font: clamp(44px, 6.2vw, 74px)/1.08 var(--display); letter-spacing: -0.02em; }
.nw, mark { white-space: nowrap; }
.hero mark, .wl mark { color: inherit; background: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 92%, transparent 92%); padding: 0 .06em; }
:root[data-theme="dark"] :is(.hero, .wl) mark { background: linear-gradient(transparent 62%, #8a6a1e 62%, #8a6a1e 94%, transparent 94%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.hero, .wl) mark { background: linear-gradient(transparent 62%, #8a6a1e 62%, #8a6a1e 94%, transparent 94%); } }

/* 특징 스티커 세 장 */
.feats { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; }
.feats li {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px 8px 9px;
  border: 2px solid var(--edge); border-radius: 10px; background: var(--paper); box-shadow: 3px 3px 0 var(--drop);
  font: 18px/1 var(--round);
}
.feats li:nth-child(1) { transform: rotate(-1.5deg); }
.feats li:nth-child(2) { transform: rotate(1deg); background: var(--yellow-s); }
.feats li:nth-child(3) { transform: rotate(-.6deg); }
.feats i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--paper-2); font-style: normal; font-size: 17px; }
.lead span { display: block; }
.lead { margin-top: 20px; max-width: 25em; font: clamp(19px, 1.9vw, 22px)/1.55 var(--round); color: var(--ink); }
.play { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 28px; }
/* 체크 표시 붙은 짧은 꼬리표 */
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font: 16px/1.3 var(--round); color: var(--ink-2); }
.checks li { display: inline-flex; align-items: center; gap: 6px; }
.checks li::before {
  content: ""; flex: none; width: 18px; height: 18px; border: 2px solid var(--edge); border-radius: 50%;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3 3 7-7' fill='none' stroke='%23f7f2e6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}

/* 앱 출시 알림 카드 */
.wl {
  position: relative; margin-top: 36px; max-width: 540px; padding: 24px 24px 22px;
  border: 2.5px solid var(--edge); border-radius: 14px;
  background: var(--dots), var(--paper); box-shadow: 6px 6px 0 var(--drop);
}
.wl::before {
  content: attr(data-tag); position: absolute; top: -15px; left: 18px; padding: 3px 10px 4px;
  border: 2px solid var(--edge); border-radius: 6px; background: var(--red); color: #f7f2e6; font: 14px/1.2 var(--round);
  transform: rotate(-2deg);
}
.wl h2 { font: 27px/1.2 var(--display); }
.wl__sub { margin-top: 8px; font: 18px/1.5 var(--round); color: var(--ink-2); }
.wl__form { margin-top: 18px; }
/* ① ② 단계 이름표 */
.step { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font: 17px/1.2 var(--round); color: var(--ink); }
.step span { display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid var(--edge); border-radius: 50%; background: var(--yellow); color: #26221f; font: 14px/1 var(--display); }
label.step { margin-top: 16px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.seg label { position: relative; display: block; -webkit-tap-highlight-color: transparent; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px;
  border: 2px solid var(--edge); border-radius: 10px; background: var(--field); color: var(--ink);
  font: 20px/1 var(--round); transition: background .1s ease, transform .1s ease, box-shadow .1s ease;
}
.seg i { font-style: normal; font-size: 20px; }
@media (hover: hover) { .seg label:hover span { background: var(--yellow-s); } }
.seg input:checked + span { background: var(--ink); color: var(--paper); box-shadow: 3px 3px 0 var(--yellow); }
.seg input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 3px; }
.wl__row { display: flex; gap: 10px; margin-top: 10px; }
.wl__row input {
  flex: 1; min-width: 0; min-height: 54px; padding: 0 16px;
  border: 2px solid var(--edge); border-radius: 10px; background: var(--field); color: var(--ink);
  font: 17px/1.2 var(--body);
}
.wl__row input::placeholder { color: var(--ink-3); }
.wl__row input:focus { outline: none; box-shadow: 3px 3px 0 var(--yellow); }
.wl__row .btn { flex: none; min-height: 54px; font-size: 20px; }
.wl__consent { margin-top: 6px; font: 15px/1.45 var(--round); color: var(--ink-2); }
.wl__consent label { display: flex; align-items: flex-start; gap: 9px; min-height: 44px; padding: 10px 0 2px; cursor: pointer; color: var(--ink); -webkit-tap-highlight-color: transparent; }
.wl__consent input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }
.wl__consent b { color: var(--red); font-weight: 400; }
.wl__consent details { padding-left: 29px; }
.wl__consent summary { display: inline-block; padding: 11px 0 13px; list-style: none; cursor: pointer; font-size: 14px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }
.wl__consent summary::-webkit-details-marker { display: none; }
.wl__consent ul { margin: 8px 0 0; padding: 10px 12px 10px 26px; display: grid; gap: 4px; border: 1.5px dashed var(--ink-3); border-radius: 8px; font: 14px/1.5 var(--body); }
.wl__consent li b { color: var(--ink); margin-right: 6px; font-weight: 700; }
.wl__msg:not(:empty) { margin-top: 12px; padding: 8px 12px; border: 2px solid var(--edge); border-radius: 8px; background: var(--yellow-s); font-weight: 700; font-size: 15px; }
.wl__hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.wl__form.is-busy .btn { opacity: .65; pointer-events: none; }
.wl__done:focus { outline: none; }
.wl__done-title { font: 30px/1.2 var(--display); }
.wl__done > p:not([class]) { margin-top: 6px; color: var(--ink-2); }
.wl__done b { color: var(--ink); }
.wl__done-acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.wl__done-acts .btn--play { min-height: 56px; font-size: 21px; }
.wl__copied { margin-top: 10px; font-size: 14px; color: var(--green); font-weight: 700; }
.wl__copied:empty { display: none; }

/* 휴대폰 속 영상 */
.hero__phone { grid-area: phone; position: sticky; top: 88px; padding-top: 8px; }
.phone {
  position: relative; width: min(330px, 80vw); margin-inline: auto; padding: 9px;
  border: 3px solid var(--edge); border-radius: 44px; background: #26221f; box-shadow: 8px 8px 0 var(--drop);
  transform: rotate(1.5deg);
}
.phone__screen { position: relative; overflow: hidden; border-radius: 34px; aspect-ratio: 390 / 844; background: #9fb2b6; }
.phone__screen video { width: 100%; height: 100%; object-fit: cover; }
.vidbtn {
  position: absolute; right: 16px; bottom: 16px; z-index: 2;
  display: grid; place-items: center; width: 44px; height: 44px; border: 2px solid #f7f2e6; border-radius: 50%;
  background: rgba(38, 34, 31, .78); color: #f7f2e6; cursor: pointer;
}
.vidbtn svg { width: 18px; height: 18px; }
.vidbtn .i-play { display: none; }
.vidbtn[aria-pressed="false"] .i-play { display: block; }
.vidbtn[aria-pressed="false"] .i-pause { display: none; }
.bubble {
  position: absolute; z-index: 3; padding: 8px 14px 9px;
  border: 2.5px solid var(--edge); border-radius: 18px; background: var(--paper); box-shadow: 3px 3px 0 var(--drop);
  font: 20px/1 var(--display); white-space: nowrap;
  animation: bob 4.4s ease-in-out infinite;
}
.bubble::after {
  content: ""; position: absolute; bottom: -11px; width: 16px; height: 16px; background: var(--paper);
  border-right: 2.5px solid var(--edge); border-bottom: 2.5px solid var(--edge);
}
.bubble--a { top: 15%; left: -10px; transform: rotate(-6deg); }
.bubble--a::after { right: 22px; transform: skewX(30deg) rotate(45deg); }
.bubble--b { bottom: 18%; right: -8px; background: var(--yellow); color: #26221f; animation-delay: -2.2s; }
.bubble--b::after { left: 20px; background: var(--yellow); transform: skewX(-30deg) rotate(45deg); }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }

.cloud { position: absolute; z-index: -1; height: auto; aspect-ratio: 2 / 1; }
.cloud--a { top: 70px; left: calc(50% + 30px); width: 120px; }
.cloud--b { top: 320px; right: -24px; width: 104px; opacity: .9; }

@media (max-width: 900px) {
  .hero__in { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "head" "phone" "cta"; gap: 36px; padding: 28px 0 56px; }
  .hero__cta .lead { margin-top: 0; }
  .hero__phone { position: relative; top: auto; max-width: 380px; width: 100%; margin-inline: auto; }
  .wl { max-width: 560px; }
  .cloud--a { top: 60px; left: auto; right: -30px; width: 96px; }
  .cloud--b { top: 500px; left: -36px; right: auto; width: 90px; }
}
@media (max-width: 520px) {
  .hero__in { gap: 28px; padding: 18px 0 48px; }
  .hero h1 { font-size: clamp(34px, 10.6vw, 44px); }
  .feats { margin-top: 16px; gap: 8px; }
  .lead { margin-top: 16px; }
  .play { margin-top: 20px; gap: 12px; }
  .wl { margin-top: 32px; }
  .phone { width: min(270px, 72vw); border-radius: 38px; padding: 8px; }
  .phone__screen { border-radius: 30px; }
  .bubble--a { left: 0; }
  .bubble--b { right: 0; }
  .feats li { font-size: 16px; padding: 6px 10px 7px 7px; }
  .feats i { width: 24px; height: 24px; font-size: 15px; }
  .checks { font-size: 15px; gap: 6px 12px; }
  .lead { font-size: 18px; }
  .lead span { display: inline; }
  .play { align-items: stretch; }
  .play .btn, .wl__done-acts .btn { width: 100%; white-space: normal; text-align: center; line-height: 1.15; }
  .btn--play { font-size: 22px; padding-inline: 18px; }
  .wl { padding: 24px 16px 18px; }
  .wl h2 { font-size: 24px; }
  .wl__sub { font-size: 17px; }
  .wl__row { flex-direction: column; }
  .seg span { font-size: 18px; min-height: 50px; }
  .bubble { font-size: 17px; }
}

/* ---------- 이런 게임이에요: 만화 칸 카드 여섯 장(번호표 · 제목 · 장면을 4:5로 잘라 낸 그림 · 설명) — 데스크톱 3×2, 휴대폰은 옆으로 넘기기 */
.section { padding: 88px 0 0; }
.section__title { margin-bottom: 40px; text-align: center; font: clamp(32px, 4.2vw, 44px)/1.2 var(--display); }
.panels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 44px 28px; margin: 0; padding: 0; list-style: none; }
.panel {
  position: relative; display: flex; flex-direction: column; padding: 30px 18px 22px;
  border: 2.5px solid var(--edge); border-radius: 14px; background: var(--dots), var(--paper); box-shadow: 6px 6px 0 var(--drop);
}
.panel__no {
  position: absolute; top: -16px; left: 16px; padding: 3px 10px 4px;
  border: 2px solid var(--edge); border-radius: 6px; background: var(--red); color: #f7f2e6; font: 17px/1.2 var(--display);
}
.panel:nth-child(3n + 2) .panel__no { background: var(--blue); }
.panel:nth-child(3n) .panel__no { background: var(--green); }
.panel h3 { min-height: 2.6em; font: 24px/1.3 var(--display); }
.panel__shot { margin-top: 16px; overflow: hidden; aspect-ratio: 4 / 5; border: 2.5px solid var(--edge); border-radius: 10px; background: var(--sky-2); }
.panel__shot img { width: 100%; height: 100%; object-fit: cover; } /* 그림은 촬영 때 4:5로 잘라 둔다(scripts/media/crop-panels.py) */
.panel > p { margin-top: 16px; font: 17px/1.6 var(--round); color: var(--ink-2); }
.panel > p b { white-space: nowrap; }
.panel > p { text-wrap: balance; }
.panel > p b { font-weight: 400; color: var(--ink); background: linear-gradient(transparent 60%, var(--yellow-s) 60%); }
@media (max-width: 900px) { .panel h3 { font-size: 21px; } }
.panels__dots { display: none; } /* 넘겨 보는 칸의 위치 점은 휴대폰에서만(아래 미디어 쿼리가 덮어쓰도록 먼저 둔다) */
@media (max-width: 760px) {
  /* 휴대폰에선 옆으로 넘겨 보는 칸(페이지는 가로로 흔들리지 않게 칸 목록만 스크롤) */
  .panels {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 80%;
    overflow-x: auto; scroll-snap-type: x mandatory; gap: 16px;
    margin-inline: -16px; padding: 20px 16px 16px; scroll-padding-inline: 16px; scrollbar-width: none;
  }
  .panels::-webkit-scrollbar { display: none; }
  .panel { scroll-snap-align: start; box-shadow: 4px 4px 0 var(--drop); }
  .panel h3 { font-size: 21px; }
  .panels__dots { display: flex; justify-content: center; gap: 8px; margin-top: 4px; }
  .panels__dots i { width: 9px; height: 9px; border: 2px solid var(--edge); border-radius: 50%; background: var(--paper); transition: width .2s ease, background .2s ease; }
  .panels__dots i.is-on { width: 24px; border-radius: 6px; background: var(--ink); }
}

/* ---------- 바닥글 */
.foot { margin-top: 96px; padding: 36px 0 calc(48px + env(safe-area-inset-bottom)); border-top: 2px solid var(--edge); background: var(--paper); color: var(--ink-2); font-size: 14px; text-align: center; }
.foot__in { display: grid; justify-items: center; gap: 4px; }
.foot .brand b { font-size: 18px; }
.foot .brand img { width: 28px; height: 28px; border-radius: 7px; }
.foot ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 6px; margin: 0; padding: 0; list-style: none; }
.foot ul a, .foot p a { display: inline-block; padding: 12px 6px; }
.foot p a { padding-inline: 2px; }
.foot__copy { margin-top: 6px; color: var(--ink-3); font-size: 13px; }

/* ---------- 404 */
.nf { min-height: 72vh; display: grid; place-items: center; text-align: center; padding: 40px 0; }
.nf h1 { font: clamp(40px, 7vw, 64px)/1.1 var(--display); }
.nf p { margin: 14px 0 26px; color: var(--ink-2); font-size: 18px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
