:root {
  --bg: #140f0d;
  --bg-soft: #241a16;
  --surface: rgba(32, 23, 19, 0.82);
  --surface-strong: rgba(21, 15, 12, 0.92);
  --paper: #ede3d4;
  --paper-soft: #d8c8b0;
  --line: rgba(235, 213, 181, 0.2);
  --line-strong: rgba(235, 213, 181, 0.4);
  --text: #f5ebdd;
  --text-muted: #cabaa5;
  --paper-text: #3f2d22;
  --accent: #ead2ae;
  --accent-strong: #f4e4cb;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(162, 111, 64, 0.22), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(255, 224, 170, 0.1), transparent 20%),
    radial-gradient(circle at 80% 80%, rgba(93, 62, 40, 0.2), transparent 22%),
    linear-gradient(180deg, #18110e 0%, #120d0b 52%, #17110e 100%);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.03), transparent 30%),
    radial-gradient(circle at center, rgba(255, 248, 238, 0.02), transparent 55%);
  mix-blend-mode: screen;
  pointer-events: none;
}

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

button {
  font: inherit;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(100px);
  pointer-events: none;
  opacity: 0.55;
}

.ambient-one {
  width: 360px;
  height: 360px;
  top: 8%;
  left: -8%;
  background: rgba(204, 139, 88, 0.2);
}

.ambient-two {
  width: 420px;
  height: 420px;
  right: -16%;
  bottom: 12%;
  background: rgba(87, 61, 44, 0.24);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 32px;
  background: rgba(14, 10, 8, 0.58);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 244, 226, 0.08);
}

