/* ============================================================
   STYLES - you normally do not need to edit this file.
   All text lives in js/content.js.
   ============================================================ */

:root {
  /* Palette - warm gold with readable earth-toned text */
  --void:       #f1d990;
  --ink:        #2b2115;
  --ivory:      #2c2418;
  --ivory-dim:  rgba(44, 36, 24, 0.80);
  --ivory-faint:rgba(44, 36, 24, 0.56);
  --gold:       #7b5819;
  --gold-soft:  rgba(123, 88, 25, 0.62);
  --gold-faint: rgba(123, 88, 25, 0.20);
  --gold-hair:  rgba(123, 88, 25, 0.28);
  --sapphire:   #5b6687;
  --rose:       #9f6254;
  --emerald:    #54785f;

  /* Type */
  --serif: "Manrope", "Inter", "Segoe UI", sans-serif;
  --sans:  "Inter", "Segoe UI", Arial, sans-serif;

  --measure: 62ch;
  --pad-x: clamp(1.25rem, 5vw, 3rem);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--gold-faint) transparent;
}

body {
  background: var(--void);
  color: var(--ivory);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.08rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--gold-faint); color: var(--ivory); }

/* ── The cosmology canvas ── */
#cosmos {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
}

/* ── Top navigation ── */
#topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--pad-x);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.9s ease, transform 0.9s ease, background 0.6s ease;
  pointer-events: none;
}
#topnav.visible { opacity: 1; transform: none; pointer-events: auto; }
#topnav.scrolled {
  background: linear-gradient(to bottom, rgba(241, 217, 144, 0.88), rgba(241, 217, 144, 0));
}

.monogram {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  text-decoration: none;
  line-height: 1;
  border: 1px solid var(--gold-faint);
  border-radius: 50%;
  width: 2.4rem; height: 2.4rem;
  display: grid; place-items: center;
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
}
.monogram:hover, .monogram:focus-visible {
  border-color: var(--gold-soft);
  box-shadow: 0 0 18px rgba(201, 164, 92, 0.25);
}

.nav-links { display: flex; gap: clamp(1rem, 3vw, 2.4rem); }
.nav-links a {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--ivory-dim);
  text-decoration: none;
  padding: 0.3rem 0;
  position: relative;
  transition: color 0.4s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 0;
  width: 0; height: 1px;
  background: var(--gold-soft);
  transition: width 0.45s ease, left 0.45s ease;
}
.nav-links a:hover, .nav-links a:focus-visible { color: var(--ivory); }
.nav-links a:hover::after, .nav-links a:focus-visible::after { width: 100%; left: 0; }

/* ── Cosmic path (right-edge progress + anchors) ── */
#cosmic-path {
  position: fixed;
  right: clamp(0.9rem, 2vw, 1.8rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  height: 46vh;
  display: flex;
  align-items: stretch;
  opacity: 0;
  transition: opacity 1s ease;
}
#cosmic-path.visible { opacity: 1; }

.path-line {
  width: 1px;
  background: rgba(44, 36, 24, 0.14);
  position: relative;
  border-radius: 1px;
}
.path-fill {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 0%;
  background: linear-gradient(to bottom, var(--gold-faint), var(--gold));
  box-shadow: 0 0 8px rgba(201, 164, 92, 0.5);
  border-radius: 1px;
}

.path-stops {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  transform: translateX(-50%);
  left: 50%;
}
.path-stop {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(44, 36, 24, 0.28);
  background: var(--void);
  transition: border-color 0.4s ease, box-shadow 0.4s ease, background 0.4s ease;
}
.path-stop:hover { border-color: var(--gold); }
.path-stop.passed {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(201, 164, 92, 0.6);
}

/* ── Layout primitives ── */
main { position: relative; z-index: 1; }

.section {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(7rem, 16vh, 12rem) var(--pad-x);
  scroll-margin-top: 5.5rem;
}
body.motion-ready .section {
  opacity: var(--section-opacity, 1);
  transform: translate3d(0, var(--section-shift, 0px), 0) scale(var(--section-scale, 1));
  transform-origin: 50% 45%;
  will-change: opacity, transform;
}

