/* ============================================================
   Shinome Lab — website v1
   Tokens from DESIGN.md (DS v1, locked 2026-07-03).
   Dark-only. No shadows — radiance veils. Layered night ramp.
   ============================================================ */

/* ---------- fonts (self-hosted) ---------- */
@font-face {
  font-family: 'Clash Grotesk';
  src: url('../fonts/ClashGrotesk-400.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Clash Grotesk';
  src: url('../fonts/ClashGrotesk-500.woff2') format('woff2');
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: 'Clash Grotesk';
  src: url('../fonts/ClashGrotesk-600.woff2') format('woff2');
  font-weight: 600; font-display: swap;
}
@font-face {
  font-family: 'Clash Grotesk';
  src: url('../fonts/ClashGrotesk-700.woff2') format('woff2');
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-var.woff2') format('woff2');
  font-weight: 100 900; font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/Fraunces-Italic-500.woff2') format('woff2');
  font-weight: 500; font-style: italic; font-display: swap;
}
@font-face {
  /* 東雲-only subset — pins the kanji face per DS wordmark rule */
  font-family: 'Noto Sans JP Subset';
  src: url('../fonts/NotoSansJP-subset.woff2') format('woff2');
  font-weight: 400; font-display: swap;
  unicode-range: U+6771, U+96F2;
}

/* ---------- tokens ---------- */
:root {
  --bg-primary: #14171F;
  --bg-secondary: #1E2330;
  --bg-tertiary: #293142;
  --border-subtle: #323A4D;
  --border-strong: #46506A;
  --text-primary: #E8EAF0;
  --text-secondary: #9BA3B4;
  --text-muted: #6B7389;
  --accent-primary: #8FB3E6;
  --accent-teal: #72C6B6;
  --accent-mauve: #B49AD6;
  --accent-pink: #E3A7C5;
  --state-success: #7DCBA6;

  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;

  --font-display: 'Clash Grotesk', 'Helvetica Neue', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-moment: 'Fraunces', Georgia, serif;

  --surface-raised: color-mix(in oklab, var(--text-primary) 5%, transparent);
  --surface-border: transparent;   /* light theme rules a fine ink line (episode-card register) */

  /* the daybreak atmosphere — night: first light below the horizon */
  --atmo-a: color-mix(in oklab, var(--accent-primary) 13%, transparent);
  --atmo-b: color-mix(in oklab, var(--accent-pink) 18%, transparent);
  --atmo-c: color-mix(in oklab, var(--accent-teal) 7%, transparent);
  --ramp-0: var(--bg-primary);
  --ramp-1: var(--bg-secondary);
  --ramp-2: var(--bg-tertiary);

  --sigil-opacity: 0.16;

  --w-page: 1080px;
  --w-prose: 640px;
}

/* ---------- light theme — the episode-title-card register ----------
   Warm paper, night ink, deepened dawn accents, thin ruled borders.
   Dark stays canonical/default; this is the day side of the same world. */
:root[data-theme="light"] {
  --bg-primary: #F4EFE3;
  --bg-secondary: #ECE4D2;
  --bg-tertiary: #E2D8C0;
  --border-subtle: #D9CFB8;
  --border-strong: #B4A98E;
  --text-primary: #23283A;
  --text-secondary: #4E5568;
  --text-muted: #79808F;
  --accent-primary: #4E6FAE;
  --accent-teal: #22796A;
  --accent-mauve: #71549E;
  --accent-pink: #AE4E7F;
  --state-success: #2F7D55;

  --surface-raised: color-mix(in oklab, var(--text-primary) 4%, transparent);
  --surface-border: color-mix(in oklab, var(--text-primary) 14%, transparent);

  /* day atmosphere — the sky after daybreak, washed on paper */
  --atmo-a: color-mix(in oklab, #8FB3E6 26%, transparent);
  --atmo-b: color-mix(in oklab, #E3A7C5 30%, transparent);
  --atmo-c: color-mix(in oklab, #72C6B6 14%, transparent);
  --ramp-0: #F4EFE3;
  --ramp-1: #EFE8D6;
  --ramp-2: #E9DFC8;

  --sigil-opacity: 0.35;
  --grain-opacity: 0.05;   /* paper wants a touch more tooth */
}
:root[data-theme="light"] .btn--solid {
  background: #40598F;   /* deepened for AA on paper */
  color: #FFFFFF;
}
:root[data-theme="light"] .btn--solid:hover {
  background: #4E6FAE;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  font-size: 15px; line-height: 1.6;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  /* the daybreak ramp — night at the masthead, first light at the sign-off */
  background-image:
    radial-gradient(90rem 42rem at 50% -22rem, var(--atmo-a), transparent 70%),
    radial-gradient(84rem 36rem at 50% calc(100% + 16rem), var(--atmo-b), transparent 72%),
    radial-gradient(64rem 28rem at 16% calc(100% - 28rem),
      color-mix(in oklab, var(--accent-primary) 6%, transparent), transparent 70%),
    linear-gradient(180deg, var(--ramp-0) 0% 42%, var(--ramp-1) 78%, var(--ramp-2) 100%);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .5s ease, color .5s ease;
}

/* living atmosphere — two slow dawn masses drifting behind everything */
body::before {
  content: '';
  position: fixed; inset: -20%; z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(46rem 34rem at 72% 18%, var(--atmo-c), transparent 68%),
    radial-gradient(52rem 40rem at 18% 82%, var(--atmo-a), transparent 70%);
  animation: atmo-drift 46s ease-in-out infinite alternate;
}
@keyframes atmo-drift {
  from { transform: translate3d(-2.5%, -1.5%, 0) scale(1); opacity: .75; }
  to   { transform: translate3d(2.5%, 2%, 0) scale(1.06); opacity: 1; }
}
.masthead, main, .footer { position: relative; z-index: 1; }

::selection { background: color-mix(in oklab, var(--accent-primary) 30%, transparent); color: var(--text-primary); }

strong { color: var(--text-primary); font-weight: 600; }
em { font-style: italic; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
sup { font-size: 0.7em; }

/* ---------- grain — kills gradient banding, adds surface ---------- */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 9;
  pointer-events: none;
  opacity: var(--grain-opacity, 0.035);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%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");
}

/* ---------- the dawn hairline — one appearance, top edge ---------- */
.dawn-hairline {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 10;
  background: linear-gradient(90deg,
    var(--accent-primary), var(--accent-teal), var(--accent-mauve), var(--accent-pink));
  transform-origin: left center;
}

/* ---------- masthead ---------- */
.masthead {
  max-width: var(--w-page);
  margin: 0 auto;
  padding: 34px 28px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.masthead__mark img { width: 150px; }
.masthead__right { display: flex; align-items: center; gap: 14px; }

.theme-toggle {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color .3s ease, border-color .3s ease, transform .3s ease;
}
.theme-toggle:hover { color: var(--accent-primary); border-color: var(--accent-primary); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 3px; }
.theme-toggle__icon { width: 19px; height: 19px; }
.tt-rays { transition: opacity .4s ease; transform-origin: center; }
.tt-sun { transition: transform .4s ease; transform-origin: center; }
:root[data-theme="light"] .tt-rays { opacity: 0; }
:root[data-theme="light"] .tt-sun { transform: scale(1.35); }

/* ---------- the sigil — 1px celestial line-work, one instance ---------- */
.hero { position: relative; }
.hero__sigil {
  position: absolute;
  right: max(28px, calc((100vw - var(--w-page)) / 2 + 8px));
  top: 130px;
  width: min(430px, 34vw);
  aspect-ratio: 1;
  color: var(--accent-primary);
  opacity: var(--sigil-opacity);
  pointer-events: none;
  transition: opacity .5s ease;
}
.hero__sigil svg { width: 100%; height: 100%; overflow: visible; }
.sigil__outer, .sigil__inner { transform-origin: 200px 200px; }
@media (prefers-reduced-motion: no-preference) {
  .sigil__outer { animation: sigil-spin 160s linear infinite; }
  .sigil__inner { animation: sigil-spin 110s linear infinite reverse; }
}
@keyframes sigil-spin { to { transform: rotate(360deg); } }
@media (max-width: 1100px) { .hero__sigil { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600; letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 999px;
  padding: 13px 26px;
  transition: background-color .25s ease, color .25s ease,
              border-color .25s ease, transform .25s ease;
}
.btn:active { transform: scale(0.98); }
.btn--solid { position: relative; overflow: hidden; }
.btn--solid::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 42%,
    color-mix(in oklab, var(--text-primary) 30%, transparent) 50%, transparent 58%);
  transform: translateX(-130%);
}
.btn--solid:hover::after { transition: transform .7s ease; transform: translateX(130%); }
.btn:focus-visible, .link-quiet:focus-visible, .masthead__mark:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
.btn:focus-visible { border-radius: 999px; }
.btn--solid {
  background: var(--accent-primary);
  color: var(--bg-primary);
}
.btn--solid:hover {
  background: color-mix(in oklab, var(--accent-primary) 85%, var(--text-primary));
}
.btn--ghost {
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 10px 20px;
}
.btn--ghost:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.btn--wide { width: 100%; text-align: center; margin-top: 28px; }

.link-quiet {
  font-size: 13.5px; color: var(--text-secondary);
  text-decoration: none; border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px; transition: color .25s ease, border-color .25s ease;
}
.link-quiet:hover { color: var(--accent-primary); border-color: var(--accent-primary); }

/* ---------- station labels (lowercase, ink = station color) ---------- */
.station {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  text-transform: lowercase;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 22px;
}
.station__dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; flex: none; }
.station--primary { color: var(--accent-primary); }
.station--teal { color: var(--accent-teal); }
.station--mauve { color: var(--accent-mauve); }
.station--pink { color: var(--accent-pink); }

/* ---------- surfaces: radiance veils on night; fine ruled panels on paper ---------- */
.surface {
  background: var(--surface-raised);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-lg);
  padding: 26px 28px;
  transition: background-color .35s ease, border-color .35s ease;
}
.surface:hover {
  background: color-mix(in oklab, var(--text-primary) 7%, transparent);
}
.stat {
  border: 1px solid var(--surface-border);
  transition: background-color .35s ease, border-color .35s ease;
}
.stat:hover { background: color-mix(in oklab, var(--text-primary) 7%, transparent); }

/* ---------- hero ---------- */
.hero {
  max-width: var(--w-page);
  margin: 0 auto;
  padding: 120px 28px 140px;
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(40px, 6.6vw, 78px);
  font-weight: 700; line-height: 1.04; letter-spacing: -0.015em;
  color: var(--text-primary);
  max-width: 13em;
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line > span { display: inline-block; }
.line--moment > span {
  font-family: var(--font-moment);
  font-style: italic; font-weight: 500;
  color: var(--accent-primary);
  letter-spacing: 0;
}
.hero__lede {
  font-size: 16px; line-height: 1.7;
  max-width: var(--w-prose);
  margin-top: 34px;
}
.hero__actions {
  display: flex; align-items: center; gap: 28px;
  margin-top: 40px;
}
.hero__stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  max-width: 760px;
  margin-top: 88px;
}
.stat {
  background: var(--surface-raised);
  border-radius: var(--r-lg);
  padding: 20px 22px;
}
.stat__label {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-muted);
}
.stat__value {
  font-family: var(--font-display);
  font-size: 34px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  margin-top: 8px;
}
.stat__value--teal { color: var(--accent-teal); }
.stat__value small {
  font-family: var(--font-body);
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  margin-left: 6px;
}
.stat__sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.hero__fine { font-size: 11px; line-height: 1.7; color: var(--text-muted); margin-top: 16px; max-width: 760px; }

/* ---------- sections ---------- */
.section {
  max-width: var(--w-page);
  margin: 0 auto;
  padding: 110px 28px;
  scroll-margin-top: 24px;
}
.section__title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 700; line-height: 1.15; letter-spacing: -0.015em;
  color: var(--text-primary);
  max-width: 17em;
}
.section__lede {
  font-size: 16px; line-height: 1.7;
  max-width: var(--w-prose);
  margin-top: 20px;
}

