/* TheAuraOfGod : gothic relics link hub
   z-scale: fog 0 / embers 1 / vignette 2 / content 10 / grain 60 */

:root {
  --char: #0d0b09;
  --soot: #161310;
  --bone: #e7ddc8;
  --bone-bright: #f4ecd9;
  --bone-dim: rgba(231, 221, 200, 0.66);
  --ash: #99907d;
  --line: rgba(231, 221, 200, 0.14);
  --line-strong: rgba(231, 221, 200, 0.34);
  --ember: #b23517;
  --ember-hot: #ff7c3f;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: 'Grenze Gotisch', 'Cormorant Garamond', serif;
  --font-body: 'Cormorant Garamond', Georgia, serif;
  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--char);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* film grain */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: rgba(178, 53, 23, 0.5); color: var(--bone-bright); }

.skip {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 10px 18px;
  background: var(--soot);
  color: var(--bone);
  border: 1px solid var(--line-strong);
  font-size: 0.95rem;
  text-decoration: none;
  transition: top 0.2s;
}
.skip:focus-visible { top: 16px; }

/* ---------- atmosphere ---------- */

.fog {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  width: 130vw;
  height: 65vh;
  background: radial-gradient(closest-side, rgba(126, 110, 88, 0.075), transparent 72%);
}
.fog-a { bottom: -22vh; left: -28vw; animation: fog-drift-a 53s ease-in-out infinite alternate; }
.fog-b { top: -18vh; right: -34vw; animation: fog-drift-b 67s ease-in-out infinite alternate; }

@keyframes fog-drift-a { from { transform: translateX(0); } to { transform: translateX(9vw); } }
@keyframes fog-drift-b { from { transform: translateX(0); } to { transform: translateX(-11vw); } }

#embers {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 50% 38%, transparent 52%, rgba(0, 0, 0, 0.52) 100%);
}

main, .foot { position: relative; z-index: 10; }

/* ---------- hero ---------- */

.hero {
  min-height: 88dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 4rem 1.25rem 3rem;
}

.hero-arch {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 96%;
  color: var(--bone);
  opacity: 0.09;
  pointer-events: none;
}

.hero-inner { position: relative; text-align: center; }
.hero-inner::before {
  content: '';
  position: absolute;
  inset: -14% -34%;
  background: radial-gradient(closest-side, rgba(178, 53, 23, 0.13), transparent 72%);
  pointer-events: none;
}
.hero-inner > * { position: relative; }

.wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 0.86;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.wm-the {
  display: block;
  font-size: clamp(1.5rem, 3.4vw, 2.5rem);
  letter-spacing: 0.42em;
  margin-left: 0.42em;
  color: var(--bone-dim);
}
.wm-aura {
  display: block;
  font-weight: 800;
  font-size: clamp(4.9rem, 17vw, 12.8rem);
  letter-spacing: 0.015em;
  color: var(--bone);
}
.wm-of {
  display: block;
  font-size: clamp(1.9rem, 4.6vw, 3.4rem);
  letter-spacing: 0.2em;
  margin-left: 0.2em;
  color: var(--bone-dim);
  transform: translateX(clamp(1.2rem, 6vw, 4.5rem));
}

.handle {
  margin-top: clamp(1.6rem, 4vh, 2.6rem);
  font-size: 1.05rem;
  letter-spacing: 0.34em;
  margin-left: 0.34em;
  color: var(--ember-hot);
  opacity: 0.88;
  text-transform: lowercase;
}

/* load-in masks */
.mask { display: block; overflow: hidden; }
.mask-in { display: block; transform: translateY(112%); }
html:not(.no-js) .hero .mask-in { animation: rise 1.1s var(--ease) forwards; }
.wordmark .mask:nth-child(1) .mask-in { animation-delay: 0.15s; }
.wordmark .mask:nth-child(2) .mask-in { animation-delay: 0.3s; }
.wordmark .mask:nth-child(3) .mask-in { animation-delay: 0.5s; }
.handle .mask-in { animation-delay: 0.75s; }
html.no-js .mask-in { transform: none; }

@keyframes rise { to { transform: translateY(0); } }

/* ---------- section shells ---------- */