.brand,
h1,
h2,
h3,
.material-name,
.result-label,
.example-label,
.step-index {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

.brand {
  font-size: 30px;
  letter-spacing: 0.05em;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 28px;
  color: var(--text-muted);
}

.topnav a:hover,
.topnav a:focus-visible {
  color: var(--text);
}

.pill-btn,
.primary-btn,
.ghost-btn {
  border-radius: 999px;
  padding: 14px 26px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.pill-btn,
.primary-btn {
  background: linear-gradient(180deg, #f6ead7 0%, #dcc4a1 100%);
  color: #271a12;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.pill-btn:hover,
.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

.ghost-btn {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}

.ghost-btn:hover {
  border-color: rgba(245, 235, 221, 0.5);
  background: rgba(245, 235, 221, 0.04);
}

main {
  position: relative;
  z-index: 1;
}

.hero,
.paper-section,
.dark-section {
  width: min(1200px, calc(100vw - 32px));
  margin: 24px auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 36px;
  min-height: calc(100vh - 140px);
  align-items: center;
  padding: 52px clamp(24px, 4vw, 54px);
  border-radius: 40px;
  background:
    radial-gradient(circle at 18% 20%, rgba(232, 199, 152, 0.08), transparent 28%),
    linear-gradient(135deg, rgba(69, 49, 39, 0.82) 0%, rgba(20, 14, 12, 0.92) 58%, rgba(17, 12, 10, 0.98) 100%);
  border: 1px solid rgba(255, 241, 217, 0.08);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -20% -20% auto;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(244, 218, 178, 0.08), transparent 60%);
  pointer-events: none;
}

.hero-copy,
.hero-visual,
.approach-layout {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(237, 227, 212, 0.08);
  border: 1px solid rgba(237, 227, 212, 0.12);
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 18px 0 18px;
  font-size: clamp(52px, 8vw, 92px);
  line-height: 0.95;
  font-weight: 500;
}

.hero-text,
.section-intro p,
.approach-copy p,
.future-card p,
.feature-card p,
.step-card p,
.example-row p {
  line-height: 1.7;
  font-size: 20px;
}

.hero-copy {
  max-width: 620px;
}

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

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 34px;
  color: var(--text-muted);
  font-size: 18px;
}

.hero-points span {
  position: relative;
}

.hero-points span:not(:last-child)::after {
  content: "•";
  margin-left: 20px;
  color: rgba(245, 235, 221, 0.45);
}

.hero-visual {
  min-height: 560px;
}

.hero-stone {
  position: absolute;
  border-radius: 30px;
  background: radial-gradient(circle at 30% 20%, rgba(255, 245, 225, 0.06), transparent 35%), rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 240, 214, 0.08);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-stone img,
.approach-visual img,
.material-card img,
.rune-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.hero-stone-left {
  width: min(360px, 62%);
  height: 480px;
  bottom: 0;
  left: 0;
  transform: rotate(-5deg);
}

.hero-stone-right {
  width: min(320px, 56%);
  height: 420px;
  top: 50px;
  right: 10px;
  transform: rotate(7deg);
}

.hero-candle {
  position: absolute;
  top: 70px;
  right: 48px;
  width: 44px;
  height: 120px;
  border-radius: 22px 22px 14px 14px;
  background: linear-gradient(180deg, #f0ddc2 0%, #d0b088 70%, #9b7a55 100%);
  box-shadow: 0 0 40px rgba(255, 208, 133, 0.26);
}

.hero-candle::before {
  content: "";
  position: absolute;
  top: -42px;
  left: 50%;
  width: 24px;
  height: 46px;
  transform: translateX(-50%);
  background: radial-gradient(circle at 50% 35%, #fff4d9 0%, #ffc96f 35%, rgba(255, 170, 88, 0.82) 62%, transparent 68%);
  filter: blur(1px);
}

.paper-section {
  padding: 72px clamp(24px, 4vw, 52px);
  border-radius: 36px;
  background:
    linear-gradient(180deg, rgba(248, 241, 231, 0.98) 0%, rgba(229, 218, 202, 0.98) 100%);
  color: var(--paper-text);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.paper-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 14% 16%, rgba(138, 111, 83, 0.08), transparent 20%),
    radial-gradient(circle at 88% 76%, rgba(198, 166, 127, 0.1), transparent 24%);
  pointer-events: none;
}

.section-intro {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin-bottom: 32px;
}

.section-intro.narrow {
  max-width: 680px;
}

h2 {
  margin: 18px 0 12px;
  font-size: clamp(36px, 4.5vw, 58px);
  line-height: 1.02;
  font-weight: 500;
}

.feature-grid,
.steps-grid,
.continuation-grid {
  display: grid;
  gap: 18px;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card,
.step-card,
.example-card,
.result-card,
.continuation-card,
.future-card,
.material-card,
.question-field textarea,
.flow-panel,
.wait-card {
  box-shadow: var(--shadow);
}

.feature-card {
  position: relative;
  z-index: 1;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: rgba(255, 251, 246, 0.66);
  border: 1px solid rgba(104, 73, 46, 0.12);
}

.feature-icon {
  font-size: 28px;
}

.feature-card h3,
.step-card h3,
.future-card h3,
.continuation-card strong {
  font-size: 28px;
  font-weight: 500;
  margin: 18px 0 12px;
}

.dark-section {
  padding: 78px clamp(24px, 4vw, 52px);
  border-radius: 36px;
  background:
    radial-gradient(circle at 14% 16%, rgba(255, 223, 167, 0.07), transparent 18%),
    linear-gradient(180deg, rgba(31, 22, 18, 0.95) 0%, rgba(17, 12, 10, 0.97) 100%);
  border: 1px solid rgba(255, 243, 223, 0.08);
  box-shadow: var(--shadow);
}

.steps-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.step-card {
  padding: 30px;
  border-radius: var(--radius-lg);
  background: rgba(255, 245, 227, 0.06);
  border: 1px solid rgba(255, 237, 206, 0.1);
}

.step-index {
  display: inline-flex;
  font-size: 24px;
  color: var(--accent);
}

.example-card {
  position: relative;
  z-index: 1;
  padding: 30px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 251, 246, 0.76), rgba(238, 226, 205, 0.9));
  border: 1px solid rgba(86, 57, 35, 0.12);
}

.example-row + .example-row {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(96, 67, 43, 0.12);
}

.example-label,
.result-label {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
  color: rgba(66, 46, 31, 0.72);
}

.approach-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: center;
}

.approach-copy {
  max-width: 620px;
}

.principles {
  display: grid;
  gap: 14px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.principles li {
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(255, 243, 222, 0.06);
  border: 1px solid rgba(255, 237, 206, 0.1);
}

.approach-visual {
  height: 460px;
  padding: 24px;
  border-radius: 32px;
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 220, 170, 0.18), transparent 34%),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 239, 214, 0.1);
}

.future-section .section-intro {
  margin-bottom: 24px;
}

.future-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px;
  border-radius: 24px;
  background: rgba(255, 249, 241, 0.7);
  border: 1px solid rgba(96, 67, 43, 0.14);
}

.flow-shell {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.flow-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 7, 6, 0.76);
  backdrop-filter: blur(20px);
}

.flow-panel {
  position: relative;
  width: min(1160px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  margin: 12px auto;
  padding: 30px 30px 32px;
  overflow: auto;
  border-radius: 34px;
  background:
    radial-gradient(circle at 12% 14%, rgba(251, 228, 195, 0.11), transparent 18%),
    linear-gradient(180deg, rgba(40, 28, 23, 0.96) 0%, rgba(17, 12, 10, 0.97) 100%);
  border: 1px solid rgba(255, 238, 210, 0.1);
}

.flow-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.08);
  color: var(--text);
  cursor: pointer;
  font-size: 26px;
}

.flow-progress {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 26px;
}

.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 241, 214, 0.14);
  transition: transform 180ms ease, background 180ms ease;
}

.progress-dot.is-active {
  transform: scale(1.45);
  background: var(--accent);
}

.flow-step {
  display: none;
}

.flow-step.is-active {
  display: block;
}