/* ---------- proof ---------- */
.proof__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  margin-top: 48px;
}
.proof__figure {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  display: flex; align-items: baseline; gap: 10px;
}
.proof__num { font-size: 56px; font-weight: 700; line-height: 1; }
.proof__num--teal { color: var(--accent-teal); }
.proof__arrow { font-size: 28px; color: var(--text-muted); }
.proof__unit { font-size: 14px; font-weight: 600; font-family: var(--font-body); color: var(--text-secondary); }
.proof__body { margin-top: 18px; font-size: 14px; line-height: 1.65; }
.moment-line {
  font-family: var(--font-moment); font-style: italic; font-weight: 500;
  font-size: 19px; color: var(--text-primary);
  margin-top: 56px;
}

/* ---------- system / phases ---------- */
@media (min-width: 1000px) {
  .system {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    column-gap: 88px;
    grid-template-areas: 'station station' 'intro phases' 'carry carry';
  }
  .system .station { grid-area: station; }
  /* sticky lives on an inner wrapper: Safari clamps sticky grid items to the grid
     container, not the grid area, which let the intro ride over the carry row */
  .system__intro { grid-area: intro; align-self: stretch; }
  .system__intro-sticky { position: sticky; top: 96px; }
  .system .phases { grid-area: phases; margin-top: 8px; }
  .system .carry { grid-area: carry; }
}
.phases {
  position: relative;
  margin-top: 64px;
  padding-left: 40px;
  display: grid; gap: 56px;
  max-width: 720px;
}
.phases__rail {
  position: absolute; left: 8px; top: 6px; bottom: 6px; width: 1px;
  background: var(--border-subtle);
}
.phases__fill {
  position: absolute; inset: 0; width: 100%;
  background: var(--accent-teal);
  transform-origin: top center; transform: scaleY(0);
}
.phase { position: relative; }
.phase::before {
  content: '';
  position: absolute; left: -36.5px; top: 6px;
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--bg-primary);
  border: 1.5px solid var(--border-strong);
  transition: border-color .4s ease, background-color .4s ease;
}
.phase.is-lit::before {
  border-color: var(--accent-teal);
  background: color-mix(in oklab, var(--accent-teal) 30%, var(--bg-primary));
}
.phase__weeks {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--accent-teal);
}
.phase__name {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-top: 6px;
}
.phase__body { margin-top: 12px; max-width: 56ch; }

