/* Ask the Oracle · ElysiumBox. Visual system: 05 "Elysian Engraving" (parchment, engraving ink, gold leaf, Aegean blue). */
:root {
  --paper: #EFE6D2;
  --paper-deep: #E2D3B2;
  --ink: #1E1B16;
  --ink-soft: #3B342B;
  --muted: #6A5F50;
  --gold: #B8913A;
  --gold-hi: #DDBF73;
  --gold-lo: #8C6A26;
  --blue: #2F4A6B;
  --caps: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --serif: "Cormorant Garamond", "Garamond", Georgia, serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.45;
  background: var(--paper) url(../img/paper.webp?v=8a4eab47) repeat;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 70% at 50% 42%, transparent 55%, rgba(156, 126, 72, .26) 100%);
}
main, header, footer { position: relative; }
a { color: inherit; }
img { max-width: 100%; }
.wrap { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }

/* Greek-key border, same unit as the banner */
.band { position: relative; height: 30px; background: url(../img/meander.svg?v=8a4eab47) repeat-x 0 0 / 20px 30px; }
.band--bottom { transform: scaleY(-1); margin-top: 28px; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0 8px; }
.brand { font: 700 21px/1 var(--caps); letter-spacing: .3em; text-decoration: none; padding-left: .3em; }
.follow {
  font: 700 12px/1 var(--caps); letter-spacing: .2em; text-transform: uppercase; text-decoration: none;
  border: 1.5px solid var(--ink); padding: 10px 14px 10px calc(14px + .2em); background: var(--paper);
  transition: background .15s, color .15s;
}
.follow:hover { background: var(--ink); color: var(--paper); }

/* hero */
.hero { text-align: center; padding-top: 18px; }
.frieze { position: relative; padding: 12px 0; margin: 0 auto; max-width: 860px; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.frieze::before, .frieze::after {
  content: ""; position: absolute; left: 0; right: 0; height: 7px;
  background: repeating-linear-gradient(to bottom, var(--ink) 0 1px, transparent 1px 2.5px);
  opacity: .8;
}
.frieze::before { top: -11px; }
.frieze::after { bottom: -11px; }
.frieze span { font: 700 clamp(13px, 2vw, 19px)/1 var(--caps); letter-spacing: .42em; padding-left: .42em; text-transform: uppercase; }
.title { font: italic 600 clamp(42px, 6.4vw, 76px)/1.02 var(--serif); margin: 40px 0 10px; letter-spacing: -.005em; }
.lede { max-width: 640px; margin: 0 auto; font-size: clamp(18px, 2.1vw, 22px); color: var(--ink-soft); }

.shrine { display: grid; grid-template-columns: 1fr minmax(0, 520px) 1fr; align-items: end; gap: 28px; margin-top: 18px; }
.col { height: min(600px, 62vw); width: auto; justify-self: end; display: block; user-select: none; }
.col--r { justify-self: start; }
.stage { position: relative; width: 100%; max-width: 520px; aspect-ratio: 560 / 720; justify-self: center; }
.oracle { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .8s ease; user-select: none; }
.stage.has-card .oracle, .stage.has-card .flames { opacity: .5; }
/* the fire's glow breathes slowly */
.stage::before {
  content: ""; position: absolute; left: 14%; right: 14%; top: 34%; height: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 232, 160, .7), rgba(221, 191, 115, .22) 58%, rgba(221, 191, 115, 0));
  animation: breathe 4.6s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { opacity: .45; transform: scale(.95); } 50% { opacity: 1; transform: scale(1.05); } }
/* the brazier flares while the Oracle listens */
.stage::after {
  content: ""; position: absolute; left: 18%; right: 18%; top: 44%; height: 36%; z-index: 1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 238, 180, .9), rgba(221, 191, 115, .35) 55%, rgba(221, 191, 115, 0));
  opacity: 0; transition: opacity .6s ease;
}
.stage.is-asking::after { animation: flare .7s ease-in-out infinite alternate; }
@keyframes flare { from { opacity: .2; transform: scale(.92); } to { opacity: .8; transform: scale(1.1); } }

