/*
-----------------------------------------------------------
Copyright (c) 2026 Ahngunism. All rights reserved.
-----------------------------------------------------------
File           : style.css
Project        : 2302_MOON_GERMAN
Theme          : Minimal modern · beginner-friendly
-----------------------------------------------------------
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+KR:wght@400;500;600;700&display=swap');

/* ============================================================
   TOKENS — monochrome with a single subtle accent
   ============================================================ */
:root {
  --bg:         #fafafa;
  --bg-card:    #ffffff;
  --bg-hover:   #f4f4f5;
  --bg-muted:   #f4f4f5;

  --ink:        #09090b;
  --ink-2:      #18181b;
  --ink-3:      #52525b;
  --ink-4:      #71717a;
  --ink-5:      #a1a1aa;

  --line:       #e4e4e7;
  --line-2:     #d4d4d8;

  --accent:     #18181b;           /* 기본은 검정, 액센트도 검정 기반 */

  --ok:         #16a34a;
  --ok-soft:    #f0fdf4;
  --no:         #dc2626;
  --no-soft:    #fef2f2;

  --radius:     12px;
  --radius-lg:  16px;

  --shadow-1:   0 1px 2px rgba(9,9,11,0.04);
  --shadow-2:   0 8px 24px -8px rgba(9,9,11,0.1);

  --font:       'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;

  --ease:       cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em;
  font-feature-settings: "ss01", "cv11";
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--ink); color: var(--bg); }

/* ============================================================
   CONTAINERS
   ============================================================ */
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

.wrap-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 28px;
}

@media (max-width: 640px) {
  .wrap, .wrap-narrow { padding: 0 20px; }
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 250, 0.8);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.015em;
}

.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bg);
  font-size: 10px;
  font-weight: 700;
}

.topbar-meta {
  font-size: 13px;
  color: var(--ink-4);
  font-weight: 500;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.back-link:hover {
  background: var(--bg-muted);
  color: var(--ink);
}

@media (max-width: 640px) {
  .topbar-inner { height: 56px; padding: 0 20px; }
  .topbar-meta { display: none; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: 120px 0 80px;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 13px;
  color: var(--ink-4);
  margin-bottom: 28px;
  font-weight: 500;
}

.hero-title {
  font-family: var(--font);
  font-weight: 800;
  font-size: clamp(48px, 8vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: 28px;
  max-width: 800px;
}

.hero-sub {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-3);
  max-width: 560px;
  margin-bottom: 40px;
  font-weight: 400;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .hero { padding: 72px 0 56px; }
  .hero-title { font-size: clamp(40px, 12vw, 56px); }
  .hero-sub { font-size: 16px; }
}

/* ============================================================
   SECTION
   ============================================================ */
.section {
  padding: 64px 0;
}

.section + .section { padding-top: 0; }

.section-head {
  margin-bottom: 40px;
}

.section-eyebrow {
  font-size: 13px;
  color: var(--ink-4);
  font-weight: 500;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(26px, 3.5vw, 36px);
  letter-spacing: -0.025em;
  line-height: 1.15;
  max-width: 600px;
}

@media (max-width: 640px) {
  .section { padding: 48px 0; }
  .section-head { margin-bottom: 28px; }
}

/* ============================================================
   CHAPTER CARDS
   ============================================================ */
.chapters {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 720px) {
  .chapters { grid-template-columns: 1fr; }
}

.chapter {
  display: block;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.chapter:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.chapter-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--ink-4);
  font-weight: 500;
}

.chapter-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
}

.chapter-title {
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.chapter-sub {
  font-size: 14px;
  color: var(--ink-4);
  margin-bottom: 16px;
  font-weight: 500;
}

.chapter-desc {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.6;
  margin-bottom: 24px;
}

.chapter-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-4);
  font-weight: 500;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.chapter-meta .arrow {
  transition: transform 0.2s var(--ease);
}

.chapter:hover .arrow {
  transform: translateX(4px);
  color: var(--ink);
}

