:root {
  /* Arcanakin brand, drawn from the flame-in-the-void mark */
  --ak-void: #030306;
  --ak-indigo: #151667;
  --ak-violet: #6c30e6;      /* secondary */
  --ak-flame-tip: #c92fd2;
  --ak-magenta: #fa058a;     /* primary */
  --ak-ember: #f7502d;
  --ak-flame: linear-gradient(100deg, var(--ak-flame-tip), var(--ak-magenta) 55%, var(--ak-ember));

  /* Deck theme. Defaults are the brand; each deck overrides these (see theme.js). */
  --glow: 250, 5, 138;       /* r, g, b */
  --accent: #ff5fb4;         /* readable accent text on black */
  --accent-strong: #fa058a;  /* lines, borders, highlights */
  --hold: 250, 5, 138;       /* the colour that kindles while a card is held (r, g, b) */
  --hold-2: 247, 80, 45;     /* its base, where the light starts */

  --night: #000000;
  --night-2: #0c0b0e;
  --night-3: #1a1820;
  --ink: #2b2118;
  --paper: #f4ecdc;
  --paper-2: #eadfc8;
  --text: #efe9e4;
  --text-dim: #9d96a0;
  --line: rgba(239, 233, 228, 0.10);
  --radius: 14px;
  --display: "Cormorant Garamond", Georgia, serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
  font-variant-numeric: lining-nums;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: clip; /* nothing may push the page sideways on a phone */
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 600; text-decoration: none; letter-spacing: 0.02em; }
.brand-mark { width: 30px; height: 30px; filter: drop-shadow(0 0 8px rgba(255, 30, 120, 0.45)); }
.gate-logo { width: 96px; height: 96px; margin: 0 auto; filter: drop-shadow(0 0 22px rgba(255, 30, 120, 0.45)); }
.wordmark, .gate-mark { font-family: "Outfit", var(--body); font-weight: 500; letter-spacing: 0.01em; }
.wordmark span, .gate-mark span { background: var(--ak-flame); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topnav { display: flex; gap: 4px; }
.topnav a {
  text-decoration: none; font-size: 14px; color: var(--text-dim);
  padding: 6px 10px; border-radius: 999px;
}
.topnav a.active, .topnav a:hover { color: var(--text); background: transparent; text-shadow: 0 0 12px rgba(var(--glow), 0.7); }

main { max-width: 1080px; margin: 0 auto; padding: 24px 16px 48px; outline: none; }
.footer { text-align: center; color: var(--text-dim); font-size: 13px; padding: 24px 16px 40px; border-top: 1px solid var(--line); }

/* Deck home */
.hero { text-align: center; padding: 16px 0 28px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.18em; font-size: 12px; color: var(--accent); margin: 0 0 8px; }
.hero h1 { font-family: var(--display); font-weight: 600; font-size: clamp(38px, 8vw, 64px); line-height: 1.05; margin: 0 0 10px; }
.hero p { color: var(--text-dim); margin: 0 auto; max-width: 560px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--text); text-decoration: none; cursor: pointer; font-size: 15px;
  border-color: rgba(var(--glow), 0.35); box-shadow: 0 0 14px rgba(var(--glow), 0.12);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.btn:hover { border-color: rgba(var(--glow), 0.7); box-shadow: 0 0 22px rgba(var(--glow), 0.35); }
.btn.primary { background: rgba(var(--glow), 0.12); color: var(--accent); border-color: rgba(var(--glow), 0.7); font-weight: 600; box-shadow: 0 0 20px rgba(var(--glow), 0.3), inset 0 0 12px rgba(var(--glow), 0.12); }
.btn.primary:hover { box-shadow: 0 0 32px rgba(var(--glow), 0.55), inset 0 0 16px rgba(var(--glow), 0.2); }

.chapter { margin-top: 36px; }
.chapter-head { display: flex; gap: 14px; align-items: baseline; border-top: 1px solid var(--line); padding-top: 18px; margin-bottom: 16px; }
.chapter-range { font-feature-settings: "lnum" 1; font-family: var(--display); font-size: 22px; color: var(--accent); white-space: nowrap; }
.chapter-q { font-family: var(--display); font-style: italic; font-size: 21px; margin: 0; color: var(--text); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.grid a { text-decoration: none; }

/* Card face: chrome rendered by the app, art from the deck */
.card {
  --w: 100%;
  position: relative; width: var(--w); aspect-ratio: 7 / 12;
  background: var(--paper); color: var(--ink);
  border-radius: 12px; padding: 7%;
  box-shadow: 0 0 18px rgba(var(--glow), 0.28), 0 0 60px rgba(var(--glow), 0.14), inset 0 0 0 1px rgba(0,0,0,0.08);
  display: flex; flex-direction: column; align-items: center;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  animation: breathe 7s ease-in-out infinite;
}
.grid a:hover .card { transform: translateY(-6px); box-shadow: 0 0 26px rgba(var(--glow), 0.5), 0 0 90px rgba(var(--glow), 0.25); animation-play-state: paused; }
.grid a:nth-child(3n+1) .card { animation-delay: -2.3s; }
.grid a:nth-child(3n+2) .card { animation-delay: -4.6s; }
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 16px rgba(var(--glow), 0.22), 0 0 50px rgba(var(--glow), 0.10), inset 0 0 0 1px rgba(0,0,0,0.08); }
  50% { box-shadow: 0 0 24px rgba(var(--glow), 0.36), 0 0 80px rgba(var(--glow), 0.18), inset 0 0 0 1px rgba(0,0,0,0.08); }
}
.card::before {
  content: ""; position: absolute; inset: 4%;
  border: 1.5px solid var(--ink); border-radius: 7px; opacity: 0.55; pointer-events: none;
}
.card::after {
  content: ""; position: absolute; inset: 5.5%;
  border: 0.75px solid var(--ink); border-radius: 5px; opacity: 0.35; pointer-events: none;
}
.card-num { font-feature-settings: "lnum" 1; font-family: var(--display); font-weight: 600; font-size: clamp(13px, 1.6em, 26px); letter-spacing: 0.08em; margin-top: 2%; }
.card-art {
  flex: 1; width: 100%; margin: 4% 0; display: flex; align-items: center; justify-content: center; overflow: hidden;
  border-radius: 4px; background: var(--paper-2);
}
.card-art img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) sepia(0.35) contrast(1.15) brightness(1.02); mix-blend-mode: multiply; }
.card-art .glyph { width: 60%; opacity: 0.75; }
.card-name { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; text-align: center; font-size: clamp(11px, 1.15em, 20px); line-height: 1.15; margin-bottom: 2%; }
.grid .card { font-size: 12px; }

