/* ==========================================================================
   ALCHEMIST'S COLOR LAB STYLESHEET

   01. Fonts and design tokens
   02. Global resets and accessibility
   03. Ambient background effects
   04. Header, branding, and navigation
   05. Intro card
   06. Contrast Cauldron
   07. WCAG results and repair tools
   08. Base Codex and footer
   09. Base responsive layouts
   10. Palette Oracle
   11. Oracle form and result refinements
   12. About and privacy dialogs
   13. Codex and content layout refinements
   14. Intro card and footer polish
   15. Themed navigation and brand icons
   16. Final navigation, intro, Codex, and footer layout
   17. Enchanted hero spellbook
   18. Palette Oracle floating scrying orb
   19. Shared header and footer potion-bottle artwork
   20. Warm ember accents
   21. Centered intro and animated section-title icons
   22. Official WCAG information card
   ========================================================================== */

/* ==========================================================================
   01. FONTS AND DESIGN TOKENS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --ink:#f8edc9;
  --muted:#c9bbd2;
  --night:#100b18;
  --night-2:#1a1026;
  --panel:#241733;
  --plum:#342044;
  --gold:#f3c969;
  --gold-dark:#8c6421;
  --ember:#d97732;
  --ember-light:#f2a65a;
  --ember-soft:rgba(217,119,50,.18);
  --mint:#a8e6c2;
  --rose:#ff9c98;
  --focus:#7ee7ff;
  --parchment:#f1dfb5;
  --parchment-ink:#302336;
  --border:rgba(243,201,105,.35);
  --shadow:0 24px 70px rgba(0,0,0,.36);
  --radius:24px
}

/* ==========================================================================
   02. GLOBAL RESETS AND ACCESSIBILITY
   ========================================================================== */

* {
  box-sizing:border-box
}

html {
  scroll-behavior:smooth
}

