:root {
  color-scheme: dark;
  --ink: #06090f;
  --ink-soft: #0a111c;
  --panel: rgba(13, 23, 36, 0.82);
  --panel-solid: #0d1724;
  --bone: #f1eee5;
  --bone-muted: #b9bec2;
  --cyan: #74dbe8;
  --cyan-strong: #9bf2f7;
  --cyan-dark: #173c47;
  --line: rgba(167, 221, 229, 0.2);
  --line-strong: rgba(167, 221, 229, 0.42);
  --danger: #f0a7a7;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  --max: 1160px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  min-width: 0;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 84% 13%, rgba(44, 131, 149, 0.13), transparent 28rem),
    radial-gradient(circle at 11% 86%, rgba(25, 77, 103, 0.12), transparent 26rem),
    var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  content: "";
  pointer-events: none;
  opacity: 0.18;
  background-image: url("../assets/water-mark.svg");
  background-size: 760px 760px;
  background-position: center top;
}

a {
  color: inherit;
  text-decoration-color: rgba(116, 219, 232, 0.48);
  text-underline-offset: 0.22em;
}

a:hover {
  color: var(--cyan-strong);
}

button,
select,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
select {
  font: inherit;
}

button:focus-visible,
select:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--cyan-strong);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus-visible {
  width: auto;
  height: auto;
  padding: 0.75rem 1rem;
  margin: 0;
  overflow: visible;
  clip-path: none;
  border-radius: 0.4rem;
  background: var(--bone);
  color: var(--ink);
}

.ambient {
  position: fixed;
  z-index: -2;
  width: 36rem;
  height: 36rem;
  border: 1px solid rgba(116, 219, 232, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.ambient::before,
.ambient::after {
  position: absolute;
  inset: 12%;
  border: inherit;
  border-radius: inherit;
  content: "";
}

.ambient::after {
  inset: 26%;
}

.ambient-one {
  top: -17rem;
  right: -14rem;
}

.ambient-two {
  bottom: -21rem;
  left: -15rem;
}

.site-header,
.site-footer,
.gateway-footer {
  display: flex;
  width: min(calc(100% - 2rem), var(--max));
  min-height: 72px;
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(0.7rem, 2vw, 1.75rem);
}

.site-header nav a,
.site-footer a,
.gateway-footer a {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bone-muted);
  font-size: 0.83rem;
  text-decoration: none;
}

.site-header nav a:hover,
.site-footer a:hover,
.gateway-footer a:hover {
  color: var(--cyan-strong);
}

.wordmark {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--bone);
  font-weight: 760;
  font-size: 0.84rem;
  letter-spacing: 0.2em;
  text-decoration: none;
}

.language-switch {
  width: 44px;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.app-shell {
  width: min(calc(100% - 2rem), var(--max));
  margin-inline: auto;
}

.screen {
  min-height: calc(100vh - 72px);
  padding: clamp(3.5rem, 8vw, 7.5rem) 0;
}

.initialization-panel {
  display: grid;
  align-items: center;
}

.initialization-panel__inner {
  max-width: 42rem;
}

.initialization-panel h1 {
  font-size: clamp(2.75rem, 7vw, 6rem);
}

.hero-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(250px, 0.8fr);
  align-items: center;
  gap: clamp(2rem, 7vw, 7rem);
}

.eyebrow,
.question-kicker,
.section-number {
  margin: 0 0 1rem;
  color: var(--cyan);
  font-size: 0.73rem;
  font-weight: 760;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3rem, 8vw, 7.4rem);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.055em;
}

h1 em {
  color: var(--cyan-strong);
  font-weight: 400;
}