/* live flames: every tongue flickers on its own clock */
.flames { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; transform-origin: 50% 70%; transition: transform .8s cubic-bezier(.3, .7, .3, 1), opacity .8s ease; }
.flames .tongue { transform-box: view-box; animation: flick var(--d, 1.4s) ease-in-out var(--dl, 0s) infinite; }
.flames .f1 { --d: 1.3s; --dl: -.35s; } .flames .f2 { --d: 1.65s; --dl: -.9s; } .flames .f3 { --d: 1.95s; --dl: -.15s; }
.flames .f4 { --d: 1.5s; --dl: -1.1s; } .flames .f5 { --d: 1.2s; --dl: -.6s; }
.flames .core { animation-name: flick-core; }
@keyframes flick {
  0%, 100% { transform: scale(1, 1) skewX(0deg); }
  22% { transform: scale(.965, 1.07) skewX(-2.6deg); }
  48% { transform: scale(1.025, .93) skewX(1.4deg); }
  74% { transform: scale(.98, 1.05) skewX(2.8deg); }
}
@keyframes flick-core {
  0%, 100% { transform: scale(1, 1) skewX(0deg); }
  30% { transform: scale(.93, 1.14) skewX(2deg); }
  60% { transform: scale(1.05, .86) skewX(-2deg); }
}
.stage.is-asking .flames { transform: scale(1.2); }
.stage.is-asking .flames .tongue { animation-duration: calc(var(--d) * .5); }
/* soft smoke and embers (fx.js), between the fire and the card */
.smoke { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

/* the card */
.card {
  position: absolute; left: 50%; top: 2.5%; width: 60%; aspect-ratio: 500 / 780; z-index: 2;
  perspective: 1600px; container-type: inline-size; pointer-events: none;
  transform: translate(-50%, 52%) scale(.16); opacity: 0;
  transition: transform 1.15s cubic-bezier(.2, .85, .2, 1), opacity .5s ease;
}
.card.is-up { transform: translate(-50%, 0) scale(1); opacity: 1; pointer-events: auto; }
.card__inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .95s cubic-bezier(.35, .7, .2, 1); }
.card.is-flipped .card__inner { transform: rotateY(180deg); }
.card__face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 2.5cqw 7cqw rgba(60, 40, 10, .38), 0 .4cqw 0 rgba(0, 0, 0, .12);
}
.card__back img { display: block; width: 100%; height: 100%; }
.card__front {
  transform: rotateY(180deg);
  background: var(--paper) url(../img/paper.webp?v=8a4eab47);
  border: .9cqw solid var(--ink);
  box-shadow: inset 0 0 0 1.5cqw var(--paper), inset 0 0 0 2.1cqw var(--gold), inset 0 0 0 2.8cqw var(--paper), inset 0 0 0 3.1cqw var(--ink),
    0 2.5cqw 7cqw rgba(60, 40, 10, .38), 0 .4cqw 0 rgba(0, 0, 0, .12);
  padding: 7cqw 7cqw 5cqw;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.card__num { display: flex; align-items: center; gap: 3cqw; font: 700 5.4cqw/1 var(--caps); letter-spacing: .3em; }
.card__num span { padding-left: .3em; }
.card__num i { display: block; width: 9cqw; height: 1px; background: var(--ink); position: relative; }
.card__num i::after { content: ""; position: absolute; top: -1.1cqw; width: 2.2cqw; height: 2.2cqw; background: var(--gold); border: 1px solid var(--ink); transform: rotate(45deg); }
.card__num i:first-child::after { left: -1cqw; }
.card__num i:last-child::after { right: -1cqw; }
.card__art { width: 96%; height: auto; display: block; margin: 3cqw 0 2.6cqw; }
.card__title { font: 700 7.4cqw/1.1 var(--caps); letter-spacing: .12em; text-transform: uppercase; margin: 0; padding-left: .12em; }
.card__verdict {
  font: 700 4.2cqw/1 var(--caps); letter-spacing: .36em; padding: 1.3cqw 3.2cqw 1.3cqw calc(3.2cqw + .36em);
  margin: 2.6cqw 0 2.8cqw; border: .45cqw solid var(--ink);
}
.card__verdict[data-v="HOLD"] { background: var(--blue); color: var(--paper); }
.card__verdict[data-v="OPEN"] { background: var(--gold); color: var(--ink); }
.card__verdict[data-v="WAIT"] { background: var(--paper); color: var(--ink); }
.card__line { font: italic 600 7.6cqw/1.18 var(--serif); margin: 0; text-wrap: balance; }
.card__foot { margin-top: auto; padding-top: 2.4cqw; font: 700 3.2cqw/1 var(--caps); letter-spacing: .48em; padding-left: .48em; opacity: .62; }

/* steps under the shrine */
.steps { display: grid; justify-items: center; margin-top: -3px; }
.steps i {
  display: block; height: 15px; margin-top: -1.5px; border: 1.5px solid var(--ink);
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(30, 27, 22, .55) 2px 3px);
}
.steps i:nth-child(1) { width: 66%; }
.steps i:nth-child(2) { width: 74%; }
.steps i:nth-child(3) { width: 82%; }

