@font-face { font-family: "IM Fell English"; src: url(fonts/IMFellEnglish-400-latin.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url(fonts/IMFellEnglish-400i-latin.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IM Fell English SC"; src: url(fonts/IMFellEnglishSC-400-latin.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Cinzel; src: url(fonts/Cinzel-var.woff2) format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Cinzel Decorative"; src: url(fonts/CinzelDeco-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Pinyon Script"; src: url(fonts/PinyonScript-400-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; font-display: swap; }
@font-face { font-family: "Pinyon Script"; src: url(fonts/PinyonScript-400-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url(fonts/CormorantGaramond-400-latin.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url(fonts/CormorantGaramond-400i-latin.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

/* ── the Indigo plate palette, same as the poster ── */
:root {
  --paper: #1a2240; --paper2: #263052; --paper3: #0c1021; --deep: #080b17;
  --ink: #f0e4c6; --ink2: #d9cba8; --faint: #9f9477; --ghost: rgba(230,215,180,.3); --hair: rgba(240,228,198,.42);
  --gold: #d3b25c; --gold-hi: #f3dc92; --gold-lo: #a3842f;
  --fell: "IM Fell English", Georgia, serif; --sc: "IM Fell English SC", "IM Fell English", Georgia, serif; --cinzel: Cinzel, serif; --script: "Pinyon Script", "Snell Roundhand", cursive;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper3); color: var(--ink); font-family: var(--fell); font-size: 18px; line-height: 1.45; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
/* page frame like the plate: double hairline + gold corner flourishes */
.plate-frame { position: fixed; inset: 14px; z-index: 1; pointer-events: none; border: 1px solid var(--hair); }
.plate-frame::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(240,228,198,.18); }
.plate-frame i { position: absolute; width: 46px; height: 46px; background: no-repeat center / contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'><path d='M2 30Q2 2 30 2' fill='none' stroke='%23d3b25c' stroke-width='1.4'/><path d='M8 44Q14 14 44 8' fill='none' stroke='%23d3b25c' stroke-width='1.4'/><circle cx='16' cy='16' r='2.3' fill='%23d3b25c'/><path d='M44 8l12-4-8 8z M8 44l-4 12 8-8z' fill='%23d3b25c'/></svg>"); }
.plate-frame i:nth-child(1) { left: 10px; top: 10px; } .plate-frame i:nth-child(2) { right: 10px; top: 10px; transform: scaleX(-1); }
.plate-frame i:nth-child(3) { left: 10px; bottom: 10px; transform: scaleY(-1); } .plate-frame i:nth-child(4) { right: 10px; bottom: 10px; transform: scale(-1); }
@media (max-width: 700px) { .plate-frame { inset: 8px; } .plate-frame i { width: 30px; height: 30px; left: 6px; top: 6px; } .plate-frame i:nth-child(2) { left: auto; right: 6px; } .plate-frame i:nth-child(3) { top: auto; bottom: 6px; } .plate-frame i:nth-child(4) { left: auto; top: auto; right: 6px; bottom: 6px; } }

/* ── type scale shared with the poster ── */
.caps { font-family: var(--cinzel); font-weight: 400; letter-spacing: .32em; text-transform: uppercase; font-size: 12px; color: var(--ink2); margin: 0; text-indent: .32em; }
.caps.tiny { font-size: 10px; letter-spacing: .26em; color: var(--faint); }
.caps.eyebrow { color: var(--ink2); margin-bottom: 10px; }
.caps.sub { color: var(--ink); font-size: 13px; margin: 10px 0 18px; line-height: 1.8; }
.script { font-family: var(--script); font-weight: 400; color: var(--gold); margin: 0; line-height: .95; text-shadow: 0 1px 0 rgba(0,0,0,.25), 0 0 26px rgba(211,178,92,.22); }
.rule { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 4px 0 14px; }
.rule span { height: 1px; width: 84px; background: var(--gold); position: relative; }
.rule span::before { content: ""; position: absolute; top: -1.5px; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }
.rule span:first-child::before { left: 0; } .rule span:last-child::before { right: 0; }
.rule b { width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); }
.lede { font-family: var(--fell); font-size: clamp(17px, 2vw, 20px); color: var(--ink2); margin: 0 0 26px; max-width: 480px; }

.stage { position: relative; z-index: 2; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 22px calc(28px + env(safe-area-inset-bottom)); animation: fade .9s ease both; }
.stage[hidden] { display: none; }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── intro ── */
.intro-grid { width: min(1240px, 100%); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 24px; }
.intro-chart { position: relative; aspect-ratio: 1; width: 100%; max-width: 82dvh; margin: 0 auto 26px; transition: transform .8s cubic-bezier(.2,.7,.2,1); will-change: transform; }
.intro-chart canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-caption { position: absolute; left: 0; right: 0; bottom: -22px; text-align: center; }
.intro-text { text-align: center; padding: 0 12px; }
.intro-text .script { font-size: clamp(64px, 7.6vw, 112px); margin: 2px 0 0; }
.intro-text .lede { margin-left: auto; margin-right: auto; }
.intro-text .caps.tiny { margin-top: 24px; }

/* ── buttons ── */
.btn { font-family: var(--cinzel); font-size: 12px; letter-spacing: .26em; text-indent: .26em; text-transform: uppercase; padding: 15px 28px; border: 1px solid var(--hair); background: rgba(12,16,33,.35); color: var(--ink); cursor: pointer; position: relative; transition: background .25s, color .25s, border-color .25s, transform .15s; text-decoration: none; display: inline-block; }
.btn::after { content: ""; position: absolute; inset: 3px; border: 1px solid rgba(240,228,198,.14); pointer-events: none; }
.btn:hover { border-color: var(--gold); color: var(--gold-hi); }
.btn:active { transform: translateY(1px); }
.btn.gold { background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); color: #1a1408; border-color: var(--gold-hi); font-weight: 600; box-shadow: 0 10px 34px rgba(211,178,92,.22), 0 0 0 1px rgba(0,0,0,.4); }
.btn.gold::after { border-color: rgba(26,20,8,.25); }
.btn.gold:hover { background: linear-gradient(180deg, #fbe9ad, var(--gold)); color: #1a1408; }
.btn.ghost { border-color: rgba(240,228,198,.2); }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; font: inherit; font-family: var(--fell); font-style: italic; color: var(--gold); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(211,178,92,.45); }

/* ── form plate ── */
.sheet { width: min(580px, 100%); padding: 34px 36px 30px; position: relative; text-align: center;
  background: radial-gradient(ellipse at 50% 30%, var(--paper2), var(--paper) 60%, #141a33); box-shadow: 0 40px 90px rgba(0,0,0,.7), inset 0 0 0 1px var(--hair), inset 0 0 80px rgba(0,0,10,.45); }
.sheet::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(240,228,198,.16); pointer-events: none; }
.sheet::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .45; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .6 0 0 0 0 .65 0 0 0 0 .9 0 0 0 .6 0'/></filter><rect width='300' height='300' filter='url(%23n)'/></svg>"); }
.sheet > * { position: relative; z-index: 1; }
.field { display: block; margin: 0 0 14px; text-align: left; }
.field span { display: block; font-family: var(--cinzel); font-size: 10.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--ink2); margin: 0 0 4px; }
.field span em { font-style: italic; text-transform: none; letter-spacing: 0; font-family: var(--fell); font-size: 13px; color: var(--faint); }
.field input { width: 100%; font-family: var(--fell); font-size: 20px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--hair); padding: 7px 2px 6px; outline: none; border-radius: 0; transition: border-color .2s; -webkit-appearance: none; appearance: none; color-scheme: dark; }
.field input:focus { border-bottom-color: var(--gold); }
.field input::placeholder { color: var(--faint); font-style: italic; }
.row { display: flex; gap: 18px; }
.row .field { flex: 1; } .row .field.small { flex: 0 0 38%; }
.placeline { font-family: var(--fell); font-size: 15px; color: var(--ink2); margin: -6px 0 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; text-align: left; }
.placeline .muted { color: var(--faint); } .placeline .ok { color: var(--gold-hi); }
.coords { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; padding: 8px 10px 2px; margin: -4px 0 14px; border: 1px dashed var(--ghost); }
.coords .field:last-child { grid-column: 1 / -1; }
.coords[hidden] { display: none; }
.actions { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 20px; }
.err { font-family: var(--fell); font-style: italic; color: #f0b2a0; margin: 12px 0 0; }

/* ── result ── */
#result { justify-content: flex-start; padding-top: 24px; gap: 16px; }
.viewer { width: 100%; display: flex; justify-content: center; perspective: 1600px; }
.sheet3d { position: relative; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.2,.7,.2,1); filter: drop-shadow(0 40px 60px rgba(0,0,0,.75)) drop-shadow(0 4px 10px rgba(0,0,0,.6)); }
#view { display: block; max-width: min(92vw, 560px); max-height: 74dvh; width: auto; height: auto; cursor: zoom-in; outline: 1px solid rgba(240,228,198,.25); outline-offset: 0; }
.quill { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--gold-hi); box-shadow: 0 0 14px 5px rgba(243,220,146,.7); pointer-events: none; }
.quill[hidden] { display: none; }
.bar { width: min(680px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; padding-bottom: 76px; }
.formats { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 2px; align-items: center; }
.pill { font-family: var(--cinzel); font-size: 11px; letter-spacing: .24em; text-indent: .24em; text-transform: uppercase; padding: 9px 12px 7px; border: 0; border-bottom: 1px solid transparent; background: none; color: var(--faint); cursor: pointer; transition: all .2s; }
.pill.on { color: var(--gold-hi); border-bottom-color: var(--gold); }
.pill:hover { color: var(--ink); }
.sep { width: 5px; height: 5px; background: var(--gold); transform: rotate(45deg); margin: 0 12px; }
.hint { font-family: var(--fell); font-style: italic; color: var(--ink2); margin: 0; font-size: 16px; text-align: center; }
.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.buttons .btn { padding: 12px 18px; font-size: 11px; }

/* ── overlay ── */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(8,11,23,.95); display: flex; flex-direction: column; padding: calc(14px + env(safe-area-inset-top)) 16px calc(14px + env(safe-area-inset-bottom)); gap: 10px; }
.overlay[hidden] { display: none; }
.overlay-top { display: flex; justify-content: space-between; align-items: center; }
.overlay-scroll { flex: 1; overflow: auto; display: flex; justify-content: center; align-items: flex-start; }
.overlay-scroll img { max-width: 100%; height: auto; box-shadow: 0 20px 60px rgba(0,0,0,.8); outline: 1px solid rgba(240,228,198,.25); }
.overlay-hint { font-family: var(--fell); font-style: italic; color: var(--ink2); text-align: center; margin: 0; font-size: 15px; }
.overlay-actions { display: flex; justify-content: center; gap: 8px; }

.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; background: var(--ink); color: #1a1408; font-family: var(--fell); padding: 10px 18px; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: 90vw; }
.toast[hidden] { display: none; }
.loading { position: fixed; inset: 0; z-index: 25; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(12,16,33,.72); font-family: var(--fell); font-style: italic; color: var(--ink2); opacity: 0; pointer-events: none; transition: opacity .3s; }
.loading.on { opacity: 1; pointer-events: auto; }
.loading-ring { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(211,178,92,.3); border-top-color: var(--gold-hi); animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media print { body > * { display: none !important; } }
@media (max-width: 900px) {
  .intro-grid { grid-template-columns: 1fr; gap: 6px; }
  .intro-chart { max-width: min(92vw, 62dvh); max-height: none; }
  .intro-text .script { font-size: clamp(58px, 15vw, 84px); }
  .intro-text .lede { font-size: 16px; margin-bottom: 20px; }
  .caps.sub { font-size: 11px; letter-spacing: .26em; }
}
@media (max-width: 520px) {
  .sheet { padding: 26px 20px 24px; }
  .row { flex-direction: column; gap: 0; } .row .field.small { flex: auto; }
  .coords { grid-template-columns: 1fr; }
  body { font-size: 17px; }
  .stage { padding-left: 16px; padding-right: 16px; }
}
