:root {
  color-scheme: light dark;
  --bg: #eef0f3;
  --surface: #e3e6ea;
  --surface-strong: #d7dbe1;
  --text: #111318;
  --muted: #545b66;
  --line: #c4c9d1;
  --gold: #9a741d;
  --gold-strong: #75550d;
  --on-gold: #fffdf7;
  --error: #962b20;
  --shadow: rgba(30, 36, 47, 0.16);
  --radius: 16px;
  --page: min(1180px, calc(100% - 40px));
  font-family: "Segoe UI Variable", "Aptos", "Noto Sans", sans-serif;
  font-synthesis: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12;
    --surface: #141820;
    --surface-strong: #1c212b;
    --text: #f3f1eb;
    --muted: #a2a7b1;
    --line: #303642;
    --gold: #d8b45a;
    --gold-strong: #f0d891;
    --on-gold: #161109;
    --error: #ff9b8f;
    --shadow: rgba(0, 0, 0, 0.42);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  overflow-x: clip;
}

button, a { font: inherit; }
a { color: inherit; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--on-gold);
}
.skip-link:focus { top: 16px; }

.section-shell { width: var(--page); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.nav-shell {
  width: var(--page);
  height: 72px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  font-weight: 750;
  text-decoration: none;
  letter-spacing: -0.03em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-strong);
}

.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a, .nav-cta { color: var(--muted); font-size: 14px; text-decoration: none; }
.nav-links a:hover, .nav-cta:hover { color: var(--text); }
.nav-cta { justify-self: end; }

.hero {
  min-height: calc(100dvh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  align-items: center;
  gap: clamp(40px, 7vw, 110px);
  padding-block: 56px;
}

.eyebrow {
  margin: 0 0 22px;
  color: var(--gold-strong);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1, h2, h3 { margin: 0; line-height: 1.04; letter-spacing: -0.05em; }
h1 { max-width: 690px; font-size: clamp(48px, 6vw, 82px); font-weight: 760; }
h2 { font-size: clamp(38px, 4.6vw, 64px); font-weight: 735; }
h3 { font-size: clamp(24px, 2.5vw, 38px); font-weight: 700; }

.hero-sub {
  max-width: 540px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 720;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}
.button:active { transform: translateY(1px) scale(0.99); }
.button:focus-visible, .cast-control:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--gold) 65%, transparent); outline-offset: 3px; }
.button-primary { background: var(--gold); color: var(--on-gold); }
.button-primary:hover { background: var(--gold-strong); }
.button-secondary { border-color: var(--line); background: var(--surface); color: var(--text); }
.button-secondary:hover { border-color: var(--gold); }

.oracle-stage {
  position: relative;
  min-height: 620px;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.oracle-stage::before {
  content: "";
  position: absolute;
  inset: 7%;
  z-index: -3;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--gold) 18%, transparent), transparent 64%);
}

.oracle-stage picture { display: contents; }

.oracle-avatar {
  width: min(430px, 72vw);
  height: auto;
  border-radius: 50%;
  filter: drop-shadow(0 30px 48px var(--shadow));
}

.orbit {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 50%;
  pointer-events: none;
}
.orbit::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  top: -5px;
  left: 50%;
}
.orbit-outer { width: 590px; height: 590px; }
.orbit-inner { width: 505px; height: 505px; border-style: dashed; }

.sample-result {
  position: absolute;
  left: 0;
  bottom: 42px;
  width: 210px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 18px 60px var(--shadow);
}
.sample-result span, .sample-result strong { display: block; }
.sample-label { color: var(--muted); font-size: 12px; }
.sample-result strong { margin-top: 8px; font-size: 32px; line-height: 1; }
#sample-bias { color: var(--gold-strong); font-size: 15px; font-weight: 780; letter-spacing: 0.12em; }
#sample-hexagram { margin-top: 10px; color: var(--muted); font-size: 14px; }