.section-head { margin-bottom: clamp(2.5rem, 6vh, 4.5rem); }
.section-head-center { text-align: center; }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 2.2rem; height: 1px;
  background: var(--gold-hair);
  vertical-align: middle;
  margin-right: 0.9rem;
}
.section-head-center .eyebrow::before { display: none; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0;
}
h2 { font-size: 3.15rem; color: var(--ivory); }
.section-intro {
  max-width: var(--measure);
  margin-top: 1.4rem;
  color: var(--ivory-dim);
  font-size: 1.08em;
}
.section-head-center .section-intro { margin-left: auto; margin-right: auto; }

/* ── Reveal on scroll ── */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1.1s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 1.1s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.reveal.in { opacity: 1; transform: none; }

/* ── HERO ── */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--pad-x);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(255, 249, 229, 0.68) 0%, rgba(241, 217, 144, 0.54) 48%, rgba(220, 176, 79, 0.34) 100%),
    radial-gradient(ellipse at center, rgba(255, 245, 207, 0.58) 0%, rgba(255, 245, 207, 0.28) 34%, rgba(255, 245, 207, 0) 62%),
    url("../assets/hero-temple-sky.jpg");
  background-size: cover;
  background-position: 58% center;
  filter: saturate(0.92) contrast(0.94);
  transform: scale(1.03);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at center, rgba(255, 244, 205, 0.68) 0%, rgba(255, 244, 205, 0.28) 32%, rgba(255, 244, 205, 0) 58%),
    linear-gradient(90deg, rgba(241, 217, 144, 0.34), rgba(255, 251, 235, 0.36), rgba(241, 217, 144, 0.18));
  pointer-events: none;
}
.hero > * {
  position: relative;
  z-index: 1;
}

.hero-invocation {
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--ivory-faint);
  margin-bottom: 2.2rem;
  transition-delay: 0.2s;
}
.hero-invocation:empty { display: none; }

.hero-logo {
  width: min(7.25rem, 31vw);
  height: auto;
  margin-bottom: 1.15rem;
  opacity: 0.96;
  filter:
    saturate(0.96)
    contrast(1.02)
    drop-shadow(0 10px 22px rgba(89, 61, 23, 0.28));
  transition-delay: 0.28s;
}

.hero-name {
  font-size: 4.8rem;
  font-weight: 700;
  color: var(--ivory);
  text-shadow: 0 14px 44px rgba(89, 61, 23, 0.24), 0 1px 0 rgba(255, 249, 229, 0.35);
  transition-delay: 0.5s;
}

.hero-rule {
  width: 4.5rem;
  height: 1px;
  margin: 2.4rem 0;
  background: linear-gradient(to right, transparent, var(--gold-soft), transparent);
  transition-delay: 0.85s;
}

.hero-tagline {
  font-family: var(--serif);
  font-style: normal;
  font-weight: 500;
  font-size: 1.45rem;
  color: rgba(44, 36, 24, 0.84);
  text-shadow: 0 10px 30px rgba(255, 248, 224, 0.45);
  max-width: 34ch;
  line-height: 1.6;
  transition-delay: 1.05s;
}

