/* Reset, typography baseline, layout primitives. */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-cream);
  font-family: var(--font-body);
  font-weight: var(--weight-body);
  font-size: var(--fs-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
  margin: 0;
  color: var(--color-cream);
}

h1 { font-size: var(--fs-display); line-height: var(--leading-display); }
h2 { font-size: var(--fs-h1); }
h3 { font-size: var(--fs-h2); }
h4 { font-size: var(--fs-h3); font-weight: var(--weight-body-strong); font-family: var(--font-body); letter-spacing: 0; }

/* Paragraph + inline */
p { margin: 0 0 1em; max-width: var(--width-prose); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover, a:focus-visible {
  color: var(--color-accent-deep);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

ul, ol { padding-left: 1.25em; margin: 0 0 1em; }
li { margin-bottom: 0.25em; }

img, picture, video { max-width: 100%; height: auto; display: block; }

/* Forms */
input, button, textarea, select { font: inherit; color: inherit; }

/* Focus */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Skip link — keyboard-accessibility affordance.
 * Bulletproof "visually hidden until focused" pattern: the element is
 * clipped to 1×1 with no overflow, so nothing — not even its border —
 * can render in the viewport. On :focus it expands to full size.
 */
.skip-link {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-md);
  z-index: 100;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  background: var(--color-bg-elevated);
  color: var(--color-cream);
  text-decoration: none;
}
.skip-link:focus {
  width: auto;
  height: auto;
  padding: var(--space-sm) var(--space-md);
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
}

/* Hangul / Korean rendering — slightly lighter weight, optical scale */
[lang="ko"] {
  font-family: var(--font-korean);
  font-weight: 300;
}

/* Layout primitives */
.container {
  max-width: var(--width-wide);
  margin: 0 auto;
  padding: 0 var(--space-edge);
}
.prose { max-width: var(--width-prose); }

/* Buttons — base
 * Specify exact properties (not `all`) so we don't transition unwanted things
 * like background-image. Press feedback is :active scale(0.97).
 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-body);
  font-weight: var(--weight-body-strong);
  font-size: var(--fs-small);
  letter-spacing: var(--tracking-uppercase);
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--duration-press) var(--ease-out),
              background-color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}
.btn:hover, .btn:focus-visible { text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover, .btn:focus-visible { transform: translateY(-1px); }
}
.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--color-accent);
  color: var(--color-ink);
}
.btn--primary:hover, .btn--primary:focus-visible {
  background: var(--color-accent-deep);
  color: var(--color-cream);
}

.btn--secondary {
  background: transparent;
  color: var(--color-cream);
  border-color: var(--color-rule-strong);
}
.btn--secondary:hover, .btn--secondary:focus-visible {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn--lg {
  padding: 1rem 1.75rem;
  font-size: var(--fs-body);
}

/* Section primitive */
.section {
  padding: var(--space-section) 0;
}
.section--bordered { border-top: 1px solid var(--color-rule); }
.section__eyebrow {
  display: inline-block;
  font-size: var(--fs-tiny);
  letter-spacing: var(--tracking-uppercase);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}

/* Visually hidden (for screen-reader-only labels) */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