h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 4.5vw, 3.7rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.lede {
  max-width: 38rem;
  margin: 1.8rem 0 2rem;
  color: var(--bone-muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.privacy-note,
.privacy-line,
.store-pending {
  color: var(--bone-muted);
  font-size: 0.83rem;
}

.privacy-note {
  max-width: 34rem;
  margin-top: 1.25rem;
}

.button {
  display: inline-flex;
  min-height: 48px;
  padding: 0.78rem 1.2rem;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  cursor: pointer;
  font-weight: 720;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.button-primary {
  background: var(--cyan-strong);
  color: #061017;
}

.button-primary:hover:not(:disabled) {
  background: #c0f8fb;
  color: #061017;
}

.button-secondary {
  border-color: var(--line-strong);
  background: rgba(13, 23, 36, 0.72);
  color: var(--bone);
}

.button-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--bone-muted);
}

.text-button {
  min-width: 44px;
  min-height: 44px;
  padding: 0.4rem 0.2rem;
  border: 0;
  background: none;
  color: var(--bone-muted);
  cursor: pointer;
}

.text-button:hover {
  color: var(--cyan-strong);
}

.resume-panel,
.recovery-panel {
  max-width: 34rem;
  margin: 0 0 1.5rem;
  padding: 1rem;
  border-left: 2px solid var(--cyan);
  background: rgba(116, 219, 232, 0.06);
}

.resume-panel p,
.recovery-panel p {
  margin: 0 0 0.75rem;
}

.recovery-panel {
  border-left-color: var(--danger);
}

.hero-orbit {
  position: relative;
  width: min(32vw, 360px);
  aspect-ratio: 1;
  justify-self: center;
}

.orbit,
.seed {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.orbit-a {
  transform: rotate(22deg) scaleY(0.62);
}

.orbit-b {
  transform: rotate(-48deg) scaleY(0.35);
}

.seed {
  inset: 43%;
  border: 0;
  background: var(--cyan-strong);
  box-shadow: 0 0 54px rgba(116, 219, 232, 0.4);
}

.quiz-screen {
  max-width: 820px;
  margin-inline: auto;
}

.quiz-topline,
.progress-meta,
.quiz-actions,
.result-actions,
.button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.progress-meta {
  margin-top: 2rem;
  color: var(--bone-muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.progress-track {
  height: 3px;
  margin-top: 0.65rem;
  overflow: hidden;
  background: rgba(185, 190, 194, 0.15);
}

.progress-track span {
  display: block;
  width: 14.285%;
  height: 100%;
  background: var(--cyan-strong);
  transition: width 260ms ease;
}

.question-card {
  margin-top: clamp(2.5rem, 8vw, 5rem);
}

.question-card h2 {
  max-width: 48rem;
  font-size: clamp(1.8rem, 5vw, 3.25rem);
}

.options-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 2.2rem;
}

.option-button {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 64px;
  padding: 1rem 3.2rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: rgba(9, 16, 26, 0.76);
  color: var(--bone);
  cursor: pointer;
  text-align: left;
}

.option-button::after {
  position: absolute;
  top: 50%;
  right: 1rem;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  content: "";
}

.option-button:hover {
  border-color: var(--cyan);
  background: rgba(18, 36, 49, 0.72);
}

.option-button[aria-checked="true"] {
  border-color: var(--cyan-strong);
  background: rgba(31, 80, 91, 0.35);
}

.option-button[aria-checked="true"]::after {
  border: 5px solid var(--cyan-strong);
}

.quiz-actions {
  justify-content: flex-end;
  margin-top: 1.6rem;
}

.result-screen {
  max-width: 900px;
  margin-inline: auto;
}

.result-screen > h1 {
  max-width: 850px;
  font-size: clamp(2.8rem, 7vw, 6rem);
}

.result-sigil {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 1rem 0 2rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.result-sigil::before,
.result-sigil::after {
  position: absolute;
  inset: 12px;
  transform: rotate(45deg);
  border: 1px solid var(--cyan);
  border-radius: 45% 55% 60% 40%;
  content: "";
}

.result-sigil::after {
  inset: 25px;
  background: var(--cyan-strong);
}

.result-description {
  max-width: 48rem;
  margin: 1.5rem 0 0;
  color: var(--bone-muted);
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.5vw, 1.55rem);
}

.fiction-note {
  max-width: 44rem;
  margin: 1.25rem 0 0;
  padding-left: 1rem;
  border-left: 2px solid var(--cyan-dark);
  color: var(--bone-muted);
  font-size: 0.85rem;
}

.why-panel,
.share-panel,
.book-cta {
  margin-top: clamp(3.5rem, 10vw, 7rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.why-panel h2,
.share-panel h2,
.book-cta h2 {
  font-size: clamp(1.9rem, 4vw, 3rem);
}

.axis-reasons {
  display: grid;
  gap: 0;
  padding: 0;
  margin: 1.8rem 0 0;
  list-style: none;
  counter-reset: axes;
}

.axis-reasons li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.8rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
  counter-increment: axes;
}

.axis-reasons li::before {
  color: var(--cyan);
  content: "0" counter(axes);
  font-size: 0.73rem;
  letter-spacing: 0.1em;
}

.axis-reasons strong {
  display: block;
  margin-bottom: 0.2rem;
}

.axis-reasons span {
  color: var(--bone-muted);
}

.share-panel > p {
  color: var(--bone-muted);
}

.share-panel label {
  display: block;
  margin: 1.4rem 0 0.4rem;
  color: var(--bone-muted);
  font-size: 0.82rem;
}

.share-panel select {
  width: min(100%, 300px);
  min-height: 48px;
  padding: 0.65rem 2.5rem 0.65rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.4rem;
  background: var(--panel-solid);
  color: var(--bone);
}

.button-row {
  justify-content: flex-start;
  margin-top: 1rem;
}

.social-share-row {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
}

.book-cta {
  display: grid;
  grid-template-columns: minmax(150px, 235px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 7vw, 5rem);
}

.cover-frame {
  padding: 0.5rem;
  border: 1px solid var(--line);
  background: #04070b;
  box-shadow: var(--shadow);
  transform: rotate(-1.5deg);
}

.cover-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.book-cta p:not(.eyebrow) {
  max-width: 34rem;
  color: var(--bone-muted);
}

.store-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

.result-actions {
  margin-top: 3rem;
}

.about-section,
.prose-page {
  max-width: 900px;
  margin-inline: auto;
  padding: clamp(4rem, 10vw, 8rem) 0;
}

.about-section {
  border-top: 1px solid var(--line);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 1.7rem;
}

.about-grid p,
.prose-page p {
  color: var(--bone-muted);
}

.prose-page {
  width: min(calc(100% - 2rem), 780px);
}

.prose-page h1 {
  margin-bottom: 2rem;
}

.prose-page section {
  padding: 2rem 0;
  border-top: 1px solid var(--line);
}

.prose-page section h2 {
  font-size: clamp(1.45rem, 3vw, 2.15rem);
}

.site-footer,
.gateway-footer {
  min-height: 90px;
  border-top: 1px solid var(--line);
  color: var(--bone-muted);
  font-size: 0.78rem;
}

.gateway-page {
  display: grid;
  min-height: 100vh;
  grid-template-rows: 1fr auto;
}

.gateway-shell {
  width: min(calc(100% - 2rem), 900px);
  margin: auto;
  padding: clamp(4rem, 10vw, 8rem) 0;
  text-align: center;
}

.gateway-shell h1 {
  font-size: clamp(3.3rem, 10vw, 7rem);
}

.gateway-en {
  margin: 1.5rem 0 0;
  color: var(--bone-muted);
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-style: italic;
}

.gateway-intro {
  max-width: 38rem;
  margin: 1.3rem auto 0;
  color: var(--bone-muted);
}

.mark {
  display: inline-flex;
  width: 72px;
  height: 72px;
  margin-bottom: 2rem;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.mark span {
  display: block;
  width: 3px;
  height: 30px;
  border-radius: 2px;
  background: var(--cyan);
}

.mark span:nth-child(2) {
  height: 44px;
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  max-width: 680px;
  margin: 2.2rem auto 0;
}

.language-card {
  display: grid;
  min-height: 140px;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--panel);
  text-align: left;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease;
}

.language-card:hover {
  transform: translateY(-3px);
  border-color: var(--cyan);
  color: var(--bone);
}

.language-code {
  align-self: start;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.language-card strong {
  align-self: end;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
}

.language-card small {
  color: var(--bone-muted);
}

.privacy-line {
  margin-top: 1.4rem;
}

.gateway-footer {
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .site-header nav a:not(.language-switch) {
    display: none;
  }

  .hero-screen {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-orbit {
    width: min(66vw, 290px);
    grid-row: 1;
  }

  .book-cta {
    grid-template-columns: minmax(120px, 180px) 1fr;
  }
}

@media (max-width: 560px) {
  .site-header,
  .site-footer,
  .gateway-footer,
  .app-shell {
    width: min(calc(100% - 1.25rem), var(--max));
  }

  .screen {
    padding: 3rem 0;
  }

  .hero-screen h1 {
    font-size: clamp(2.9rem, 15vw, 4.8rem);
  }

  .language-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .book-cta {
    grid-template-columns: 1fr;
  }

  .cover-frame {
    width: min(58vw, 220px);
  }

  .button-row .button,
  .result-actions .button {
    width: 100%;
  }
}

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