/* --------------------------------------------------------------------------
   i12.net

   The palette is lifted from src/lib/theme.ts so the site and the app are
   recognisably the same object. Dark only, like the app, and for the same
   reason: this is a thing you glance at, not a thing you read at a desk.

   Korean first in every font stack — a Latin-first stack renders Hangul in
   whatever the browser falls back to, which on Windows is ugly.
   -------------------------------------------------------------------------- */

:root {
  --bg:      #0E1013;
  --card:    #181B21;
  --card2:   #1F232A;
  --edge:    #2B3039;
  --edge2:   #383E49;

  --tx:      #EDEFF2;
  --tx2:     #A8AFBB;
  --tx3:     #6E7683;

  --lit:     #FF6B1A;
  --lit-ink: #170A02;
  --lit-dim: #8A3A0E;
  --glow:    rgba(255, 107, 26, 0.30);

  --go:      #3ECF8E;
  --go-dim:  #14563A;

  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
          "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui,
          "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;

  --w: 62rem;
  --prose: 40rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--tx2);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.68;
  word-break: keep-all;          /* Hangul wraps on word boundaries, not mid-word */
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

:lang(en) { word-break: normal; }

a { color: var(--lit); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: #ff8442; }

:focus-visible {
  outline: 2px solid var(--lit);
  outline-offset: 3px;
  border-radius: 3px;
}

strong { color: var(--tx); font-weight: 600; }

code, .mono { font-family: var(--mono); font-size: 0.9em; }

code {
  background: var(--card2);
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding: 0.08em 0.36em;
  color: var(--tx);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--lit);
  color: var(--lit-ink);
  padding: 10px 16px;
  font-weight: 600;
  z-index: 10;
}
.skip:focus { left: 0; }

/* --- header --------------------------------------------------------------- */

.site-head {
  border-bottom: 1px solid var(--edge);
  background: rgba(14, 16, 19, 0.86);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.bar {
  max-width: var(--w);
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--tx);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.015em;
  font-size: 1.02rem;
  flex: 0 0 auto;
}
.wordmark .dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--lit);
  box-shadow: 0 0 0 4px var(--glow);
  flex: 0 0 auto;
}
.wm-el { color: var(--lit); }

.nav {
  display: flex;
  gap: 4px 18px;
  flex-wrap: wrap;
  margin-left: auto;
  font-size: 0.93rem;
}
.nav a { color: var(--tx2); text-decoration: none; }
.nav a:hover { color: var(--tx); }
.nav a[aria-current="page"] { color: var(--lit); }

.lang {
  font-size: 0.85rem;
  color: var(--tx2);
  text-decoration: none;
  border: 1px solid var(--edge2);
  border-radius: 999px;
  padding: 4px 13px;
  flex: 0 0 auto;
}
.lang:hover { color: var(--tx); border-color: var(--tx3); }

/* --- layout --------------------------------------------------------------- */

main { display: block; }

.band { padding: 0 22px; }
.band-in { max-width: var(--w); margin: 0 auto; }

.prose { max-width: var(--prose); margin: 0 auto; padding: 0 22px 96px; }
.prose > * + * { margin-top: 1.05em; }

/* --- hero ----------------------------------------------------------------- */

.hero {
  padding: clamp(58px, 11vw, 118px) 22px clamp(44px, 8vw, 84px);
  border-bottom: 1px solid var(--edge);
}
.hero-in { max-width: var(--w); margin: 0 auto; }

.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lit);
  margin: 0 0 18px;
}

h1 {
  font-size: clamp(2.1rem, 6.4vw, 3.5rem);
  line-height: 1.13;
  letter-spacing: -0.03em;
  color: var(--tx);
  font-weight: 700;
  margin: 0 0 20px;
  max-width: 20ch;
  text-wrap: balance;
}

.lede {
  font-size: clamp(1.06rem, 2.3vw, 1.24rem);
  color: var(--tx2);
  max-width: 44ch;
  margin: 0;
}

/* --- sections ------------------------------------------------------------- */

section { padding-top: clamp(52px, 8vw, 88px); }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tx3);
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--edge); }

h2 {
  font-size: clamp(1.4rem, 3.4vw, 1.85rem);
  line-height: 1.24;
  letter-spacing: -0.022em;
  color: var(--tx);
  font-weight: 650;
  margin: 0 0 16px;
  text-wrap: balance;
}

h3 {
  font-size: 1.05rem;
  color: var(--tx);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2.1em 0 0.5em;
}

.prose h2 { margin-top: 2.4em; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }

p { margin: 0 0 1.05em; }
.prose p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 1.05em; padding-left: 1.3em; }
li { margin-bottom: 0.45em; }
li::marker { color: var(--tx3); }

/* --- the three steps ------------------------------------------------------ */

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  counter-reset: s;
}
.steps li {
  counter-increment: s;
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: 16px;
  padding: 22px 22px 24px;
  margin: 0;
}
.steps li::before {
  content: counter(s);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--card2);
  border: 1px solid var(--edge2);
  color: var(--lit);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}
.steps h3 { margin: 0 0 6px; font-size: 1.02rem; }
.steps p { margin: 0; font-size: 0.95rem; color: var(--tx2); }

/* --- the demo tile grid --------------------------------------------------- */