.carry {
  list-style: none;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  margin-top: 72px;
}
.carry__item { font-size: 13.5px; line-height: 1.6; }

/* ---------- fit ---------- */
.fit__cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px;
  margin-top: 48px;
}
.fit__head {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 600;
  margin-bottom: 22px;
}
.fit__head--yes { color: var(--state-success); }
.fit__head--no { color: var(--text-muted); }
.fit__list { list-style: none; display: grid; gap: 16px; }
.fit__list li {
  padding-left: 22px; position: relative;
  font-size: 14.5px; line-height: 1.65;
}
.fit__list li::before {
  content: '';
  position: absolute; left: 4px; top: 9px;
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--state-success);
}
.fit__list--no li::before { background: var(--border-strong); }

/* ---------- start / CTA ---------- */
.start { padding-bottom: 140px; }
.start__panel {
  max-width: 620px;
  margin-top: 48px;
  padding: 34px 36px;
}
.start__step {
  display: flex; gap: 18px; align-items: baseline;
  font-size: 14.5px; line-height: 1.65;
  padding: 12px 0;
}
.start__step span {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 700;
  color: var(--accent-pink);
  font-variant-numeric: tabular-nums;
  flex: none;
}
.start__note { font-size: 12px; color: var(--text-secondary); margin-top: 18px; line-height: 1.7; }