/* ============================================================
   STEPS (how it works)
   ============================================================ */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; gap: 16px; }
}

.step {
  padding: 28px 4px 4px;
  border-top: 1px solid var(--ink);
}

.step-num {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-4);
  margin-bottom: 10px;
}

.step-title {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}

.step-desc {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.6;
}

/* ============================================================
   ADS — Kakao AdFit
   주의: 광고 래퍼에는 border-radius / overflow:hidden 등을 주면 안 됩니다.
        AdFit 심사에서 외형 변형으로 간주해 리젝됩니다.
   ============================================================ */
.ad-area {
  width: 100%;
  margin: 48px auto 0;
}

.ad-grid {
  display: grid;
  grid-template-columns: repeat(2, 320px);
  gap: 12px;
  justify-content: center;
}

.ad-cell {
  width: 320px;
  min-height: 50px;
  margin: 0 auto;
}

@media (max-width: 720px) {
  .ad-grid { grid-template-columns: 320px; }
  .ad-area { margin-top: 36px; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 48px;
  margin-top: 48px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--ink-4);
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================================
   STUDY PAGE
   ============================================================ */
.study-head {
  padding: 64px 0 40px;
}

.study-breadcrumb {
  font-size: 13px;
  color: var(--ink-4);
  margin-bottom: 20px;
  font-weight: 500;
}

.study-breadcrumb span {
  color: var(--ink);
  font-weight: 600;
}

.study-title {
  font-weight: 800;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin-bottom: 18px;
}

.study-sub {
  font-size: 17px;
  color: var(--ink-3);
  max-width: 560px;
  line-height: 1.6;
}

.study-sub strong { color: var(--ink); font-weight: 600; }

/* ---- Setup grid ---- */
.setup-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 56px;
  padding: 48px 0 72px;
  align-items: start;
}

@media (max-width: 880px) {
  .setup-grid { grid-template-columns: 1fr; gap: 32px; padding: 32px 0 56px; }
}

.setup-sidebar {
  position: sticky;
  top: 92px;
}

.setup-sidebar h3 {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}

.setup-sidebar p {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.65;
  margin-bottom: 24px;
}

.setup-sidebar .selected-label {
  font-size: 13px;
  color: var(--ink-4);
  padding-top: 20px;
  border-top: 1px solid var(--line);
  margin-bottom: 20px;
}

.setup-sidebar .selected-label strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  margin-top: 4px;
}

@media (max-width: 880px) {
  .setup-sidebar { position: static; }
}

.sets {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

@media (max-width: 560px) {
  .sets { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 420px) {
  .sets { grid-template-columns: repeat(3, 1fr); }
}

.set-btn {
  aspect-ratio: 1;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  color: var(--ink-2);
  letter-spacing: -0.015em;
}

.set-btn:hover {
  border-color: var(--ink-3);
  background: var(--bg-hover);
}

.set-btn.selected {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 12px 22px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--ink-2);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--ink);
  border-color: var(--line-2);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--ink-4);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-3);
}
.btn-ghost:hover {
  color: var(--ink);
  background: var(--bg-muted);
}

.btn-ok {
  background: var(--bg-card);
  color: var(--ok);
  border-color: var(--line-2);
}
.btn-ok:hover {
  background: var(--ok);
  color: #fff;
  border-color: var(--ok);
}

.btn-no {
  background: var(--bg-card);
  color: var(--no);
  border-color: var(--line-2);
}
.btn-no:hover {
  background: var(--no);
  color: #fff;
  border-color: var(--no);
}

.btn-lg {
  padding: 14px 24px;
  font-size: 15px;
  border-radius: 12px;
}

.btn-block { width: 100%; }

.btn svg { width: 16px; height: 16px; }

/* ============================================================
   GAME · FLASHCARD
   ============================================================ */
.game {
  padding: 48px 0 72px;
}

.game-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--ink-4);
  font-weight: 500;
}

.game-topbar .counter {
  color: var(--ink);
  font-weight: 600;
}

