:root {
  --bg: #141917;
  --bg-2: #1a201d;
  --panel: #1d2421;
  --glass: rgba(29, 36, 33, 0.86);
  --glass-light: rgba(243, 239, 230, 0.045);
  --line: rgba(243, 239, 230, 0.08);
  --line-strong: rgba(243, 239, 230, 0.15);
  --text: #f3efe6;
  --text-2: #d8d2c6;
  --muted: #a8a294;
  --muted-2: #857f73;
  --accent: #6faa72;
  --accent-2: #4b7f52;
  --accent-3: #b3d8ae;
  --accent-rgb: 111, 170, 114;
  --amber: #d9a441;
  --amber-2: #ecc36b;
  --amber-rgb: 217, 164, 65;
  --terra: #c9673a;
  --terra-2: #e08a5c;
  --terra-rgb: 201, 103, 58;
  --rose: #c8517f;
  --rose-2: #e08bb0;
  --rose-rgb: 200, 81, 127;
  --sky: #5a8ea3;
  --sky-2: #8fbccb;
  --violet: #a687c7;
  --sand: #cdb48a;
  --emerald: var(--accent);
  --laurel: var(--accent);
  --radius: 1.1rem;
  --radius-sm: 0.7rem;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Outfit', 'Segoe UI', system-ui, sans-serif;
  --header-h: 64px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --press: 160ms var(--ease);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* contour texture, static: reads as a topographic map, not a gradient wash */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600' viewBox='0 0 600 600'%3E%3Cg fill='none' stroke='%23f3efe6' stroke-opacity='0.06' stroke-width='1'%3E%3Cpath d='M-20 120c90-60 180-40 260 10s170 70 260 20 110-60 120-40'/%3E%3Cpath d='M-20 170c90-60 180-40 260 10s170 70 260 20 110-60 120-40'/%3E%3Cpath d='M-20 230c100-50 190-30 270 20s160 60 250 10 120-50 120-40'/%3E%3Cpath d='M-20 300c110-40 200-20 280 30s150 50 240 0 120-40 120-30'/%3E%3Cpath d='M-20 380c120-30 210-10 290 40s140 40 230-10 120-30 120-20'/%3E%3Cpath d='M-20 470c130-20 220 0 300 50s130 30 220-20 120-20 120-10'/%3E%3Cpath d='M-20 560c140-10 230 10 310 60s120 20 210-30 120-10 120 0'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 600px 600px;
}

/* soft glow behind the step pages, tinted by the current step, hidden on the hero */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 600ms var(--ease);
  --glow-rgb: var(--accent-rgb);
  background:
    radial-gradient(60vw 55vh at 10% 0%, rgba(var(--glow-rgb), 0.18), transparent 70%),
    radial-gradient(55vw 50vh at 100% 95%, rgba(var(--glow-rgb), 0.1), transparent 70%),
    linear-gradient(180deg, rgba(243, 239, 230, 0.03), transparent 45%);
}

body:not(.is-hero)::after {
  opacity: 1;
}

body[data-view="persona"]::after {
  --glow-rgb: var(--amber-rgb);
}

body[data-view="setup"]::after {
  --glow-rgb: 90, 142, 163;
}

body[data-view="guide"]::after {
  --glow-rgb: var(--terra-rgb);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
}

h3 {
  font-size: 1.35rem;
}

p {
  margin: 0;
}

a {
  color: var(--accent-3);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}

img {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--amber);
  color: #1a1000;
  font-weight: 500;
  transition: transform 160ms var(--ease);
}

.skip-link:focus {
  transform: translateY(5rem);
  text-decoration: none;
}

.icon {
  flex: none;
  vertical-align: -0.2em;
}

.page {
  position: relative;
  z-index: 1;
}

.container {
  width: min(1240px, 100% - 2.5rem);
  margin-inline: auto;
}