.demo {
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: 20px;
  padding: 24px;
  max-width: 30rem;
}
.demo-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.demo-label { color: var(--tx); font-weight: 600; }
.demo-count { font-family: var(--mono); font-size: 0.86rem; color: var(--tx3); }
.demo-count b { color: var(--lit); font-weight: 600; }

.tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 9px;
}
.tiles li {
  margin: 0;
  aspect-ratio: 1;
  border-radius: 13px;
  background: var(--card2);
  border: 1px solid var(--edge);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.78rem;
  color: var(--tx3);
}
.tiles li.on {
  background: linear-gradient(180deg, #ff7c33, var(--lit));
  border-color: transparent;
  color: var(--lit-ink);
  box-shadow: 0 0 0 4px var(--glow);
  font-weight: 600;
}
.tiles .rank { font-family: var(--mono); font-size: 0.66rem; opacity: 0.72; }

/* --- callouts ------------------------------------------------------------- */

.note, .warn {
  border: 1px solid var(--edge);
  border-left: 3px solid var(--lit);
  background: var(--card);
  border-radius: 0 12px 12px 0;
  padding: 18px 20px;
  margin: 1.6em 0;
}
.warn { border-left-color: var(--go); }
.note > :last-child, .warn > :last-child { margin-bottom: 0; }
.note .h, .warn .h {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lit);
  margin-bottom: 7px;
}
.warn .h { color: var(--go); }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--lit);
  color: var(--lit-ink);
  font-weight: 650;
  text-decoration: none;
  border-radius: 999px;
  padding: 13px 26px;
  font-size: 1rem;
}
.cta:hover { background: #ff8442; color: var(--lit-ink); }

.cta-ghost {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--edge2);
  color: var(--tx);
  font-weight: 550;
  text-decoration: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 0.97rem;
}
.cta-ghost:hover { border-color: var(--tx3); color: var(--tx); }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* --- tables --------------------------------------------------------------- */

.scroller {
  overflow-x: auto;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--card);
  margin: 1.4em 0;
  -webkit-overflow-scrolling: touch;
}
table { border-collapse: collapse; width: 100%; min-width: 30rem; font-size: 0.94rem; }
thead th {
  text-align: left;
  padding: 11px 15px;
  background: var(--card2);
  border-bottom: 1px solid var(--edge);
  color: var(--tx3);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}
tbody td { padding: 12px 15px; border-bottom: 1px solid var(--edge); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody td:first-child { color: var(--tx); font-weight: 500; }

/* --- legal page furniture ------------------------------------------------- */

.legal-head {
  border-bottom: 1px solid var(--edge);
  padding: clamp(44px, 7vw, 76px) 22px clamp(26px, 4vw, 40px);
}
.legal-head .in { max-width: var(--prose); margin: 0 auto; }
.legal-head h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); margin-bottom: 12px; max-width: none; }
.stamp {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--tx3);
  margin: 0;
}
.prose { padding-top: clamp(30px, 5vw, 46px); }

.toc {
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 0.93rem;
}
.toc ol { margin: 0; padding-left: 1.25em; }
.toc li { margin-bottom: 0.25em; }
.toc a { color: var(--tx2); text-decoration: none; }
.toc a:hover { color: var(--lit); text-decoration: underline; }

.mailbig {
  display: inline-block;
  font-family: var(--mono);
  font-size: 1.02rem;
  background: var(--card2);
  border: 1px solid var(--edge2);
  border-radius: 10px;
  padding: 11px 18px;
  color: var(--tx);
  text-decoration: none;
}
.mailbig:hover { border-color: var(--lit); color: var(--lit); }

/* --- footer --------------------------------------------------------------- */

.site-foot {
  border-top: 1px solid var(--edge);
  margin-top: clamp(60px, 10vw, 110px);
  padding: 40px 22px 56px;
}
.foot-in { max-width: var(--w); margin: 0 auto; }
.foot-tag { color: var(--tx2); margin: 0 0 18px; max-width: 40ch; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 0.93rem; margin-bottom: 20px; }
.foot-nav a { color: var(--tx2); text-decoration: none; }
.foot-nav a:hover { color: var(--tx); }
.foot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.86rem;
  color: var(--tx3);
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--edge);
}
.foot-meta a { color: var(--tx3); }
.foot-meta a:hover { color: var(--tx2); }

/* --- 404 ------------------------------------------------------------------ */

.mid {
  min-height: 52vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 22px;
}
.mid h1 { max-width: none; }
.mid p { color: var(--tx2); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* --- narrow screens -------------------------------------------------------
   The bar is wordmark + nav + language chip on one line at desktop widths.
   Below this it needs two lines, and the nav has to be the one that wraps —
   right-aligned nav links running into the edge of a phone screen look broken
   and are awkward to hit. Wordmark and language chip take line one; the nav
   gets line two, full width and left-aligned like the text beneath it.
   -------------------------------------------------------------------------- */
@media (max-width: 40rem) {
  .bar { padding: 12px 18px; gap: 10px 12px; }
  .wordmark { order: 1; }
  .lang { order: 2; margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; margin-left: 0; gap: 4px 15px; font-size: 0.9rem; }

  .band, .hero, .legal-head, .prose, .site-foot { padding-left: 18px; padding-right: 18px; }
  .prose { padding-bottom: 72px; }
  .demo { padding: 18px; }
  body { font-size: 16.5px; }
}
