/* Eikon — A Library of the Saints
   Layout concept: the site is a dim nave. A vaulted bar at the top, a lancet window throwing
   light across the page, icons hung in gilded kiots on a plastered wall, and vellum placards
   for everything you read. One committed dark look: it is always evening in this church. */
:root {
  --soot: #0b0806;          /* deepest shadow of the nave */
  --umber: #19110b;         /* plaster in candlelight */
  --walnut: #2a1c12;        /* panels, lecterns */
  --gold: #c9a24a;          /* gold leaf */
  --gold-hi: #f4dc94;       /* burnished highlight */
  --gold-lo: #6e4f1a;       /* gold in shadow */
  --cinnabar: #b23a22;      /* the red of icon borders and festal rubrics */
  --lapis: #2c4e93;         /* glass and the Theotokos' maphorion */
  --vellum: #eadcbc;        /* text: candle-lit parchment */
  --vellum-dim: #b3a17f;    /* secondary text */
  --ash: #7d6d55;           /* tertiary text, rules */

  --display: "Cormorant Unicase", "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --body: "EB Garamond", "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --label: "Marcellus SC", "Cormorant SC", "EB Garamond", Georgia, serif;

  --step--1: clamp(0.95rem, 0.9rem + 0.15vw, 1.02rem);
  --step-0: clamp(1.12rem, 1.06rem + 0.25vw, 1.28rem);
  --step-1: clamp(1.3rem, 1.2rem + 0.5vw, 1.6rem);
  --step-2: clamp(1.7rem, 1.4rem + 1.2vw, 2.4rem);
  --step-3: clamp(2.2rem, 1.6rem + 2.4vw, 3.6rem);
  --step-4: clamp(3.2rem, 2rem + 6vw, 7.5rem);

  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --flicker-a: 1; --flicker-b: 1;

  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --plaster: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='600'><filter id='p'><feTurbulence type='fractalNoise' baseFrequency='.012 .018' numOctaves='5' seed='4'/><feDiffuseLighting lighting-color='%23d9b47a' surfaceScale='3.2' diffuseConstant='1'><feDistantLight azimuth='225' elevation='38'/></feDiffuseLighting></filter><rect width='100%' height='100%' filter='url(%23p)'/></svg>");
  --guilloche: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='44' height='18' viewBox='0 0 44 18'><g fill='none' stroke='%23c9a24a' stroke-width='1.3'><path d='M0 9 C 11 -2, 11 20, 22 9 S 33 -2, 44 9'/><path d='M0 9 C 11 20, 11 -2, 22 9 S 33 20, 44 9'/></g><circle cx='11' cy='9' r='1.6' fill='%23b23a22'/><circle cx='33' cy='9' r='1.6' fill='%23b23a22'/></svg>");

  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--soot); scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh;
  background: var(--soot); color: var(--vellum);
  font-family: var(--body); font-size: var(--step-0); line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--soot); }
img { max-width: 100%; display: block; }
a { color: var(--gold-hi); text-decoration-color: color-mix(in srgb, var(--gold) 45%, transparent); text-underline-offset: 3px; }
a:hover { color: #fff1c4; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--cinnabar); color: #fff6dc; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.08; text-wrap: balance; margin: 0; letter-spacing: 0.01em; }
p { margin: 0; }

/* ---------- the nave: fixed layers behind everything ---------- */
.wall {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 45% at 50% 108%, rgba(255, 160, 60, calc(.20 * var(--flicker-a))), transparent 70%),
    radial-gradient(ellipse 35% 30% at 8% 100%, rgba(255, 150, 50, calc(.16 * var(--flicker-b))), transparent 70%),
    radial-gradient(ellipse 120% 80% at 50% 40%, var(--umber), var(--soot) 75%);
}
.wall::before {
  content: ""; position: absolute; inset: 0; background-image: var(--plaster); background-size: 600px;
  mix-blend-mode: multiply; opacity: .55;
}
.wall::after {
  content: ""; position: absolute; inset: 0; background-image: var(--noise); opacity: .22; mix-blend-mode: overlay;
}
#nave { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.vignette { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(ellipse 90% 75% at 50% 45%, transparent 45%, rgba(0, 0, 0, .72)); }