body {
  margin:0;
  background:radial-gradient(circle at 50% -10%,#39214a 0,#171021 42%,#0c0912 100%);
  color:var(--ink);
  font-family:"DM Sans",
  system-ui,
  sans-serif;
  line-height:1.6;
  min-height:100vh;
  overflow-x:hidden
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: 0.01ms !important;
}

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

a {
  color:inherit
}

button,
input {
  font:inherit
}

button {
  cursor:pointer
}

.skip-link {
  position:fixed;
  top:10px;
  left:10px;
  z-index:999;
  transform:translateY(-150%);
  background:#fff;
  color:#111;
  padding:.75rem 1rem;
  border-radius:8px
}

.skip-link:focus {
  transform:none
}

:focus-visible {
  outline:3px solid var(--focus);
  outline-offset:4px
}

.visually-hidden {
  position:absolute!important;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0
}

/* ==========================================================================
   03. AMBIENT BACKGROUND EFFECTS
   ========================================================================== */

.ambient {
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:-1;
  opacity:.7
}

.star {
  position:absolute;
  width:4px;
  height:4px;
  border-radius:50%;
  background:#fff7c8;
  box-shadow:0 0 14px #fff7c8;
  animation:twinkle 3s ease-in-out infinite
}

.star--1 {
  top:14%;
  left:7%
}

.star--2 {
  top:22%;
  right:12%;
  animation-delay:-1s
}

.star--3 {
  top:67%;
  left:4%;
  animation-delay:-2s
}

.star--4 {
  top:78%;
  right:8%;
  animation-delay:-.5s
}

@keyframes twinkle {
  50% {
    opacity:.25;
    transform:scale(.65)
  }

}

/* ==========================================================================
   04. HEADER, BRANDING, AND NAVIGATION
   ========================================================================== */

.site-header {
  max-width:1380px;
  margin:auto;
  padding:1.25rem 4vw;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:1rem
}

.brand {
  display:flex;
  align-items:center;
  gap:.8rem;
  text-decoration:none
}

.brand__mark {
  display:grid;
  place-items:center;
  width:46px;
  height:46px;
  border:1px solid var(--border);
  border-radius:50%;
  background:rgba(243,201,105,.08);
  color:var(--gold);
  font-size:1.5rem
}

.brand strong {
  display:block;
  font-family:Cinzel,
  serif;
  letter-spacing:.04em
}

.brand small {
  display:block;
  color:var(--muted)
}

.header-actions {
  display:flex;
  align-items:center;
  gap:1rem
}

.icon-button {
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  color:var(--ink);
  padding:.65rem .85rem;
  border-radius:999px;
  display:flex;
  gap:.5rem;
  align-items:center
}

.text-link {
  text-underline-offset:5px;
  color:var(--gold)
}

/* ==========================================================================
   05. INTRO CARD
   ========================================================================== */

.hero {
  min-height:54vh;
  display:grid;
  place-content:center;
  text-align:center;
  padding:4rem 5vw 5.5rem;
  max-width:1050px;
  margin:auto
}

.eyebrow {
  margin:0 0 .6rem;
  text-transform:uppercase;
  letter-spacing:.18em;
  font-weight:700;
  font-size:.74rem;
  color:var(--gold)
}

h1,
h2,
h3 {
  font-family:Cinzel,
  serif;
  line-height:1.12
}

h1 {
  font-size:clamp(2.6rem,6vw,5.4rem);
  margin:.2rem 0 1.25rem;
  text-wrap:balance
}

h1 em {
  font-style:normal;
  color:var(--gold);
  text-shadow:0 0 34px rgba(243,201,105,.18)
}

.hero__copy {
  font-size:clamp(1.05rem,2vw,1.3rem);
  max-width:740px;
  margin:0 auto 2rem;
  color:var(--muted)
}

.primary-link {
  justify-self:center;
  text-decoration:none;
  border:1px solid var(--gold);
  background:linear-gradient(135deg,#e5b950,#a97425);
  color:#160e1f;
  padding:.9rem 1.25rem;
  border-radius:999px;
  font-weight:800;
  box-shadow:0 10px 30px rgba(243,201,105,.18);
  transition:transform .2s
}

.primary-link:hover {
  transform:translateY(-3px)
}

/* ==========================================================================
   06. CONTRAST CAULDRON
   ========================================================================== */

.lab-shell,
.codex {
  max-width:1450px;
  margin:auto;
  padding:4rem 4vw
}

.section-heading {
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:2rem;
  margin-bottom:2rem
}

.section-heading h2 {
  font-size:clamp(2rem,4vw,3.5rem);
  margin:0
}

.section-heading>p {
  max-width:420px;
  color:var(--muted);
  margin:0
}

.lab-grid {
  display:grid;
  grid-template-columns:minmax(270px,.88fr) minmax(340px,1.15fr) minmax(300px,.92fr);
  gap:1.25rem;
  align-items:stretch
}

.parchment {
  background:linear-gradient(145deg,#f6e8c5,#e3c995);
  color:var(--parchment-ink);
  border:1px solid #fff2cf;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  position:relative;
  overflow:hidden
}

.parchment:before {
  content:"";
  position:absolute;
  inset:8px;
  border:1px solid rgba(75,51,37,.18);
  border-radius:18px;
  pointer-events:none
}

.ingredient-panel,
.results-panel {
  padding:2rem
}

.ingredient-panel fieldset {
  border:0;
  padding:0;
  margin:0
}

.ingredient-panel legend {
  font-family:Cinzel,
  serif;
  font-weight:700;
  font-size:1.4rem;
  margin-bottom:1.6rem
}

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

.ingredient__heading {
  display:flex;
  gap:.75rem;
  align-items:center;
  margin-bottom:.7rem
}

.ingredient__number {
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border:1px solid #71532b;
  border-radius:50%;
  font-family:Cinzel,
  serif
}

.ingredient label {
  font-weight:800
}

.ingredient small {
  display:block;
  color:#6f5c67
}

.color-row {
  display:flex;
  gap:.65rem
}

.color-row input[type=color] {
  width:52px;
  height:52px;
  padding:3px;
  border:2px solid #5d3c51;
  border-radius:12px;
  background:#fff
}

.hex-control {
  flex:1;
  display:flex;
  align-items:center;
  border:2px solid #5d3c51;
  background:#fffaf0;
  border-radius:12px;
  overflow:hidden
}

.hex-control>span {
  padding-left:.75rem;
  color:#6f5c67;
  font-weight:700
}

.hex-control input {
  min-width:0;
  width:100%;
  border:0;
  background:transparent;
  padding:.75rem .3rem;
  text-transform:uppercase;
  font-weight:800;
  color:#302336
}

.copy-button {
  align-self:stretch;
  border:0;
  border-left:1px solid #cab99d;
  background:#efe2c8;
  color:#403044;
  font-size:.78rem;
  font-weight:700
}

.field-error {
  min-height:1.5rem;
  color:#8c2032;
  margin:.25rem 0;
  font-size:.84rem
}

.swap-button {
  display:flex;
  align-items:center;
  gap:.5rem;
  margin:.5rem auto 1rem;
  border:0;
  background:transparent;
  color:#563a56;
  text-decoration:underline;
  text-underline-offset:4px;
  font-weight:700
}

.cauldron-stage {
  position:relative;
  min-height:740px;
  border-radius:var(--radius);
  border:1px solid var(--border);
  background:radial-gradient(circle at 50% 37%,rgba(105,67,119,.55),transparent 28%),
  linear-gradient(180deg,#271532,#120b19);
  box-shadow:var(--shadow);
  padding:1.5rem;
  display:flex;
  flex-direction:column;
  align-items:center;
  overflow:hidden
}

.cauldron-stage:before {
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(90deg,transparent 49.5%,rgba(255,255,255,.035) 50%,transparent 50.5%),
  linear-gradient(rgba(255,255,255,.02) 1px,transparent 1px);
  background-size:100% 100%,
  100% 32px;
  pointer-events:none
}

.hanging-sign {
  border:1px solid var(--border);
  border-top:0;
  background:#1a1023;
  padding:.45rem 1.2rem;
  color:var(--gold);
  font-size:.72rem;
  letter-spacing:.18em;
  font-weight:800;
  border-radius:0 0 12px 12px
}

.cauldron-wrap {
  height:245px;
  width:280px;
  position:relative;
  margin-top:1rem
}

.cauldron {
  position:absolute;
  bottom:0;
  left:30px;
  width:220px;
  height:125px;
  border:5px solid #08060c;
  border-radius:14px 14px 95px 95px;
  background:linear-gradient(100deg,#24182b,#09070c 40%,#31203c);
  box-shadow:inset 0 8px 10px rgba(255,255,255,.07),
  0 24px 25px rgba(0,0,0,.5)
}

.cauldron:before,
.cauldron:after {
  content:"";
  position:absolute;
  top:8px;
  width:50px;
  height:25px;
  border:6px solid #09070d
}

.cauldron:before {
  left:-43px;
  border-right:0;
  border-radius:20px 0 0 20px
}

.cauldron:after {
  right:-43px;
  border-left:0;
  border-radius:0 20px 20px 0
}

.potion {
  position:absolute;
  left:5%;
  top:7px;
  width:90%;
  height:34px;
  border-radius:50%;
  background:#f6e7b0;
  box-shadow:0 0 30px currentColor;
  transition:background .35s,
  box-shadow .35s
}

.bubble {
  position:absolute;
  border-radius:50%;
  background:rgba(255,255,255,.55);
  animation:bubble 2.5s ease-in infinite
}

.bubble--1 {
  left:20%;
  width:12px;
  height:12px
}

.bubble--2 {
  left:55%;
  width:8px;
  height:8px;
  animation-delay:-.8s
}

.bubble--3 {
  left:75%;
  width:15px;
  height:15px;
  animation-delay:-1.6s
}

@keyframes bubble {
  0% {
    transform:translateY(3px) scale(.2);
    opacity:0
  }

  35% {
    opacity:.9
  }

  100% {
    transform:translateY(-95px) scale(1);
    opacity:0
  }

}

.steam {
  position:absolute;
  bottom:125px;
  width:18px;
  height:80px;
  border-radius:50%;
  border-left:4px solid rgba(255,255,255,.25);
  filter:blur(1px);
  animation:steam 4s ease-in-out infinite
}

.steam--1 {
  left:95px
}

.steam--2 {
  left:140px;
  animation-delay:-1.5s
}

.steam--3 {
  left:180px;
  animation-delay:-2.7s
}

@keyframes steam {
  0% {
    transform:translateY(0) scale(.5);
    opacity:0
  }

  40% {
    opacity:.65
  }

  100% {
    transform:translateY(-80px) translateX(18px) scale(1.3);
    opacity:0
  }

}

.result-card {
  text-align:center;
  position:relative;
  z-index:1
}

.result-card__kicker {
  text-transform:uppercase;
  letter-spacing:.15em;
  color:var(--muted);
  font-size:.74rem;
  font-weight:800;
  margin:0
}

.ratio {
  font-family:Cinzel,
  serif;
  font-size:clamp(3.5rem,6vw,5.7rem);
  line-height:1;
  color:var(--gold);
  margin:.35rem 0
}

.ratio span {
  font-size:.42em
}

.result-card h3 {
  font-size:1.45rem;
  margin:.4rem
}

.result-card p:last-child {
  color:var(--muted);
  margin:.35rem
}

.sample-card {
  width:min(100%,500px);
  margin-top:auto;
  padding:1.4rem;
  border-radius:18px;
  background:#241733;
  color:#f6e7b0;
  border:1px solid rgba(255,255,255,.15);
  transition:background .35s,
  color .35s;
  position:relative;
  z-index:1
}

.sample-card__label {
  text-transform:uppercase;
  letter-spacing:.14em;
  font-size:.68rem;
  font-weight:800;
  opacity:.8
}

.sample-card h3 {
  font-size:1.35rem;
  margin:.3rem 0
}

.sample-card p {
  margin:.5rem 0 1rem
}

.sample-card .preview-button-wrap {
  display:flex;
  justify-content:center;
  width:100%
}

.sample-card .preview-button {
  border:2px solid currentColor;
  border-radius:9px;
  background:transparent;
  color:inherit;
  padding:.6rem .85rem;
  font-weight:800;
  cursor:default;
  opacity:1;
  pointer-events:none;
  user-select:none
}

/* ==========================================================================
   07. WCAG RESULTS AND REPAIR TOOLS
   ========================================================================== */

.results-panel__heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:1rem;
  position:relative;
  z-index:1
}

.results-panel h2 {
  margin:0;
  font-size:1.7rem
}

.rank-seal {
  display:grid;
  place-items:center;
  width:64px;
  height:64px;
  border-radius:50%;
  border:3px double #65452a;
  color:#503123;
  font-family:Cinzel,
  serif;
  font-weight:800;
  transform:rotate(5deg);
  background:rgba(151,94,45,.12)
}

.checks {
  display:grid;
  gap:.75rem;
  margin:1.6rem 0;
  position:relative;
  z-index:1
}

.check {
  display:grid;
  grid-template-columns:38px 1fr auto;
  gap:.7rem;
  align-items:center;
  padding:.8rem;
  border:1px solid rgba(72,47,58,.22);
  border-radius:13px;
  background:rgba(255,255,255,.23)
}

.check__icon {
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border-radius:50%;
  font-weight:900
}

.check.pass .check__icon {
  background:#d5efdc;
  color:#165c34
}

.check.fail .check__icon {
  background:#f3ced0;
  color:#8a1f2d
}

.check h3 {
  font-family:"DM Sans",
  sans-serif;
  font-size:.9rem;
  margin:0
}

.check p {
  font-size:.77rem;
  color:#6e5a68;
  margin:0
}

.check strong {
  font-size:.78rem
}

.repair-box {
  position:relative;
  z-index:1;
  border:2px dashed rgba(76,48,61,.34);
  border-radius:14px;
  padding:1rem;
  background:rgba(255,255,255,.24)
}

.repair-box>div {
  display:flex;
  gap:.75rem
}

.repair-box__icon {
  font-size:1.4rem
}

.repair-box h3 {
  font-family:"DM Sans",
  sans-serif;
  font-size:.95rem;
  margin:0
}

.repair-box p {
  font-size:.83rem;
  margin:.25rem 0
}

.repair-box button {
  width:100%;
  margin-top:.8rem;
  border:0;
  border-radius:10px;
  background:#4a2c50;
  color:#fff4d2;
  padding:.75rem;
  font-weight:800
}

.formula-note {
  position: relative;
  z-index: 1;
  margin-top: 1rem;
}

.formula-details summary {
  font-weight:800;
  cursor:pointer
}

.formula-note {
  font-size: .84rem;
}

.formula-note code {
  display: block;
  padding: .7rem;
  background: rgba(54,34,47,.1);
  border-radius: 8px;
  text-align: center;
  font-weight: 800;
}

/* ==========================================================================
   08. BASE CODEX AND FOOTER
   ========================================================================== */

.codex-grid {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:1rem
}

.codex article {
  border:1px solid var(--border);
  background:rgba(255,255,255,.045);
  border-radius:18px;
  padding:1.4rem
}

.codex-rune {
  display:grid;
  place-items:center;
  width:48px;
  height:48px;
  border:1px solid var(--border);
  border-radius:50%;
  color:var(--gold);
  font-family:Cinzel,
  serif;
  font-weight:800
}

.codex h3 {
  font-size:1.1rem;
  margin:1rem 0 .5rem
}

.codex article p {
  color:var(--muted);
  margin:0
}

.codex article small {
  display:block;
  color:var(--gold);
  margin-top:.9rem
}

footer {
  max-width:1380px;
  margin:3rem auto 0;
  padding:1.5rem 4vw;
  border-top:1px solid rgba(255,255,255,.1);
  color:var(--muted)
}

footer span {
  font-family:Cinzel,
  serif;
  color:var(--ink)
}

.toast {
  position:fixed;
  left:50%;
  bottom:1.5rem;
  transform:translate(-50%,150%);
  background:#fff;
  color:#1e1328;
  padding:.8rem 1rem;
  border-radius:999px;
  box-shadow:var(--shadow);
  font-weight:800;
  z-index:99;
  transition:transform .25s
}

.toast.show {
  transform:translate(-50%,0)
}

/* ==========================================================================
   09. BASE RESPONSIVE LAYOUTS
   ========================================================================== */

@media(max-width:1080px) {
  .lab-grid {
    grid-template-columns:1fr 1.2fr
  }

  .results-panel {
    grid-column:1/-1
  }

  .codex-grid {
    grid-template-columns:1fr 1fr
  }

}

@media(max-width:720px) {
  .site-header {
    align-items:flex-start
  }

  .header-actions {
    flex-direction:column;
    align-items:flex-end
  }

  .header-actions .text-link {
    display:none
  }

  .icon-button span:last-child {
    display:none
  }

  .hero {
    min-height:auto;
    padding-top:4rem
  }

  .section-heading {
    align-items:flex-start;
    flex-direction:column;
    gap:.5rem
  }

  .lab-grid {
    grid-template-columns:1fr
  }

  .results-panel {
    grid-column:auto
  }

  .cauldron-stage {
    min-height:680px
  }

  .codex-grid {
    grid-template-columns:1fr
  }

  footer {
    align-items:flex-start;
    flex-direction:column
  }

  .ingredient-panel,
  .results-panel {
    padding:1.5rem
  }

  .lab-shell,
  .codex {
    padding-inline:1rem
  }

}

/* ==========================================================================
   10. PALETTE ORACLE
   ========================================================================== */
.oracle-section {
  padding: 5rem clamp(1rem, 4vw, 4rem);
}

.oracle-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 1.5rem;
  align-items: start;
}

.oracle-form,
.oracle-result {
  border-radius: 1.25rem;
}

.oracle-form {
  padding: clamp(1.25rem, 3vw, 2rem);
}

.oracle-intro {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.oracle-intro h3,
.oracle-result h3 {
  margin: 0 0 .35rem;
}

.oracle-intro p,
.oracle-result p {
  margin: 0;
}

.oracle-orb {
  display: grid;
  place-items: center;
  width: 4rem;
  aspect-ratio: 1;
  border-radius: 50%;
  font-size: 1.5rem;
  background: radial-gradient(circle at 35% 30%, #fff8cf, #9f6ac4 35%, #30203e 72%);
  box-shadow: 0 0 0 .35rem rgb(117 79 143 / .18),
  0 0 2rem rgb(197 147 232 / .42);
  animation: oracleFloat 4s ease-in-out infinite;
  flex: 0 0 auto;
}

.oracle-form label {
  display: block;
  font-weight: 800;
  margin: 1rem 0 .45rem;
}

.oracle-form label span {
  font-weight: 500;
}

.oracle-form textarea,
.oracle-form select,
.anchor-control input[type="text"],
#anchor-color {
  width: 100%;
  border: 2px solid #6d5a42;
  border-radius: .65rem;
  background: #fff8dc;
  color: #211727;
  padding: .8rem .9rem;
  font: inherit;
}

.oracle-form textarea:focus-visible,
.oracle-form select:focus-visible {
  outline: 3px solid #2c6d62;
  outline-offset: 3px;
}

.anchor-hex:focus-within {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(243, 201, 105, .28);
}

#anchor-color:focus-visible {
  outline: 0;
}

.field-hint,
.oracle-privacy {
  font-size: .86rem;
  opacity: .8;
}

.oracle-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.anchor-control {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: .6rem;
}

.anchor-control input[type="color"] {
  width: 3.25rem;
  height: 3.15rem;
  padding: .2rem;
  border-radius: .65rem;
  border: 2px solid #6d5a42;
  background: #fff8dc;
}

.oracle-button {
  width: 100%;
  margin-top: 1.3rem;
  min-height: 3.4rem;
  border: 0;
  border-radius: .75rem;
  background: #33203f;
  color: #fff4cf;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px #b88f46,
  0 .5rem 1.2rem rgb(38 23 45 / .25);
}

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

.oracle-button:disabled {
  cursor: wait;
  opacity: .72;
  transform: none;
}

.oracle-button span:first-child {
  margin-right: .5rem;
}

.oracle-status {
  min-height: 1.5rem;
  font-weight: 750;
  margin-top: .75rem;
}

.oracle-result {
  background: linear-gradient(145deg, #22152d, #120d19);
  color: #f9ecc4;
  border: 1px solid #765d37;
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: 0 1rem 3rem rgb(8 5 11 / .35);
}

.oracle-result__heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.verified-seal {
  border: 2px solid currentColor;
  border-radius: 50%;
  width: 5rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: .62rem;
  font-weight: 900;
  line-height: 1.1;
  transform: rotate(8deg);
  flex: 0 0 auto;
}

.palette-vials {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .55rem;
  margin: 1.5rem 0;
}

.palette-vial {
  min-width: 0;
}

.palette-vial__color {
  height: 5.5rem;
  border-radius: 3rem 3rem .75rem .75rem;
  border: 2px solid rgb(255 255 255 / .55);
  box-shadow: inset 0 -1rem 1.5rem rgb(0 0 0 / .2);
  position: relative;
  overflow: hidden;
}

.palette-vial strong,
.palette-vial small {
  display: block;
  overflow-wrap: anywhere;
}

.palette-vial strong {
  font-size: .74rem;
  margin-top: .45rem;
}

.palette-vial small {
  opacity: .8;
  font-size: .7rem;
}

.palette-preview {
  border-radius: .9rem;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / .25);
}

.palette-preview__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .8rem 1rem;
}

.palette-preview button,
.palette-preview__link {
  display: inline-block;
  border-radius: .45rem;
  padding: .55rem .75rem;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
}

.palette-preview button {
  border: 0;
  cursor: default;
  pointer-events: none;
}

.palette-preview__body {
  padding: 1.6rem;
}

.palette-preview__body h4 {
  font-size: clamp(1.4rem, 3vw, 2.25rem);
  max-width: 18ch;
  margin: .3rem 0 .7rem;
}

.palette-preview__body a {
  display: inline-block;
  margin-top: .5rem;
}

.oracle-ratios {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  margin: 1rem 0;
}

.oracle-ratio {
  border: 1px solid rgb(255 255 255 / .25);
  border-radius: .65rem;
  padding: .7rem;
}

.oracle-ratio strong,
.oracle-ratio span {
  display: block;
}

.oracle-ratio span {
  font-size: .76rem;
  opacity: .82;
}

.oracle-result__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.oracle-result__actions button {
  border: 2px solid #d4b26f;
  background: #f6e7b0;
  color: #241733;
  border-radius: .65rem;
  padding: .75rem 1rem;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.oracle-result__actions .secondary-button {
  background: transparent;
  color: #f6e7b0;
}

@keyframes oracleFloat {
  50% {
    transform: translateY(-.45rem) rotate(5deg);
  }

}

.reduce-motion .oracle-orb {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .oracle-orb {
    animation: none;
  }

}

@media (max-width: 850px) {
  .oracle-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 560px) {
  .oracle-fields,
  .oracle-ratios {
    grid-template-columns: 1fr;
  }

  .palette-vials {
    grid-template-columns: repeat(2, 1fr);
  }

  .palette-vial:last-child {
    grid-column: 1 / -1;
    max-width: 50%;
  }

}

/* ==========================================================================
   11. ORACLE FORM AND RESULT REFINEMENTS
   ========================================================================== */
.hero > .eyebrow {
  display: none;
}

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

.oracle-form {
  max-width: 880px;
}

.oracle-result {
  width: 100%;
}

.oracle-intro {
  margin-bottom: 1rem;
}

.oracle-form textarea {
  min-height: 8rem;
  resize: vertical;
}

.anchor-option {
  margin-top: 1rem;
}

.checkbox-label {
  display: inline-flex !important;
  align-items: center;
  gap: .65rem;
  margin: 0 !important;
  cursor: pointer;
}

.checkbox-label input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: #4a2c50;
}

.anchor-panel {
  margin-top: .8rem;
  padding: 1rem;
  border: 1px solid rgba(74,49,60,.25);
  border-radius: .85rem;
  background: rgba(255,255,255,.2);
}

.anchor-panel[hidden] {
  display: none;
}

.anchor-control {
  grid-template-columns: 3.4rem minmax(0, 1fr);
}

.anchor-hex {
  display: flex;
  align-items: center;
  border: 2px solid #6d5a42;
  border-radius: .65rem;
  background: #fff8dc;
  overflow: hidden;
}

.anchor-hex > span {
  padding-left: .8rem;
  color: #6f5c67;
  font-weight: 800;
}

.anchor-hex #anchor-color {
  position: relative;
  z-index: 1;
  min-width: 0;
  border: 0;
  border-radius: 0;
  pointer-events: auto;
  user-select: text;
  caret-color: #211727;
}

.oracle-privacy,
.verified-seal {
  display: none !important;
}

.oracle-result__heading {
  display: block;
}

.site-footer {
  max-width: 1380px;
  margin: 3rem auto 0;
  padding: 1.5rem 4vw 2rem;
  border-top: 1px solid rgba(255,255,255,.1);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .65rem 1.5rem;
  align-items: center;
  color: var(--muted);
}

.footer-brand {
  font-family: Cinzel,
  serif;
  color: var(--ink);
  font-weight: 700;
}

.footer-links {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
}

.footer-links button {
  border: 0;
  background: transparent;
  color: var(--gold);
  padding: .35rem .5rem;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-credit {
  grid-column: 1 / -1;
  margin: 0;
  font-size: .88rem;
}

/* ==========================================================================
   12. ABOUT AND PRIVACY DIALOGS
   ========================================================================== */

.info-dialog {
  width: min(92vw, 760px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: transparent;
  color: var(--ink);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.55),
    0 0 35px rgba(159, 106, 196, 0.16);
}

.info-dialog::backdrop {
  background: rgba(7, 4, 10, 0.82);
  backdrop-filter: blur(8px);
}

.dialog-card {
  position: relative;
  padding: 0 3rem 3rem;
  border-radius: 24px;
  background:
    radial-gradient(
      circle at 15% 0%,
      rgba(159, 106, 196, 0.18),
      transparent 36%
    ),
    linear-gradient(145deg, #241733, #120b19);
}

.dialog-card::before {
  content: "";
  display: block;
  height: 12px;
  margin: 0 -3rem 2rem;
  background:
    linear-gradient(
      90deg,
      #9f6ac4,
      #f3c969 50%,
      #9f6ac4
    );
  box-shadow: 0 5px 18px rgba(243, 201, 105, 0.2);
}

.dialog-card .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
  color: var(--gold);
}

.dialog-card h2 {
  margin: 0 0 1.25rem;
  color: var(--ink);
  font-size: clamp(2rem, 5vw, 3rem);
}

.dialog-card h3 {
  margin: 2rem 0 0.65rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(243, 201, 105, 0.22);
  color: var(--gold);
  font-size: 1.25rem;
}

.dialog-card p {
  margin: 0;
  color: var(--ink);
  line-height: 1.75;
}

.dialog-card p + p {
  margin-top: 1rem;
}

.dialog-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(243, 201, 105, 0.45);
  border-radius: 50%;
  background: rgba(243, 201, 105, 0.08);
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.dialog-close:hover {
  background: rgba(243, 201, 105, 0.16);
  transform: rotate(6deg);
}

@media (max-width: 640px) {
  .dialog-card {
    padding: 0 1.5rem 2rem;
  }

  .dialog-card::before {
    margin-right: -1.5rem;
    margin-left: -1.5rem;
  }

  .dialog-card h2 {
    font-size: 2rem;
  }
}

@media (max-width: 720px) {
  .site-footer {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .footer-credit {
    grid-column: auto;
  }

}

/* ==========================================================================
   13. CODEX AND CONTENT LAYOUT REFINEMENTS
   ========================================================================== */
.hero {
  min-height: auto;
  max-width: 860px;
  padding: clamp(3.5rem, 8vw, 6rem) 5vw clamp(3rem, 7vw, 5rem);
}

.hero h1 {
  max-width: 20ch;
  margin: 0 auto .9rem;
  font-size: clamp(2rem, 4.2vw, 3.75rem);
  line-height: 1.08;
}

.hero__copy {
  max-width: 690px;
  margin: 0 auto;
  font-size: clamp(1rem, 1.7vw, 1.18rem);
  line-height: 1.55;
}

.primary-link {
  display: none;
}

.oracle-section > .section-heading,
.oracle-grid {
  width: min(100%, 1120px);
  margin-left: auto;
  margin-right: auto;
}

.oracle-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.oracle-form {
  width: min(100%, 900px);
  max-width: none;
  margin: 0 auto;
}

.oracle-result {
  width: min(100%, 1120px);
  margin: 0 auto;
}

.oracle-result[hidden] {
  display: none;
}

.codex {
  padding-top: 5rem;
}

.codex-heading {
  align-items: end;
}

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

.codex article {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(145deg, rgba(255,255,255,.065), rgba(255,255,255,.025));
}

.codex article p {
  line-height: 1.55;
}

.codex article small {
  margin-top: auto;
  padding-top: 1rem;
}

.codex-formula {
  margin-top: 1rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(243,201,105,.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.codex-formula > div {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.codex-formula > div > span {
  color: var(--gold);
  font-size: 1.8rem;
}

.codex-formula h3 {
  margin: 0 0 .25rem;
  font-size: 1rem;
}

.codex-formula p {
  margin: 0;
  color: var(--muted);
}

.codex-formula code {
  flex: 0 0 auto;
  padding: .8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0,0,0,.22);
  color: var(--gold);
  font-weight: 800;
}

@media (max-width: 900px) {
  .codex-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 620px) {
  .oracle-section > .section-heading {
    align-items: flex-start;
  }

  .oracle-form,
  .oracle-result {
    width: 100%;
  }

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

  .codex article {
    min-height: auto;
  }

  .codex-formula {
    align-items: flex-start;
    flex-direction: column;
  }

  .codex-formula code {
    width: 100%;
    text-align: center;
  }

}

/* ==========================================================================
   14. INTRO CARD AND FOOTER POLISH
   ========================================================================== */
html,
body {
  background-color: var(--night);
}

.hero {
  display: block;
  width: min(100%, 1180px);
  max-width: 1180px;
  min-height: auto;
  margin: 0 auto;
  padding: clamp(3.5rem, 7vw, 6rem) 4vw clamp(3rem, 6vw, 5rem);
  text-align: left;
}

.hero__eyebrow {
  margin: 0 0 1rem;
  color: var(--gold);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 5.6rem);
  line-height: 1;
  text-wrap: balance;
}

.hero__copy {
  max-width: 720px;
  margin: 1.35rem 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  line-height: 1.55;
}

.hero__features {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: 1.6rem;
}

.hero__features span {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  padding: .42rem .78rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .045);
  color: var(--ink);
  font-size: .84rem;
  font-weight: 700;
}

.site-footer {
  width: min(calc(100% - 2rem), 1380px);
  max-width: 1380px;
  margin: 3rem auto 0;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(145deg, rgba(52, 32, 68, .72), rgba(18, 11, 25, .92));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 1.5rem;
  color: var(--muted);
  box-shadow: 0 -12px 35px rgba(0, 0, 0, .16);
}

.footer-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .45rem;
}

.footer-brand {
  font-family: Cinzel,
  serif;
  color: var(--ink);
  font-weight: 700;
}

.footer-divider {
  color: var(--gold);
}

.footer-credit {
  color: var(--muted);
  font-size: .88rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  justify-content: flex-end;
}

.footer-links button {
  min-height: 2.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(243, 201, 105, .08);
  color: var(--ink);
  padding: .45rem .85rem;
  text-decoration: none;
  font-weight: 700;
  transition: background .2s ease,
  transform .2s ease;
}

.footer-links button:hover {
  background: rgba(243, 201, 105, .16);
  transform: translateY(-1px);
}

dialog:not([open]) {
  display: none !important;
}

.info-dialog {
  margin: auto;
}

body > .toast:not(.show) {
  pointer-events: none;
}

@media (max-width: 720px) {
  .hero {
    padding: 3.25rem 1rem 3.75rem;
  }

  .hero h1 {
    font-size: clamp(2.55rem, 13vw, 4.35rem);
  }

  .hero__features {
    gap: .5rem;
  }

  .site-footer {
    width: calc(100% - 1rem);
    padding: 1rem;
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }

}

/* ==========================================================================
   15. THEMED NAVIGATION AND BRAND ICONS
   ========================================================================== */
.hero {
  width: min(100%, 1120px);
  max-width: 1120px;
  margin-inline: auto;
  text-align: center;
}

.hero h1,
.hero__copy {
  margin-left: auto;
  margin-right: auto;
}

.hero__features {
  justify-content: center;
}

.brand__mark {
  width: 52px;
  height: 52px;
  padding: .45rem;
  border-radius: 16px;
}

.brand__mark svg,
.footer-brand svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.brand__mark svg path:first-child,
.footer-brand svg path:first-child {
  fill: var(--ink);
}

.brand__mark .bottle-liquid,
.footer-brand .bottle-liquid {
  fill: #9f6ac4;
}

.brand__mark .bottle-bubble {
  fill: #fff8cf;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .55rem;
}

.nav-pill {
  min-height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(243, 201, 105, .08);
  color: var(--ink);
  padding: .48rem .85rem;
  text-decoration: none;
  font: inherit;
  font-size: .84rem;
  font-weight: 700;
  transition: background .2s ease,
  transform .2s ease;
}

.nav-pill:hover {
  background: rgba(243, 201, 105, .16);
  transform: translateY(-1px);
}

.oracle-section {
  width: 100%;
  max-width: 1450px;
  margin-inline: auto;
}

.oracle-section > .section-heading,
.oracle-grid {
  width: 100%;
  max-width: none;
}

.oracle-form,
.oracle-result {
  width: 100%;
  max-width: none;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.footer-brand svg {
  width: 28px;
  height: 28px;
}

.toast {
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 1rem);
}

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

body > .toast:not(.show) {
  display: none !important;
}

dialog:not([open]) {
  display: none !important;
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
  }

  .header-actions {
    max-width: 60%;
  }

}

@media (max-width: 720px) {
  .site-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    max-width: none;
    justify-content: flex-start;
  }

  .nav-pill {
    font-size: .78rem;
  }

}

