/* ============================================================
   Turtle Story Games — site styles
   Modern layout with pixel accents (Galmuri11 for pixel text).
   ============================================================ */

:root {
  --bg: #0f1a14;
  --bg-elev: #15231b;
  --bg-alt: #0b130f;
  --surface: #1a2c22;
  --surface-2: #213628;
  --line: #2d4a39;
  --text: #e9f3ec;
  --text-muted: #9fb8a9;
  --green: #3ccf78;
  --green-deep: #1f7a4d;
  --green-ink: #06281a;
  --sky: #3b9dff;
  --sun: #ffd23f;
  --rose: #ff6b6b;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 14px;
  --font-body: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --font-pixel: "Galmuri11", "Galmuri", "DungGeunMo", monospace;
  --container: 1120px;
  --gutter: 16px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5faf6;
    --bg-elev: #ffffff;
    --bg-alt: #eaf4ed;
    --surface: #ffffff;
    --surface-2: #f0f7f2;
    --line: #cfe3d6;
    --text: #10231a;
    --text-muted: #4f6a5b;
    --green: #1f9a55;
    --green-deep: #166b3e;
    --green-ink: #ffffff;
    --shadow: 0 10px 30px rgba(16, 35, 26, .10);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.pixel { font-family: var(--font-pixel); letter-spacing: 0.02em; }

.skip-link {
  position: absolute; left: 8px; top: -60px;
  padding: 8px 12px; background: var(--green); color: var(--green-ink);
  border-radius: 8px; z-index: 100; font-weight: 700;
}
.skip-link:focus { top: 8px; }

:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 20px;
  min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.brand-mark { width: 44px; height: 22px; image-rendering: pixelated; }
.brand-name { font-size: 1.02rem; white-space: nowrap; }
.site-nav { display: flex; gap: 22px; margin-left: auto; }
.site-nav a {
  font-weight: 600; color: var(--text-muted);
  padding: 6px 2px; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--text); border-bottom-color: var(--green); }

.lang-switch {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px;
  padding: 3px; background: var(--surface);
}
.lang-switch button {
  appearance: none; border: 0; background: transparent; color: var(--text-muted);
  font: inherit; font-weight: 700; font-size: 0.8rem;
  padding: 4px 10px; border-radius: 999px; cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--green); color: var(--green-ink); }

@media (max-width: 640px) {
  .site-nav { display: none; }
  .lang-switch { margin-left: auto; }
  .brand-name { font-size: 0.95rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px;
  font-weight: 700; font-size: 0.98rem; line-height: 1;
  border: 2px solid transparent;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 9px 14px; font-size: 0.9rem; }
.btn-primary {
  background: var(--green); color: var(--green-ink);
  box-shadow: 0 4px 0 var(--green-deep);
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-primary:active { box-shadow: 0 2px 0 var(--green-deep); transform: translateY(2px); }
.btn-ghost {
  background: transparent; color: var(--text); border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--green); background: var(--surface); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 72px 0 56px;
  background:
    radial-gradient(900px 400px at 85% 10%, color-mix(in srgb, var(--green) 14%, transparent), transparent 70%),
    var(--bg);
}
.hero::before {
  /* subtle pixel grid */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.6), transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.6), transparent 85%);
}
.hero-inner {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 40px;
}
.eyebrow {
  color: var(--green); font-size: 0.82rem; margin-bottom: 14px;
  text-transform: uppercase;
}
.hero-title {
  font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 800; letter-spacing: -0.02em;
}
.hero-lead { color: var(--text-muted); font-size: 1.12rem; margin-top: 18px; max-width: 48ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.hero-art { position: relative; display: flex; flex-direction: column; align-items: center; min-height: 260px; justify-content: center; min-width: 0; }
.hero-copy { min-width: 0; }
.mascot {
  width: min(360px, 80%); image-rendering: pixelated;
  filter: drop-shadow(0 12px 0 rgba(0,0,0,.25));
  animation: bob 3.2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.ground {
  width: 88%; height: 10px; margin-top: 2px;
  background: repeating-linear-gradient(90deg, var(--green-deep) 0 12px, transparent 12px 24px);
  opacity: .55;
}

@media (max-width: 820px) {
  .hero { padding: 48px 0 40px; }
  .hero-inner { grid-template-columns: 1fr; gap: 20px; }
  .hero-art { order: -1; min-height: 180px; }
  .mascot { width: min(260px, 70%); }
}

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { margin-bottom: 36px; max-width: 64ch; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; }
.section-sub { color: var(--text-muted); margin-top: 12px; font-size: 1.05rem; }
@media (max-width: 640px) { .section { padding: 56px 0; } }

/* ---------- Cards ---------- */
.cards {
  display: grid; gap: 20px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}
.card {
  grid-column: span 4;
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--green-deep); }
.card-featured { grid-column: span 8; }
.card-compact { grid-column: span 12; }
@media (max-width: 900px) {
  .card, .card-featured, .card-compact { grid-column: span 12; }
}

.card-media { display: block; aspect-ratio: 16 / 9.5; background: #1e90ff; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media-placeholder {
  display: grid; place-items: center;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-2) 70%, transparent), transparent),
    repeating-linear-gradient(45deg, var(--surface-2) 0 10px, var(--surface) 10px 20px);
}
.qmark { font-size: 4rem; color: var(--sun); text-shadow: 4px 4px 0 rgba(0,0,0,.35); }

.card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.platform { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; }
.card-title { font-size: 1.35rem; font-weight: 800; }
.card-desc { color: var(--text-muted); }
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 10px; }
.card-compact .card-body { padding: 20px 22px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-pixel); font-size: 0.72rem; letter-spacing: 0.04em;
  padding: 4px 9px; border-radius: 6px; border: 1px solid transparent;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.badge-live { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.badge-wip { color: var(--sun); background: color-mix(in srgb, var(--sun) 14%, transparent); border-color: color-mix(in srgb, var(--sun) 35%, transparent); }
.badge-private { color: var(--text-muted); background: var(--surface-2); border-color: var(--line); }

/* ---------- About ---------- */
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.pillar {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px;
}
.pillar-icon { display: inline-block; color: var(--green); font-size: 1.4rem; margin-bottom: 12px; }
.pillar h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 8px; }
.pillar p { color: var(--text-muted); font-size: 0.98rem; }
@media (max-width: 820px) { .pillars { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.contact-card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; transition: border-color .15s ease, transform .15s ease;
}
.contact-card:hover { border-color: var(--green); transform: translateY(-2px); }
.contact-label { font-family: var(--font-pixel); font-size: 0.74rem; color: var(--green); text-transform: uppercase; }
.contact-value { font-weight: 700; }
@media (max-width: 820px) { .contact-list { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--text-muted); font-size: 0.9rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer-domain { font-size: 0.78rem; }

/* ---------- 404 ---------- */
.notfound {
  min-height: 100vh; display: grid; place-content: center; justify-items: center;
  text-align: center; gap: 12px; padding: 40px var(--gutter);
}
.notfound h1 { font-size: 2rem; font-weight: 800; }
.notfound .btn { margin-top: 16px; }
