/* PageOne public pages — shared tokens, type, chrome (header/nav, footer), reveal.
   Ported from search-pick-sub/assets/sp-tokens.css; page-specific layout lives in each template. */
/* Self-hosted fonts (no CDN): DM Sans latin (OFL), Pretendard Variable (OFL). */
@font-face { font-family: "DM Sans"; src: url("fonts/DMSans-latin.woff2") format("woff2"); font-style: normal; font-weight: 400 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Pretendard Variable"; src: url("fonts/PretendardVariable.woff2") format("woff2"); font-style: normal; font-weight: 100 900; font-display: swap; }
:root {
  --paper: oklch(91% .006 250);
  --studio-dark: oklch(23% .022 255);
  --ink: oklch(24% .025 255);
  --ink-2: oklch(40% .022 255);
  --mark: oklch(66% 0.17 38);
  --on-dark-2: color-mix(in oklch, var(--paper) 70%, var(--studio-dark));
  --line: color-mix(in oklch, var(--ink) 14%, transparent);
  --line-dark: color-mix(in oklch, var(--paper) 16%, transparent);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --gutter: clamp(16px, 4vw, 56px);
  --sans: "DM Sans", "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --header-h: 72px;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, .25vw + .95rem, 1.125rem);
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.is-dark { background: var(--studio-dark); color: var(--paper); }
:focus-visible { outline: 2px solid var(--mark); outline-offset: 3px; border-radius: 4px; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip { position: fixed; left: var(--gutter); top: -100px; z-index: 30; padding: .6em 1em; background: var(--ink); color: var(--paper); border-radius: 8px; pointer-events: auto; }
.skip:focus { top: 12px; }

/* Layers: dark fills (z 0) < particle canvas (z 1) < copy (z 2) < header (z 10) */
#stage { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
#stage canvas, .sp-canvas canvas { display: block; }

/* ---------- Header (same component as the main page) ---------- */
.site-header { position: fixed; inset: 0 0 auto; z-index: 10; pointer-events: none; color: var(--ink); transition: color .6s var(--ease); }
.site-header.on-dark { color: var(--paper); }
/* Once the page scrolls, the header gets a near-solid band so copy never runs under the nav (toggled by site()). */
.site-header::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--paper); box-shadow: 0 1px 0 var(--line); opacity: 0; transition: opacity .4s var(--ease), background-color .6s var(--ease); }
.site-header.on-dark::before { background: var(--studio-dark); box-shadow: 0 1px 0 var(--line-dark); }
.site-header.solid::before { opacity: 1; }
.site-header a { pointer-events: auto; color: inherit; text-decoration: none; }
.bar { display: flex; align-items: center; gap: clamp(16px, 3vw, 40px); padding: 18px var(--gutter); }
.logo { margin-right: auto; font-size: 1.3125rem; font-weight: 700; letter-spacing: -.045em; line-height: 1; }
/* Brand logo images: ink version on paper, light version over dark bands. */
.logo { display: inline-flex; align-items: center; min-height: 44px; }
.logo img { display: block; width: 140px; height: auto; }
.logo-inverse, .on-dark .logo-default, .is-dark .logo-default { display: none !important; }
.on-dark .logo-inverse, .is-dark .logo-inverse { display: block !important; }
.nav ul { display: flex; gap: clamp(14px, 2vw, 30px); margin: 0; padding: 0; list-style: none; }
.nav a { font-size: .9375rem; opacity: .72; transition: opacity .3s; white-space: nowrap; }
.nav a:hover, .nav a:focus-visible, .nav a[aria-current="page"] { opacity: 1; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--mark); text-decoration-thickness: 2px; text-underline-offset: 6px; }
/* 내 진단 기록: header button for the shared history popover (content loads with JS). */
.nav-hist { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-size: .9375rem; opacity: .72; cursor: pointer; pointer-events: auto; white-space: nowrap; transition: opacity .3s; }
.nav-hist:hover, .nav-hist:focus-visible { opacity: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-height: 48px; padding: 0 1.45em; border-radius: 999px; border: 0;
  font: 600 1rem/1 var(--sans); letter-spacing: -.01em; text-decoration: none; white-space: nowrap; cursor: pointer;
  pointer-events: auto; transition: transform .6s var(--ease), background-color .3s, color .3s, border-color .3s;
}
.btn span { display: inline-block; transition: transform .6s var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn:hover span { transform: translate(2px, -2px); }
.btn--mark { background: var(--mark); color: var(--ink); }
.btn--ink { background: var(--ink); color: var(--paper); }
.is-dark .btn--ink { background: var(--paper); color: var(--ink); }
.btn--line { min-height: 40px; padding: 0 1.1em; font-size: .9375rem; border: 1px solid color-mix(in oklch, currentColor 38%, transparent); color: inherit; background: transparent; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Overlay copy never blocks the canvas; only interactive things take the pointer (main-page rule). */
main, .site-footer { pointer-events: none; }
main a, main button, main input, main select, main textarea, main summary, main label, main [tabindex], main .pe,
.site-footer a, .site-footer button { pointer-events: auto; }

.wrap { position: relative; z-index: 2; width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); }
.is-dark { color: var(--paper); }
section.is-dark, .band.is-dark { position: relative; }
section.is-dark::before, .band.is-dark::before { content: ""; position: absolute; inset: 0; z-index: 0; background: var(--studio-dark); }

.eyebrow { display: block; margin: 0 0 1.2rem; font-size: .8125rem; font-weight: 500; line-height: 1.4; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.is-dark .eyebrow, .is-dark .lede, .is-dark .note { color: var(--on-dark-2); }
.lede { margin: 1.4rem 0 0; max-width: 32em; font-size: clamp(1.0625rem, .5vw + .95rem, 1.375rem); line-height: 1.6; color: var(--ink-2); }
.note { margin: 1rem 0 0; max-width: 40em; font-size: .9375rem; color: var(--ink-2); }
.tnum { font-variant-numeric: tabular-nums; }

/* Breadcrumb: 홈 / 페이지명 */
.crumbs { margin: 0 0 1.6rem; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .5em; font-size: .8125rem; color: var(--ink-2); }
.is-dark .crumbs { color: var(--on-dark-2); }
.crumbs li + li::before { content: "/"; margin-right: .5em; opacity: .5; }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--mark); }