/* ==========================================================================
   16. FINAL NAVIGATION, INTRO, CODEX, AND FOOTER LAYOUT
   ========================================================================== */
.brand small {
  display: none;
}

.header-actions {
  gap: .65rem;
}

.nav-pill {
  min-width: 150px;
  padding: .55rem .85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .05rem;
  line-height: 1.2;
  text-align: center;
}

.nav-pill strong {
  font-size: .86rem;
}

.nav-pill small {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 600;
}

.hero {
  width: min(100%, 980px);
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 4rem) 4vw;
  text-align: left;
}

.hero-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: clamp(1.25rem, 3vw, 1.8rem);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(52,32,68,.74), rgba(18,11,25,.92));
  box-shadow: var(--shadow);
}

.hero-card__icon {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  padding: .7rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(243,201,105,.08);
}

.hero-card__icon svg {
  width: 100%;
  height: 100%;
}

.hero-card__icon svg path:first-child {
  fill: var(--ink);
}

.hero-card__icon .bottle-liquid {
  fill: #9f6ac4;
}

.hero h1 {
  max-width: none;
  margin: 0 0 .45rem;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.1;
  text-align: left;
}

.hero-card p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(.98rem, 1.6vw, 1.12rem);
  line-height: 1.55;
}

.hero__eyebrow,
.hero__features {
  display: none !important;
}

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

