/* RUIN site — one hand-written stylesheet. No imports, no web fonts, no external URLs.
   Palette: design/steam/store/CAPSULE-ART-BRIEF-V1.md section 4 (amber on near-black, pale blue kept scarce).
   Contrast ratios are listed in site/README.md. */

:root {
  color-scheme: dark;
  --sky: #0b0907;      /* page ground */
  --panel: #14100c;    /* cards, code, header */
  --hairline: #514031; /* decorative lines only (2.0:1, never carries meaning) */
  --edge: #8a7258;     /* borders that mark a component (4.4:1) */
  --muted: #b9a184;    /* secondary text (8.0:1) */
  --accent: #d8b48a;   /* amber: headings, labels (10.2:1) */
  --text: #f2ddc2;     /* body text (15.1:1) */
  --blue: #a9c4e6;     /* links, focus ring (11.1:1) */
  --measure: 72ch;
  --sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--sky);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  word-break: keep-all;      /* Korean: break between words, not inside them */
  overflow-wrap: anywhere;   /* long paths still wrap on a phone */
}

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + 2.5rem);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- skip link ---------- */
.skip {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--panel);
  color: var(--text);
  border: 2px solid var(--blue);
}
.skip:focus { top: 0.5rem; }

/* ---------- links and focus ---------- */
a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--text); text-decoration-thickness: 2px; }
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 1px;
}
a[aria-current="page"] { color: var(--text); text-decoration: none; border-bottom: 2px solid var(--accent); }

/* ---------- header ---------- */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--hairline);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}
.brand { display: inline-flex; padding: 0.25rem 0; }
.brand img { display: block; height: 1.25rem; width: auto; }
.site-header nav { flex: 1 1 auto; }
.site-header ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-header li a { display: inline-block; padding: 0.35rem 0; }
.lang { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.lang a, .lang span { display: inline-block; padding: 0.35rem 0; }
.lang span { color: var(--text); }

/* ---------- type ---------- */
main { padding: 2.25rem 0 3rem; }
h1, h2, h3 { line-height: 1.3; margin: 0; font-weight: 600; }
h1 { font-size: 1.75rem; color: var(--text); }
h2 {
  margin-top: 2.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
  font-size: 1.25rem;
  color: var(--accent);
}
h3 { margin-top: 1.75rem; font-size: 1.0625rem; color: var(--accent); }
p, ul, ol, dl { margin: 0.9rem 0 0; }
ul, ol { padding-left: 1.35rem; }
li + li { margin-top: 0.4rem; }
strong { color: var(--text); font-weight: 600; }
small, .small { font-size: 0.875rem; }
.muted { color: var(--muted); }
.lede { font-size: 1.0625rem; }

.code-line {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

code, kbd {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--panel);
  border: 1px solid var(--hairline);
  padding: 0.08em 0.35em;
  border-radius: 2px;
}
kbd { border-color: var(--edge); color: var(--text); white-space: nowrap; }
pre {
  margin: 0.9rem 0 0;
  padding: 0.85rem 1rem;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--accent);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.6;
  word-break: normal;
  overflow-wrap: normal;
}
pre code { background: none; border: 0; padding: 0; font-size: 1em; }

/* ---------- hero ---------- */
.hero { padding: 1.5rem 0 0.5rem; }
.hero h1 {
  font-family: var(--mono);
  font-size: clamp(3rem, 16vw, 5.5rem);
  font-weight: 500;
  letter-spacing: 0.4em;
  line-height: 1.1;
}
.hero .subtitle {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--accent);
  display: inline-block;
  font-size: 1.25rem;
  color: var(--accent);
  letter-spacing: 0.12em;
}
.hero .code-line { display: block; margin-top: 0.75rem; }

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}
.badges li {
  margin: 0;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--edge);
  background: var(--panel);
  font-size: 0.9375rem;
}
.badges .status { border-color: var(--accent); color: var(--accent); }

/* ---------- blocks ---------- */
.placeholder {
  margin-top: 1rem;
  padding: 2.25rem 1rem;
  border: 2px dashed var(--edge);
  background: var(--panel);
  text-align: center;
  color: var(--muted);
}
.placeholder strong { display: block; color: var(--text); }

.card {
  margin-top: 1rem;
  padding: 1rem 1.1rem 1.15rem;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--accent);
}
.card > :first-child { margin-top: 0; }

.notice {
  margin-top: 1rem;
  padding: 0.9rem 1.1rem;
  background: var(--panel);
  border: 1px solid var(--hairline);
  font-size: 0.9375rem;
  color: var(--muted);
}
.notice p:first-child { margin-top: 0; }

.contact {
  font-family: var(--mono);
  color: var(--text);
  font-size: 1.0625rem;
}

/* fact sheet: label / value pairs, one column on a phone, two from 40rem */
dl.facts { display: grid; grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--hairline); }
dl.facts dt {
  padding-top: 0.7rem;
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 600;
}
dl.facts dd {
  margin: 0;
  padding: 0.1rem 0 0.7rem;
  border-bottom: 1px solid var(--hairline);
}

/* controls table */
.table-scroll { margin-top: 0.9rem; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
caption { text-align: left; color: var(--muted); font-size: 0.9375rem; padding-bottom: 0.4rem; }
th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.75rem 0.55rem 0;
  border-bottom: 1px solid var(--hairline);
}
thead th { color: var(--accent); font-size: 0.9375rem; font-weight: 600; border-bottom-color: var(--edge); }
tbody th { font-weight: 400; white-space: nowrap; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  background: var(--panel);
  padding: 1.5rem 0 2.25rem;
  color: var(--muted);
  font-size: 0.9375rem;
}
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}
.site-footer li { margin: 0; }
.site-footer li a { display: inline-block; padding: 0.3rem 0; }
.site-footer p { margin: 0.35rem 0 0; }

/* ---------- wider screens ---------- */
@media (min-width: 40rem) {
  body { font-size: 1.0625rem; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.375rem; }
  dl.facts { grid-template-columns: 11rem 1fr; }
  dl.facts dt { padding: 0.7rem 1rem 0.7rem 0; border-bottom: 1px solid var(--hairline); }
  dl.facts dd { padding: 0.7rem 0; }
  .placeholder { padding: 3.5rem 1.5rem; }
}

/* ---------- preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root { --muted: #f2ddc2; --hairline: #8a7258; --edge: #d8b48a; }
}

@media (forced-colors: active) {
  .badges li, .card, .notice, .placeholder, pre { border-color: CanvasText; }
  a:focus-visible, summary:focus-visible { outline-color: Highlight; }
}

@media print {
  body { background: #fff; color: #000; }
  .site-header nav, .lang, .skip { display: none; }
  a { color: #000; }
  h2, h3, dl.facts dt, thead th, .hero .subtitle { color: #000; }
  .card, .notice, pre, code, kbd, .placeholder, .site-header, .site-footer, .badges li { background: #fff; color: #000; }
}