.hero-descend {
  position: absolute;
  bottom: 3.2rem;
  left: 50%;
  transform: translateX(-50%);
  transition-delay: 1.6s;
}
.descend-line {
  display: block;
  width: 1px; height: 3.4rem;
  background: linear-gradient(to bottom, var(--gold-soft), transparent);
  animation: descend 3.2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes descend {
  0%, 100% { transform: scaleY(0.55); opacity: 0.5; }
  50%      { transform: scaleY(1);    opacity: 1; }
}

/* ── ABOUT ── */
.about-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.about-portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 999px 999px 12px 12px;   /* arched, like a temple niche */
  overflow: hidden;
  border: 1px solid var(--gold-hair);
  box-shadow: 0 0 0 10px rgba(123, 88, 25, 0.07), 0 30px 70px rgba(89, 61, 23, 0.18);
  background: radial-gradient(ellipse at 50% 35%, rgba(255, 248, 224, 0.42), rgba(123, 88, 25, 0.08) 70%);
}
.about-portrait img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 54% 23%;
  display: block;
  filter: saturate(0.92);
}
.portrait-emblem {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.portrait-emblem svg { width: 62%; height: auto; opacity: 0.9; }

#about-paragraphs p {
  max-width: var(--measure);
  margin-bottom: 1.5rem;
  color: var(--ivory-dim);
}
#about-paragraphs p:first-child {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: var(--ivory-dim);
}
.about-segment {
  max-width: var(--measure);
  margin-bottom: 2.05rem;
}
.about-segment-label {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.9rem;
  color: var(--gold);
}
.about-segment-label::after {
  content: "";
  width: 2.25rem;
  height: 1px;
  background: var(--gold-hair);
}
.about-segment p {
  margin-bottom: 0;
}

.about-facts {
  margin-top: 2.6rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem 2rem;
  border-top: 1px solid rgba(239, 231, 212, 0.1);
  padding-top: 2rem;
}
.about-facts:empty { display: none; }
.about-facts dt {
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 0.4rem;
}
.about-facts dd { color: var(--ivory-dim); font-size: 0.98em; }

.about-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 3.5rem;
}
.about-gallery:empty { display: none; }
.about-gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(239, 231, 212, 0.1);
  filter: saturate(0.92);
}

.about-closing {
  font-family: var(--serif);
  font-style: normal;
  font-size: 1.45rem;
  line-height: 1.6;
  color: var(--ivory);
  max-width: 44ch;
  margin: clamp(3.5rem, 8vh, 5.5rem) auto 0;
  text-align: center;
}

/* ── ESSENCE ── */
.essence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: clamp(1.2rem, 2.5vw, 2rem);
}
.essence-grid:empty { display: none; }

#essence .section-intro {
  max-width: 64rem;
  color: var(--ivory);
  font-size: 1.16rem;
  line-height: 1.95;
}
.essence-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}
.essence-actions:empty { display: none; }
.essence-action {
  color: var(--ivory);
  background: rgba(255, 248, 224, 0.08);
}

.essence-card {
  padding: 2.2rem 1.9rem 2.4rem;
  border-top: 1px solid var(--gold-hair);
  background: linear-gradient(to bottom, rgba(239, 231, 212, 0.035), rgba(239, 231, 212, 0));
  border-radius: 0 0 8px 8px;
  transition: background 0.6s ease, border-color 0.6s ease, transform 0.6s ease;
}
.essence-card:hover {
  background: linear-gradient(to bottom, rgba(201, 164, 92, 0.07), rgba(201, 164, 92, 0));
  border-top-color: var(--gold-soft);
  transform: translateY(-4px);
}
.essence-card .glyph {
  width: 2.1rem; height: 2.1rem;
  margin-bottom: 1.4rem;
  color: var(--gold);
  opacity: 0.85;
}
.essence-card h3 {
  font-size: 1.45rem;
  margin-bottom: 0.8rem;
  color: var(--ivory);
}
.essence-card p { color: var(--ivory-dim); font-size: 0.98em; }

/* RESOURCES - the living library */
.resource-group { margin-bottom: clamp(2.6rem, 6vh, 4rem); }
.resource-group:last-child { margin-bottom: 0; }

.resource-category {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.resource-category::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--gold-faint), transparent);
}

.resource-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 2rem;
  align-items: baseline;
  padding: 1.15rem 0.9rem;
  margin: 0 -0.9rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.45s ease, transform 0.45s ease;
}
.resource-item:hover, .resource-item:focus-visible {
  background: rgba(239, 231, 212, 0.045);
  transform: translateX(4px);
}
.resource-item + .resource-item { border-top: 1px solid rgba(239, 231, 212, 0.07); }