.codex article {
  min-height: 210px;
}

.site-footer {
  align-items: center;
}

.footer-identity {
  display: block;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.footer-brand > span {
  display: flex;
  flex-direction: column;
  gap: .08rem;
}

.footer-brand strong {
  font-family: Cinzel,
  serif;
  color: var(--ink);
  font-size: .95rem;
}

.footer-brand small {
  color: var(--muted);
  font-family: "DM Sans",
  system-ui,
  sans-serif;
  font-size: .72rem;
  font-weight: 500;
}

.footer-divider,
.footer-credit {
  display: none !important;
}

@media (max-width: 1180px) {
  .codex-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

}

@media (max-width: 900px) {
  .header-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    max-width: none;
  }

  .nav-pill {
    min-width: 0;
  }

}

@media (max-width: 720px) {
  .hero-card {
    align-items: flex-start;
  }

  .hero-card__icon {
    width: 58px;
    height: 58px;
  }

  .header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .3rem;
    width: 100%;
  }

  .nav-pill {
    width: clamp(11rem, 52vw, 13rem);
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    padding: .3rem .65rem;
    border-radius: 10px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    text-align: left;
  }

  .nav-pill strong {
    font-size: .78rem;
    line-height: 1.1;
  }

  .nav-pill small {
    font-size: .62rem;
    line-height: 1.1;
  }

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

}