/* ---------- vaulted header ---------- */
.vault {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  padding-left: var(--gutter); padding-right: var(--gutter-r); padding-block: 10px;
  background: linear-gradient(to bottom, rgba(11, 8, 6, .96), rgba(11, 8, 6, .82));
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(201, 162, 74, .25);
}
.vault::after { content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 9px; background: var(--guilloche) repeat-x center / 33px 14px; opacity: .55; }
.vault-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gold-hi); }
.mark svg { width: 34px; height: 44px; flex: none; }
.mark b { font-family: var(--display); font-size: 2.15rem; font-weight: 700; letter-spacing: .04em; line-height: 1; }
.mark .wm-i { font-family: "Cormorant Garamond", var(--display); font-size: 1.12em; font-weight: 700; }
.mark small { display: block; font-family: var(--label); font-size: 1.01rem; letter-spacing: .18em; color: var(--vellum-dim); }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  font-family: var(--label); letter-spacing: .14em; font-size: 1.04rem; text-decoration: none; color: var(--vellum-dim);
  padding: 6px 12px; border-radius: 2px; border: 1px solid transparent;
}
.nav a:hover { color: var(--gold-hi); }
.nav a[aria-current="page"] { color: var(--gold-hi); border-color: rgba(201, 162, 74, .4); background: rgba(201, 162, 74, .07); }
.style-toggle { display: inline-flex; border: 1px solid rgba(201, 162, 74, .35); border-radius: 2px; overflow: hidden; }
.style-toggle button { background: none; border: 0; padding: 5px 10px; font-family: var(--label); font-size: 0.87rem; letter-spacing: .12em; color: var(--vellum-dim); cursor: pointer; }
.style-toggle button[aria-pressed="true"] { background: rgba(201, 162, 74, .18); color: var(--gold-hi); }

main { position: relative; z-index: 1; }
.wrap { max-width: 1280px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter-r); }
section { padding-block: clamp(36px, 6vw, 80px); }