.resource-title {
  font-family: var(--serif);
  font-size: 1.22rem;
  color: var(--ivory);
}
.resource-title::after {
  content: "->";
  display: inline-block;
  margin-left: 0.6rem;
  color: var(--gold-soft);
  font-family: var(--sans);
  font-size: 0.9rem;
  transform: translateX(0);
  transition: transform 0.4s ease;
}
.resource-item:hover .resource-title::after { transform: translateX(5px); }

.resource-type {
  font-size: 0.68rem;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--gold-soft);
  border: 1px solid var(--gold-faint);
  border-radius: 99px;
  padding: 0.25rem 0.85rem;
  white-space: nowrap;
}
.resource-desc {
  grid-column: 1 / -1;
  color: var(--ivory-dim);
  font-size: 0.94em;
}

/* CONTACT - the spiritual sky */
.section-contact {
  min-height: 92svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.contact-actions { margin-top: 0.5rem; }

.btn-sacred {
  display: inline-block;
  font-size: 0.82rem;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--ivory);
  text-decoration: none;
  padding: 1.05rem 2.9rem;
  border: 1px solid var(--gold-soft);
  border-radius: 99px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.6s ease, border-color 0.6s ease, color 0.6s ease;
}
.btn-sacred::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(201, 164, 92, 0.22), transparent 70%);
  opacity: 0;
  transition: opacity 0.6s ease;
}
.btn-sacred:hover, .btn-sacred:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 0 45px rgba(201, 164, 92, 0.3);
}
.btn-sacred:hover::before { opacity: 1; }

.contact-collab {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  max-width: 46rem;
  margin-top: 3.2rem;
}
.contact-collab:empty,
.contact-socials:empty,
.contact-closing:empty {
  display: none;
}
.contact-collab li {
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--ivory-dim);
  border: 1px solid rgba(239, 231, 212, 0.14);
  border-radius: 99px;
  padding: 0.45rem 1.15rem;
}

.contact-socials {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.2rem;
  margin-top: 3rem;
}
.contact-socials a {
  font-size: 0.8rem;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--ivory-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.25rem;
  transition: color 0.4s ease, border-color 0.4s ease;
}
.contact-socials a:hover, .contact-socials a:focus-visible {
  color: var(--gold);
  border-color: var(--gold-faint);
}

.contact-closing {
  font-family: var(--serif);
  font-style: normal;
  font-size: 1.3rem;
  color: var(--ivory-dim);
  margin-top: 4.2rem;
}

.site-footer {
  margin-top: 4.5rem;
  font-size: 0.75rem;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--ivory-faint);
}

/* ── Focus visibility ── */
a:focus-visible, .path-stop:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  #cosmic-path { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .about-portrait { max-width: 300px; margin: 0 auto; }
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  #topnav {
    padding: 0.85rem 0.95rem;
  }
  #topnav.scrolled {
    background: linear-gradient(to bottom, rgba(241, 217, 144, 0.96) 0%, rgba(241, 217, 144, 0.82) 58%, rgba(241, 217, 144, 0) 100%);
  }
  h2 { font-size: 2.35rem; }
  .hero-logo { width: 5.75rem; margin-bottom: 0.9rem; }
  .hero::before {
    background-position: 62% center;
  }
  .hero-name { font-size: 3.1rem; }
  .hero-tagline { font-size: 1.16rem; }
  .nav-links { gap: 0.7rem; }
  .nav-links a { font-size: 0.62rem; letter-spacing: 0; }
  .monogram { width: 2rem; height: 2rem; font-size: 1.3rem; }
  .resource-item { grid-template-columns: 1fr; }
  .resource-type { justify-self: start; }
}

/* ── Reduced motion: honor the visitor's stillness ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body.motion-ready .section {
    opacity: 1 !important;
    transform: none !important;
  }
  .reveal { opacity: 1; transform: none; transition: none; }
  .descend-line { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
