:root {
  --ink: #f4f0e8;
  --muted: #aaa2b4;
  --paper: #0e0b14;
  --panel: #17121f;
  --line: rgba(238, 225, 205, 0.16);
  --gold: #d9b875;
  --violet: #9d7bea;
  --rose: #d99aa6;
  --serif: "Iowan Old Style", "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 8%, rgba(112, 71, 160, .2), transparent 24rem),
    radial-gradient(circle at 5% 40%, rgba(143, 88, 96, .1), transparent 28rem),
    var(--paper);
  font-family: var(--sans);
  line-height: 1.7;
  overflow-x: hidden;
}

button, textarea, input, select { font: inherit; }
button, .file-button { cursor: pointer; }
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.nav {
  max-width: 1260px;
  height: 84px;
  margin: auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  color: var(--ink);
  text-decoration: none;
  letter-spacing: .16em;
  font-size: .78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark { color: var(--gold); font-size: 1.8rem; }
.privacy-pill {
  border: 1px solid var(--line);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: .68rem;
  letter-spacing: .12em;
  color: var(--muted);
}
.privacy-pill span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: #80c89e;
  box-shadow: 0 0 10px #80c89e;
}
.nav-tools { display: flex; align-items: center; gap: 12px; }
.lang-switch {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.lang-switch button {
  min-width: 42px;
  padding: 5px 9px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: .68rem;
}
.lang-switch button[aria-pressed="true"] {
  color: var(--paper);
  background: var(--gold);
}

.hero {
  position: relative;
  min-height: calc(100svh - 84px);
  margin: 0;
  padding: 118px max(32px, calc((100vw - 1196px) / 2)) 90px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(9, 8, 15, .93) 0%, rgba(9, 8, 15, .74) 38%, rgba(9, 8, 15, .08) 75%),
    url("./assets/oracle-council-hero.png") center / cover no-repeat;
}
.eyebrow {
  margin: 0 0 18px;
  color: var(--gold);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .2em;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.025em;
}
h1 {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin-bottom: 26px;
  font-size: clamp(3rem, 5.6vw, 5.1rem);
  line-height: 1.25;
}
h1 em { color: var(--gold); font-style: normal; }
.lead {
  max-width: 610px;
  color: var(--muted);
  font-size: 1.03rem;
}
.hero .eyebrow { animation: hero-rise .7s ease-out both; }
.hero h1 { animation: hero-rise .8s .08s ease-out both; }
.hero .lead { animation: hero-rise .8s .16s ease-out both; }
.hero-actions { animation: hero-rise .8s .24s ease-out both; }
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-top: 42px;
}
.primary {
  border: 0;
  color: #17100a;
  background: var(--gold);
  padding: 15px 22px;
  border-radius: 2px;
  font-weight: 600;
  box-shadow: 0 10px 35px rgba(217, 184, 117, .12);
}
.primary:hover { transform: translateY(-1px); background: #e7c98b; }
.primary span { margin-left: 14px; }
.hero-actions a { color: var(--ink); text-underline-offset: 6px; }
.orbit {
  position: absolute;
  right: -30px;
  top: 65px;
  width: 520px;
  height: 520px;
  opacity: .16;
  mix-blend-mode: screen;
  animation: orbit-drift 18s ease-in-out infinite alternate;
}
@keyframes orbit-drift {
  to { transform: translate3d(-24px, 18px, 0) rotate(4deg); }
}
.orbit-ring {
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(217, 184, 117, .28);
  border-radius: 50%;
}
.ring-two { inset: 24%; border-color: rgba(157, 123, 234, .32); }
.moon {
  position: absolute;
  inset: 35%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 6rem;
  color: var(--gold);
  background: radial-gradient(circle, rgba(217,184,117,.15), transparent 68%);
}
.star { position: absolute; color: var(--gold); }
.s1 { top: 12%; left: 18%; }.s2 { bottom: 15%; right: 7%; }.s3 { top: 36%; right: 0; }

.traditions {
  max-width: 1260px;
  margin: auto;
  padding: 0 32px 100px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
}
.traditions div {
  padding: 18px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--serif);
  font-size: .9rem;
}
.traditions div { display: flex; justify-content: space-between; gap: 8px; }
.traditions b { color: rgba(217,184,117,.5); font-family: var(--sans); font-size: .62rem; font-weight: 500; }