/* surfaces */

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.glass-light {
  background: var(--glass-light);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.gradient-text {
  color: var(--amber-2);
  font-style: italic;
}

/* buttons and chips */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1;
  transition: transform var(--press), background 200ms, border-color 200ms, opacity 200ms, color 200ms;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  color: #101510;
  background: var(--accent);
}

.btn-ghost {
  color: var(--text);
  background: var(--glass-light);
  border: 1px solid var(--line-strong);
}

.btn-sm {
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
}

.btn-amber {
  color: #1a1000;
  background: var(--amber);
}

.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--glass-light);
  color: var(--text-2);
  transition: transform var(--press), background 200ms, border-color 200ms, color 200ms;
}

.btn-icon:active {
  transform: scale(0.94);
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    background: #7db980;
  }

  .btn-amber:hover {
    background: var(--amber-2);
  }

  .btn-ghost:hover,
  .btn-icon:hover {
    background: rgba(243, 239, 230, 0.09);
    border-color: rgba(243, 239, 230, 0.25);
    color: var(--text);
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid var(--line-strong);
  background: var(--glass-light);
  color: var(--text-2);
}

.pill-accent {
  color: var(--accent-3);
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.12);
}

.pill-amber {
  color: var(--amber-2);
  border-color: rgba(var(--amber-rgb), 0.4);
  background: rgba(var(--amber-rgb), 0.12);
}

.pill-star {
  width: 30px;
  height: 30px;
  padding: 0;
  justify-content: center;
}

.pill-star svg {
  fill: currentColor;
}

.pill-rose {
  color: var(--rose-2);
  border-color: rgba(var(--rose-rgb), 0.4);
  background: rgba(var(--rose-rgb), 0.12);
}

.pill-terra {
  color: var(--terra-2);
  border-color: rgba(var(--terra-rgb), 0.4);
  background: rgba(var(--terra-rgb), 0.12);
}

.pill-violet {
  color: #d3c2e8;
  border-color: rgba(166, 135, 199, 0.4);
  background: rgba(166, 135, 199, 0.12);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--glass-light);
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 400;
  transition: transform var(--press), background 200ms, border-color 200ms, color 200ms;
}

.chip:active {
  transform: scale(0.96);
}

@media (hover: hover) and (pointer: fine) {
  .chip:hover {
    border-color: rgba(var(--accent-rgb), 0.5);
    color: var(--text);
  }
}

.chip.is-active {
  color: #101510;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 500;
}

.chip.is-active .icon {
  color: #101510;
}

/* forms */

.field {
  display: grid;
  gap: 0.4rem;
  align-content: start;
}

.field > span {
  font-size: 0.8rem;
  color: var(--muted);
}

.field input,
.field select {
  width: 100%;
  height: 46px;
  padding: 0 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: rgba(243, 239, 230, 0.04);
  color: var(--text);
  transition: border-color 200ms, background 200ms;
  color-scheme: dark;
}

.field input[type="search"] {
  appearance: none;
  -webkit-appearance: none;
}

.field select {
  padding-right: 2.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23f3efe6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 14px;
}

.field select,
.field select option,
select[data-move],
select[data-move] option {
  background-color: var(--panel);
  color: var(--text);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.7);
  background-color: rgba(var(--accent-rgb), 0.06);
}

.field input::placeholder {
  color: var(--muted-2);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 46px;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: rgba(243, 239, 230, 0.04);
  font-size: 0.9rem;
  color: var(--text-2);
  cursor: pointer;
}

.switch input {
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
  margin: 0;
}

/* header */

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: rgba(20, 25, 23, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 400ms var(--ease), opacity 300ms;
}

.header.is-visible {
  transform: translateY(0);
  opacity: 1;
}

body.is-hero .header {
  position: fixed;
  left: 0;
  right: 0;
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand-word {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1;
}

.brand-word small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--amber);
  margin-top: 0.2rem;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-switch {
  position: relative;
}

.lang-switch button {
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: background 200ms, color 200ms, transform var(--press);
}

.lang-switch button:active {
  transform: scale(0.94);
}