/* ---------- footer ---------- */
.footer {
  max-width: var(--w-page);
  margin: 0 auto;
  padding: 0 28px 72px;
}
.footer__moment {
  font-size: 12px; color: var(--text-secondary);
}
.footer__links { display: flex; gap: 24px; margin-top: 22px; }
.footer__moment .kanji {
  font-family: 'Noto Sans JP Subset', 'Noto Sans JP', sans-serif;
  font-size: 18px; letter-spacing: 0.22em; color: var(--text-primary);
  margin-right: 6px;
}
.footer__moment em {
  font-family: var(--font-moment); font-style: italic; font-weight: 500;
  font-size: 13px;
  color: var(--text-secondary);
}
.footer__fine {
  font-size: 11px; line-height: 1.7;
  color: var(--text-secondary); /* lifted-ink rule: dawn-side ground → secondary, not muted */
  max-width: 620px;
  margin-top: 20px;
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .hero { padding: 80px 24px 96px; }
  /* let the title flow naturally on small screens; keep the moment on its own line */
  .hero__title .line, .hero__title .line > span { display: inline; }
  .hero__title .line--moment { display: block; margin-top: 10px; }
  .hero__title .line--moment > span { display: inline-block; }
  .hero__stats { grid-template-columns: 1fr; margin-top: 64px; }
  .section { padding: 80px 24px; }
  .proof__grid { grid-template-columns: 1fr; }
  .carry { grid-template-columns: 1fr; margin-top: 56px; }
  .fit__cols { grid-template-columns: 1fr; gap: 44px; }
  .masthead { padding: 26px 24px 0; }
  /* wordmark clearspace: masthead CTA is redundant on mobile (hero CTA is one glance down) */
  .masthead__cta { display: none; }
  .hero__actions { flex-wrap: wrap; gap: 20px; }
  .start__panel { padding: 28px 24px; }
  .footer { padding: 0 24px 56px; }
}

/* ---------- reduced motion: everything visible, nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
