/*
  The club's shared furniture, used on every page: type, colour, the header and footer, the deco frame, the
  plaque, the answer line. Each page keeps only its own styles inline, after this file, so a page can still
  override anything here. Cached once, then free on every page after the first.
*/

/* ---------- Type: all self-hosted (no third-party requests; one origin to trust) ---------- */
@font-face { font-family: "Gothicon"; src: url("../fonts/gothicon.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "CS Aymeric"; src: url("../fonts/aymeric.woff2") format("woff2"); font-style: normal; font-display: swap; }
@font-face { font-family: "CS Aymeric"; src: url("../fonts/aymeric-italic.woff2") format("woff2"); font-style: italic; font-display: swap; }
@font-face { font-family: "CS Aymeric Reverse"; src: url("../fonts/aymeric-reverse.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Inkfolk"; src: url("../fonts/inkfolk.woff2") format("woff2"); font-display: swap; ascent-override: 93.4%; descent-override: 21.6%; line-gap-override: 10%; } /* the same line height, split so capitals sit centred in it */
@font-face { font-family: "SwordStone"; src: url("../fonts/swordstone.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url("../fonts/im-fell-english.woff2") format("woff2"); font-style: normal; font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url("../fonts/im-fell-english-italic.woff2") format("woff2"); font-style: italic; font-display: swap; }
/* Greek only: the unicode ranges keep these from loading on pages with no Greek text */
@font-face { font-family: "GFS Didot"; src: url("../fonts/gfs-didot-greek.woff2") format("woff2"); font-display: swap; unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "GFS Didot"; src: url("../fonts/gfs-didot-greek-ext.woff2") format("woff2"); font-display: swap; unicode-range: U+1F00-1FFF; }

:root {
  font-synthesis: none;
  --void: #000000;
  --bone: #f2f0eb;
  --ash: #8e8e8e;
  --brass: #cfa24b;
  --bone-dim: rgba(242, 240, 235, 0.18);
  --line: #2a2a2a;
  /* Type roles: Gothicon for display, CS Aymeric for incantation and captions, Inkfolk for the
     interface, SwordStone for numbers and code, IM Fell English for reading. */
  --display: "Gothicon", "Old English Text MT", Georgia, serif;
  --uncial: "CS Aymeric", Georgia, serif;
  --reverse: "CS Aymeric Reverse", "CS Aymeric", Georgia, serif;
  --ui: "Inkfolk", Georgia, serif;
  --stone: "SwordStone", ui-monospace, Menlo, monospace;
  --gothic: var(--display); --title: var(--uncial); --mono: var(--stone);
  --greek: "GFS Didot", "Gentium Plus", "Palatino Linotype", serif;
  --text: "IM Fell English", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --tap: 44px; /* the smallest a control may be, for fingers */
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
[hidden] { display: none !important; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); background: var(--void); }
body {
  margin: 0; background: var(--void); color: var(--bone);
  font-family: var(--text);
  font-size: clamp(1.125rem, 1rem + 0.4vw, 1.3rem); line-height: 1.6;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brass); text-underline-offset: 0.2em; }
a:hover { color: var(--bone); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 4px; }
::selection { background: var(--bone); color: var(--void); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Grain and a candlelit vignette over everything */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 49;
  background: radial-gradient(ellipse at 50% 40%, transparent 45%, rgba(0,0,0,0.7) 100%);
}

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--bone); color: var(--void); padding: 0.5rem 1rem; }

/* For a browser with scripts off: a plain line at the foot of the page */
.noscript { margin: 0; padding: 1rem 1.5rem 2rem; text-align: center; color: var(--ash); font-style: italic; }

/* Shown above a puzzle when the page isn't secure: no answer can be checked over plain http */
.insecure-note { position: relative; z-index: 7; max-width: 40rem; margin: 0 auto 1.5rem; padding: 0.8rem 1rem; border: 1px solid var(--brass); color: var(--bone); font-family: var(--uncial); text-align: center; background: #0b0905; }

/* ---------- Header ---------- */
.site-header {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem 2rem;
  padding: clamp(2.2rem, 4vw, 3rem) clamp(1.75rem, 5vw, 4rem) 0;
  font-family: var(--uncial); font-weight: normal; font-size: 1.4rem;
}
.site-header .name { display: block; line-height: 0; color: var(--bone); text-decoration: none; }
.name__crest { display: block; height: clamp(2.8rem, 4.5vw, 3.6rem); width: auto; opacity: 0.92; transition: opacity 0.3s, filter 0.3s; }
.site-header .name:hover .name__crest { opacity: 1; filter: drop-shadow(0 0 0.6rem rgba(242,240,235,0.35)); }
.site-header nav ul { display: flex; gap: clamp(1rem, 2.5vw, 2.25rem); margin: 0; padding: 0; list-style: none; }
.site-header nav a { display: inline-flex; align-items: center; min-height: var(--tap); padding-inline: 0.25rem; color: var(--ash); text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--bone); }

/* ---------- Footer: an ankh, a line of Ovid, and a slow smoke rising behind them ---------- */
.site-footer { position: relative; overflow: hidden; padding: clamp(5rem, 12vw, 8rem) 1.5rem clamp(3.5rem, 8vw, 5rem); text-align: center; }
.site-footer .ankh { width: 2.2rem; margin: 0 auto 1.25rem; display: block; position: relative; z-index: 1; }
.site-footer .ankh path { fill: none; stroke: var(--bone); stroke-width: 3; stroke-linecap: round; }
.site-footer figure { position: relative; z-index: 1; margin: 0; }
.site-footer blockquote { margin: 0; }
.site-footer blockquote p { margin: 0; font-family: var(--display); font-weight: normal; font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.2rem); color: var(--bone); }
.site-footer figcaption { margin-top: 0.5rem; font-style: italic; color: var(--ash); font-size: 0.95rem; }
.ether { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; filter: url(#goo); opacity: 0.4; pointer-events: none; }
.ether::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.25rem; background: #161616; }
.ether i { position: absolute; bottom: -3rem; left: var(--x); width: var(--s); height: var(--s); border-radius: 50%; background: #161616;
  animation: rise var(--t) ease-in infinite var(--d); transform: translateX(-50%); }
@keyframes rise {
  0% { bottom: -3rem; width: var(--s); height: var(--s); }
  75% { width: var(--s); height: var(--s); }
  100% { bottom: var(--h); width: 0; height: 0; }
}
.site-footer__ig { position: relative; z-index: 2; display: flex; width: fit-content; min-height: var(--tap); align-items: center; gap: 0.5rem; margin: 1.9rem auto 0; font-family: var(--ui); font-style: normal; font-size: 0.98rem; letter-spacing: 0.02em; color: var(--ash); text-decoration: none; padding: 0.35rem 1rem; border: 1px solid rgba(242, 240, 235, 0.14); border-radius: 999px; transition: color 0.3s, border-color 0.3s; }
.site-footer__ig svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.6; }
.site-footer__ig svg .dot { fill: currentColor; stroke: none; }
.site-footer__ig:hover, .site-footer__ig:focus-visible { color: var(--bone); border-color: rgba(242, 240, 235, 0.45); }

/* ---------- Deco furniture: a double hairline frame with notched corners ---------- */
.deco { position: absolute; inset: 0; pointer-events: none; overflow: clip; } /* the corners sit 1px out; never past the page */
.deco::before, .deco::after { content: ""; position: absolute; border: 1px solid var(--bone-dim); }
.deco::before { inset: 0; }
.deco::after { inset: 9px; border-color: rgba(242, 240, 235, 0.1); }
.deco-corner { position: absolute; width: 3.6rem; height: 3.6rem; }
.deco-corner path, .deco-corner rect { fill: none; stroke: var(--bone); stroke-width: 1; opacity: 0.55; }
.deco-corner--tl { left: -1px; top: -1px; }
.deco-corner--tr { right: -1px; top: -1px; }
.deco-corner--bl { left: -1px; bottom: -1px; }
.deco-corner--br { right: -1px; bottom: -1px; }

/* ---------- Reliquary plaque: the site's call-to-action shape ----------
   A long hexagon with pointed ends, a hairline edge, and a small diamond at each side. The edge is a clipped
   layer so the points stay crisp. */
.plaque {
  --edge: rgba(242, 240, 235, 0.85);
  position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 0.85em;
  padding: 0.8rem 2.6rem 0.85rem; font-family: var(--ui); font-size: 1.3rem; color: var(--bone); text-decoration: none;
  pointer-events: auto; transition: color 0.3s; white-space: nowrap;
}
@media (max-width: 480px) { .plaque { padding: 0.75rem 1.9rem 0.8rem; font-size: 1.15rem; gap: 0.6em; } }
.plaque::before, .plaque::after {
  content: ""; position: absolute; z-index: -1;
  clip-path: polygon(1.1rem 0, calc(100% - 1.1rem) 0, 100% 50%, calc(100% - 1.1rem) 100%, 1.1rem 100%, 0 50%);
}
.plaque::before { inset: 0; background: var(--edge); z-index: -2; }
.plaque::after { inset: 1px; background: #050505; transition: background 0.3s; }
.plaque__gem { width: 0.38em; height: 0.38em; border: 1px solid var(--brass); transform: rotate(45deg); transition: background 0.3s; }
.plaque:hover, .plaque:focus-visible { color: var(--void); outline: none; }
.plaque:hover::after, .plaque:focus-visible::after { background: var(--bone); }
.plaque:hover .plaque__gem, .plaque:focus-visible .plaque__gem { background: var(--brass); }
.plaque:focus-visible { filter: drop-shadow(0 0 0.8rem rgba(207, 162, 75, 0.5)); }

/* ---------- The answer line: a word typed into a terminal-like pill, as at the jar and the trials ---------- */
.terminal { display: flex; align-items: center; gap: 0.5rem; max-width: 28rem; margin: 0 auto; border: 1px solid var(--bone-dim); border-radius: 999px; padding: 0.3rem 0.35rem 0.3rem 1.1rem; background: #070707; }
.terminal:focus-within { border-color: var(--brass); }
.terminal__prompt { font-family: var(--stone); color: var(--brass); font-size: 1.1rem; }
.terminal input { flex: 1; min-width: 0; min-height: var(--tap); background: none; border: 0; outline: none; color: var(--bone); font-family: var(--ui); font-size: 1.2rem; letter-spacing: 0.08em; caret-color: var(--brass); }
.terminal button { min-height: var(--tap); font-family: var(--ui); font-size: 1.05rem; color: var(--void); background: var(--bone); border: 0; border-radius: 999px; padding: 0.4rem 1.2rem; cursor: pointer; }
.terminal button:hover, .terminal button:focus-visible { background: var(--brass); }
.terminal button:disabled { opacity: 0.6; cursor: progress; }
.finale__gloss { font-family: var(--uncial); font-style: italic; color: #c9c5bb; font-size: 1.2rem; margin: 0 0 1.6rem; }
.finale__call { color: var(--bone); margin: 0 0 1.2rem; }

@media (prefers-reduced-motion: reduce) {
  .ether i { animation: none; }
  .name__crest, .plaque, .plaque::after, .plaque__gem, .site-footer__ig { transition: none; }
}
