:root {
  --void: #070504;
  --chapel: #100c09;
  --wood: #1c120c;
  --wood-lit: #2a1a10;
  --ink: #e8dcc8;
  --ink-dim: #8a7a62;
  --gold: #c9a227;
  --gold-soft: #e8c872;
  --gold-deep: #8a6a1a;
  --flame: #ffc857;
  --ember: #ff6b1a;
  --wine: #6b1c23;
  --lampada: #c43c2c;
  --glow: 0;
  --space: 8px;
  --display: "Cormorant Garamond", "Times New Roman", serif;
  --text: "Old Standard TT", "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--ink);
  font-family: var(--text);
  font-size: 18px;
  line-height: 1.65;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--gold-soft);
  text-decoration: none;
}

a:hover {
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.grain,
.vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 20;
}

.grain {
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.vignette {
  background: radial-gradient(ellipse at 50% 42%, transparent 18%, rgba(0, 0, 0, 0.55) 72%, #000 100%);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 22px 40px 18px;
  background: linear-gradient(180deg, rgba(7, 5, 4, 0.96), rgba(7, 5, 4, 0.55) 70%, transparent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f3e6c4;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
}

.brand svg {
  flex-shrink: 0;
}

.nav {
  display: flex;
  gap: 28px;
  justify-content: flex-end;
}

.nav a {
  color: #ead9b3;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav a[aria-current="page"],
.nav a:hover {
  color: #f6e27a;
}

.header-rule {
  position: absolute;
  left: 40px;
  right: 40px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold-soft), var(--gold) 80%, transparent);
  opacity: 0.75;
}

.orthodox-cross {
  width: 14px;
  height: 22px;
}

.brand .nut {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sanctuary {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 110px 24px 36px;
  background:
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(201, 162, 39, calc(0.07 + var(--glow) * 0.18)), transparent 62%),
    radial-gradient(ellipse 40% 30% at 50% 36%, rgba(201, 162, 39, 0.07), transparent 70%),
    var(--chapel);
}

.sanctuary-inner {
  width: min(1120px, 100%);
  display: flex;
  justify-content: center;
}

.icon-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(420px, 88vw);
}

.lampada {
  position: relative;
  z-index: 2;
  width: 28px;
  height: 54px;
  margin-bottom: -8px;
}

.lampada-chain {
  width: 1px;
  height: 18px;
  margin: 0 auto;
  background: var(--gold);
  opacity: 0.7;
}

.lampada-bowl {
  width: 22px;
  height: 14px;
  margin: 0 auto;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(180deg, #4a1414, var(--wine));
  box-shadow: 0 8px 18px rgba(196, 60, 44, 0.45);
}

.lampada-flame {
  width: 7px;
  height: 12px;
  margin: -18px auto 4px;
  border-radius: 50% 50% 45% 45%;
  background: radial-gradient(circle at 40% 70%, #fff6d2, var(--flame) 40%, var(--ember));
  animation: lamp-flicker 1.4s ease-in-out infinite;
  box-shadow: 0 0 10px 4px rgba(255, 140, 50, 0.55);
}

.icon-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4.15;
  padding: 11px;
  background:
    linear-gradient(180deg, #3d2c16, #1a1208 40%, #0e0a06);
  border-radius: 50% 50% 10px 10px / 28% 28% 10px 10px;
  box-shadow:
    0 0 0 1px rgba(232, 200, 114, 0.35),
    0 0 0 7px #120c08,
    0 0 0 8px rgba(201, 162, 39, 0.55),
    0 40px 80px rgba(0, 0, 0, 0.65),
    0 0 80px rgba(201, 162, 39, calc(0.08 + var(--glow) * 0.22));
}

.icon-frame::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: inherit;
  border: 1px solid rgba(232, 200, 114, 0.22);
  pointer-events: none;
}

.portrait {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 48% 48% 6px 6px / 24% 24% 6px 6px;
  background: #0c0806;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  filter: contrast(1.04) saturate(0.92);
}

.portrait img.is-missing {
  display: none;
}

.portrait-fallback {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait img.is-missing + .portrait-fallback {
  display: block;
}

.portrait-light {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 72%, rgba(255, 150, 40, calc(0.04 + var(--glow) * 0.16)), transparent 42%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 22%, transparent 70%, rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

.her-name {
  margin: 18px 0 4px;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(32px, 5vw, 48px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
}

.analogion {
  width: min(920px, 100%);
  margin: 8px auto 0;
  padding: 22px 22px 18px;
  background:
    linear-gradient(180deg, rgba(58, 36, 20, 0.92), rgba(18, 10, 6, 0.96));
  border: 1px solid rgba(201, 162, 39, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(232, 200, 114, 0.18),
    0 -30px 80px rgba(255, 140, 40, calc(0.04 + var(--glow) * 0.12));
}

.stand {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: end;
  gap: 10px 14px;
  min-height: 118px;
  padding: 8px 6px 4px;
}

.candle {
  position: relative;
  width: 16px;
  height: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.candle.is-new .wax {
  animation: rise 0.7s ease both;
}

.candle.is-new .flame-wrap {
  animation: ignite 0.45s 0.45s ease both;
}

.flame-wrap {
  position: relative;
  z-index: 2;
  width: 14px;
  height: 26px;
  display: grid;
  place-items: end center;
}

.flame {
  width: 9px;
  height: 18px;
  border-radius: 50% 50% 40% 40% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 78%, #fff8d8 8%, var(--flame) 38%, var(--ember) 78%);
  transform-origin: 50% 100%;
  animation: flicker 0.18s infinite alternate;
  box-shadow:
    0 0 8px 3px rgba(255, 180, 50, 0.75),
    0 0 22px 8px rgba(255, 110, 20, 0.35);
}

.flame::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 4px;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #fff6d0;
  opacity: 0.85;
}

.wick {
  width: 2px;
  height: 7px;
  background: #3a2a18;
  border-radius: 1px;
}

.wax {
  width: 13px;
  height: 58px;
  border-radius: 3px 3px 2px 2px;
  background:
    linear-gradient(90deg, #b9a27a 0%, #f3e6c4 38%, #d7c399 100%);
  box-shadow: inset -3px 0 6px rgba(80, 50, 10, 0.25);
}

.candle--health .wax {
  background: linear-gradient(90deg, #c9b48a, #f7edd4 40%, #dcc8a0);
}

.candle--repose .wax {
  background: linear-gradient(90deg, #8a6a4a, #d4b896 40%, #a88862);
}

.candle-name {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 4px 8px;
  background: rgba(12, 8, 6, 0.92);
  border: 1px solid rgba(201, 162, 39, 0.3);
  color: var(--ink);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.candle:hover .candle-name,
.candle:focus-within .candle-name {
  opacity: 1;
}

.actions {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.btn {
  appearance: none;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold-soft);
  cursor: pointer;
  padding: 14px 36px;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}

.btn:hover,
.btn:focus-visible {
  background: var(--gold);
  color: var(--void);
  box-shadow: 0 0 28px rgba(201, 162, 39, 0.35);
  outline: none;
}

.btn:disabled {
  cursor: default;
  opacity: 0.35;
  box-shadow: none;
}

.btn:disabled:hover,
.btn:disabled:focus-visible {
  background: transparent;
  color: var(--gold-soft);
  box-shadow: none;
}

.btn--ghost {
  border-color: transparent;
  color: var(--ink-dim);
  letter-spacing: 0.18em;
}

.btn--ghost:hover {
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.rite {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: end center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.62);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.rite.is-open {
  opacity: 1;
  visibility: visible;
}

.rite-panel {
  width: min(460px, 100%);
  margin-bottom: 8vh;
  padding: 32px 32px 24px;
  background:
    linear-gradient(180deg, #24180f, #120c08);
  border: 1px solid rgba(201, 162, 39, 0.45);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  transform: translateY(24px);
  transition: transform 0.35s ease;
}

.rite.is-open .rite-panel {
  transform: none;
}

.rite-kicker,
.field-label {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
}

.rite h2 {
  margin: 0 0 22px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 34px;
}

.intentions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 0 0 20px;
}

.intention {
  border: 1px solid rgba(201, 162, 39, 0.28);
  background: transparent;
  color: var(--ink-dim);
  padding: 12px 8px;
  cursor: pointer;
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.intention[aria-pressed="true"] {
  border-color: var(--gold);
  color: var(--gold-soft);
  background: rgba(201, 162, 39, 0.08);
}

.field {
  margin-bottom: 22px;
}

.field input {
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid rgba(201, 162, 39, 0.35);
  background: transparent;
  color: var(--ink);
  outline: none;
}

.field input:focus {
  border-bottom-color: var(--gold-soft);
}

.rite-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.page {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
  padding: 128px 0 80px;
}

.page h1 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(36px, 6vw, 56px);
  letter-spacing: 0.08em;
}

.ornament {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 36px;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.4em;
}

.ornament::before,
.ornament::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.ornament::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.page p {
  color: #d4c7b0;
}

.canon h2 {
  margin: 42px 0 18px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

.faces {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  border-top: 1px solid rgba(201, 162, 39, 0.2);
}

.faces li {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(201, 162, 39, 0.14);
  color: #d4c7b0;
}

.faces span {
  font-family: var(--display);
  color: var(--gold-soft);
  letter-spacing: 0.04em;
}

@media (max-width: 860px) {
  .faces li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.lede {
  font-family: var(--display);
  font-style: italic;
  font-size: 22px;
  color: var(--ink) !important;
}

.book {
  list-style: none;
  margin: 0;
  padding: 0;
}

.book li {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(201, 162, 39, 0.14);
  font-size: 16px;
}

.book time {
  color: var(--ink-dim);
  font-family: var(--display);
  letter-spacing: 0.08em;
}

.book .who {
  font-family: var(--display);
  font-size: 20px;
}

.book .intent {
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
}

.empty-book {
  color: var(--ink-dim);
  font-family: var(--display);
  font-style: italic;
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 48px 24px 40px;
  text-align: center;
  color: var(--ink-dim);
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 0.16em;
}

.footer-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  color: #d4c4a8;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  font-size: 16px;
  font-weight: 600;
}

.footer-mark .nut {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.maker {
  display: inline-block;
  margin-top: 4px;
  padding: 12px 28px;
  border: 1px solid var(--gold);
  color: #f3e6c4;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}

.maker-num {
  font-size: 1.28em;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-variant-numeric: lining-nums;
}

.maker:hover,
.maker:focus-visible {
  background: var(--gold);
  color: var(--void);
  box-shadow: 0 0 28px rgba(201, 162, 39, 0.35);
  outline: none;
}

@keyframes flicker {
  from { transform: scaleY(0.92) scaleX(1.04) rotate(-2deg); }
  to { transform: scaleY(1.06) scaleX(0.94) rotate(2deg); }
}

@keyframes lamp-flicker {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes rise {
  from { height: 0; opacity: 0; }
  to { height: 58px; opacity: 1; }
}

@keyframes ignite {
  from { opacity: 0; transform: scale(0.2); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 860px) {
  .site-header {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 16px 16px 12px;
  }

  .nav {
    justify-content: center;
    gap: 18px;
  }

  .book li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .flame,
  .lampada-flame,
  .candle.is-new .wax,
  .candle.is-new .flame-wrap {
    animation: none;
  }
}