/* ==========================================================================
   17. ENCHANTED HERO SPELLBOOK
   ========================================================================== */
.hero-card__icon--spellbook {
  width: 82px;
  height: 82px;
  padding: 0.45rem;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: radial-gradient( circle at 50% 40%, rgba(159, 106, 196, 0.18), transparent 52% ),
  rgba(243, 201, 105, 0.06);
}

.hero-card__icon--spellbook svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 7px 9px rgba(0, 0, 0, 0.28)) drop-shadow(0 0 9px rgba(159, 106, 196, 0.2));
}

.spellbook-float {
  transform-box: fill-box;
  transform-origin: center;
  animation: spellbook-float 4.5s ease-in-out infinite;
}

.spellbook-cover {
  fill: #4d315f;
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linejoin: round;
}

.spellbook-cover--left {
  fill: #432954;
}

.spellbook-cover--right {
  fill: #563668;
}

.spellbook-pages {
  fill: #f8edc9;
  stroke: rgba(48, 35, 54, 0.34);
  stroke-width: 1;
}

.spellbook-binding {
  fill: none;
  stroke: #c9a454;
  stroke-width: 2;
  stroke-linecap: round;
}

.spellbook-line {
  fill: none;
  stroke: rgba(77, 49, 95, 0.34);
  stroke-width: 1.4;
  stroke-linecap: round;
}