.game-topbar .score {
  display: flex;
  gap: 16px;
}

.game-topbar .score .ok-s { color: var(--ok); font-weight: 600; }
.game-topbar .score .no-s { color: var(--no); font-weight: 600; }

.progress {
  height: 3px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 36px;
}

.progress-fill {
  height: 100%;
  background: var(--ink);
  transition: width 0.4s var(--ease);
}

.flash-stage {
  perspective: 1600px;
  margin: 0 auto 28px;
  max-width: 600px;
  aspect-ratio: 8 / 5;
}

.flash {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}

.flash.flipped { transform: rotateY(180deg); }

.flash-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-2);
}

.flash-face.back {
  transform: rotateY(180deg);
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.flash-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-4);
  font-weight: 500;
}

.flash-face.back .flash-top { color: var(--ink-5); }

.flash-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 0;
}

.word-de {
  font-weight: 700;
  font-size: clamp(30px, 5.5vw, 52px);
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--ink);
  max-width: 100%;
  word-break: break-word;
}

.word-ko {
  font-family: 'Noto Sans KR', var(--font);
  font-weight: 600;
  font-size: clamp(24px, 4.5vw, 40px);
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--bg);
  max-width: 100%;
  word-break: keep-all;
}

.flash-bottom {
  font-size: 12px;
  color: var(--ink-5);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.flash-bottom svg { width: 12px; height: 12px; opacity: 0.7; }

/* Controls */
.controls {
  display: flex;
  gap: 8px;
  max-width: 600px;
  margin: 0 auto;
}

.controls .btn {
  flex: 1;
  padding: 16px;
  font-size: 15px;
}

.sub-controls {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 560px) {
  .flash-face { padding: 28px 24px; }
}

/* ============================================================
   RESULT
   ============================================================ */
.result-head {
  padding: 72px 0 40px;
  text-align: center;
}

.result-kicker {
  font-size: 13px;
  color: var(--ink-4);
  margin-bottom: 16px;
  font-weight: 500;
}

.result-title {
  font-weight: 800;
  font-size: clamp(48px, 8vw, 88px);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 18px;
}

.result-meta {
  font-size: 15px;
  color: var(--ink-3);
}

.result-meta strong { color: var(--ink); font-weight: 600; }

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 48px 0 40px;
}

@media (max-width: 640px) {
  .result-stats { grid-template-columns: 1fr; }
}

.stat-card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-label {
  font-size: 13px;
  color: var(--ink-4);
  font-weight: 500;
}

.stat-num {
  font-weight: 700;
  font-size: 52px;
  letter-spacing: -0.04em;
  line-height: 1;
}

.stat-card.ok .stat-num { color: var(--ok); }
.stat-card.no .stat-num { color: var(--no); }
.stat-card.rate {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.stat-card.rate .stat-label { color: var(--ink-5); }

.result-list-wrap { padding-bottom: 48px; }

.result-list {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.result-list-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--ink-4);
  font-weight: 500;
}

.result-list-head strong { color: var(--ink); font-weight: 600; }

.result-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s var(--ease);
}
.result-row:last-child { border-bottom: none; }
.result-row:hover { background: var(--bg-hover); }

.rn {
  font-size: 12px;
  color: var(--ink-5);
  min-width: 24px;
  font-weight: 500;
}

.rdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.rdot.ok { background: var(--ok); }
.rdot.no { background: var(--no); }

.rde {
  font-weight: 600;
  font-size: 16px;
  flex: 1;
  min-width: 0;
  letter-spacing: -0.015em;
}

.rko {
  font-family: 'Noto Sans KR', var(--font);
  font-size: 14px;
  color: var(--ink-3);
  text-align: right;
  flex: 1;
  min-width: 0;
}

.result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 8px 0 64px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .stat-card { padding: 22px; }
  .stat-num { font-size: 40px; }
  .result-row { padding: 12px 18px; flex-wrap: wrap; }
  .rko { text-align: left; flex-basis: 100%; padding-left: 32px; }
}