.flow-heading {
  max-width: 720px;
  margin-bottom: 26px;
}

.flow-heading p {
  margin: 16px 0 0;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 18px;
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.material-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 18px;
  border-radius: 26px;
  border: 1px solid rgba(255, 238, 210, 0.12);
  background: rgba(251, 239, 219, 0.06);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.material-card img {
  height: 180px;
}

.material-card.is-selected {
  border-color: rgba(244, 228, 203, 0.42);
  background: rgba(255, 246, 230, 0.11);
  transform: translateY(-2px);
}

.material-name {
  font-size: 34px;
}

.material-copy {
  color: var(--text-muted);
  line-height: 1.55;
}

.flow-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
}

.flow-actions-center {
  justify-content: center;
}

.question-field {
  display: block;
}

.question-field span {
  display: block;
  margin-bottom: 10px;
  color: var(--text-muted);
}

.question-field textarea {
  width: 100%;
  padding: 24px;
  resize: vertical;
  min-height: 220px;
  border-radius: 24px;
  border: 1px solid rgba(255, 238, 210, 0.14);
  background:
    linear-gradient(180deg, rgba(247, 236, 216, 0.92), rgba(232, 215, 189, 0.88));
  color: #3a291f;
  font-size: 24px;
  line-height: 1.5;
}

.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--text-muted);
}

.rune-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.rune-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 14px;
}

.rune-tile {
  position: relative;
  min-height: 206px;
  border-radius: 22px;
  padding: 14px;
  border: 1px solid rgba(255, 238, 210, 0.1);
  background: rgba(255, 248, 237, 0.04);
  cursor: pointer;
  overflow: hidden;
}

.rune-tile.is-selected {
  border-color: rgba(244, 228, 203, 0.42);
  background: rgba(255, 244, 219, 0.12);
  transform: translateY(-2px);
}

.rune-tile img {
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.3));
}

.inline-error {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(147, 54, 39, 0.22);
  border: 1px solid rgba(255, 156, 139, 0.24);
  color: #ffd2c9;
}

.wait-card {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 68vh;
  padding: 32px;
  border-radius: 28px;
  background:
    radial-gradient(circle at center, rgba(255, 232, 194, 0.11), transparent 22%),
    rgba(255, 250, 242, 0.04);
  border: 1px solid rgba(255, 238, 210, 0.1);
}

.wait-card h2 {
  margin: 18px 0 10px;
}

.wait-card p {
  max-width: 540px;
  color: var(--text-muted);
  line-height: 1.65;
  font-size: 18px;
}

.wait-ring {
  width: 124px;
  height: 124px;
  border-radius: 999px;
  border: 2px solid rgba(255, 235, 203, 0.14);
  border-top-color: var(--accent);
  animation: spin 1.2s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.meta-chip {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 238, 210, 0.14);
  background: rgba(255, 247, 231, 0.06);
  color: var(--text-muted);
}

.result-card {
  padding: 26px;
  border-radius: 28px;
  border: 1px solid rgba(255, 238, 210, 0.12);
  background: rgba(255, 248, 237, 0.05);
}

.result-block + .result-block {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 238, 210, 0.1);
}

.result-block p {
  margin: 0;
  line-height: 1.7;
  font-size: 20px;
}

.result-runes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.result-runes span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 244, 219, 0.1);
  border: 1px solid rgba(255, 238, 210, 0.14);
}

.result-text {
  white-space: pre-wrap;
  color: var(--text);
  line-height: 1.8;
  font-size: 19px;
}

.continuation-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
}

.continuation-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(248, 239, 222, 0.9), rgba(227, 208, 179, 0.85));
  color: #302118;
  border: 1px solid rgba(96, 67, 43, 0.14);
}

.continuation-card span {
  line-height: 1.55;
}

@media (max-width: 1080px) {
  .hero,
  .approach-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-visual {
    min-height: 460px;
  }

  .feature-grid,
  .steps-grid,
  .material-grid,
  .continuation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .topbar {
    padding: 16px 18px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .topnav {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 18px;
    font-size: 14px;
  }

  .hero,
  .paper-section,
  .dark-section {
    width: min(100vw - 16px, 1200px);
    margin: 10px auto 18px;
  }

  .hero,
  .paper-section,
  .dark-section,
  .flow-panel {
    padding: 22px 18px 24px;
    border-radius: 24px;
  }

  .feature-grid,
  .steps-grid,
  .material-grid,
  .continuation-grid {
    grid-template-columns: 1fr;
  }

  .future-card,
  .flow-actions,
  .question-meta,
  .rune-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-points {
    flex-direction: column;
    gap: 10px;
  }

  .hero-points span:not(:last-child)::after {
    display: none;
  }

  .question-field textarea {
    min-height: 180px;
    font-size: 20px;
  }

  .rune-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .material-card img,
  .rune-tile {
    min-height: 0;
  }
}