.birth-section {
  max-width: 1260px;
  margin: auto;
  padding: 100px 32px;
}
.birth-card {
  padding: clamp(28px, 5vw, 60px);
  border: 1px solid rgba(217,184,117,.35);
  background: linear-gradient(120deg, rgba(157,123,234,.08), rgba(217,184,117,.04));
}
.birth-card h2 { max-width: 820px; font-size: clamp(2.4rem, 4.8vw, 4.2rem); line-height: 1.35; }
.birth-intro { max-width: 760px; color: var(--muted); }
.birth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 34px;
}
.field { display: grid; gap: 8px; }
.field label { color: var(--gold); font-size: .76rem; letter-spacing: .06em; }
.field input, .field select {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  color: var(--ink);
  background: rgba(0,0,0,.2);
}
.field input:focus, .field select:focus { border-color: rgba(217,184,117,.65); }
.field select { color-scheme: dark; }
.birth-note {
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .78rem;
}

.workspace {
  border-top: 1px solid var(--line);
  padding: 110px max(32px, calc((100vw - 1196px) / 2));
  background: rgba(255,255,255,.012);
}
.section-heading { max-width: 690px; margin-bottom: 54px; }
.section-heading h2, .result-intro h2 {
  font-size: clamp(2.5rem, 5vw, 4.4rem);
  line-height: 1.35;
}
.section-heading > p:last-child, .result-intro > p { color: var(--muted); }
.import-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.source-card {
  position: relative;
  min-width: 0;
  min-height: 340px;
  padding: 34px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255,255,255,.035), rgba(255,255,255,.008));
}
.source-card:hover { border-color: rgba(217,184,117,.42); }
.source-card { transition: border-color .2s ease, transform .25s ease; }
.source-card:hover { transform: translateY(-3px); }
.source-icon {
  position: absolute;
  right: 30px;
  top: 22px;
  font-size: 3rem;
  color: rgba(217,184,117,.45);
}
.source-label { color: var(--gold); font-size: .65rem; letter-spacing: .18em; }
.source-card h3 { font-family: var(--serif); font-size: 1.7rem; font-weight: 400; }
.source-card > p:not(.source-label) { max-width: 460px; color: var(--muted); min-height: 74px; }
.file-button, .text-button {
  display: inline-block;
  margin: 16px 10px 0 0;
  padding: 11px 14px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  font-size: .8rem;
}
.file-button:hover, .text-button:hover { border-color: var(--gold); }
.file-button { position: relative; }
.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  inset: 0 auto auto 0;
  opacity: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

.memory-input {
  margin-top: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.prompt-output {
  margin-top: 18px;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(217,184,117,.4);
  background: linear-gradient(120deg, rgba(157,123,234,.08), rgba(217,184,117,.04));
}
.prompt-output h3 { margin: 8px 0; font-family: var(--serif); font-size: 1.65rem; font-weight: 400; }
.prompt-output > p:not(.eyebrow) { max-width: 790px; color: var(--muted); }
.prompt-output textarea { margin-top: 18px; min-height: 360px; line-height: 1.65; }
.prompt-output button {
  margin-top: 12px;
  padding: 11px 16px;
  border: 0;
  color: #17100a;
  background: var(--gold);
}
.memory-input label { display: block; margin-bottom: 10px; color: var(--gold); }
textarea {
  width: 100%;
  resize: vertical;
  color: var(--ink);
  background: rgba(0,0,0,.2);
  border: 1px solid var(--line);
  padding: 15px;
  outline: none;
}
textarea:focus { border-color: rgba(217,184,117,.65); }
.memory-input button {
  margin-top: 12px;
  padding: 10px 15px;
  color: #17100a;
  background: var(--gold);
  border: 0;
}
.hidden { display: none !important; }

.memory-review {
  margin-top: 60px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.review-head { display: flex; justify-content: space-between; align-items: end; }
.review-head h3 { font-family: var(--serif); font-size: 2rem; font-weight: 400; }
.memory-count { display: flex; align-items: baseline; gap: 8px; }
.memory-count strong { color: var(--gold); font-family: var(--serif); font-size: 2.8rem; }
.memory-count span { color: var(--muted); font-size: .72rem; }
.memory-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.memory-item {
  position: relative;
  padding: 20px 52px 20px 20px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.12);
}
.memory-item.off { opacity: .42; }
.memory-item .source { color: var(--gold); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; }
.memory-item h4 { margin: 5px 0; font-family: var(--serif); font-weight: 400; }
.memory-item p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.memory-item input { position: absolute; right: 20px; top: 22px; accent-color: var(--gold); width: 18px; height: 18px; }
.empty-state { display: block; color: var(--muted); padding: 30px 0; }
.empty-state button { color: var(--ink); background: transparent; border: 0; text-decoration: underline; text-underline-offset: 5px; }

.question-section { padding: 100px 32px; max-width: 1260px; margin: auto; }
.question-card {
  padding: clamp(28px, 5vw, 60px);
  border: 1px solid rgba(217,184,117,.35);
  background: linear-gradient(120deg, rgba(157,123,234,.08), rgba(217,184,117,.04));
}
.question-card > label { display: block; font-family: var(--serif); font-size: clamp(1.7rem, 3vw, 2.7rem); margin-bottom: 24px; }
.question-card textarea { font-family: var(--serif); font-size: 1.1rem; }
.question-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 22px; }
.question-footer p { margin: 0; color: var(--muted); font-size: .75rem; }
.question-footer p span { color: var(--gold); margin-right: 7px; }