/* Honesty badges */
.badge { display: inline-flex; align-items: center; gap: .35em; padding: .18em .7em; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: .02em; line-height: 1.4; white-space: nowrap; vertical-align: middle; }
.badge--ex { background: color-mix(in oklch, var(--mark) 18%, transparent); color: color-mix(in oklch, var(--mark) 70%, var(--ink)); border: 1px solid color-mix(in oklch, var(--mark) 45%, transparent); }
.is-dark .badge--ex { color: color-mix(in oklch, var(--mark) 60%, var(--paper)); }
.badge--sim { border: 1px dashed currentColor; color: inherit; opacity: .9; }

/* Reveal: masked lines rise; .rv fades. Pages use these sparingly — not every block. */
.ln { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.ln > span { display: block; }
.js .ln > span { transform: translateY(108%); transition: transform 1.3s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
.js .rv { opacity: 0; transform: translateY(20px); transition: opacity 1s var(--ease), transform 1.2s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
.js .is-in > .ln > span, .js .ln.is-in > span, .js .is-in .ln > span, .js .rv.is-in, .js .is-in > .rv { opacity: 1; transform: none; }
/* If the module never runs, nothing stays hidden. */
.rv-fallback .ln > span, .rv-fallback .rv { opacity: 1 !important; transform: none !important; }

/* ---------- Footer (original composition, dark band) ---------- */
.site-footer { position: relative; z-index: 2; }
.site-footer.is-dark::before { content: ""; position: absolute; inset: 0; z-index: 0; background: var(--studio-dark); }
.site-footer a { color: inherit; text-decoration: none; }
.ft { padding-top: clamp(72px, 12vh, 140px); padding-bottom: 28px; color: var(--paper); }
.ft-top { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 28px; padding-bottom: clamp(48px, 8vh, 88px); border-bottom: 1px solid var(--line-dark); }
.ft-top p { margin: 0 0 .9rem; color: var(--on-dark-2); }
.ft-top h2 { font-size: clamp(2.5rem, 6vw, 5.5rem); line-height: 1; letter-spacing: -.05em; }
.ft-mid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding: clamp(36px, 6vh, 64px) 0; }
.ft-brand .logo { display: inline-block; font-size: 1.75rem; }
.ft-brand .logo img { width: 190px; }
.ft-company { margin: 0; flex-basis: 100%; line-height: 1.7; }
.ft-company a { text-decoration: underline; text-underline-offset: 3px; }
.ft-brand p { margin: 1rem 0 0; font-size: .875rem; line-height: 1.7; color: var(--on-dark-2); letter-spacing: .02em; }
.ft-mid ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .55rem; font-size: .9375rem; }
.ft-mid a { color: var(--on-dark-2); transition: color .3s; }
.ft-mid a:hover, .ft-bot a:hover { color: var(--paper); }
.ft-bot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 22px; border-top: 1px solid var(--line-dark); font-size: .8125rem; color: var(--on-dark-2); }
.ft-bot p { margin: 0; }
.ft-legal { display: flex; flex-wrap: wrap; gap: 18px; }
.ft-up { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-dark); }

