/* Ongi Studio — one stylesheet for every page.
   Tokens live in :root (studio) and .theme-gamlog (GamLog's own palette, copied from
   bp-log/GamLog/Resources/Assets.xcassets/Colors). tests/test_site.py checks every
   text pair listed in CONTRAST below against WCAG AA in light and dark.
   CONTRAST: ink/ground ink/paper muted/ground muted/paper accent/ground accent/paper on-accent/accent */

@font-face {
  font-family: "Fraunces Soft";
  src: url("/assets/fonts/fraunces-soft-semibold.woff2") format("woff2");
  font-weight: 600 700;
  font-display: swap;
}
@font-face {
  font-family: "Lexend";
  src: url("/assets/fonts/lexend-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  /* Subset to the Hangul on this site by scripts/build_fonts.py. */
  font-family: "Jua";
  src: url("/assets/fonts/jua-subset.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --ground: #fbf5ec;
  --paper: #fffdf8;
  --ink: #2b231e;
  --muted: #6a5a4f;
  --line: #eaded0;
  --accent: #a6461a;
  --on-accent: #ffffff;
  --ember: #e8743b;   /* decorative only */
  --glow: #f8d6b3;    /* decorative only */
  --shadow: 0 1px 2px rgb(60 35 20 / 6%), 0 8px 28px rgb(60 35 20 / 8%);

  --display: "Fraunces Soft", "Jua", ui-serif, Georgia, serif;
  --display-ko: "Jua", "Fraunces Soft", system-ui, sans-serif;
  --text: "Lexend", "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --text-ko: "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", "Lexend", system-ui, sans-serif;

  --radius: 22px;
  --wrap: 1080px;
  --gutter: clamp(18px, 5vw, 40px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #17120f;
    --paper: #221b16;
    --ink: #f5ece3;
    --muted: #c4b3a5;
    --line: #3b3029;
    --accent: #f2a672;
    --on-accent: #2a160a;
    --ember: #e8743b;
    --glow: #4a2c1c;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 28px rgb(0 0 0 / 30%);
  }
}

.theme-gamlog {
  --ground: #dce8e0;
  --paper: #fffdf8;
  --ink: #22302a;
  --muted: #4b6457;
  --line: #c9d8cd;
  --accent: #a14817;
  --on-accent: #ffffff;
  --ember: #e56f2a;   /* persimmon */
  --glow: #fffdf8;
  --leaf: #2f6b50;    /* decorative only */
}
@media (prefers-color-scheme: dark) {
  .theme-gamlog {
    --ground: #131b17;
    --paper: #1d2722;
    --ink: #eef3ef;
    --muted: #a9bdb0;
    --line: #34443b;
    --accent: #f0a06c;
    --on-accent: #22150c;
    --ember: #e9824a;
    --glow: #3a4d42;
    --leaf: #5f9c7e;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--text);
  -webkit-font-smoothing: antialiased;
}
:lang(ko) body, body:lang(ko) { font-family: var(--text-ko); word-break: keep-all; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-thickness: 2.5px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--display); font-weight: 650; line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 0.5em; text-wrap: balance; }
:lang(ko) h1, :lang(ko) h2, :lang(ko) h3, h1:lang(ko), h2:lang(ko), h3:lang(ko) { font-family: var(--display-ko); font-weight: 400; letter-spacing: 0; line-height: 1.25; }
h1 { font-size: clamp(2.2rem, 6.4vw, 4rem); }
h2 { font-size: clamp(1.7rem, 4.2vw, 2.5rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; text-wrap: pretty; }
.ko { font-family: var(--display-ko); font-weight: 400; letter-spacing: 0; }
h1 .ko, h2 .ko, h3 .ko { margin-left: 0.15em; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 10; background: var(--paper); padding: 10px 14px; border-radius: 10px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.narrow { width: min(100% - 2 * var(--gutter), 720px); margin-inline: auto; }

/* Header */
.site-header { padding-block: 14px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; min-width: 44px; color: var(--ink); text-decoration: none; font-family: var(--display); font-weight: 650; font-size: 1.2rem; white-space: nowrap; }
.brand img, .brand svg { width: 36px; height: 36px; flex: none; }
.nav { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; white-space: nowrap; padding: 0 12px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.98rem; }
.nav a:hover, .nav a[aria-current="page"] { background: color-mix(in srgb, var(--ink) 7%, transparent); }
@media (max-width: 380px) {
  .brand-name { font-size: 1.05rem; }
  .nav a { padding: 0 9px; font-size: 0.92rem; }
}
/* Pages with a language link have three nav items: on narrow phones the 온 tile
   stands in for the name (the link keeps its accessible name). */
@media (max-width: 420px) {
  .site-header:has(.lang-switch) .brand-name { display: none; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 600; font-size: 1rem; text-decoration: none; border: 2px solid transparent; transition: transform 0.15s ease; }
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-quiet { border-color: color-mix(in srgb, var(--ink) 22%, transparent); color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover { transform: none; } }

.eyebrow { display: inline-block; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.lede { font-size: clamp(1.1rem, 2.4vw, 1.3rem); color: var(--muted); max-width: 36em; }

/* Studio hero */
.hero { padding-block: clamp(32px, 8vw, 96px) clamp(40px, 8vw, 88px); }
.hero .wrap { display: grid; gap: clamp(32px, 6vw, 64px); align-items: center; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
@media (max-width: 820px) { .hero .wrap { grid-template-columns: 1fr; } }
.hero h1 { max-width: 12em; }

.word-card { position: relative; background: var(--paper); border-radius: 28px; padding: clamp(24px, 4vw, 36px); box-shadow: var(--shadow); overflow: hidden; isolation: isolate; }
.word-card::before { content: ""; position: absolute; inset: auto -30% -55% auto; width: 120%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, var(--glow), transparent); z-index: -1; }
.word-card .word { font-family: var(--display-ko); font-size: clamp(3.4rem, 10vw, 5rem); line-height: 1; color: var(--accent); margin: 0 0 6px; }
.word-card .say { color: var(--muted); font-size: 0.95rem; margin-bottom: 16px; }
.word-card .say i { font-style: normal; color: var(--ink); font-weight: 600; }
.word-card ol { margin: 0; padding-left: 1.2em; }
.word-card li { margin-bottom: 6px; }

/* Sections */
.section { padding-block: clamp(48px, 8vw, 96px); }
.section-tight { padding-block: clamp(32px, 6vw, 64px); }
.section-head { margin-bottom: clamp(24px, 4vw, 40px); max-width: 40em; }
.section-head p { color: var(--muted); }

/* App cards */
.apps { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.app-card { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; align-content: start; background: var(--paper); border-radius: var(--radius); padding: clamp(20px, 3.5vw, 30px); box-shadow: var(--shadow); }
.app-card .icon { grid-row: span 2; width: 88px; height: 88px; border-radius: 22.5%; box-shadow: 0 0 0 1px rgb(0 0 0 / 6%), 0 6px 16px rgb(0 0 0 / 10%); }
.app-card h3 { margin: 4px 0 0; font-size: 1.5rem; }
.app-card h3 a { color: var(--ink); text-decoration: none; }
.app-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.app-card h3 a:focus-visible { outline: none; }
.app-card:has(h3 a:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.app-card .tagline { margin: 0; color: var(--muted); font-weight: 500; }
.app-card .body { grid-column: 1 / -1; margin: 14px 0 0; }
.app-card .meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.app-card .meta a { position: relative; z-index: 1; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.app-card .meta a:hover { background: color-mix(in srgb, var(--ink) 11%, transparent); }
.app-card .go { grid-column: 1 / -1; margin-top: 10px; font-weight: 600; color: var(--accent); }
@media (max-width: 420px) {
  .app-card { grid-template-columns: 1fr; }
  .app-card .icon { grid-row: auto; width: 76px; height: 76px; margin-bottom: 8px; }
}

.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 14px; border-radius: 999px; font-size: 0.9rem; font-weight: 600; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ember) 25%, transparent); }

/* Values */
.values { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); margin: 0; padding: 0; list-style: none; }
.values li { background: color-mix(in srgb, var(--paper) 70%, transparent); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.values h3 { font-size: 1.15rem; margin-bottom: 8px; }
.values p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.values .glyph { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--ember) 16%, transparent); margin-bottom: 14px; }
.values .glyph svg { width: 22px; height: 22px; stroke: var(--accent); }

/* Name story */
.story { display: grid; gap: clamp(24px, 5vw, 56px); grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: start; }
@media (max-width: 760px) { .story { grid-template-columns: 1fr; } }
.story .big { font-family: var(--display-ko); font-size: clamp(5rem, 16vw, 9rem); line-height: 0.95; color: var(--accent); margin: 0; }
.story .big small { display: block; font-family: var(--display); font-size: 1.1rem; color: var(--muted); margin-top: 12px; }

/* Contact band */
.band { background: var(--paper); border-radius: 28px; padding: clamp(28px, 5vw, 56px); box-shadow: var(--shadow); display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
@media (max-width: 720px) { .band { grid-template-columns: 1fr; } }
.band h2 { margin-bottom: 8px; }
.band p { margin: 0; color: var(--muted); }
.mail { overflow-wrap: anywhere; }

/* Footer */
.site-footer { padding-block: 40px 56px; color: var(--muted); font-size: 0.95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 28px; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0 4px; margin: 0; padding: 0; list-style: none; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--muted); }
.site-footer a:hover { color: var(--ink); }
.site-footer p { margin: 0; }

/* GamLog page */
.gl-hero { padding-block: clamp(24px, 6vw, 72px) clamp(32px, 6vw, 72px); }
.gl-hero .wrap { display: grid; gap: clamp(24px, 5vw, 56px); grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: center; }
@media (max-width: 820px) { .gl-hero .wrap { grid-template-columns: 1fr; } }
.gl-id { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.gl-id img { width: 64px; height: 64px; border-radius: 22.5%; box-shadow: 0 0 0 1px rgb(0 0 0 / 6%), 0 6px 16px rgb(0 0 0 / 12%); }
.gl-id .name { font-family: var(--display); font-weight: 650; font-size: 1.5rem; line-height: 1.1; }
.gl-id .name .ko { display: block; font-size: 1.05rem; color: var(--muted); margin-top: 2px; }
.gl-hero h1 { margin-top: 18px; }
.gl-hero .note { font-size: 0.98rem; color: var(--muted); border-left: 3px solid var(--ember); padding: 2px 0 2px 14px; margin-top: 22px; max-width: 34em; }
.gl-art { position: relative; justify-self: center; width: min(100%, 380px); aspect-ratio: 1; display: grid; place-items: end center; }
.gl-art::before { content: ""; position: absolute; inset: 6% 6% 0; border-radius: 50%; background: radial-gradient(closest-side, var(--glow), transparent); }
.gl-art img { position: relative; width: 82%; }

.features { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin: 0; padding: 0; list-style: none; }
.features li { background: var(--paper); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); }
.features h3 { font-size: 1.2rem; margin-bottom: 8px; }
.features p { margin: 0; color: var(--muted); }

.shots { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px var(--gutter) 20px; margin-inline: calc(-1 * var(--gutter)); scrollbar-width: thin; }
.shots img { flex: none; width: min(62vw, 248px); border-radius: 22px; scroll-snap-align: center; box-shadow: var(--shadow); }
/* Wide screens: all five fit side by side, no sideways scrolling. */
@media (min-width: 1000px) {
  .shots { overflow: visible; margin-inline: 0; padding-inline: 0; }
  .shots img { flex: 1 1 0; width: auto; min-width: 0; }
}

.gami { display: grid; gap: clamp(20px, 5vw, 48px); grid-template-columns: auto minmax(0, 1fr); align-items: center; background: var(--paper); border-radius: 28px; padding: clamp(24px, 4vw, 44px); box-shadow: var(--shadow); }
.gami img { width: clamp(120px, 22vw, 200px); }
@media (max-width: 560px) { .gami { grid-template-columns: 1fr; text-align: left; } .gami img { width: 140px; } }
.gami p { color: var(--muted); }
.gami p:last-child { margin-bottom: 0; }

.lang-switch { font-weight: 600; }

/* Long-form text (privacy, support) */
.doc { padding-block: clamp(24px, 6vw, 64px) clamp(48px, 8vw, 96px); }
.doc h1 { font-size: clamp(2rem, 5.4vw, 3rem); }
.doc h2 { font-size: 1.45rem; margin-top: 1.8em; }
.doc h3 { font-size: 1.12rem; margin-top: 1.4em; margin-bottom: 0.35em; font-family: var(--text); font-weight: 600; }
.doc .updated { color: var(--muted); font-size: 0.95rem; }
.doc .card { background: var(--paper); border-radius: 20px; padding: clamp(20px, 4vw, 32px); box-shadow: var(--shadow); margin-block: 24px; }
.doc details { border-top: 1px solid var(--line); }
.doc details:last-of-type { border-bottom: 1px solid var(--line); }
.doc summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding-block: 10px; cursor: pointer; font-weight: 600; list-style: none; }
.doc summary::-webkit-details-marker { display: none; }
.doc summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--muted); flex: none; }
.doc details[open] summary::after { content: "−"; }
.doc details > div { padding-bottom: 14px; color: var(--muted); }
.doc details > div p:last-child { margin-bottom: 0; }

.not-found { min-height: 60vh; display: grid; place-items: center; text-align: center; padding-block: 64px; }
.not-found .btn-row { justify-content: center; }
.not-found .word { font-family: var(--display-ko); font-size: 4rem; color: var(--accent); margin: 0; }