.lang-current {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.3rem 0.45rem 0.3rem 0.65rem;
  border: 1px solid var(--line);
  background: var(--glass-light);
  color: var(--text-2);
}

.lang-current .icon {
  transition: transform 200ms var(--ease);
}

.lang-switch.is-open .lang-current .icon {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 30;
  display: flex;
  gap: 0.15rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--glass);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px) scale(0.96);
  transform-origin: top right;
  transition: opacity 160ms var(--ease), transform 160ms var(--ease);
}

.lang-switch.is-open .lang-menu {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

@media (hover: hover) and (pointer: fine) {
  .lang-menu button:hover,
  .lang-current:hover {
    color: var(--text);
  }

  button.step-dot:hover {
    color: var(--text);
    background: var(--glass-light);
  }
}

.steps {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.step-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem 0.35rem 0.35rem;
  border-radius: 999px;
  color: var(--muted-2);
  font-size: 0.8rem;
  transition: color 200ms, background 200ms;
}

.step-dot span:first-child {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-size: 0.75rem;
  font-weight: 500;
  transition: background 200ms, border-color 200ms, color 200ms;
}

button.step-dot {
  cursor: pointer;
}

.step-dot.is-done {
  color: var(--muted);
}

.step-dot.is-done span:first-child {
  background: rgba(var(--accent-rgb), 0.16);
  border-color: rgba(var(--accent-rgb), 0.45);
  color: var(--accent-3);
}

.step-dot.is-current {
  color: var(--text);
}

.step-dot.is-current span:first-child {
  background: var(--amber);
  border-color: transparent;
  color: #1a1000;
}

.step-line {
  width: 18px;
  height: 1px;
  background: var(--line-strong);
}

/* sections */

.section {
  padding: clamp(2.5rem, 6vw, 5rem) 0;
}

.section-head {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 2.25rem;
}

.section-head .kicker {
  font-size: 0.85rem;
  color: var(--amber);
  font-weight: 500;
}

.section-head p {
  color: var(--muted);
  max-width: 60ch;
  font-size: 1.05rem;
}

.section-head h2 em {
  font-style: italic;
  color: var(--amber-2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.actions.is-end {
  justify-content: flex-end;
}

.actions.is-between {
  justify-content: space-between;
}

/* reveal: one orchestrated entrance per step, not per card */

.reveal,
.reveal-left {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms var(--ease), transform 600ms var(--ease);
  transition-delay: var(--delay, 0s);
}

.reveal-left {
  transform: translateX(-16px);
}

.reveal.is-visible,
.reveal-left.is-visible {
  opacity: 1;
  transform: none;
}

/* toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 60;
  transform: translate(-50%, 12px);
  opacity: 0;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--amber-rgb), 0.4);
  background: rgba(29, 36, 33, 0.94);
  color: var(--amber-2);
  font-size: 0.9rem;
  pointer-events: none;
  transition: transform 250ms var(--ease), opacity 200ms;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: calc(100vw - 2rem);
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* modal */

.modal {
  width: min(760px, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  overflow: hidden;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 180ms var(--ease), transform 220ms var(--ease), overlay 220ms allow-discrete, display 220ms allow-discrete;
}

.modal[open] {
  opacity: 1;
  transform: scale(1);
}

@starting-style {
  .modal[open] {
    opacity: 0;
    transform: scale(0.96);
  }
}

.modal::backdrop {
  background: rgba(8, 10, 9, 0.72);
  opacity: 0;
  transition: opacity 220ms, overlay 220ms allow-discrete, display 220ms allow-discrete;
}

.modal[open]::backdrop {
  opacity: 1;
}

@starting-style {
  .modal[open]::backdrop {
    opacity: 0;
  }
}

.modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 2;
  background: rgba(20, 25, 23, 0.7);
  color: var(--text);
}

/* keyframes still used by hero and light band */

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* reduced motion */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }

  .reveal,
  .reveal-left {
    opacity: 1;
    transform: none;
  }
}

.print-only {
  display: none;
}
