/*
 * moduviewer.com
 *
 * Accessibility is not decoration here — §26 requires sufficient contrast,
 * keyboard operation, respect for the OS text size and reduced-motion setting.
 * All sizing is in rem so a user who enlarges text in their browser or OS gets
 * a page that grows with them instead of one that clips.
 */

:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-inset: #eef0f4;
  --line: #d9dde4;
  --fg: #14161a;
  --fg-muted: #565d69;
  --accent: #2f5fd8;
  --accent-fg: #ffffff;
  --ok: #1a7f4b;
  --warn: #8a5a00;
  --radius: 12px;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --bg-soft: #161922;
    --bg-inset: #1d212c;
    --line: #2b3140;
    --fg: #e8eaf0;
    --fg-muted: #a3aab8;
    --accent: #7ea2ff;
    --accent-fg: #0f1115;
    --ok: #4ec98a;
    --warn: #f0b048;
  }
}

* { box-sizing: border-box; }

html {
  /* No fixed px root size: the OS/browser text-size setting must win (§26). */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  line-height: 1.7;
  word-break: keep-all; /* Korean lines break between words, not inside them */
  overflow-wrap: break-word;
}

/* Keyboard users must always be able to see where they are (§26). */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0.75rem 1.25rem;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
}

.wrap {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

header.site {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
header.site .wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4rem;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: inherit;
}
.brand .en {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: 0;
}
nav.site {
  margin-left: auto;
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}
nav.site a {
  color: var(--fg-muted);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
}
nav.site a:hover { background: var(--bg-soft); color: var(--fg); }
nav.site a[aria-current="page"] { color: var(--fg); font-weight: 600; }

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

.hero {
  padding: 5rem 0 3.5rem;
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
}
.hero .lead {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--fg-muted);
  max-width: var(--measure);
  margin: 0 0 2rem;
}

/* The status notice is deliberately prominent. Nothing here is downloadable
   yet, and a visitor must learn that before they go looking for a button. */
.status {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--warn);
  border-radius: var(--radius);
  background: var(--bg-soft);
  max-width: var(--measure);
}
.status strong { display: block; }
.status p { margin: 0.25rem 0 0; color: var(--fg-muted); font-size: 0.95rem; }

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

main section {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--line);
}
main section:last-child { border-bottom: 0; }

h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}
h3 { font-size: 1.1rem; margin: 2rem 0 0.5rem; }
.section-lead {
  color: var(--fg-muted);
  max-width: var(--measure);
  margin: 0 0 2rem;
}

p, li { max-width: var(--measure); }

a { color: var(--accent); }

/* ---- principle cards ---- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--bg-soft);
}
.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
/* Icons are decorative; the heading text carries the meaning (§26). */
.card h3 .icon { font-size: 1.25rem; }
.card p { margin: 0; color: var(--fg-muted); font-size: 0.95rem; }

/* ---- format table ---- */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 1.5rem;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}
caption {
  text-align: left;
  padding: 1rem 1.25rem;
  color: var(--fg-muted);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--line);
}
th, td {
  text-align: left;
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
thead th {
  background: var(--bg-inset);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
td code {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.85em;
  color: var(--fg-muted);
}

/* Support level is never communicated by colour alone (§26): every badge
   carries its own word, and the shape does not encode meaning either. */
.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--bg-inset);
}
.badge.full { border-color: var(--ok); color: var(--ok); }
.badge.partial { border-color: var(--warn); color: var(--warn); }
.badge.none { color: var(--fg-muted); }

/* ---- prose pages ---- */

.prose { padding: 3rem 0 5rem; }
.prose h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -0.02em; }
.prose h2 { margin-top: 2.5rem; font-size: 1.3rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin: 0.35rem 0; }
.prose .updated { color: var(--fg-muted); font-size: 0.9rem; }
.prose blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--accent);
  background: var(--bg-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.prose blockquote p:last-child { margin-bottom: 0; }

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

footer.site {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 4rem;
  color: var(--fg-muted);
  font-size: 0.9rem;
}
footer.site .wrap {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}
footer.site nav { display: flex; gap: 1rem; flex-wrap: wrap; }
footer.site a { color: var(--fg-muted); }
footer.site .spacer { margin-left: auto; }

/* ---- motion ---- */

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

/* ---- print ---- */

@media print {
  header.site, footer.site, .skip-link { display: none; }
  body { color: #000; background: #fff; }
}