.spellbook-glyph {
  transform-box: fill-box;
  transform-origin: center;
  animation: spellbook-glow 2.8s ease-in-out infinite;
}

.spellbook-glyph-ring {
  fill: rgba(159, 106, 196, 0.13);
  stroke: #9f6ac4;
  stroke-width: 1.8;
}

.spellbook-star {
  fill: #9f6ac4;
  filter: drop-shadow(0 0 5px rgba(159, 106, 196, 0.8));
}

.spellbook-spark,
.spellbook-dot {
  fill: #f3c969;
  transform-box: fill-box;
  transform-origin: center;
  animation: spellbook-sparkle 2.4s ease-in-out infinite;
}

.spellbook-spark--two,
.spellbook-dot--two {
  animation-delay: -1.1s;
}

@keyframes spellbook-float {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }

  50% {
    transform: translateY(-5px) rotate(1deg);
  }

}

@keyframes spellbook-glow {
  0%,
  100% {
    opacity: 0.82;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.08);
  }

}

@keyframes spellbook-sparkle {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.15);
  }

}

@media (max-width: 720px) {
  .hero-card__icon--spellbook {
    width: 64px;
    height: 64px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .spellbook-float,
  .spellbook-glyph,
  .spellbook-spark,
  .spellbook-dot {
    animation: none;
  }

}

/* ==========================================================================
   18. PALETTE ORACLE — FLOATING SCRYING ORB
   ========================================================================== */

.oracle-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 5.25rem;
  height: 5.25rem;
  flex: 0 0 auto;
  overflow: visible;
  background: transparent;
}

.oracle-orb svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter:
    drop-shadow(0 0 12px rgba(159, 106, 196, 0.34))
    drop-shadow(0 10px 12px rgba(40, 20, 52, 0.32));
}

.oracle-orb__float {
  transform-box: fill-box;
  transform-origin: center;
  animation: oracle-orb-float 4.8s ease-in-out infinite;
}