.relics, .gates {
  padding: clamp(4.5rem, 11vh, 8.5rem) clamp(1.1rem, 4vw, 3rem);
}
.gates { padding-bottom: clamp(2.5rem, 6vh, 4.5rem); }

.sec-head {
  max-width: 720px;
  margin: 0 auto clamp(2.8rem, 7vh, 5rem);
  text-align: center;
}

.rule {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-bottom: 1.4rem;
}
.rule span { flex: 1; height: 1px; background: var(--line); }
.gem {
  width: 8px;
  height: 8px;
  border: 1px solid var(--ember);
  transform: rotate(45deg);
  flex: none;
}

.sec-head h2 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(2.3rem, 5.6vw, 3.7rem);
  letter-spacing: 0.06em;
  line-height: 1.1;
  color: var(--bone);
}

.lede {
  margin-top: 0.8rem;
  color: var(--ash);
  font-size: 1.12rem;
}

/* ---------- relics ---------- */

.relics-row {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: clamp(1rem, 3vw, 3.2rem);
  align-items: end;
  max-width: 1380px;
  margin: 0 auto;
}

.niche { text-align: center; }

.relic-btn {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 0.98;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.relic-btn:focus-visible {
  outline: 1px solid var(--bone);
  outline-offset: 6px;
}

.arch {
  position: absolute;
  bottom: 4%;
  left: 50%;
  transform: translateX(-50%);
  height: 96%;
  aspect-ratio: 320 / 460;
  max-width: 74%;
  color: var(--bone);
  transition: filter 0.7s;
}
.arch-line { stroke: currentColor; stroke-width: 1.4; opacity: 0.35; }
.arch-line-2 { stroke-width: 1; opacity: 0.18; }

html:not(.no-js) .reveal .arch-line { stroke-dasharray: 1000; stroke-dashoffset: 1000; }
html:not(.no-js) .reveal.in .arch-line { animation: draw 1.9s var(--ease) 0.2s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.relic {
  position: absolute;
  bottom: 0;
  left: -3%;
  width: 106%;
  color: var(--bone);
  transition: color 0.6s;
}
.relic .relic-lines path,
.relic .relic-lines rect,
.relic .relic-lines circle,
.relic .relic-lines line {
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.relic .s3 { stroke-width: 3; }
.relic .s25 { stroke-width: 2.4; }
.relic .s2 { stroke-width: 2; }
.relic .s15 { stroke-width: 1.5; }
.relic .s1 { stroke-width: 1.1; }
.relic .dim { opacity: 0.5; }

.relic .hot { transition: filter 0.6s; }
.relic .hot * { transition: stroke 0.6s; }
.relic .smoke { stroke: currentColor; fill: none; }

/* candle flames: hidden until lit */
.relic .relic-lines path.flame {
  stroke: none;
  fill: var(--ember-hot);
  opacity: 0;
  transition: opacity 0.5s;
  transition-delay: var(--d, 0s);
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
.relic .flames { transition: filter 0.6s; }

.relic-btn:hover .relic, .relic-btn:focus-visible .relic { color: var(--bone-bright); }
.relic-btn:hover .arch, .relic-btn:focus-visible .arch {
  filter: drop-shadow(0 0 22px rgba(255, 124, 63, 0.1));
}
.relic-btn:active .relic { transform: scale(0.995); }

.niche.running .relic { color: var(--bone-bright); }
.niche.running .relic .hot * { stroke: var(--ember-hot); }
.niche.running .relic .hot { filter: drop-shadow(0 0 7px rgba(255, 124, 63, 0.5)); }
.niche.running .relic .lens { stroke: var(--ember-hot); }
.niche.running .relic path.flame {
  opacity: 0.92;
  animation: flick 0.85s ease-in-out infinite alternate;
  animation-delay: var(--d, 0s);
}
.niche.running .relic .flames { filter: drop-shadow(0 0 9px rgba(255, 124, 63, 0.55)); }
.niche.running .arch { filter: drop-shadow(0 0 26px rgba(255, 124, 63, 0.16)); }
.niche.running .relic-cap b { color: var(--ember-hot); }

@keyframes flick {
  0% { transform: scaleY(1) skewX(0deg); }
  40% { transform: scaleY(0.92) skewX(2.2deg); }
  100% { transform: scaleY(1.08) skewX(-2.4deg); }
}

/* bell toll swing */
.bell-swing {
  transform-box: view-box;
  transform-origin: 460px 208px;
}
.clapper {
  transform-box: view-box;
  transform-origin: 460px 300px;
}
.niche.running .bell-swing { animation: toll 2.45s ease-in-out infinite; }
.niche.running .clapper { animation: toll-clapper 2.45s ease-in-out infinite; }

@keyframes toll {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(13deg); }
  50% { transform: rotate(0deg); }
  75% { transform: rotate(-13deg); }
  100% { transform: rotate(0deg); }
}
@keyframes toll-clapper {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-9deg); }
  50% { transform: rotate(0deg); }
  75% { transform: rotate(9deg); }
  100% { transform: rotate(0deg); }
}

/* censer pendulum */
.censer-swing {
  transform-box: view-box;
  transform-origin: 460px 40px;
}
.niche.running .censer-swing { animation: pendulum 1.9s ease-in-out infinite alternate; }

@keyframes pendulum {
  from { transform: rotate(11deg); }
  to { transform: rotate(-11deg); }
}

.relic-cap {
  margin-top: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.relic-cap b {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  transition: color 0.5s;
}
.relic-cap span {
  color: var(--ash);
  font-size: 0.98rem;
  letter-spacing: 0.14em;
}

/* ---------- gates ---------- */

.gate-list {
  max-width: 980px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.gate {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: clamp(1.5rem, 3.4vw, 2.2rem) clamp(0.9rem, 2.5vw, 1.8rem);
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}
.gate::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(178, 53, 23, 0.14), transparent 65%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.55s var(--ease);
}
.gate:hover::before, .gate:focus-visible::before { transform: scaleX(1); }
.gate:focus-visible { outline: 1px solid var(--bone); outline-offset: -1px; }

.gate-text { position: relative; display: flex; flex-direction: column; gap: 0.3rem; }

.gate-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(1.55rem, 3.5vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: 0.03em;
  transition: color 0.4s;
}
.gate:hover .gate-title, .gate:focus-visible .gate-title { color: var(--ember-hot); }

.gate-desc { color: var(--ash); font-size: 1.05rem; }

.gate-glyph {
  position: relative;
  width: 30px;
  height: 30px;
  color: var(--bone-dim);
  opacity: 0.75;
  transition: transform 0.5s var(--ease), color 0.4s, opacity 0.4s;
}
.gate:hover .gate-glyph, .gate:focus-visible .gate-glyph {
  color: var(--ember-hot);
  opacity: 1;
  transform: translateX(6px);
}

.gate--main { padding-top: clamp(2rem, 4.5vw, 3rem); padding-bottom: clamp(2rem, 4.5vw, 3rem); }
.gate--main .gate-title { font-size: clamp(2rem, 4.6vw, 3.1rem); }
.gate--main .gate-glyph { width: 38px; height: 38px; color: var(--ember); }

/* ---------- footer ---------- */

.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  max-width: 980px;
  margin: 0 auto;
  padding: 2.2rem clamp(1.1rem, 4vw, 1.8rem) 2.8rem;
  border-top: 1px solid var(--line);
}
.foot-mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--bone-dim);
}
.foot-copy { color: var(--ash); font-size: 0.98rem; letter-spacing: 0.08em; }

/* ---------- reveals ---------- */

html:not(.no-js) .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
html:not(.no-js) .reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- mobile ---------- */

@media (max-width: 860px) {
  .relics-row { grid-template-columns: 1fr; gap: 3.2rem; max-width: 480px; }
  .niche--main { order: -1; }
  .hero { min-height: 82dvh; }
  .gate { gap: 1rem; }
  .gate-glyph { width: 26px; height: 26px; }
  .gate--main .gate-glyph { width: 32px; height: 32px; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fog-a, .fog-b { animation: none; }
  html:not(.no-js) .hero .mask-in { animation: none; transform: none; }
  html:not(.no-js) .reveal { opacity: 1; transform: none; transition: none; }
  html:not(.no-js) .reveal .arch-line { stroke-dasharray: none; stroke-dashoffset: 0; animation: none; }
  .niche.running .relic path.flame { animation: none; }
  .niche.running .bell-swing, .niche.running .clapper, .niche.running .censer-swing { animation: none; }
  .gate::before { transition: none; }
}
