/* 비 내리는 공부방 — Figma 에셋(흑백 손그림 + 연회색 + 빨강 강조)에 맞춘 랜딩 */
:root {
  --paper: #ffffff;
  --paper-2: #f3f3f1;
  --card: #f1f1f1;
  --ink: #1a1a1a;
  --ink-soft: #5d5d5a;
  --line: #e2e2dc;
  --red: #e5322d;
  --hand: "Gaegu", "Noto Sans KR", cursive;
  --font: "Noto Sans KR", -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, figure { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px dashed var(--ink); outline-offset: 4px; }
.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 10; padding: 10px 16px; background: var(--ink); color: #fff; }
.skip-link:focus { top: 12px; }

/* 회사 로고용 유령 */
.ghost { display: block; overflow: visible; }
.ghost-body { fill: #fff; stroke: var(--ink); stroke-width: 3.5; stroke-linejoin: round; }
.ghost-eye { fill: var(--ink); }
.ghost-blush { fill: #ffb4b4; opacity: 0.85; }
.ghost-line { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }

/* 상단 */
.top { position: sticky; top: 0; z-index: 5; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; }
.brand img { flex: none; width: 36px; height: 36px; border: 1.5px solid var(--ink); border-radius: 10px; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang { padding: 5px 12px; border: 1.5px solid var(--ink); border-radius: 999px; font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.lang:hover { background: var(--card); }

/* 히어로 */
.hero { padding: 56px 0 72px; }
.hero-copy { text-align: center; }
.eyebrow { font-family: var(--hand); font-size: 22px; color: var(--ink-soft); }
.hero h1 {
  max-width: 14em;
  margin: 6px auto 0;
  font-family: var(--hand);
  font-size: clamp(2.6rem, 1.6rem + 4.6vw, 5rem);
  font-weight: 400;
  line-height: 1.05;
}
.mark { color: var(--red); }
.lead { max-width: 34em; margin: 18px auto 0; color: var(--ink-soft); font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem); }

.stores { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; justify-content: center; }
.store {
  display: inline-flex; flex-direction: column; justify-content: center;
  min-width: 170px; height: 58px; padding: 0 20px;
  border: 2px solid var(--ink); border-radius: 14px;
  background: var(--ink); color: #fff; text-decoration: none; line-height: 1.15;
  box-shadow: 4px 4px 0 rgba(26, 26, 26, 0.18);
  transition: transform 0.12s;
}
.store small { font-size: 11.5px; opacity: 0.85; }
.store span:not(.sr-only) { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.store-apple { background: #fff; color: var(--ink); }
.store:hover { transform: translateY(-2px); }

.proof { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 28px; margin-top: 22px; }
.proof li { display: flex; align-items: baseline; gap: 6px; }
.proof b { font-family: var(--hand); font-size: 26px; font-weight: 400; }
.proof span { color: var(--ink-soft); font-size: 14px; }

/* ---------- 공부방 장면 (Figma 844×390 좌표계) ---------- */
.scene-card {
  margin: 44px auto 0;
  max-width: 1000px;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: #f7f7f7;
  box-shadow: 8px 8px 0 var(--ink);
}
.scene-small { margin: 0; max-width: none; box-shadow: 6px 6px 0 var(--ink); }

/* 스크린샷 속 대사 줄을 실제 글자로: 대사 + 꼬리 달린 점선 */
.talk {
  position: relative;
  padding: 16px 20px 30px;
  background: #fff;
  text-align: center;
  font-family: var(--hand);
  font-size: clamp(1.15rem, 0.9rem + 1.2vw, 1.75rem);
  line-height: 1.3;
}
.talk::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 8px; height: 3px;
  background: linear-gradient(90deg, var(--ink) 55%, transparent 55%) 0 0 / 22px 3px repeat-x;
}
/* 점선이 아래로 살짝 꺾였다 올라오는 말풍선 꼬리 (스크린샷과 같은 모양) */
.talk::before {
  content: "";
  position: absolute; left: 30%; bottom: -10px; z-index: 1;
  width: 34px; height: 24px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='24' viewBox='0 0 34 24'%3E%3Cpath d='M0 9.5 C9 9.5 11 12 13 21 M18 21 C19 13 22 9.5 34 9.5' fill='none' stroke='%231a1a1a' stroke-width='3' stroke-linecap='round' stroke-dasharray='6 4'/%3E%3C/svg%3E") no-repeat;
}

.stage {
  position: relative;
  aspect-ratio: 844 / 390;
  container-type: inline-size;
  overflow: hidden;
  background: #f7f7f7;
}
.stage .layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.win {
  position: absolute;
  left: calc(28 / 844 * 100%);
  top: calc(2 / 390 * 100%);
  width: calc(178 / 844 * 100%);
  height: calc(350 / 390 * 100%);
}
.win img { width: 100%; height: 100%; }
.win img.pop { animation: winpop 0.35s ease; }
@keyframes winpop { 0% { opacity: 0.2; transform: scale(0.97); } 100% { opacity: 1; transform: none; } }

/* 창밖 빗줄기 — 창문 모양으로만 보이게 마스크 */
.win-rain {
  position: absolute; inset: 0; display: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='70'%3E%3Cg stroke='%23ffffff' stroke-width='2' stroke-linecap='round' opacity='.9'%3E%3Cpath d='M10 4l-3 12'/%3E%3Cpath d='M30 30l-3 12'/%3E%3Cpath d='M18 52l-3 12'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask: url("/scene/win-rain.svg") center / 100% 100% no-repeat;
  mask: url("/scene/win-rain.svg") center / 100% 100% no-repeat;
  animation: fall 0.9s linear infinite;
  pointer-events: none;
}
.stage:not([data-window]) .win-rain, .stage[data-window="rain"] .win-rain { display: block; }
@keyframes fall { to { background-position: -10px 70px; } }

/* 앱처럼 동작하는 타이머 (Figma 'Group 987' 자리) */
.timer {
  position: absolute;
  left: calc(351 / 844 * 100%);
  top: calc(40 / 390 * 100%);
  width: calc(270 / 844 * 100%);
  display: flex; flex-direction: column; align-items: center;
  padding: 0; border: 0; background: none; cursor: pointer;
  line-height: 1.05;
}
.timer small { font-family: var(--hand); font-size: 2.6cqw; font-weight: 700; color: #4a4a4a; letter-spacing: 0.04em; }
.timer b { font-family: var(--hand); font-size: 7.2cqw; font-weight: 700; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.timer em { margin-top: 0.4cqw; font-family: var(--hand); font-size: 2.6cqw; font-style: normal; font-weight: 700; color: #8a4a4a; }
.timer:hover em { text-decoration: underline; }
.timer.is-running em { color: var(--ink-soft); }
.timer:focus-visible { outline-offset: 6px; border-radius: 8px; }

/* ---------- 꾸미기 ---------- */
.deco { padding: 72px 0 64px; background: var(--paper-2); border-block: 1px solid var(--line); }
.label { font-family: var(--hand); font-size: 22px; color: var(--red); }
.deco h2, .story h2, .features h2 { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.5rem); font-weight: 800; letter-spacing: -0.035em; }
.deco-text { max-width: 36em; margin-top: 8px; color: var(--ink-soft); }
.deco-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 40px; margin-top: 36px; align-items: start; }
.pick-title { margin: 22px 0 12px; font-family: var(--hand); font-size: 24px; font-weight: 400; }

.swatches { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.swatch {
  width: 100%; padding: 8px 6px 6px;
  border: 2px solid transparent; border-radius: 14px;
  background: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: transform 0.12s, border-color 0.12s;
}
.swatch img { width: 58%; aspect-ratio: 356 / 700; object-fit: contain; }
.swatch span { font-size: 11.5px; line-height: 1.25; text-align: center; color: var(--ink-soft); }
.swatch:hover { transform: translateY(-2px); }
.swatch.is-on { border-color: var(--ink); }
.swatch.is-on span { color: var(--ink); font-weight: 700; }

.ghost-card {
  display: grid; place-items: center;
  aspect-ratio: 1;
  border: 3px solid var(--ink); border-radius: 18px;
  background: var(--card);
  box-shadow: 6px 6px 0 var(--ink);
}
.ghost-card img { width: 78%; }
.ghost-card img.pop { animation: boing 0.45s ease; }
@keyframes boing { 30% { transform: scale(1.06, 0.94); } 60% { transform: scale(0.97, 1.04); } }
.chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.chip {
  width: 100%; padding: 4px 4px 6px;
  border: 2px solid transparent; border-radius: 12px;
  background: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: transform 0.12s, border-color 0.12s;
}
.chip img { width: 100%; border-radius: 8px; }
.chip span { font-size: 11px; line-height: 1.2; color: var(--ink-soft); text-align: center; }
.chip:hover { transform: translateY(-2px); }
.chip.is-on { border-color: var(--ink); }
.chip.is-on span { color: var(--ink); font-weight: 700; }

/* 대사 점선 구분선 */
.talk-line {
  position: relative; height: 24px; margin: 8px 0;
  background: linear-gradient(90deg, var(--ink) 55%, transparent 55%) 0 50% / 22px 3px repeat-x;
}

/* 앱 화면 */
.story, .features { padding: 64px 0; }
.panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; margin-top: 34px; }
.panel { overflow: hidden; border: 2.5px solid var(--ink); border-radius: 12px; background: #fff; box-shadow: 5px 5px 0 rgba(26, 26, 26, 0.85); transform: rotate(var(--r, 0deg)); transition: transform 0.2s; }
.panel:hover { transform: rotate(0deg) translateY(-3px); }

/* 기능 */
.features { background: var(--paper-2); border-block: 1px solid var(--line); }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 34px; }
.feature { padding: 24px; border: 2px solid var(--ink); border-radius: 16px 20px 14px 22px; background: #fff; }
.feature svg { width: 44px; height: 44px; fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { margin-top: 12px; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.feature p { margin-top: 6px; color: var(--ink-soft); font-size: 15px; }

/* 마지막 권유 */
.cta { padding: 80px 0 96px; text-align: center; }
.cta-ghost { width: 150px; margin: 0 auto 18px; animation: bob 4s ease-in-out infinite; }
.cta-ghost img { border: 2.5px solid var(--ink); border-radius: 22px; box-shadow: 5px 5px 0 var(--ink); }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(3deg); } }
.cta h2 { font-family: var(--hand); font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem); font-weight: 400; line-height: 1.15; }
.cta p { margin-top: 10px; color: var(--ink-soft); }

/* 404 */
.nf { padding: 120px 0; text-align: center; }
.nf .cta-ghost .ghost { width: 96px; margin: 0 auto 18px; }
.nf h1 { font-family: var(--hand); font-weight: 400; font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); }
.nf p { margin-top: 24px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn { display: inline-block; padding: 10px 20px; border: 2px solid var(--ink); border-radius: 12px; background: var(--ink); color: #fff; font-weight: 700; text-decoration: none; }
.btn-line { background: #fff; color: var(--ink); }

/* 푸터 */
.foot { padding: 36px 0 44px; border-top: 1px solid var(--line); background: var(--paper-2); color: var(--ink-soft); font-size: 13.5px; }
.foot-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.maker { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.maker .ghost { width: 22px; }
.maker .ghost-body { stroke-width: 7; }
.maker .ghost-blush, .maker .ghost-line { display: none; }
.maker b { font-family: var(--hand); font-size: 19px; font-weight: 700; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { text-decoration: none; overflow-wrap: anywhere; }
.foot-links a:hover { text-decoration: underline; }
.foot-privacy { color: var(--ink); font-weight: 700; }
.biz { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 16px 0 0; }
.biz div { display: flex; gap: 6px; }
.biz div:not(:last-child)::after { content: ""; align-self: center; width: 1px; height: 11px; margin: 0 12px; background: var(--line); }
.biz dt { font-weight: 600; }
.biz dd { margin: 0; }
.copy { margin-top: 12px; }

/* 반응형 */
@media (max-width: 900px) {
  .deco-grid { grid-template-columns: 1fr; }
  .deco-ghost { max-width: 460px; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hero { padding-top: 36px; }
  .eyebrow { font-size: 18px; }
  .proof { gap: 2px 18px; }
  .proof b { font-size: 22px; }
  .store { flex: 1 1 140px; min-width: 0; }
  .scene-card { margin-top: 32px; box-shadow: 5px 5px 0 var(--ink); }
  .swatches { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .chip span { font-size: 10px; }
  .ghost-card { max-width: 260px; margin-inline: auto; }
  .panels { grid-template-columns: 1fr; gap: 24px; }
  .feature-grid { grid-template-columns: 1fr; }
}