/* buttons */
.actions { margin-top: 30px; display: flex; justify-content: center; }
.after { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.btn {
  display: inline-block; font: 700 14px/1 var(--caps); letter-spacing: .2em; text-transform: uppercase; text-decoration: none;
  color: var(--ink); background: var(--paper); border: 1.5px solid var(--ink);
  padding: 15px 24px 15px calc(24px + .2em); box-shadow: 3px 3px 0 var(--ink); cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .15s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn--primary { background: var(--ink); color: var(--paper); box-shadow: 3px 3px 0 var(--gold); }
.btn--primary:hover { box-shadow: 4px 4px 0 var(--gold); }
.btn--primary:active { box-shadow: 1px 1px 0 var(--gold); }
.btn:focus-visible, .follow:focus-visible, .brand:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.btn[disabled] { cursor: progress; transform: none; }
#ask { font-size: 16px; padding: 19px 36px 19px calc(36px + .2em); }
.hint { margin: 18px auto 0; font-style: italic; color: var(--muted); font-size: 18px; max-width: 520px; }

/* about */
.about { text-align: center; margin-top: 96px; }
.ornament { display: flex; align-items: center; justify-content: center; gap: 14px; }
.ornament i { width: min(140px, 28vw); height: 1.5px; background: var(--ink); }
.ornament b { width: 12px; height: 12px; background: var(--gold); border: 1.5px solid var(--ink); transform: rotate(45deg); }
.about h2 { font: 700 clamp(22px, 3vw, 30px)/1.2 var(--caps); letter-spacing: .16em; text-transform: uppercase; margin: 22px 0 34px; }
.tri { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; max-width: 980px; margin: 0 auto 40px; }
.tri__item img { width: min(100%, 280px); height: auto; display: block; margin: 0 auto; }
.tri__item h3 { font: 700 17px/1.2 var(--caps); letter-spacing: .22em; text-transform: uppercase; margin: 16px 0 6px; padding-left: .22em; }
.tri__item p { margin: 0 auto; max-width: 290px; font-size: 19px; color: var(--ink-soft); }
.tri__item a { text-decoration-color: var(--gold); text-underline-offset: 3px; }

.foot { text-align: center; margin-top: 88px; font-size: 16px; color: var(--muted); }
.foot p { margin: 4px 0; }
.foot a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: 3px; }

/* 404 */
.lost { text-align: center; padding: 80px 0 40px; }
.lost img { width: min(300px, 70vw); height: auto; }

@media (max-width: 900px) {
  .shrine { grid-template-columns: 1fr; }
  .col { display: none; }
  .stage { max-width: 480px; width: 100%; }
  .steps i:nth-child(1) { width: 86%; } .steps i:nth-child(2) { width: 93%; } .steps i:nth-child(3) { width: 100%; }
  .tri { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 600px) {
  body { font-size: 18px; }
  .brand { font-size: 16px; letter-spacing: .24em; }
  .follow { font-size: 10.5px; padding: 9px 10px 9px calc(10px + .2em); }
  .hero { padding-top: 10px; }
  .frieze { padding: 9px 0; }
  .title { margin-top: 26px; font-size: 38px; }
  .lede { font-size: 17px; line-height: 1.4; }
  .shrine { margin-top: 4px; }
  .stage { width: 90%; }
  .card { width: 76%; }
  .btn { font-size: 12.5px; padding: 14px 16px 14px calc(16px + .2em); }
  #ask { font-size: 14px; padding: 17px 26px 17px calc(26px + .2em); }
  .after { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .flames .tongue, .stage::before { animation: none; }
  .card, .card__inner, .oracle, .flames { transition: none; }
}
