:root {
  --ink-950: #0b0e1a;
  --ink-900: #131829;
  --ink-850: #1b2137;
  --ink-800: #242c48;
  --gold-400: #c9a46b;
  --gold-300: #dfc08c;
  --wine-500: #7a2e3a;
  --wine-400: #9a4553;
  --ivory-100: #ede6d6;
  --mist-500: #8890a6;
  --line-500: rgba(201, 164, 107, 0.16);
  --radius-md: 6px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--ink-950);
  background-image: radial-gradient(circle at 12% 8%, rgba(201, 164, 107, 0.06), transparent 40%),
    radial-gradient(circle at 88% 92%, rgba(122, 46, 58, 0.1), transparent 45%);
  color: var(--ivory-100);
  font-family: "Inter", -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: "Fraunces", serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--ivory-100);
}

h1 {
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  font-weight: 400;
  line-height: 1.08;
}

h2 {
  font-size: clamp(1.7rem, 2.6vw, 2.3rem);
}

p {
  margin: 0 0 1em;
  color: var(--mist-500);
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-400);
  display: inline-block;
  margin-bottom: 1em;
}

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

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: "Fraunces", serif;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
}

.brand span {
  color: var(--gold-400);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.92rem;
}

.nav-links a {
  color: var(--mist-500);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-links a:hover, .nav-links a:focus-visible {
  color: var(--gold-300);
  border-color: var(--gold-400);
}

.nav-logout-form {
  display: contents;
}

.link-button {
  font: inherit;
  color: var(--mist-500);
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 0 0 2px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.link-button:hover, .link-button:focus-visible {
  color: var(--gold-300);
  border-color: var(--gold-400);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: var(--radius-md);
  font-size: 0.94rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--gold-300);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--gold-400);
  color: var(--ink-950);
}

.btn-primary:hover {
  background-color: var(--gold-300);
  transform: translateY(-1px);
}

.btn-ghost {
  border-color: var(--line-500);
  color: var(--ivory-100);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--gold-400);
  color: var(--gold-300);
}

.btn-block {
  width: 100%;
}

.hero {
  padding: 96px 0 72px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 28px;
}

.ledger {
  border: 1px solid var(--line-500);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--ink-900), var(--ink-950));
  padding: 32px;
}

.ledger-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-500);
}

.ledger-row:last-child {
  border-bottom: none;
}

.ledger-label {
  font-size: 0.82rem;
  color: var(--mist-500);
  letter-spacing: 0.04em;
}

.ledger-value {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.6rem;
  color: var(--gold-300);
}

.ruler {
  position: relative;
  height: 4px;
  background: var(--ink-800);
  border-radius: 2px;
  margin: 34px 4px 12px;
}

.ruler-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--gold-400);
  border-radius: 2px;
}

.ruler-marker {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  background: var(--ivory-100);
  border: 3px solid var(--gold-400);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.ruler-ticks {
  display: flex;
  justify-content: space-between;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  color: var(--mist-500);
  padding: 0 2px;
}

.badge-master {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  color: var(--wine-400);
  border: 1px solid var(--wine-500);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  margin-top: 20px;
}

.section {
  padding: 72px 0;
  border-top: 1px solid var(--line-500);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 40px;
}

.step-index {
  font-family: "IBM Plex Mono", monospace;
  color: var(--gold-400);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.plan-card {
  border: 1px solid var(--line-500);
  border-radius: var(--radius-lg);
  padding: 28px;
  background: var(--ink-900);
  display: flex;
  flex-direction: column;
}

.plan-card.featured {
  border-color: var(--gold-400);
  background: linear-gradient(180deg, rgba(201, 164, 107, 0.08), var(--ink-900));
}

.plan-price {
  font-family: "Fraunces", serif;
  font-size: 2.2rem;
  margin: 12px 0 4px;
  color: var(--ivory-100);
}

.plan-price small {
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  color: var(--mist-500);
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 20px 0 28px;
  font-size: 0.9rem;
  color: var(--mist-500);
  flex-grow: 1;
}

.plan-features li {
  padding: 8px 0;
  border-top: 1px solid var(--line-500);
}

.card {
  border: 1px solid var(--line-500);
  border-radius: var(--radius-lg);
  background: var(--ink-900);
  padding: 28px;
}

.form-field {
  margin-bottom: 18px;
}

.form-field label {
  display: block;
  font-size: 0.85rem;
  color: var(--mist-500);
  margin-bottom: 8px;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  background: var(--ink-950);
  border: 1px solid var(--line-500);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--ivory-100);
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
}

.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
  outline: 2px solid var(--gold-300);
  outline-offset: 1px;
}

.input {
  width: 100%;
  background: var(--ink-950);
  border: 1px solid var(--line-500);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--ivory-100);
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
}

.input:focus-visible {
  outline: 2px solid var(--gold-300);
  outline-offset: 1px;
}

.errorlist {
  list-style: none;
  padding: 0;
  color: var(--wine-400);
  font-size: 0.85rem;
  margin: 6px 0 0;
}

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.messages li {
  border: 1px solid var(--wine-500);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--gold-300);
  font-size: 0.9rem;
}

.auth-shell {
  min-height: calc(100vh - 78px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.oracle-thread {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
}

.oracle-entry {
  border-left: 2px solid var(--gold-400);
  padding-left: 18px;
}

.oracle-question {
  font-family: "Fraunces", serif;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.oracle-answer {
  color: var(--mist-500);
}

.oracle-chat-role {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mist-500);
  margin-bottom: 4px;
}

.oracle-chat-message.role-user {
  border-color: var(--mist-500);
}

.site-footer {
  border-top: 1px solid var(--line-500);
  padding: 32px 0;
  color: var(--mist-500);
  font-size: 0.85rem;
}

.processing-shell {
  min-height: calc(100vh - 78px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold-400);
  display: inline-block;
  margin-right: 10px;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.reveal {
  animation: rise 0.6s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .pulse-dot {
    animation: none !important;
  }
}

@media (max-width: 860px) {
  .hero {
    padding: 56px 0;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .steps, .plans {
    grid-template-columns: 1fr;
  }

  .nav-links {
    gap: 16px;
  }
}