/* ---------- shared ornament ---------- */
.eyebrow { font-family: var(--label); letter-spacing: .24em; font-size: var(--step--1); color: var(--gold); text-transform: uppercase; }
.rubric { color: var(--cinnabar); }
.rule { height: 14px; background: var(--guilloche) repeat-x center / 33px 14px; opacity: .7; border: 0; margin: 0; }
.gilt-text {
  background: linear-gradient(176deg, #fff6d8 0%, var(--gold-hi) 28%, #dcb766 52%, #c9a24a 66%, #ecd08a 86%, #d7b25e 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .55)) drop-shadow(0 0 22px rgba(255, 190, 90, .18));
}
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.section-head h2 { font-size: var(--step-3); }
.btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer; text-decoration: none; white-space: nowrap;
  font-family: var(--label); letter-spacing: .14em; font-size: 1.01rem; color: #1b1107;
  padding: 11px 18px; border: 0; border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, #9b7428);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -2px 0 rgba(0, 0, 0, .25), 0 6px 18px rgba(0, 0, 0, .5);
}
.btn:hover { filter: brightness(1.08); color: #1b1107; }
.btn.ghost { background: rgba(20, 14, 9, .6); color: var(--gold-hi); box-shadow: inset 0 0 0 1px rgba(201, 162, 74, .5); }
.btn.ghost:hover { background: rgba(201, 162, 74, .12); }
.btn svg { width: 16px; height: 16px; }

/* ---------- gilded frame (kiot) ---------- */
.kiot {
  position: relative; padding: clamp(10px, 1.4vw, 16px); border-radius: 3px;
  background:
    var(--noise),
    linear-gradient(135deg, #6b4c18 0%, var(--gold-hi) 18%, #a37a2c 34%, #f1d27e 50%, #7d5a1d 68%, var(--gold) 84%, #5a3e12 100%);
  background-blend-mode: overlay, normal;
  box-shadow:
    inset 0 0 0 1px rgba(255, 240, 190, .55), inset 0 0 0 4px rgba(90, 60, 18, .7), inset 0 0 0 5px rgba(255, 226, 150, .35),
    0 24px 50px rgba(0, 0, 0, .7), 0 0 calc(60px * var(--flicker-a)) rgba(255, 170, 70, .12);
}
.kiot::before { /* inner cinnabar fillet, like the red border of an icon panel */
  content: ""; position: absolute; inset: clamp(7px, 1vw, 11px); border: 1.5px solid rgba(178, 58, 34, .8); pointer-events: none; border-radius: 1px;
}
.kiot img { width: 100%; height: auto; position: relative; box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 2px 10px rgba(0, 0, 0, .55); background: var(--walnut); }
.kiot .glint { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 30%, rgba(255, 240, 200, .14) 45%, transparent 55%); mix-blend-mode: screen; opacity: calc(var(--flicker-b) - .4); }

/* ---------- candles ---------- */
.candles { display: flex; justify-content: center; align-items: flex-end; gap: clamp(14px, 3vw, 30px); margin-top: -6px; position: relative; z-index: 2; }
.candle { position: relative; width: 14px; display: flex; flex-direction: column; align-items: center; }
.candle .wax {
  width: 14px; border-radius: 3px 3px 2px 2px;
  background: linear-gradient(90deg, #8a5a22, #e7b766 35%, #f6d690 50%, #c48b3e 75%, #6e4417);
  box-shadow: 0 -6px 14px rgba(255, 190, 90, calc(.35 * var(--flicker-a)));
}
.candle .wick { width: 2px; height: 6px; background: #2a1a0e; }
.candle .flame {
  width: 10px; height: 26px; margin-bottom: -2px;
  background: radial-gradient(ellipse 50% 60% at 50% 70%, #fff 0%, #ffe9a6 30%, #ffb43c 58%, rgba(255, 110, 20, .0) 75%);
  border-radius: 50% 50% 45% 45% / 70% 70% 30% 30%;
  transform-origin: 50% 90%; animation: flame 2.6s ease-in-out infinite; filter: blur(.3px);
}
.candle .flame::after { content: ""; position: absolute; left: 50%; top: 6px; width: 3px; height: 9px; transform: translateX(-50%); background: rgba(80, 120, 255, .45); border-radius: 50%; filter: blur(1px); }
.candle .halo { position: absolute; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 200, 110, calc(.32 * var(--flicker-a))), transparent 65%); pointer-events: none; }
.candle:nth-child(2) .flame { animation-duration: 3.1s; animation-delay: -.7s; }
.candle:nth-child(3) .flame { animation-duration: 2.2s; animation-delay: -1.3s; }
@keyframes flame {
  0%, 100% { transform: scaleY(1) skewX(0deg); }
  25% { transform: scaleY(1.08) skewX(2deg); }
  50% { transform: scaleY(.94) skewX(-2.5deg); }
  75% { transform: scaleY(1.05) skewX(1deg); }
}

/* ---------- hero ---------- */
.hero { position: relative; padding-block: clamp(36px, 7vw, 96px) clamp(24px, 4vw, 48px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(20px, 5vw, 70px); align-items: center; }
.hero .greek { font-family: var(--body); letter-spacing: .5em; color: var(--gold); font-size: var(--step-1); }
.hero h1 { font-size: var(--step-4); font-weight: 700; letter-spacing: .02em; line-height: .92; margin-top: 6px; }
.hero .sub { font-family: var(--display); font-size: var(--step-2); color: var(--vellum); margin-top: 10px; }
.hero .lede { max-width: 56ch; color: var(--vellum-dim); margin-top: 18px; }
.lancet-wrap { position: relative; width: clamp(110px, 16vw, 190px); }
.lancet-wrap .stone { position: absolute; inset: -16px -16px -10px; border-radius: 50% 50% 4px 4px / 22% 22% 4px 4px; background: var(--noise), linear-gradient(90deg, #2b2016, #4a3826 50%, #2b2016); background-blend-mode: overlay; box-shadow: inset 0 0 18px rgba(0, 0, 0, .8), 0 20px 50px rgba(0, 0, 0, .7); }
canvas.lancet { position: relative; width: 100%; height: auto; aspect-ratio: 180 / 420; display: block; filter: saturate(1.1) brightness(calc(1.05 + .1 * var(--flicker-b))); box-shadow: 0 0 80px rgba(255, 200, 120, .25), 0 0 160px rgba(80, 120, 255, .15); border-radius: 50% 50% 0 0 / 22% 22% 0 0; }
.search-big { margin-top: 28px; display: flex; max-width: 560px; border: 1px solid rgba(201, 162, 74, .5); background: rgba(8, 5, 3, .9); border-radius: 2px; box-shadow: inset 0 2px 10px rgba(0, 0, 0, .6); }
.search-big input { flex: 1; min-width: 0; background: none; border: 0; padding: 14px 16px; font-size: var(--step-0); color: var(--vellum); }
.search-big input::placeholder { color: var(--ash); font-style: italic; }
.search-big input:focus { outline: none; }
.search-big:focus-within { border-color: var(--gold-hi); box-shadow: inset 0 2px 10px rgba(0, 0, 0, .6), 0 0 0 3px rgba(244, 220, 148, .15); }
.search-big button { border: 0; background: none; color: var(--gold-hi); padding: 0 16px; cursor: pointer; }

/* ---------- today: the first thing on the page ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero-today { padding-block: clamp(18px, 3vw, 34px) clamp(30px, 5vw, 60px); }
.hero-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: clamp(18px, 3vw, 30px); }
.hero-bar .lede { color: var(--vellum-dim); font-style: italic; margin: 0; }
.search-slim { display: flex; align-items: center; width: min(340px, 100%); padding: 2px 6px 2px 10px; background: rgba(8, 5, 3, .88); border: 1px solid rgba(201, 162, 74, .32); border-radius: 2px; box-shadow: inset 0 1px 6px rgba(0, 0, 0, .6); }
.search-slim input { flex: 1; min-width: 0; background: none; border: 0; padding: 6px 4px; font-size: .95rem; color: var(--vellum); }
.search-slim input::placeholder { color: var(--ash); font-style: italic; }
.search-slim input:focus { outline: none; }
.search-slim:focus-within { border-color: var(--gold); }
.search-slim button { border: 0; background: none; color: var(--vellum-dim); padding: 4px; cursor: pointer; display: grid; }
.search-slim button svg { width: 17px; height: 17px; }
.hero-today .today { grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; }
.hero-today .today-icon .kiot { width: fit-content; margin-inline: auto; }
.hero-today .today-icon .kiot img { width: auto; max-width: min(100%, 520px); max-height: min(64vh, 640px); }
.hero-today .today.no-icon { grid-template-columns: minmax(0, 1fr) auto; }
.hero-today .lancet-wrap { width: clamp(90px, 9vw, 130px); margin-top: 10px; }
.day-strip { grid-template-columns: repeat(auto-fill, minmax(64px, 72px)); margin-top: 14px; }
@media (max-width: 1100px) { .hero-today .lancet-wrap { display: none; } .hero-today .today { grid-template-columns: auto minmax(0, 1fr); } .hero-today .today.no-icon { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .hero-today .today { grid-template-columns: minmax(0, 1fr); } .hero-today .today-icon .kiot img { max-height: 58vh; } }

/* ---------- today ---------- */
.today { display: grid; grid-template-columns: minmax(260px, 420px) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.today-icon { position: relative; }
a.today-icon { display: block; text-decoration: none; }
a.today-icon .kiot { cursor: pointer; transition: box-shadow .3s ease; }
a.today-icon:hover .kiot { box-shadow: inset 0 0 0 1px rgba(255, 240, 190, .55), inset 0 0 0 4px rgba(90, 60, 18, .7), inset 0 0 0 5px rgba(255, 226, 150, .35), 0 24px 50px rgba(0, 0, 0, .7), 0 0 70px rgba(255, 180, 80, .22); }
.placard {
  position: relative; padding: clamp(22px, 3vw, 36px);
  background: var(--noise), linear-gradient(160deg, rgba(48, 34, 22, .92), rgba(22, 15, 10, .94));
  background-blend-mode: overlay, normal;
  border: 1px solid rgba(201, 162, 74, .35); border-radius: 2px;
  box-shadow: inset 0 0 0 4px rgba(10, 7, 5, .5), inset 0 0 0 5px rgba(201, 162, 74, .18), 0 30px 60px rgba(0, 0, 0, .55);
  min-width: 0;
}
.date-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.date-line h2 { font-size: var(--step-3); }
.date-line .church-date { color: var(--vellum-dim); font-style: italic; }
.fast {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  font-family: var(--label); font-size: 0.94rem; letter-spacing: .14em; padding: 5px 12px 5px 9px; border-radius: 20px;
  border: 1px solid currentColor; background: rgba(0, 0, 0, .3);
}
.fast::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.fast[data-level="free"] { color: #d9c48c; }
.fast[data-level="fast"] { color: #a7b8dd; }
.fast[data-level="oil"] { color: #c7b25e; }
.fast[data-level="fish"] { color: #8fc0c9; }
.fast[data-level="dairy"] { color: #e6d4b0; }
.fast[data-level="strict"] { color: #e0806a; }
.fast-note { color: var(--vellum-dim); font-size: var(--step--1); margin-top: 6px; }
.principal { font-size: var(--step-2); margin-top: 22px; color: var(--vellum); }
.principal.great { color: var(--cinnabar); filter: brightness(1.35); }
.comm-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.comm-list li { display: grid; grid-template-columns: 16px 1fr; gap: 10px; align-items: baseline; color: var(--vellum); }
.comm-list li::before { content: ""; width: 7px; height: 7px; transform: rotate(45deg) translateY(-2px); background: var(--gold); margin-left: 4px; }
.comm-list li.great::before, .comm-list li.pascha::before { background: var(--cinnabar); box-shadow: 0 0 6px var(--cinnabar); }
.comm-list li.great, .comm-list li.pascha { color: #f0a58f; font-weight: 600; }
.comm-list li.major { font-weight: 600; }
.today .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.note { color: var(--vellum-dim); font-style: italic; margin-top: 18px; font-size: var(--step--1); }

/* upcoming feasts */
.upcoming { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; }
.feast-card { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; text-decoration: none; color: inherit; padding: 12px; border: 1px solid rgba(201, 162, 74, .18); background: rgba(14, 10, 7, .55); border-radius: 2px; transition: border-color .2s, background .2s; min-width: 0; }
.feast-card:hover { border-color: rgba(201, 162, 74, .55); background: rgba(40, 28, 16, .55); color: inherit; }
.feast-card .thumb { aspect-ratio: 3 / 4; overflow: hidden; border: 3px solid var(--gold-lo); box-shadow: 0 0 0 1px var(--gold), 0 6px 14px rgba(0, 0, 0, .6); background: var(--walnut); }
.feast-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.feast-card .thumb.empty { display: grid; place-items: center; color: var(--gold); font-family: var(--display); font-size: 1.6rem; }
.feast-card h3 { font-size: 1.12rem; font-family: var(--body); font-weight: 600; line-height: 1.25; }
.feast-card .when { font-family: var(--label); letter-spacing: .12em; font-size: 0.87rem; color: var(--gold); margin-top: 6px; }

/* ---------- library ---------- */
.library-tools { display: grid; gap: 16px; margin-bottom: 30px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { white-space: nowrap; cursor: pointer; font-family: var(--label); letter-spacing: .1em; font-size: 0.91rem; padding: 6px 13px; border-radius: 20px; border: 1px solid rgba(201, 162, 74, .35); background: rgba(12, 8, 6, .6); color: var(--vellum-dim); }
.chip:hover { color: var(--gold-hi); }
.chip[aria-pressed="true"] { background: linear-gradient(180deg, rgba(244, 220, 148, .25), rgba(201, 162, 74, .15)); color: var(--gold-hi); border-color: var(--gold); }
.chip-label { font-family: var(--label); letter-spacing: .2em; font-size: 0.84rem; color: var(--ash); align-self: center; margin-right: 4px; min-width: 64px; }
.result-count { color: var(--vellum-dim); font-style: italic; }
.wall-grid { columns: 4 260px; column-gap: 28px; }
.icon-tile { break-inside: avoid; display: block; margin-bottom: 34px; text-decoration: none; color: inherit; }
.icon-tile .kiot { transition: transform .35s ease, box-shadow .35s ease; }
.icon-tile:hover .kiot { transform: translateY(-4px); box-shadow: inset 0 0 0 1px rgba(255, 240, 190, .55), inset 0 0 0 4px rgba(90, 60, 18, .7), inset 0 0 0 5px rgba(255, 226, 150, .35), 0 30px 60px rgba(0, 0, 0, .8), 0 0 70px rgba(255, 180, 80, .25); }
.icon-tile .cap { padding: 12px 4px 0; }
.lib-wall { display: flex; align-items: flex-start; gap: var(--gap, 22px); }
.lib-col { flex: 1 1 0; min-width: 0; }
.lib-wall .icon-tile { margin-bottom: 28px; }
.lib-wall .icon-tile h3 { font-size: 1.08rem; }
.lib-more { height: 1px; }
.icon-tile h3 { font-family: var(--body); font-size: 1.18rem; font-weight: 600; line-height: 1.25; color: var(--vellum); }
.icon-tile .meta { font-family: var(--label); letter-spacing: .1em; font-size: 0.87rem; color: var(--vellum-dim); margin-top: 4px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--vellum-dim); }
.empty-state h3 { font-size: var(--step-2); color: var(--vellum); margin-bottom: 10px; }

/* ---------- icon detail: icon left; facts and a small map right, their bottoms flush ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.detail .kiot { cursor: zoom-in; }
.detail-icon { min-width: 0; }
.detail-icon .kiot img { max-height: 82vh; width: auto; max-width: 100%; margin-inline: auto; }
.detail-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.facts.facts-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 22px; }
.facts-grid .fact { border-bottom: 1px solid rgba(201, 162, 74, .15); padding-block: 9px; min-width: 0; }
.facts-grid .fact.wide { grid-column: 1 / -1; }
.facts-grid .fact dt, .facts-grid .fact dd { padding: 0; border: 0; }
.facts-grid .fact dt { margin-bottom: 3px; }
@media (max-width: 520px) { .facts.facts-grid { grid-template-columns: minmax(0, 1fr); } }
.detail-more { padding-top: 0; }
.detail-text { max-width: none; }
.detail-text .prose { font-size: 1.25em; max-width: 60ch; }
/* Behind the description: the icon itself, widened and blurred, fading out from the top right. */
.detail-text { position: relative; overflow: hidden; isolation: isolate; }
.detail-text > :not(.detail-bg) { position: relative; z-index: 1; }
.detail-bg { position: absolute; top: -12%; right: -6%; width: 75%; height: 135%; z-index: 0; pointer-events: none;
  background-size: cover; background-position: center 30%; filter: blur(16px) saturate(1.35); opacity: .9;
  -webkit-mask-image: radial-gradient(ellipse 110% 100% at 100% 0%, #000 0%, rgba(0, 0, 0, .7) 30%, rgba(0, 0, 0, .25) 58%, transparent 80%);
  mask-image: radial-gradient(ellipse 110% 100% at 100% 0%, #000 0%, rgba(0, 0, 0, .7) 30%, rgba(0, 0, 0, .25) 58%, transparent 80%); }
@media (max-width: 760px) { .detail-bg { width: 100%; right: 0; opacity: .6; } }
.detail h1 { font-size: var(--step-2); }
.detail-side .placard { padding: clamp(18px, 2.2vw, 28px); }
/* Behind the details: candlelight in a Georgian church, blurred, fading out from the top right. */
.detail-side .placard { position: relative; overflow: hidden; isolation: isolate; }
.detail-side .placard > * { position: relative; z-index: 1; }
.detail-side .placard::before { content: ""; position: absolute; top: -45%; right: -25%; width: 95%; height: 140%; z-index: 0; pointer-events: none;
  background: url("../assets/textures/candles.jpg") 45% 52% / 300% auto no-repeat; filter: blur(12px) saturate(1.3); opacity: .95;
  -webkit-mask-image: radial-gradient(ellipse 110% 100% at 100% 0%, #000 0%, rgba(0, 0, 0, .7) 30%, rgba(0, 0, 0, .25) 58%, transparent 80%);
  mask-image: radial-gradient(ellipse 110% 100% at 100% 0%, #000 0%, rgba(0, 0, 0, .7) 30%, rgba(0, 0, 0, .25) 58%, transparent 80%); }
.detail-side .facts { margin-top: 16px; }
.medium-line { margin: 14px 0 0; font-family: var(--label); letter-spacing: .12em; font-size: 0.96rem; color: var(--gold); }
.detail .alt { color: var(--vellum-dim); font-style: italic; margin-top: 8px; }
.facts { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); gap: 0; margin: 26px 0 0; border-top: 1px solid rgba(201, 162, 74, .25); }
.facts dt, .facts dd { padding: 11px 0; border-bottom: 1px solid rgba(201, 162, 74, .15); margin: 0; }
.facts dt { font-family: var(--label); letter-spacing: .14em; font-size: 0.89rem; color: var(--gold); padding-right: 16px; padding-top: 14px; }
.facts dd { color: var(--vellum); min-width: 0; }
.facts dd .sub { color: var(--vellum-dim); font-size: var(--step--1); display: block; }
.prose { margin-top: 24px; max-width: 64ch; }
.prose p + p { margin-top: 1em; }
.prose p:first-child::first-letter { font-family: var(--display); float: left; font-size: 3.6em; line-height: .8; padding: 6px 10px 0 0; color: var(--cinnabar); filter: brightness(1.3); }
.credit { margin-top: 24px; font-size: var(--step--1); color: var(--ash); }
.credit a { color: var(--vellum-dim); }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; }
.pager .btn { max-width: calc(50% - 8px); min-width: 0; }
.pager .btn span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tagline { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; white-space: nowrap; font-family: var(--label); font-size: 0.84rem; letter-spacing: .1em; padding: 3px 9px; border: 1px solid rgba(201, 162, 74, .3); color: var(--vellum-dim); border-radius: 2px; text-decoration: none; }
a.tag:hover { color: var(--gold-hi); border-color: var(--gold); }
.patron-on { color: var(--gold-hi); }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cal-head h2 { font-size: var(--step-3); min-width: 0; }
.cal-head .spacer { flex: 1; }
.iconbtn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid rgba(201, 162, 74, .45); background: rgba(12, 8, 6, .6); color: var(--gold-hi); cursor: pointer; }
.iconbtn:hover { background: rgba(201, 162, 74, .15); }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 32px; margin-top: 24px; align-items: start; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.month .dow { font-family: var(--label); letter-spacing: .14em; font-size: 0.84rem; color: var(--ash); text-align: center; padding-bottom: 6px; }
.day {
  position: relative; min-height: 104px; padding: 7px 8px 8px; text-align: left; cursor: pointer; overflow: hidden;
  background: rgba(16, 11, 8, .72); border: 1px solid rgba(201, 162, 74, .14); border-radius: 2px; color: var(--vellum);
  display: flex; flex-direction: column; gap: 4px; font-size: 0.94rem; line-height: 1.25; min-width: 0;
}
.day:hover { border-color: rgba(201, 162, 74, .5); }
.day > * { position: relative; z-index: 1; }
.day > .jn, .day > .dot, .day > .fastbar { position: absolute; }
.day > .bg {
  position: absolute; inset: -12px; z-index: 0; pointer-events: none;
  background-size: cover; background-position: center 30%;
  filter: blur(4px) saturate(.9) brightness(.44); transition: filter .3s ease;
}
.day.has-icon { background: rgba(10, 7, 5, .9); }
.day.has-icon:hover > .bg { filter: blur(3px) saturate(1) brightness(.56); }
.day.has-icon .c { text-shadow: 0 1px 3px rgba(0, 0, 0, .9); }
.day.has-icon.is-selected > .bg { filter: blur(3px) saturate(1) brightness(.54); }
.day.out { opacity: .35; }
.day .n { font-family: var(--display); font-size: 1.3rem; font-weight: 700; color: var(--gold); line-height: 1; font-variant-numeric: tabular-nums; }
.day .jn { position: absolute; top: 9px; right: 8px; font-size: 0.84rem; color: var(--ash); font-variant-numeric: tabular-nums; }
.day .c { color: var(--vellum-dim); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.day.great .c { color: #f0a58f; font-weight: 600; }
.day.major .c { color: var(--vellum); font-weight: 600; }
.day .fastbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.day[data-fast="strict"] .fastbar { background: #c4553e; }
.day[data-fast="fast"] .fastbar { background: #6f84b8; }
.day[data-fast="oil"] .fastbar { background: #a8913e; }
.day[data-fast="fish"] .fastbar { background: #5f9aa5; }
.day[data-fast="dairy"] .fastbar { background: #cdbb92; }
.day.is-today { box-shadow: inset 0 0 0 1px var(--gold-hi), 0 0 24px rgba(255, 190, 90, .25); }
.day.is-selected { background: rgba(70, 48, 22, .7); border-color: var(--gold); }
.day .dot { position: absolute; top: 10px; right: 26px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-hi); box-shadow: 0 0 6px var(--gold-hi); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; font-size: var(--step--1); color: var(--vellum-dim); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 18px; height: 3px; display: inline-block; }
.paschalion { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.paschalion div { padding: 10px 12px; border: 1px solid rgba(201, 162, 74, .18); background: rgba(14, 10, 7, .55); }
.paschalion b { display: block; font-family: var(--label); letter-spacing: .12em; font-size: 0.84rem; color: var(--gold); font-weight: 400; }
.mini-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 12px; margin-top: 18px; }
.mini-icons a { display: block; border: 3px solid var(--gold-lo); box-shadow: 0 0 0 1px var(--gold); aspect-ratio: 3/4; overflow: hidden; }
.mini-icons img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- sources ---------- */
.sources-table-wrap { overflow-x: auto; margin-top: 20px; }
table.sources { width: 100%; border-collapse: collapse; font-size: var(--step--1); min-width: 720px; }
table.sources th, table.sources td { text-align: left; padding: 10px 12px; border-bottom: 1px solid rgba(201, 162, 74, .16); vertical-align: top; }
table.sources th { font-family: var(--label); letter-spacing: .12em; font-weight: 400; color: var(--gold); font-size: 0.84rem; }

/* ---------- dialogs ---------- */
dialog { border: 0; padding: 0; background: transparent; color: var(--vellum); max-width: min(1080px, calc(100vw - 24px)); width: 100%; }
dialog::backdrop { background: rgba(4, 3, 2, .82); backdrop-filter: blur(3px); }
.share-box { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 26px; padding: clamp(16px, 3vw, 28px); }
/* The preview is just the card itself, framed: no box around it, so no letterboxing at any shape. */
.share-preview { display: flex; justify-content: center; align-items: flex-start; min-width: 0; }
.share-preview canvas, .share-preview img { display: block; max-width: 100%; max-height: 74vh; width: auto; height: auto; border: 1px solid rgba(201, 162, 74, .4); box-shadow: 0 20px 50px rgba(0, 0, 0, .7); }
.share-opts { display: grid; gap: 18px; align-content: start; }
.share-opts h3 { font-size: var(--step-2); }
.opt-group { display: grid; gap: 8px; }
.opt-group > span { font-family: var(--label); letter-spacing: .18em; font-size: 0.84rem; color: var(--gold); }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-row label { cursor: pointer; }
.radio-row input { position: absolute; opacity: 0; pointer-events: none; }
.radio-row input:checked + .chip { background: linear-gradient(180deg, rgba(244, 220, 148, .25), rgba(201, 162, 74, .15)); color: var(--gold-hi); border-color: var(--gold); }
.radio-row input:focus-visible + .chip { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.share-readout { font-size: var(--step--1); color: var(--vellum-dim); margin: 2px 0 0; line-height: 1.45; }
.share-readout b { color: var(--vellum); font-weight: 600; }
.pick-icons { display: flex; flex-wrap: wrap; gap: 10px; }
.pick-icons label { position: relative; cursor: pointer; width: 64px; }
.pick-icons input { position: absolute; opacity: 0; pointer-events: none; }
.pick-icons img { width: 64px; height: 84px; object-fit: cover; border: 2px solid var(--gold-lo); opacity: .55; transition: opacity .15s, border-color .15s; }
.pick-icons input:checked + img { opacity: 1; border-color: var(--gold-hi); box-shadow: 0 0 0 1px var(--gold), 0 0 14px rgba(255, 200, 110, .35); }
.pick-icons input:focus-visible + img { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.pick-icons small { display: block; font-size: 0.84rem; line-height: 1.2; color: var(--vellum-dim); margin-top: 4px; }
.day-step { display: flex; gap: 8px; align-items: center; }
.day-step .iconbtn { width: 34px; height: 34px; flex: none; }
.share-opts select, .share-opts input[type="text"], .share-opts input[type="date"] { width: 100%; padding: 9px 11px; background: rgba(8, 6, 4, .8); border: 1px solid rgba(201, 162, 74, .4); color: var(--vellum); border-radius: 2px; }
.close-x { position: absolute; top: 10px; right: 10px; }
.share-shell { position: relative; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: rgba(20, 14, 9, .96); border: 1px solid var(--gold); padding: 10px 18px; z-index: 100; font-family: var(--label); letter-spacing: .1em; font-size: 0.96rem; }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(3, 2, 1, .94); display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-height: calc(100vh - 40px); max-width: 100%; width: auto; box-shadow: 0 0 120px rgba(255, 190, 90, .15); }
.lightbox .cap { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; text-align: center; color: var(--vellum-dim); font-size: var(--step--1); padding: 0 16px; }

footer.crypt { position: relative; z-index: 1; padding-block: 50px 60px; color: var(--ash); font-size: var(--step--1); }
footer.crypt .wrap { display: flex; flex-wrap: wrap; gap: 12px 30px; justify-content: space-between; border-top: 1px solid rgba(201, 162, 74, .2); padding-top: 26px; }

/* view entrance */
.view-enter { animation: rise .6s ease both; }
@keyframes rise { from { transform: translateY(10px); } to { transform: none; } }

@media (max-width: 900px) {
  .today, .detail, .cal-layout, .share-box { grid-template-columns: minmax(0, 1fr); }
  .today-icon { max-width: 420px; margin: 0 auto; width: 100%; }
}
@media (max-width: 640px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) 84px; }
  .lancet-wrap { width: 84px; }
  .nav { margin-left: 0; width: 100%; justify-content: space-between; order: 3; }
  .mark small { display: none; }
  .style-toggle { margin-left: auto; }
  .vault-inner { gap: 8px 12px; }
  .nav a { padding: 6px 6px; font-size: .9rem; letter-spacing: .08em; }
  .day { min-height: 62px; padding: 5px; }
  .day .c { display: none; }
  .day .jn { display: none; }
  .day .n { font-size: 1.05rem; }
  .day .dot { right: 6px; top: 6px; }
  .wall-grid { columns: 2 150px; column-gap: 16px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts dt { padding-bottom: 0; border-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