.oracle-orb__shadow {
  fill: rgba(36, 20, 51, 0.3);
  filter: blur(2px);
  transform-origin: center;
  animation: oracle-shadow-pulse 4.8s ease-in-out infinite;
}

.oracle-orb__glass {
  fill: rgba(79, 47, 102, 0.92);
  stroke: #f8edc9;
  stroke-width: 2.3;
}

.oracle-orb__mist {
  opacity: 0.82;
  transform-box: fill-box;
  transform-origin: center;
}

.oracle-orb__mist--one {
  fill: #9f6ac4;
  animation: oracle-mist-shift 5.5s ease-in-out infinite;
}

.oracle-orb__mist--two {
  fill: #cf9ee8;
  opacity: 0.55;
  animation: oracle-mist-shift 4.4s ease-in-out infinite reverse;
}

.oracle-orb__glyph {
  transform-box: fill-box;
  transform-origin: center;
  animation: oracle-glyph-pulse 2.8s ease-in-out infinite;
}

.oracle-orb__glyph-ring {
  fill: rgba(248, 237, 201, 0.12);
  stroke: #f3c969;
  stroke-width: 1.6;
}

.oracle-orb__star {
  fill: #f8edc9;
  filter: drop-shadow(0 0 7px rgba(248, 237, 201, 0.9));
}

.oracle-orb__highlight {
  fill: none;
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 3;
  stroke-linecap: round;
}

.oracle-orb__spark,
.oracle-orb__dot {
  fill: #f3c969;
  transform-box: fill-box;
  transform-origin: center;
  animation: oracle-sparkle 2.5s ease-in-out infinite;
}

.oracle-orb__spark--two,
.oracle-orb__dot--two {
  animation-delay: -1.2s;
}

@keyframes oracle-orb-float {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }

  50% {
    transform: translateY(-7px) rotate(1deg);
  }
}

@keyframes oracle-shadow-pulse {
  0%,
  100% {
    opacity: 0.26;
    transform: scaleX(1);
  }

  50% {
    opacity: 0.16;
    transform: scaleX(0.82);
  }
}

@keyframes oracle-mist-shift {
  0%,
  100% {
    transform: translateX(-2px) scale(1);
  }

  50% {
    transform: translateX(3px) scale(1.06);
  }
}

@keyframes oracle-glyph-pulse {
  0%,
  100% {
    opacity: 0.85;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes oracle-sparkle {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.75);
  }

  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .oracle-orb__float,
  .oracle-orb__shadow,
  .oracle-orb__mist,
  .oracle-orb__glyph,
  .oracle-orb__spark,
  .oracle-orb__dot {
    animation: none;
  }
}

/* ==========================================================================
   19. SHARED HEADER AND FOOTER POTION-BOTTLE ARTWORK
   ========================================================================== */
.brand__mark svg,
.footer-brand svg {
  display: block;
  width: 100%;
  height: 100%;
  flex: 0 0 auto;
}

.bottle-shell {
  fill: var(--ink);
}

.bottle-liquid {
  fill: #9f6ac4;
}

.bottle-bubble {
  fill: #fff8cf;
}

.footer-brand svg {
  width: 28px;
  height: 28px;
}

/* ==========================================================================
   20. WARM EMBER ACCENTS
   ========================================================================== */

body {
  background:
    radial-gradient(
      circle at 12% 18%,
      rgba(217, 119, 50, 0.08),
      transparent 24%
    ),
    radial-gradient(
      circle at 88% 72%,
      rgba(242, 166, 90, 0.06),
      transparent 26%
    ),
    radial-gradient(
      circle at 50% -10%,
      #39214a 0,
      #171021 42%,
      #0c0912 100%
    );
}

.brand__mark {
  border-color: rgba(217, 119, 50, 0.48);
  background:
    radial-gradient(
      circle at 35% 25%,
      rgba(242, 166, 90, 0.16),
      transparent 42%
    ),
    rgba(243, 201, 105, 0.06);
  box-shadow:
    inset 0 0 0 1px rgba(243, 201, 105, 0.12),
    0 0 18px rgba(217, 119, 50, 0.08);
}

.nav-pill {
  border-color: rgba(217, 119, 50, 0.34);
  background:
    linear-gradient(
      145deg,
      rgba(217, 119, 50, 0.08),
      rgba(243, 201, 105, 0.04)
    );
}

.nav-pill:hover {
  border-color: rgba(242, 166, 90, 0.64);
  background:
    linear-gradient(
      145deg,
      rgba(217, 119, 50, 0.18),
      rgba(243, 201, 105, 0.1)
    );
  box-shadow: 0 8px 20px rgba(217, 119, 50, 0.12);
}

.hero-card {
  border-color: rgba(217, 119, 50, 0.36);
  background:
    radial-gradient(
      circle at 12% 24%,
      rgba(217, 119, 50, 0.11),
      transparent 34%
    ),
    linear-gradient(
      145deg,
      rgba(52, 32, 68, 0.78),
      rgba(18, 11, 25, 0.94)
    );
}

.hero-card__icon {
  border-color: rgba(242, 166, 90, 0.46);
  box-shadow:
    inset 0 0 0 1px rgba(243, 201, 105, 0.08),
    0 0 20px rgba(217, 119, 50, 0.08);
}

.section-heading h2 {
  text-shadow: 0 0 24px rgba(217, 119, 50, 0.1);
}

.ingredient__number {
  border-color: var(--ember);
  background: rgba(217, 119, 50, 0.08);
  color: #5f3218;
}

.swap-button {
  color: #6e351c;
}

.swap-button:hover {
  color: #9a471e;
}

.hanging-sign {
  border-color: rgba(217, 119, 50, 0.48);
  color: var(--ember-light);
  box-shadow: 0 7px 18px rgba(217, 119, 50, 0.1);
}

.cauldron-stage {
  border-color: rgba(217, 119, 50, 0.3);
  background:
    radial-gradient(
      circle at 50% 37%,
      rgba(217, 119, 50, 0.12),
      transparent 22%
    ),
    radial-gradient(
      circle at 50% 37%,
      rgba(105, 67, 119, 0.55),
      transparent 32%
    ),
    linear-gradient(180deg, #271532, #120b19);
}

.ratio {
  text-shadow:
    0 0 22px rgba(243, 201, 105, 0.16),
    0 0 32px rgba(217, 119, 50, 0.1);
}

.rank-seal {
  border-color: #9a5428;
  background: rgba(217, 119, 50, 0.12);
}

.repair-box {
  border-color: rgba(217, 119, 50, 0.42);
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.24),
      rgba(217, 119, 50, 0.08)
    );
}

.repair-box__icon {
  color: var(--ember);
}

.oracle-button {
  background:
    linear-gradient(
      135deg,
      #4a2c50,
      #6c3627
    );
  box-shadow:
    inset 0 0 0 2px rgba(242, 166, 90, 0.72),
    0 0.5rem 1.2rem rgba(83, 38, 29, 0.24);
}