.result {
  max-width: 1260px;
  margin: auto;
  padding: 120px 32px;
}
.result:not(.hidden) .result-intro,
.result:not(.hidden) .reading-grid,
.result:not(.hidden) .next-step {
  animation: result-rise .65s ease-out both;
}
.result:not(.hidden) .reading-grid { animation-delay: .08s; }
.result:not(.hidden) .next-step { animation-delay: .16s; }
@keyframes result-rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-intro { max-width: 860px; margin-bottom: 54px; }
#synthesis { white-space: pre-line; line-height: 1.85; }
.birth-summary {
  margin: 22px 0 0;
  padding: 15px 18px;
  border-left: 2px solid var(--gold);
  color: var(--muted);
  background: rgba(217,184,117,.045);
  font-size: .82rem;
}
.theme-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.theme-row span { padding: 7px 12px; border: 1px solid var(--line); color: var(--gold); font-size: .75rem; }
.reading-grid { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--line); }
.reading-card {
  padding: 38px 30px;
  border-bottom: 1px solid var(--line);
}
.reading-number { color: rgba(217,184,117,.5); font-size: .62rem; letter-spacing: .16em; }
.reading-card h3 { margin: 15px 0 5px; font-family: var(--serif); font-size: 1.5rem; font-weight: 400; }
.reading-card .symbol { color: var(--gold); font-size: .78rem; }
.reading-card > p { color: var(--muted); font-size: .86rem; }
.reading-block { max-width: 940px; margin-top: 24px; }
.reading-block h4 {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.reading-block p { margin: 0; color: var(--muted); line-height: 1.85; }
.reading-block p + p { margin-top: 16px; }
.resonance {
  padding: 18px 20px;
  border-left: 2px solid var(--rose);
  background: rgba(217,154,166,.045);
}
.actions ol { margin: 0; padding-left: 1.25rem; }
.actions li { margin: 8px 0; padding-left: 5px; }
.method-caveat { margin-top: 24px !important; color: #777080 !important; font-size: .72rem !important; }
.memory-link { padding-top: 14px; border-top: 1px solid var(--line); color: var(--rose) !important; font-size: .75rem !important; }
.next-step {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 30px;
  margin-top: 72px;
  padding: 42px;
  border: 1px solid rgba(217,184,117,.35);
  background: rgba(217,184,117,.04);
}
.next-step h3 { font-family: var(--serif); font-size: 2rem; font-weight: 400; }
.next-step p { color: var(--muted); margin-bottom: 0; }
.next-step button {
  padding: 14px 18px;
  color: var(--paper);
  background: var(--gold);
  border: 0;
  white-space: nowrap;
}
.next-step button span { margin-left: 12px; }
.disclaimer { margin: 22px auto 0; max-width: 800px; color: #777080; text-align: center; font-size: .72rem; }

footer {
  max-width: 1260px;
  margin: auto;
  padding: 36px 32px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .1em;
}
footer p { margin: 0; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  padding: 11px 18px;
  background: var(--ink);
  color: var(--paper);
  font-size: .78rem;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  z-index: 30;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 850px) {
  .hero {
    background:
      linear-gradient(90deg, rgba(9, 8, 15, .94), rgba(9, 8, 15, .62)),
      url("./assets/oracle-council-hero.png") 62% center / cover no-repeat;
  }
  .orbit { display: none; }
  .traditions { grid-template-columns: repeat(2, 1fr); }
  .import-grid, .memory-list, .reading-grid, .birth-grid { grid-template-columns: 1fr; }
  .question-footer, .next-step { display: block; }
  .question-footer .primary, .next-step button { margin-top: 20px; width: 100%; }
}

@media (max-width: 520px) {
  .nav, .hero, .traditions, .birth-section, .question-section, .result { padding-left: 20px; padding-right: 20px; }
  .workspace { padding-left: 20px; padding-right: 20px; }
  .nav { height: auto; min-height: 84px; gap: 12px; }
  .nav-tools { align-items: flex-end; flex-direction: column-reverse; gap: 6px; }
  .privacy-pill { padding: 4px 8px; font-size: .58rem; }
  .hero { padding-top: 78px; }
  h1 { font-size: 2.35rem; }
  .hero-actions { align-items: flex-start; flex-direction: column; }
  .traditions { grid-template-columns: 1fr; }
  .source-card { padding: 26px; }
  .review-head { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