@media (max-width: 899px) {
  .bar { flex-wrap: wrap; row-gap: 4px; padding-top: 12px; padding-bottom: 10px; }
  .nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .nav ul { gap: 18px; }
  .nav a { display: inline-block; padding: 6px 0; font-size: .8125rem; white-space: nowrap; }
  .nav-hist { padding: 6px 0; font-size: .8125rem; }
  .ft-mid { grid-template-columns: 1fr 1fr; }
  .ft-brand { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .js .ln > span, .js .rv { opacity: 1; transform: none; transition: none; }
  .btn, .btn span { transition: none; }
}

/* Footer "무료 진단 이용 안내" and other small notices: native popover, works without JS. */
.ft-terms { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; pointer-events: auto; }
.ft-terms:hover { color: var(--paper); }
.sp-pop {
  width: min(30rem, calc(100vw - 2 * var(--gutter))); margin: auto; padding: 30px 28px 26px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--paper); color: var(--ink); pointer-events: auto; text-align: left; font-size: .9375rem; line-height: 1.7;
  box-shadow: 0 24px 64px color-mix(in oklch, var(--studio-dark) 28%, transparent);
}
.sp-pop::backdrop { background: color-mix(in oklch, var(--studio-dark) 38%, transparent); }
.sp-pop h2 { margin: 0 2rem .7rem 0; font-size: 1.25rem; letter-spacing: -.03em; }
.sp-pop p { margin: 0; color: var(--ink-2); }
.sp-pop p + p { margin-top: .8rem; }
.sp-pop a { color: var(--ink); }
.sp-pop .eyebrow { margin-bottom: .6rem; }
.sp-pop-x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: inherit; font: 400 1.5rem/1 var(--sans); cursor: pointer; }
.sp-pop-x:hover { background: color-mix(in oklch, var(--ink) 8%, transparent); }
.sp-hist { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 500; cursor: pointer; text-decoration: underline; text-decoration-color: var(--mark); text-underline-offset: 3px; pointer-events: auto; }
/* Inline free-audit form (includes/audit-quick.html). currentColor keeps it right on light and dark bands. */
.aq { margin-top: 1.4rem; }
.aq-row { display: flex; flex-wrap: wrap; gap: 10px; }
.aq-input { flex: 1 1 13rem; min-width: 0; min-height: 48px; padding: 0 1.1rem; border: 1px solid color-mix(in oklch, currentColor 34%, transparent); border-radius: 999px; background: transparent; color: inherit; font: 500 1rem/1 var(--sans); pointer-events: auto; }
.aq-input::placeholder { color: color-mix(in oklch, currentColor 50%, transparent); }
.aq-input:focus-visible { outline: 2px solid var(--mark); outline-offset: 2px; }
.aq .btn { flex: none; }
.aq-note { margin: .85rem 0 0 !important; font-size: .8125rem; line-height: 1.65; color: inherit !important; opacity: .78; }
.aq-note a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.sp-pop-empty { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.sp-pop-empty p:first-child { color: var(--ink); font-weight: 500; }
.sp-pop-acts { margin-top: 1.4rem !important; display: flex; flex-wrap: wrap; gap: 10px; }
/* 내 진단 기록 (server list from /analysis/history/) */
.sp-pop-list { margin-top: 1.1rem; max-height: min(50vh, 420px); overflow: auto; }
.sp-hist-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; border-top: 1px solid var(--line); }
.sp-hist-list li { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.sp-hist-head { display: flex; justify-content: space-between; gap: 12px; font-size: .8125rem; color: var(--ink-2); }
.sp-hist-head b { color: var(--ink); font-size: 1rem; }
.sp-hist-head small { margin-left: .2em; font-weight: 500; color: var(--ink-2); }
.sp-hist-list a { display: inline-block; margin-top: .3rem; font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.sp-hist-list a:hover { color: var(--mark); }
.sp-hist-list p { margin: .2rem 0 0; font-size: .8125rem; }
.sp-pop .btn--ink { color: var(--paper); }