.oracle-button:hover {
  box-shadow:
    inset 0 0 0 2px var(--ember-light),
    0 0.7rem 1.5rem rgba(217, 119, 50, 0.22);
}

.oracle-result {
  border-color: rgba(217, 119, 50, 0.48);
  background:
    radial-gradient(
      circle at 82% 12%,
      rgba(217, 119, 50, 0.1),
      transparent 30%
    ),
    linear-gradient(145deg, #22152d, #120d19);
}

.codex article {
  border-color: rgba(217, 119, 50, 0.28);
}

.codex article:nth-child(even) {
  background:
    linear-gradient(
      145deg,
      rgba(217, 119, 50, 0.055),
      rgba(255, 255, 255, 0.025)
    );
}

.codex-rune {
  border-color: rgba(217, 119, 50, 0.5);
  box-shadow: inset 0 0 14px rgba(217, 119, 50, 0.08);
}

.codex-formula {
  border-color: rgba(217, 119, 50, 0.34);
  background:
    linear-gradient(
      145deg,
      rgba(243, 201, 105, 0.07),
      rgba(217, 119, 50, 0.07)
    );
}

.site-footer {
  position: relative;
  overflow: hidden;
  padding: 1.75rem 1.35rem 1.25rem;
  border-color: rgba(217, 119, 50, 0.38);
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background:
    linear-gradient(
      90deg,
      #9f6ac4,
      var(--ember),
      var(--gold) 50%,
      var(--ember),
      #9f6ac4
    );
  box-shadow: 0 5px 18px rgba(217, 119, 50, 0.22);
}

.footer-links button {
  border-color: rgba(217, 119, 50, 0.38);
}

.footer-links button:hover {
  border-color: rgba(242, 166, 90, 0.68);
  background: rgba(217, 119, 50, 0.16);
}

.dialog-card::before {
  background:
    linear-gradient(
      90deg,
      #9f6ac4,
      var(--ember),
      var(--gold) 50%,
      var(--ember),
      #9f6ac4
    );
  box-shadow: 0 5px 18px rgba(217, 119, 50, 0.24);
}

.dialog-card h3 {
  border-top-color: rgba(217, 119, 50, 0.3);
  color: var(--ember-light);
}

.dialog-close {
  border-color: rgba(217, 119, 50, 0.55);
  background: rgba(217, 119, 50, 0.08);
}

.dialog-close:hover {
  background: rgba(217, 119, 50, 0.18);
}

.spellbook-binding {
  stroke: var(--ember-light);
}

.spellbook-spark,
.spellbook-dot,
.oracle-orb__spark,
.oracle-orb__dot {
  fill: var(--ember-light);
}

/* ==========================================================================
   21. CENTERED INTRO AND ANIMATED SECTION-TITLE ICONS
   ========================================================================== */

.hero-card {
  justify-content: center;
  text-align: center;
}

.hero-card > div {
  width: 100%;
}

.hero h1 {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.hero-card p {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.section-heading__title {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-width: 0;
}

.section-heading__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  overflow: visible;
}

.section-heading__icon svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.codex-heading {
  align-items: center;
}

.codex-heading__icon {
  width: 50px;
  height: 50px;
  flex-basis: 50px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.codex-heading__icon svg {
  filter:
    drop-shadow(0 4px 6px rgba(0, 0, 0, .24))
    drop-shadow(0 0 7px rgba(159, 106, 196, .2));
}

.cauldron-heading__icon {
  filter:
    drop-shadow(0 4px 6px rgba(0, 0, 0, .28))
    drop-shadow(0 0 8px rgba(217, 119, 50, .18));
}

.title-cauldron {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: title-cauldron-rock 4s ease-in-out infinite;
}

.title-cauldron__pot {
  fill: #4d315f;
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linejoin: round;
}

.title-cauldron__handle,
.title-cauldron__rim,
.title-cauldron__potion,
.title-cauldron__feet {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.title-cauldron__handle {
  stroke: #c9a454;
  stroke-width: 2.5;
}

.title-cauldron__rim {
  stroke: var(--ink);
  stroke-width: 2.2;
}

.title-cauldron__potion {
  stroke: var(--ember-light);
  stroke-width: 4;
  filter: drop-shadow(0 0 5px rgba(242, 166, 90, .72));
}

.title-cauldron__feet {
  stroke: var(--ink);
  stroke-width: 2.4;
}

.title-cauldron__bubble {
  fill: var(--gold);
  transform-box: fill-box;
  transform-origin: center;
  animation: title-cauldron-bubble 2.2s ease-in-out infinite;
}

.title-cauldron__bubble--two {
  animation-delay: -1.1s;
}

.title-cauldron__steam {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.2;
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: title-cauldron-steam 2.8s ease-in-out infinite;
}

.title-cauldron__steam--two {
  animation-delay: -.9s;
}

.title-cauldron__steam--three {
  animation-delay: -1.7s;
}

@keyframes title-cauldron-rock {
  0%,
  100% {
    transform: rotate(-1.5deg);
  }

  50% {
    transform: translateY(-1px) rotate(1.5deg);
  }
}

@keyframes title-cauldron-steam {
  0%,
  100% {
    opacity: .25;
    transform: translateY(2px) scaleY(.9);
  }

  50% {
    opacity: 1;
    transform: translateY(-4px) scaleY(1.08);
  }
}

@keyframes title-cauldron-bubble {
  0%,
  100% {
    opacity: .45;
    transform: translateY(1px) scale(.78);
  }

  50% {
    opacity: 1;
    transform: translateY(-3px) scale(1.12);
  }
}

@media (max-width: 720px) {
  .section-heading__title {
    gap: .65rem;
  }

  .section-heading__icon {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  .codex-heading__icon {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .title-cauldron,
  .title-cauldron__steam,
  .title-cauldron__bubble {
    animation: none;
  }
}

/* ==========================================================================
   22. OFFICIAL WCAG INFORMATION CARD
   ========================================================================== */

.codex-reference {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 1rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid rgba(217, 119, 50, .34);
  border-radius: 18px;
  background:
    linear-gradient(
      145deg,
      rgba(243, 201, 105, .07),
      rgba(217, 119, 50, .07)
    );
}

.codex-reference__content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.codex-reference__rune {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border: 1px solid rgba(217, 119, 50, .46);
  border-radius: 50%;
  color: var(--gold);
  font-family: Cinzel, serif;
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: inset 0 0 14px rgba(217, 119, 50, .08);
}

.codex-reference h3 {
  margin: 0 0 .25rem;
  font-size: 1rem;
}

.codex-reference p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.codex-reference__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  flex: 0 0 auto;
  padding: .75rem 1rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: linear-gradient(135deg, #e5b950, #a97425);
  color: #160e1f;
  box-shadow: 0 10px 30px rgba(243, 201, 105, .14);
  font-weight: 800;
  text-decoration: none;
  transition:
    transform .2s ease,
    box-shadow .2s ease;
}

.codex-reference__link:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(243, 201, 105, .2);
}

@media (max-width: 620px) {
  .codex-reference {
    align-items: flex-start;
    flex-direction: column;
  }

  .codex-reference__link {
    width: 100%;
  }
}

