/* =========================================================================
   VANTA OTT — Base
   ========================================================================= */

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

:root { color-scheme: dark; }

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

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

body {
  margin: 0;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body-m);
  line-height: 1.72;
  letter-spacing: -0.003em;
  font-feature-settings: "ss01" on, "cv01" on;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* faint page-wide grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-cursor);
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg, video, canvas { display: block; max-width: 100%; }

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

input, textarea, select {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--accent-bone);
  color: var(--text-on-light);
}

/* ---- scrollbar ---------------------------------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-canvas); }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-pill);
  border: 2px solid var(--bg-canvas);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

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

/* ---- typography helpers -------------------------------------------------- */
h1, h2, h3, h4 {
  margin: 0;
  font-weight: 400;
}

.display-serif { font-family: var(--font-serif); }
.display-ko { font-family: var(--font-koserif); word-break: keep-all; }
.mono { font-family: var(--font-mono); }

/* thin hairline rule */
.rule {
  height: 1px;
  background: var(--border-hairline);
  border: 0;
  margin: 0;
}

/* eyebrow / mono label */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-label-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--border-strong);
}

/* mono labels: tighten word gaps so Korean words don't drift apart */
.eyebrow, .nav-cta, .field-label, .step, .stat-label, .badge, .kv dt,
.footer-col h4, .footer-bottom, .hero-meta, .cat-more, .flow-kicker,
.plan-term, .plan-flag, .prose-date {
  word-spacing: -0.25em;
}

/* ---- layout primitives --------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { position: relative; padding-block: var(--sp-11); }

@media (max-width: 720px) {
  .section { padding-block: var(--sp-9); }
}

.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;
}

/* ---- reveal on scroll ----------------------------------------------------- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
html.js [data-reveal].is-inview {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---- reduced motion global ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---- custom cursor (desktop pointers only) --------------------------------- */
@media (hover: hover) and (pointer: fine) {
  body.has-cursor, body.has-cursor a, body.has-cursor button, body.has-cursor input,
  body.has-cursor label, body.has-cursor [role="button"] {
    cursor: none;
  }
  /* form fields: native I-beam / arrow; custom dot+ring hidden while over them
     (visibility, not opacity — main.js writes inline opacity). Checkboxes keep
     the custom cursor. */
  body.has-cursor :is(input:not([type=checkbox],[type=radio]), textarea) { cursor: text; }
  body.has-cursor select, body.has-cursor .field-label { cursor: default; }
  body.has-cursor:has(:is(input:not([type=checkbox],[type=radio]), textarea, select):hover)
    :is(.cursor-dot, .cursor-ring) { visibility: hidden; }
}

.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  z-index: var(--z-cursor);
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--text-primary);
  pointer-events: none;
  mix-blend-mode: difference;
}
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  z-index: var(--z-cursor);
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  pointer-events: none;
  transition:
    width var(--dur-fast) var(--ease-out),
    height var(--dur-fast) var(--ease-out),
    margin var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}
.cursor-ring.is-hovering {
  width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-color: var(--text-secondary);
}
@media (prefers-reduced-motion: reduce) {
  .cursor-dot, .cursor-ring { display: none; }
}