.cast-control {
  position: absolute;
  right: 8px;
  bottom: 84px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.cast-control:hover { border-color: var(--gold); }

.method-section, .services-section, .privacy-section { padding-block: clamp(90px, 12vw, 160px); }
.method-heading { max-width: 720px; }
.method-heading p, .services-section > p, .privacy-copy > p, .cta-section p { max-width: 620px; color: var(--muted); font-size: 19px; }

.method-track {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 0;
  margin-top: 72px;
  border-top: 1px solid var(--line);
}
.method-track article { min-width: 0; padding: 32px 32px 12px 0; }
.method-track article + article { padding-left: 32px; border-left: 1px solid var(--line); }
.method-track span, .service-name { color: var(--gold-strong); font-size: 13px; font-weight: 750; }
.method-track h3 { margin-top: 48px; font-size: 28px; letter-spacing: -0.035em; }
.method-track p { color: var(--muted); }

.services-section > h2 { max-width: 620px; }
.service-layout { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 20px; margin-top: 64px; align-items: stretch; }
.service {
  min-height: 430px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.service-instant { margin-top: 88px; background: var(--surface-strong); }
.service-decision {
  grid-column: 1 / -1;
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: clamp(36px, 7vw, 96px);
  background: var(--surface-strong);
}
.service h3 { max-width: 520px; margin-top: 24px; }
.service p { max-width: 520px; color: var(--muted); }
.service-meta { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-top: 56px; }
.service-meta code { color: var(--muted); overflow-wrap: anywhere; }
.service-meta strong { color: var(--gold-strong); white-space: nowrap; }
.decision-copy { display: flex; flex-direction: column; }
.decision-copy .service-meta { margin-top: auto; padding-top: 36px; }
.decision-console {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
.decision-field { display: grid; gap: 9px; }
.decision-field label { font-weight: 720; }
.decision-field label span, .decision-field small { color: var(--muted); font-weight: 400; }
.decision-field textarea {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  line-height: 1.5;
}
.decision-field textarea::placeholder { color: color-mix(in srgb, var(--muted) 86%, transparent); }
.decision-field textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--gold) 65%, transparent); outline-offset: 2px; }
.decision-console .button { align-self: flex-start; margin-top: 20px; }
.decision-console .button:disabled { cursor: wait; opacity: 0.65; }
.decision-status { min-height: 24px; margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.decision-status.error { color: var(--error); }
.decision-result {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 14px;
  margin-top: 12px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.decision-result[hidden] { display: none; }
.decision-result span { color: var(--gold-strong); font-size: 13px; font-weight: 760; letter-spacing: 0.08em; }
.decision-result strong { font-size: clamp(38px, 5vw, 64px); line-height: 1; letter-spacing: -0.04em; }
.decision-result code { color: var(--muted); }
.decision-result p { grid-column: 1 / -1; margin: 4px 0 0; color: var(--muted); }

.privacy-section {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: clamp(50px, 9vw, 140px);
  align-items: center;
}
.privacy-symbol { color: var(--gold); font-size: clamp(180px, 30vw, 390px); line-height: 0.8; filter: drop-shadow(0 24px 44px var(--shadow)); }
.privacy-copy dl { display: grid; grid-template-columns: 1fr 1fr; margin: 52px 0 0; border-top: 1px solid var(--line); }
.privacy-copy dl div { padding: 20px 18px 20px 0; border-bottom: 1px solid var(--line); }
.privacy-copy dt { color: var(--muted); font-size: 13px; }
.privacy-copy dd { margin: 4px 0 0; font-size: 22px; font-weight: 700; }

.cta-section {
  margin-top: 90px;
  margin-bottom: 90px;
  padding: clamp(40px, 6vw, 72px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 36px;
  border-radius: var(--radius);
  background: var(--surface-strong);
}
.cta-section h2 { font-size: clamp(34px, 4vw, 54px); }
.cta-section p { margin-bottom: 0; }

.site-footer {
  min-height: 140px;
  padding-block: 42px;
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.site-footer p { max-width: 560px; }
.site-footer div { display: flex; gap: 22px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--text); }

.copy-status {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 15;
  min-width: 180px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 16px 48px var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.copy-status.visible { opacity: 1; transform: translateY(0); }

.reveal { opacity: 1; transform: none; }
.js .reveal { animation: reveal-in 700ms cubic-bezier(.16, 1, .3, 1) both; }
.casting .oracle-avatar { animation: cast-turn 700ms cubic-bezier(.16, 1, .3, 1); }

@media (prefers-reduced-motion: no-preference) {
  .orbit-outer { animation: orbit 18s linear infinite; }
  .orbit-inner { animation: orbit-reverse 24s linear infinite; }
}

@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes orbit-reverse { to { transform: rotate(-360deg); } }
@keyframes cast-turn { 50% { transform: rotateY(90deg) scale(0.9); } 100% { transform: rotateY(360deg); } }
@keyframes reveal-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  :root { --page: min(100% - 32px, 720px); }
  .nav-shell { grid-template-columns: 1fr auto; }
  .nav-links { display: none; }
  .hero { grid-template-columns: 1fr; gap: 20px; padding-top: 70px; }
  .hero-copy { max-width: 660px; }
  .oracle-stage { min-height: 590px; }
  .orbit-outer { width: min(590px, 86vw); height: min(590px, 86vw); }
  .orbit-inner { width: min(505px, 74vw); height: min(505px, 74vw); }
  .method-track { grid-template-columns: 1fr; }
  .method-track article { padding: 28px 0; border-bottom: 1px solid var(--line); }
  .method-track article + article { padding-left: 0; border-left: 0; }
  .method-track h3 { margin-top: 22px; }
  .service-layout { grid-template-columns: 1fr; }
  .service-instant { margin-top: 0; }
  .service-decision { grid-column: auto; grid-template-columns: 1fr; }
  .privacy-section { grid-template-columns: 1fr; }
  .privacy-symbol { font-size: 220px; }
  .cta-section { align-items: flex-start; flex-direction: column; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
  .nav-cta { display: none; }
  .nav-shell { grid-template-columns: 1fr; }
  .hero { padding-top: 48px; }
  h1 { font-size: 47px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .button { width: 100%; }
  .oracle-stage { min-height: 500px; }
  .sample-result { left: 0; bottom: 18px; width: 190px; }
  .cast-control { right: 0; bottom: 50px; }
  .service { min-height: 380px; padding: 26px; }
  .service-meta { align-items: flex-start; flex-direction: column; }
  .decision-console .button { width: 100%; }
  .privacy-copy dl { grid-template-columns: 1fr; }
  .cta-section { width: calc(100% - 24px); }
  .site-footer div { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