/* Card back */
.card-back { background: #050505; padding: 6%; color: var(--accent); }
.card-back::before, .card-back::after { border-color: var(--accent); opacity: 0.8; }
.card-back svg { width: 100%; height: 100%; }

/* Card detail */
.detail { display: grid; grid-template-columns: minmax(240px, 360px) 1fr; gap: 40px; align-items: start; }
.detail-card { position: sticky; top: 84px; }
.detail-card .card { font-size: 18px; }
.flip-hint { text-align: center; color: var(--text-dim); font-size: 13px; margin-top: 12px; }
.pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.pager a { font-size: 14px; color: var(--text-dim); text-decoration: none; }
.pager a:hover { color: var(--text); }

.detail h1 { font-family: var(--display); font-size: clamp(34px, 6vw, 52px); font-weight: 600; margin: 0; line-height: 1.05; }
.lineage { color: var(--text-dim); margin: 6px 0 20px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tab { background: none; border: 0; color: var(--text-dim); padding: 10px 12px; cursor: pointer; border-bottom: 2px solid transparent; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent-strong); }

.arc { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 26px; }
.arc div { background: var(--night-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.arc dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-dim); }
.arc dd { margin: 4px 0 0; font-family: var(--display); font-size: 20px; line-height: 1.15; }
.arc div:nth-child(4) { border-color: var(--accent-strong); }

.section-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent); margin: 26px 0 10px; }
.affirmations { list-style: none; padding: 0; margin: 0; }
.affirmations li { font-family: var(--display); font-size: 22px; line-height: 1.3; padding: 6px 0; }
.wisdom { font-family: var(--display); font-style: italic; font-size: 26px; line-height: 1.3; margin: 0; padding-left: 16px; border-left: 2px solid var(--accent-strong); }
.reflection { color: var(--text-dim); margin-top: 12px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare div { background: var(--night-2); border-radius: 10px; padding: 14px; border: 1px solid var(--line); }
.compare h4 { margin: 0 0 6px; font-size: 13px; color: var(--text-dim); font-weight: 500; }
.compare p { margin: 0; }
.questions { padding-left: 20px; margin: 0; }
.questions li { margin: 8px 0; }

.contributors { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--night-3); border-radius: 999px; padding: 6px 12px; font-size: 14px; text-decoration: none; }
.seeds { display: grid; gap: 10px; }
.seed { background: var(--night-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.seed h4 { margin: 0 0 4px; font-family: var(--display); font-size: 20px; }
.seed .by { color: var(--text-dim); font-size: 13px; }
.seed p { margin: 6px 0 0; }
.sketches { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.sketches button { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 8px; overflow: hidden; }
.sketches img { aspect-ratio: 2 / 3; object-fit: cover; width: 100%; }
.notes { color: var(--text-dim); padding-left: 18px; }
.muted { color: var(--text-dim); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(8, 8, 18, 0.92); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; cursor: zoom-out; }
.lightbox img { max-height: 92vh; width: auto; border-radius: 8px; }

/* Draw + spread */
.draw-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 8px; }
.draw-stage .intro { text-align: center; max-width: 520px; color: var(--text-dim); }
.draw-stage h1 { font-family: var(--display); font-weight: 600; font-size: 40px; margin: 0; color: var(--text); }
.flipper { width: min(300px, 78vw); perspective: 1400px; cursor: pointer; background: none; border: 0; padding: 0; }
.flipper-inner { position: relative; transition: transform 0.9s cubic-bezier(.2,.7,.2,1); transform-style: preserve-3d; }
.flipper.revealed .flipper-inner { transform: rotateY(180deg); }
.flipper .face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flipper .face.front { position: absolute; inset: 0; transform: rotateY(180deg); }
.flipper .card { font-size: 17px; }
.drawn-text { text-align: center; max-width: 560px; opacity: 0; transition: opacity 0.6s 0.6s; }
.drawn-text.show { opacity: 1; }
.drawn-text .wisdom { border: 0; padding: 0; margin: 10px 0; }

.spread { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; width: 100%; max-width: 760px; }
.spread .slot { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.spread .slot-label { text-transform: uppercase; letter-spacing: 0.16em; font-size: 12px; color: var(--accent); }
.spread .flipper { width: 100%; }
.spread .card { font-size: 11px; }
.spread .slot a { font-size: 14px; color: var(--text-dim); text-align: center; text-decoration: none; opacity: 0; transition: opacity 0.5s 0.6s; }
.spread .slot.revealed a { opacity: 1; }

/* Circle */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.person { background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.person h3 { margin: 0 0 8px; font-family: var(--display); font-size: 24px; font-weight: 600; }
.person ul { list-style: none; margin: 0; padding: 0; }
.person li a { text-decoration: none; color: var(--text-dim); }
.person li a:hover { color: var(--text); }

/* Access gate */
body.gate { display: flex; align-items: center; justify-content: center; padding: 16px; }
.gate-form { width: 100%; max-width: 360px; display: grid; gap: 12px; text-align: center; }
.gate-mark { font-size: 40px; margin: 0; }
.gate-form label { color: var(--text-dim); font-family: "Outfit", var(--body); font-weight: 300; font-size: 17px; letter-spacing: 0.02em; }
.gate-form input:focus { outline: none; border-color: rgba(250, 5, 138, 0.6); box-shadow: 0 0 16px rgba(250, 5, 138, 0.25); }
/* The Enter button rises into view once something has been typed. */
.gate-form button { transition: opacity 0.4s ease, transform 0.4s ease; }
.gate-form input:placeholder-shown ~ button { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.gate-form input { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--night-2); color: var(--text); font-size: 16px; }
.gate-form button { padding: 12px; border-radius: 999px; border: 0; background: var(--ak-flame); color: #fff; font-weight: 600; cursor: pointer; box-shadow: 0 0 22px rgba(250, 5, 138, 0.4); }
.gate-error { color: #f0a58f; margin: 0; }

/* Finished art keeps its colour; only raw sketches get the sepia placeholder treatment */
.card-art img.final { filter: none; mix-blend-mode: normal; }

/* The facilitator's welcome on the deck home */
.hero .intention { font-family: var(--display); font-style: italic; font-size: clamp(20px, 3.4vw, 26px); color: var(--text); max-width: 640px; }
.gathering { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; margin: 4px 0 8px; padding: 22px 0; border-top: 1px solid var(--line); }
.gathering-text .section-label, .reflect .section-label { margin-top: 0; }
.gathering-text p { color: var(--text); margin: 0 0 12px; max-width: 64ch; }
.reflect { border: 1px solid rgba(var(--glow), 0.35); border-radius: var(--radius); padding: 18px; box-shadow: 0 0 24px rgba(var(--glow), 0.10); align-self: start; }
.reflect p:last-child { font-family: var(--display); font-style: italic; font-size: 21px; line-height: 1.35; margin: 0; }

/* Spreads */
.spread-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.spread-option { display: flex; gap: 16px; align-items: center; text-decoration: none; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); transition: border-color 0.25s, box-shadow 0.25s; }
.spread-option:hover { border-color: rgba(var(--glow), 0.6); box-shadow: 0 0 22px rgba(var(--glow), 0.22); }
.spread-option strong { display: block; font-family: var(--display); font-size: 22px; font-weight: 600; }
.spread-option small { color: var(--text-dim); font-size: 13px; }
.mini-layout { flex: none; display: grid; grid-template-columns: repeat(var(--cols), 9px); grid-template-rows: repeat(var(--rows), 15px); gap: 3px; width: 72px; justify-content: center; align-content: center; }
.mini-card { background: rgba(var(--glow), 0.75); border-radius: 2px; box-shadow: 0 0 6px rgba(var(--glow), 0.5); }
.mini-card.cross { transform: rotate(90deg) scale(0.85); background: var(--accent); }

.layout { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: auto; gap: 14px 12px; width: min(100%, calc(var(--cols) * var(--cw))); align-items: start; }
.layout-three { --cw: 180px; }
.layout-cross { --cw: 130px; }
.layout-horseshoe { --cw: 118px; }
.layout-celtic { --cw: 112px; }
.layout .slot { display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; min-width: 0; }
.layout .slot-label { font-size: 11px; letter-spacing: 0.06em; color: var(--accent); text-align: center; line-height: 1.25; min-height: 2.5em; }
.layout .slot-label b { display: inline-block; min-width: 1.4em; color: var(--text-dim); font-weight: 500; }
.layout .rcard { width: 100%; }
.layout .slot.cross { z-index: 2; }
.layout .slot.cross .rcard { rotate: 90deg; scale: 0.78; translate: 0 calc(1.25em + 6px); }
.layout .slot.cross .slot-label { position: absolute; bottom: -2.8em; left: 0; right: 0; min-height: 0; }
.layout-celtic .slot.cross .slot-label, .layout-celtic .slot:first-child .slot-label { visibility: visible; }
.layout-celtic { gap: 26px 12px; }
.reading { list-style: none; padding: 0; margin: 10px 0 0; width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 10px; }
.reading li { border-left: 2px solid rgba(var(--glow), 0.6); padding: 4px 0 4px 14px; display: grid; gap: 2px; }
.reading-pos { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-dim); }
.reading a { font-family: var(--display); font-size: 21px; text-decoration: none; }
.reading-wisdom { color: var(--text-dim); font-style: italic; }

/* Faces */
.avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid rgba(var(--glow), 0.5); box-shadow: 0 0 12px rgba(var(--glow), 0.25); }
.avatar.initials { display: inline-flex; align-items: center; justify-content: center; background: var(--night-3); color: var(--text-dim); font-size: 15px; letter-spacing: 0.04em; box-shadow: none; border-color: var(--line); }
.person-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.person-head h3 { margin: 0; }
.faces { display: flex; flex-wrap: wrap; gap: 16px; }
.face-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); }

/* Shared form + panel pieces (join flow and studio) */
main.narrow { max-width: 640px; }
.hero.compact h1 { font-size: clamp(30px, 6vw, 44px); }
.panel { background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-top: 18px; }
fieldset { border: 0; padding: 0; margin: 0 0 26px; }
.q { font-family: var(--display); font-size: 22px; margin: 0 0 6px; padding: 0; color: var(--text); }
.q-hint { color: var(--text-dim); font-size: 14px; margin: 0 0 12px; }
.field { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: #000; color: var(--text); font-size: 16px; margin-top: 10px; }
.field:focus { outline: none; border-color: rgba(var(--glow), 0.6); box-shadow: 0 0 14px rgba(var(--glow), 0.2); }
.btn.wide { width: 100%; justify-content: center; margin-top: 8px; }
.actions.left { justify-content: flex-start; }
.form-error { color: #f0a58f; margin: 8px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip.pick { border: 1px solid var(--line); background: transparent; color: var(--text-dim); cursor: pointer; }
.chip.pick.on, .chip.pick:hover { color: var(--text); border-color: rgba(var(--glow), 0.6); box-shadow: 0 0 12px rgba(var(--glow), 0.25); }

.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.choice { display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: block; height: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; transition: border-color 0.2s, box-shadow 0.2s; }
.choice strong { display: block; font-family: var(--display); font-size: 20px; font-weight: 600; }
.choice small { color: var(--text-dim); font-size: 13px; }
.choice input:checked + span { border-color: rgba(var(--glow), 0.8); box-shadow: 0 0 18px rgba(var(--glow), 0.3), inset 0 0 12px rgba(var(--glow), 0.08); }
.choice input:focus-visible + span { outline: 2px solid rgba(var(--glow), 0.8); outline-offset: 2px; }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; text-align: center; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.dot { display: inline-block; width: 44px; height: 44px; border-radius: 50%; background: var(--c); border: 1px solid rgba(255,255,255,0.18); vertical-align: middle; transition: box-shadow 0.2s, transform 0.2s; }
.dot.small { width: 16px; height: 16px; margin-right: 8px; }
.brief .dot, .answer-line .dot { width: 26px; height: 26px; margin-right: 6px; }
.swatch-label { font-size: 12px; color: var(--text-dim); }
.swatch input:checked + .dot { transform: scale(1.08); box-shadow: 0 0 0 2px #000, 0 0 0 4px rgba(var(--glow), 0.9), 0 0 20px rgba(var(--glow), 0.5); }
.swatch input:disabled + .dot { opacity: 0.5; }
.swatch input:focus-visible + .dot { outline: 2px solid rgba(var(--glow), 0.8); outline-offset: 4px; }
.answer-line { font-size: 18px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }

/* Studio */
.brand-tag { font-family: var(--body); font-size: 12px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--text-dim); margin-left: 6px; }
.stages { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; scrollbar-width: none; }
.stages::-webkit-scrollbar { display: none; }
@media (max-width: 640px) { .stages { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); } }
.stage { display: flex; align-items: center; gap: 8px; white-space: nowrap; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-dim); font-size: 14px; opacity: 0.55; }
.stage.live { opacity: 1; }
.stage.active { color: var(--text); border-color: rgba(var(--glow), 0.7); box-shadow: 0 0 16px rgba(var(--glow), 0.3); }
.stage-n { font-size: 12px; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1px solid currentColor; }
.studio-head h1 { font-family: var(--display); font-size: clamp(32px, 6vw, 48px); font-weight: 600; margin: 0 0 6px; }
.share { display: grid; grid-template-columns: 1fr 1.2fr; gap: 16px; align-items: center; }
.share-row { display: flex; gap: 8px; align-items: center; }
.share-row .field { margin: 0; }
.share-row .btn { white-space: nowrap; }
.brief-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 10px 0 18px; }
.brief-k { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-dim); margin-bottom: 6px; }
.brief-v { font-family: var(--display); font-size: 22px; display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.brief-v small { font-family: var(--body); font-size: 13px; color: var(--text-dim); width: 100%; margin-top: 4px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.results { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 40%) 1fr 28px; align-items: center; gap: 10px; margin: 8px 0; font-size: 14px; }
.bar-label { display: flex; align-items: center; }
.bar { height: 8px; background: var(--night-3); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: rgba(var(--glow), 0.85); box-shadow: 0 0 10px rgba(var(--glow), 0.6); border-radius: 999px; }
.bar-n { text-align: right; color: var(--text-dim); }
.words { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; font-family: var(--display); }
.answered { columns: 2; padding-left: 18px; margin: 0; color: var(--text-dim); }
.studio-gate { margin: 10vh auto 0; }
.nav-join { color: var(--accent) !important; }

@media (max-width: 760px) {
  .detail { grid-template-columns: 1fr; gap: 24px; }
  .detail-card { position: static; max-width: 300px; margin: 0 auto; width: 100%; }
  .arc { grid-template-columns: repeat(2, 1fr); }
  .compare { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
  .grid .card { font-size: 10px; }
  .spread { gap: 8px; }
  .spread .card { font-size: 7px; }
  .topnav a { padding: 6px 8px; font-size: 13px; }
  .chapter-head { flex-direction: column; gap: 4px; }
  .share, .results, .brief-grid { grid-template-columns: 1fr; }
  .gathering { grid-template-columns: 1fr; }
  .layout { gap: 10px 6px; }
  .layout .slot-label { font-size: 9px; }
  .choices { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Selfie step */
.face-step { text-align: center; }
.face-frame { width: 220px; height: 220px; margin: 0 auto 12px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(var(--glow), 0.5); box-shadow: 0 0 30px rgba(var(--glow), 0.25); background: var(--night-3); }
.face-frame video, .face-frame img { width: 100%; height: 100%; object-fit: cover; }
.face-frame video { transform: scaleX(-1); }
.avatar.huge { width: 100%; height: 100%; border: 0; font-size: 60px; color: var(--text-dim); }
.avatar.large { width: 72px; height: 72px; font-size: 26px; }
.me-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.face-step .actions { justify-content: center; }
.face-step label.btn { cursor: pointer; }

/* Studio: set up */
a.stage { text-decoration: none; }
a.stage:hover { color: var(--text); border-color: rgba(var(--glow), 0.5); }
.setup-form .q { display: block; margin-top: 18px; }
.setup-form .q:first-child { margin-top: 0; }
.setup-form textarea.field { resize: vertical; font-family: var(--body); line-height: 1.5; }
.avatar.tiny { width: 22px; height: 22px; margin-right: 8px; vertical-align: middle; box-shadow: none; }
.answered { list-style: none; padding-left: 0; }
.answered li { display: flex; align-items: center; margin: 4px 0; }

/* Lineage examples */
.choice > span { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.choice-text { display: block; }
.examples { display: flex; gap: 4px; flex: none; padding: 0; border: 0; background: none; cursor: zoom-in; }
.examples img { width: 34px; height: 56px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); transition: transform 0.25s ease, box-shadow 0.25s ease; }
.examples:hover img, .examples:focus-visible img { transform: translateY(-3px) scale(1.12); box-shadow: 0 0 14px rgba(var(--glow), 0.35); }
.examples.soon { font-size: 11px; color: var(--text-dim); cursor: default; border: 1px dashed var(--line); border-radius: 6px; padding: 6px 8px; }
.gallery { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.9); display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.gallery-inner { max-width: 760px; width: 100%; text-align: center; }
.gallery-hint { color: var(--text-dim); margin: 0 0 18px; }
.gallery-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 18px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; max-height: 60vh; object-fit: contain; border-radius: 6px; box-shadow: 0 0 30px rgba(var(--glow), 0.18); }
.gallery figcaption { font-family: var(--display); font-size: 17px; margin-top: 8px; }
.gallery figcaption small { display: block; font-family: var(--body); font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.gallery figcaption a { color: var(--text-dim); }


/* ---------- The ritual: fan, hold, pause, emergence ---------- */
@property --reveal { syntax: '<percentage>'; inherits: false; initial-value: 0%; }

.ritual .intro { min-height: 0; }
.ritual-step { color: var(--text); transition: opacity 0.6s ease; min-height: 3em; }
.ritual-step.quiet { opacity: 0; }
.ritual-count { color: var(--accent); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; margin: 0; }
.ritual-area { --altar-w: min(260px, 62vw); position: relative; width: 100%; height: calc(var(--altar-w) * 12 / 7 + 30px); }
.altar { position: absolute; top: 0; left: 50%; width: var(--altar-w); transform: translateX(-50%); z-index: 3; }
.altar .rcard { opacity: 0; }

.fan-wrap { --fw: 84px; --fh: calc(var(--fw) * 12 / 7); width: 100%; height: calc(var(--fh) * 1.75 + 50px); transition: opacity 0.9s ease, transform 0.9s ease, height 0.8s ease 0.5s; }
.ritual-area .fan-wrap { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); }
.fan-wrap.sinking { opacity: 0; transform: translateY(40px); pointer-events: none; }
.ritual-area .fan-wrap.sinking { transform: translateY(calc(-50% + 50px)); }
.fan-wrap.collapse { height: 0; }
.fan { position: relative; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; }
.fan-card {
  position: absolute; left: 50%; bottom: calc(var(--fh) * 0.66 + 10px); width: var(--fw);
  transform-origin: 50% 300%;
  transform: translateX(-50%) rotate(var(--a, 0deg)) translateY(var(--lift, 0px));
  transition: transform 0.35s ease, filter 0.35s ease;
  animation: drift 6s ease-in-out infinite; animation-delay: var(--d, 0s);
  cursor: grab; outline: none;
}
.fan-card .card { font-size: 5px; animation: none; box-shadow: 0 0 10px rgba(var(--glow), 0.18), 0 6px 14px rgba(0, 0, 0, 0.6); }
/* The card under your finger rises above its neighbours (z-index is set inline per card). */
.fan-card.near, .fan-card.holding, .fan-card:focus-visible { z-index: 100 !important; }
.fan-card.near, .fan-card:focus-visible { --lift: -24px; filter: brightness(1.3) drop-shadow(0 0 14px rgba(var(--glow), 0.55)); }
.fan-card.holding { --lift: -32px; cursor: grabbing; animation: drift 6s ease-in-out infinite, kindle var(--hold-ms, 1200ms) linear forwards; }
@keyframes kindle {
  from { filter: brightness(1.25) drop-shadow(0 0 8px rgba(var(--hold), 0.45)); }
  to { filter: brightness(1.55) drop-shadow(0 0 28px rgba(var(--hold), 0.95)) drop-shadow(0 0 8px rgba(var(--hold-2), 0.8)); }
}
.fan-card .fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0; border-radius: 12px; pointer-events: none;
  background: linear-gradient(to top, rgba(var(--hold-2), 0.95), rgba(var(--hold), 0.75) 45%, rgba(var(--hold), 0));
  mix-blend-mode: screen;
}
.fan-card.holding .fill { height: 100%; transition: height var(--hold-ms, 1200ms) linear; }
.fan-done .fan-card { pointer-events: none; }
@keyframes drift { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }

.rcard { position: relative; container-type: inline-size; }
.rcard .card { font-size: 6.5cqw; }
.rcard.empty { aspect-ratio: 7 / 12; border: 1px dashed rgba(var(--glow), 0.28); border-radius: 12px; }
.rback { position: absolute; inset: 0; z-index: 2;
  -webkit-mask-image: radial-gradient(circle at 50% 60%, transparent var(--reveal), #000 calc(var(--reveal) + 14%));
  mask-image: radial-gradient(circle at 50% 60%, transparent var(--reveal), #000 calc(var(--reveal) + 14%)); }
.rface { filter: brightness(0.08) blur(10px) saturate(0.3); transform: scale(0.965); }
.rcard.waiting { cursor: pointer; animation: inhale 5s ease-in-out infinite; }
.rcard.waiting .rback .card { animation: breathe 2.5s ease-in-out infinite; }
.rcard.emerging .rback { --reveal: 130%; opacity: 0; transition: --reveal 2.4s cubic-bezier(.5, 0, .3, 1), opacity 0.6s ease 2.1s; }
.rcard.emerging .rface { filter: none; transform: none; transition: filter 2.9s cubic-bezier(.4, 0, .2, 1), transform 2.9s ease-out; }
.rcard::after { content: ""; position: absolute; inset: -30%; z-index: 3; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 58%, rgba(var(--glow), 0.55), rgba(var(--glow), 0) 55%); }
.rcard.emerging::after { animation: flare 2.9s ease-out; }
@keyframes inhale { 0%, 100% { scale: 1; } 50% { scale: 1.03; } }
@keyframes flare { 0% { opacity: 0; transform: scale(0.6); } 35% { opacity: 1; } 100% { opacity: 0; transform: scale(1.25); } }

.drawn-text { transition: none; opacity: 1; }
.drawn-text:not(.show) { display: none; }
.reveal-name { font-family: var(--display); font-weight: 600; font-size: clamp(34px, 7vw, 50px); margin: 0 0 6px; line-height: 1.05; }
.reveal-name span { display: inline-block; opacity: 0; transform: translateY(10px); filter: blur(5px); animation: letter 0.8s ease forwards; animation-delay: calc(var(--i) * 55ms); }
.drawn-text .eyebrow, .drawn-text .wisdom, .drawn-q, .drawn-text .actions { opacity: 0; animation: rise 1s ease forwards; }
.drawn-text .eyebrow { animation-delay: 0.1s; }
.drawn-text .wisdom { animation-delay: 1.1s; }
.drawn-q { animation-delay: 1.8s; color: var(--text-dim); }
.drawn-text .actions { animation-delay: 2.4s; }
@keyframes letter { to { opacity: 1; transform: none; filter: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.ritual-tools { display: flex; justify-content: center; }
.sound-toggle { background: none; border: 0; color: var(--text-dim); font-size: 13px; cursor: pointer; padding: 6px 10px; }
.sound-toggle[aria-pressed="true"] { color: var(--accent); }
.spread-fan { margin-bottom: 6px; }

@media (max-width: 760px) {
  .fan-wrap { --fw: 62px; }
}
@media (prefers-reduced-motion: reduce) {
  .fan-card { animation: none; }
  .rcard.waiting { animation: none; }
}


/* Navigation: icons only appear in the phone tab bar */
.nav-icon { display: none; width: 22px; height: 22px; }

@media (max-width: 640px) {
  /* backdrop-filter would make the header the containing block for the fixed tab bar */
  .topbar { padding: 10px 16px; backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(0, 0, 0, 0.94); }
  .topnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: flex; justify-content: space-around; gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, 0.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .topnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; font-size: 11px; border-radius: 10px; }
  .topnav a.active, .topnav a:hover { background: transparent; }
  .topnav a.active .nav-icon { filter: drop-shadow(0 0 6px rgba(var(--glow), 0.8)); color: var(--accent); }
  .nav-icon { display: block; }
  body:has(.topnav) { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
}


/* "In the place of": the info button beside a card's name, and its pop-up */
.name-row { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: inherit; }
h1.name-row, h2.name-row { display: flex; }
.reveal-name.name-row { justify-content: center; }
.info-btn {
  flex: none; width: 22px; height: 22px; border-radius: 50%; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-weight: 600; font-size: 15px; line-height: 1;
  color: var(--accent); background: transparent; border: 1px solid rgba(var(--glow), 0.55); cursor: pointer;
  box-shadow: 0 0 10px rgba(var(--glow), 0.2); transition: box-shadow 0.2s, border-color 0.2s;
}
.info-btn:hover, .info-btn[aria-expanded="true"] { border-color: rgba(var(--glow), 0.95); box-shadow: 0 0 16px rgba(var(--glow), 0.5); }
.reveal-name .info-btn { opacity: 0; animation: rise 0.8s ease 1.4s forwards; }
.tradition-pop {
  position: fixed; z-index: 70; padding: 16px 18px; border-radius: var(--radius);
  background: rgba(12, 11, 14, 0.97); border: 1px solid rgba(var(--glow), 0.4);
  box-shadow: 0 0 30px rgba(var(--glow), 0.18), 0 12px 30px rgba(0, 0, 0, 0.6);
  font-family: var(--body); text-align: left; animation: rise 0.25s ease;
}
.tradition-pop .eyebrow { margin-bottom: 10px; }
.tradition-pop dl { margin: 0; display: grid; gap: 8px; }
.tradition-pop dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-dim); }
.tradition-pop dd { margin: 2px 0 0; font-family: var(--display); font-size: 20px; color: var(--text); }
.tradition-pop dd small { font-family: var(--body); font-size: 12px; color: var(--text-dim); }
.pop-note { margin: 12px 0 0; font-size: 12px; color: var(--text-dim); line-height: 1.45; }


/* Footer links */
.footer a { color: var(--text-dim); }
.footer a:hover { color: var(--text); }
.footer .footer-brand { color: var(--text); font-weight: 600; text-decoration: none; }

/* ---------- Landing page (arcanakin.com) ---------- */
body.home { --glow: 250, 5, 138; --accent: #ff5fb4; --accent-strong: #fa058a; }
.home main { max-width: 980px; }
.home-nav { display: flex; gap: 4px; }
.home-nav a { text-decoration: none; font-size: 14px; color: var(--text-dim); padding: 6px 10px; }
.home-nav a:hover { color: var(--text); text-shadow: 0 0 12px rgba(var(--glow), 0.7); }
.home-hero { text-align: center; padding: 40px 0 10px; position: relative; }
.home-mark { width: 120px; height: 120px; margin: 0 auto 18px; filter: drop-shadow(0 0 30px rgba(250, 5, 138, 0.45)); animation: inhale 6s ease-in-out infinite; }
.home-hero h1 { font-family: var(--display); font-weight: 600; font-size: clamp(38px, 7.5vw, 66px); line-height: 1.04; margin: 0 auto 16px; max-width: 760px; }
.home-lede { color: var(--text-dim); font-size: 18px; max-width: 620px; margin: 0 auto; }
.home-cta { background: var(--ak-flame) !important; color: #fff !important; border: 0 !important; box-shadow: 0 0 24px rgba(250, 5, 138, 0.45) !important; }
.home-fan { position: relative; height: 170px; margin-top: 30px; }
.home-fan span {
  position: absolute; left: 50%; bottom: 0; width: 70px; aspect-ratio: 7 / 12; border-radius: 9px;
  background: #050505; border: 1px solid rgba(250, 5, 138, 0.55);
  box-shadow: 0 0 18px rgba(250, 5, 138, 0.25), inset 0 0 0 5px #050505, inset 0 0 0 6px rgba(250, 5, 138, 0.3);
  transform-origin: 50% 260%; transform: translateX(-50%) rotate(var(--a));
}
.home-fan span:nth-child(3) { background: linear-gradient(to top, rgba(247, 80, 45, 0.85), rgba(250, 5, 138, 0.55) 55%, #050505); box-shadow: 0 0 30px rgba(250, 5, 138, 0.55); }
.home-section { scroll-margin-top: 70px; padding: 46px 0 10px; border-top: 1px solid var(--line); margin-top: 36px; }
.home-section h2 { font-family: var(--display); font-weight: 600; font-size: clamp(28px, 5vw, 40px); line-height: 1.1; margin: 0 0 16px; max-width: 760px; }
.home-section h3 { font-family: var(--display); font-weight: 600; font-size: 22px; margin: 0 0 6px; }
.home-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.home-cols p, .home-narrow { color: var(--text); margin: 0 0 12px; max-width: 64ch; }
.home-steps { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.home-steps li { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--night-2); }
.home-steps p { color: var(--text-dim); margin: 0; }
.step-n { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; align-items: center; justify-content: center; font-size: 13px; color: var(--accent); border: 1px solid rgba(var(--glow), 0.55); box-shadow: 0 0 12px rgba(var(--glow), 0.25); margin-bottom: 10px; }
.home-tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.home-tags li { padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(var(--glow), 0.35); font-size: 15px; }
.home-start { text-align: center; }
.home-start h2, .home-start .home-narrow { margin-left: auto; margin-right: auto; }
.home-start .actions { margin: 18px 0; }
.home-small { color: var(--text-dim); font-size: 14px; }
.home-fine .home-narrow, .privacy p { color: var(--text-dim); font-size: 15px; }
.home-fine h3 { font-size: 19px; margin-top: 18px; }
.privacy { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 28px; }
.privacy h3 { margin-top: 14px; }
.home main a:not(.btn) { color: var(--accent); }
@media (max-width: 640px) {
  .home-nav { display: none; }
  .home-cols { grid-template-columns: 1fr; gap: 0; }
  .home-hero { padding-top: 20px; }
  .home-fan { height: 140px; }
  .home-fan span { width: 56px; }
}
