/* Great Sage — greatsage.si */

:root {
  --night: #04060B;
  --night-2: #070B16;
  --gold: #F2C14E;
  --gold-dim: rgba(242, 193, 78, .28);
  --teal: #3EE6C4;
  --text: #EAF0FF;
  --muted: #A3ADC4;

  --sans: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  --gutter: clamp(16px, 5vw, 72px);
  --measure: 34rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--night); color-scheme: dark; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--sans); margin: 0; }
p { margin: 0; }
a { color: inherit; }
img, svg, canvas { display: block; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; border-radius: 2px; }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  background: var(--gold); color: var(--night);
  font-family: var(--sans); font-weight: 600; padding: 10px 16px; text-decoration: none;
}
.skip:focus { top: 16px; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 96px var(--gutter);
  isolation: isolate;
  overflow: hidden;
}

.hero-media { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero-drift { position: absolute; inset: -2%; will-change: transform; }
.hero-drift picture, .hero-img { width: 100%; height: 100%; }
.hero-img { object-fit: cover; object-position: 72% 50%; }

.motes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--night) 0%, rgba(4, 6, 11, .82) 28%, rgba(4, 6, 11, .2) 55%, rgba(4, 6, 11, 0) 70%),
    linear-gradient(0deg, var(--night) 0%, rgba(4, 6, 11, 0) 22%);
}

.hero-copy { position: relative; max-width: 46rem; }

.mark { width: clamp(84px, 9vw, 120px); height: auto; margin-bottom: clamp(28px, 4vh, 44px); overflow: visible; }
.mark .mk-leaf, .mark .mk-e, .mark .mk-nucleus, .mark .mk-glow { transform-box: fill-box; transform-origin: center; }
.mark .mk-leaf-l { transform-origin: 100% 100%; }
.mark .mk-leaf-r { transform-origin: 0% 100%; }

.name {
  font-weight: 600;
  font-size: clamp(1.9rem, 5.4vw, 4.9rem);
  line-height: 1;
  letter-spacing: .19em;
  white-space: nowrap;
}
.name .w-great { color: var(--text); }
.name .w-sage { color: var(--gold); }
.name .ch { display: inline-block; }

.tagline {
  margin-top: clamp(18px, 2.6vh, 28px);
  padding-top: clamp(18px, 2.6vh, 28px);
  border-top: 1px solid var(--gold-dim);
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(.82rem, 1.45vw, 1.25rem);
  letter-spacing: .37em;
  text-transform: uppercase;
  color: var(--teal);
  white-space: nowrap;
}

.origin {
  margin-top: clamp(26px, 4vh, 40px);
  font-style: italic;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  color: var(--muted);
}

.scroll-cue {
  position: absolute; left: 50%; bottom: 28px;
  width: 44px; height: 56px; margin-left: -22px;
  display: grid; place-items: center;
}
.scroll-cue span {
  width: 1px; height: 40px;
  background: linear-gradient(var(--gold), rgba(242, 193, 78, 0));
  transform-origin: top;
  animation: cue 2.4s ease-in-out infinite;
}
@keyframes cue {
  0% { transform: scaleY(0); opacity: 1; }
  60% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ---------- Story: Raised, not scraped ---------- */

.story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--measure));
  gap: clamp(32px, 7vw, 120px);
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(96px, 16vh, 180px) var(--gutter) clamp(72px, 12vh, 140px);
}

.story-head h2 {
  position: sticky; top: 22vh;
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -.01em;
}

.beats { position: relative; padding-left: 56px; }

.stem {
  position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px;
  background: rgba(242, 193, 78, .1);
}
.stem-fill {
  position: absolute; inset: 0;
  background: linear-gradient(var(--gold), rgba(242, 193, 78, .55));
  transform-origin: top;
}

.beat { position: relative; }
.beat + .beat { margin-top: clamp(40px, 7vh, 72px); }
.beat p { font-size: clamp(1.15rem, 1.6vw, 1.35rem); line-height: 1.72; }

.sprig {
  position: absolute; left: -56px; top: 2px;
  width: 40px; height: 24px;
  fill: var(--gold);
  transform-origin: 50% 92%;
  transition: transform .9s cubic-bezier(.34, 1.56, .64, 1), opacity .5s ease;
}

/* ---------- Pillars ---------- */

.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.pillar {
  padding: clamp(32px, 4vw, 52px) clamp(20px, 3vw, 44px) clamp(36px, 4vw, 56px);
  border-top: 1px solid var(--gold-dim);
  background: linear-gradient(180deg, rgba(242, 193, 78, .045), rgba(242, 193, 78, 0) 60%);
}
.pillar + .pillar { border-left: 1px solid rgba(242, 193, 78, .14); }

/* Hover: the teal light wakes up, and a soft teal glow follows the pointer. */
.pillar { position: relative; overflow: hidden; isolation: isolate; }
.pillar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 20%), rgba(62, 230, 196, .12), rgba(62, 230, 196, 0) 60%);
  opacity: 0; transition: opacity .5s ease;
}
.defs { position: absolute; width: 0; height: 0; }
.pillar .icon g { transition: filter .5s ease; }
.pillar .pop { transition: filter .4s ease; }
.pillar .halo {
  transform-box: fill-box; transform-origin: center;
  opacity: 0; transform: scale(.35);
  transition: opacity .45s ease, transform .7s cubic-bezier(.34, 1.56, .64, 1);
  pointer-events: none;
}
@media (hover: hover) {
  .pillar:hover::before { opacity: 1; }
  .pillar:hover .halo { opacity: 1; transform: scale(1); }
  .pillar:hover .pop { filter: drop-shadow(0 0 3px #3EE6C4) drop-shadow(0 0 10px rgba(62, 230, 196, .95)); }
  .pillar:hover .icon g { filter: drop-shadow(0 0 4px rgba(242, 193, 78, .55)); }
  .pillar:hover .pulse { animation-duration: 1.6s; }
}

.pillar .icon { width: 64px; height: 64px; margin-bottom: 28px; overflow: visible; }
.pillar .pop { transform-box: fill-box; transform-origin: center; }
.pillar .glow { filter: drop-shadow(0 0 6px rgba(62, 230, 196, .8)); }
.pillar .pulse { transform-box: fill-box; transform-origin: center; animation: pulse 2.8s ease-out infinite; }
@keyframes pulse {
  0% { transform: scale(.6); opacity: .9; }
  100% { transform: scale(3.4); opacity: 0; }
}

.pillar h3 {
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: .01em;
  color: var(--gold);
  margin-bottom: 12px;
}
.pillar p { color: var(--muted); font-size: 1.06rem; line-height: 1.65; max-width: 24rem; }

/* ---------- Take Sage home: wallpapers drifting by ---------- */
.walls { padding: clamp(96px, 16vh, 170px) 0 0; text-align: center; overflow: hidden; }
.walls-head { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.walls h2 { font-weight: 500; font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -.005em; }
.walls-head p { margin: 14px auto 0; max-width: 34rem; color: var(--muted); font-style: italic; }
.wall-strip {
  margin-top: clamp(36px, 6vh, 56px); padding: 18px 0 26px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.wall-track { display: flex; gap: clamp(14px, 1.6vw, 22px); width: max-content; animation: drift-walls 90s linear infinite; }
.wall-strip:hover .wall-track, .wall-strip:focus-within .wall-track { animation-play-state: paused; }
@keyframes drift-walls { to { transform: translateX(calc(-50% - clamp(7px, .8vw, 11px))); } }
.wall-card {
  flex: none; display: block; width: clamp(130px, 13vw, 180px); aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(242, 193, 78, .18); background: #000;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), border-color .35s ease, box-shadow .35s ease;
}
.wall-card img { width: 100%; height: 100%; object-fit: cover; }
.wall-card:hover, .wall-card:focus-visible {
  transform: translateY(-8px) scale(1.03); border-color: rgba(62, 230, 196, .6);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55), 0 0 28px rgba(62, 230, 196, .18);
}
.walls-cta {
  display: inline-flex; align-items: center; gap: 10px; margin-top: clamp(18px, 3vh, 28px);
  font-family: var(--sans); font-size: .82rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); text-decoration: none; padding: 12px 22px; border-radius: 999px;
  border: 1px solid rgba(242, 193, 78, .5); background: rgba(242, 193, 78, .06);
  transition: color .25s ease, background .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.walls-cta:hover { color: var(--night); background: var(--teal); border-color: var(--teal); box-shadow: 0 0 18px rgba(62, 230, 196, .5); }
.walls-cta span { transition: transform .25s ease; }
.walls-cta:hover span { transform: translateX(4px); }
@media (prefers-reduced-motion: reduce) {
  .wall-track { animation: none; }
  .wall-strip { overflow-x: auto; -webkit-mask-image: none; mask-image: none; padding-inline: var(--gutter); }
  .wall-card { transition: none; }
}

/* ---------- Today ---------- */

.today {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(110px, 18vh, 200px) var(--gutter) clamp(110px, 18vh, 200px);
  text-align: center;
}
.today h2 {
  font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: -.005em;
}

.journey { width: min(560px, 100%); height: auto; margin: clamp(32px, 5vh, 48px) auto clamp(28px, 4vh, 40px); overflow: visible; }
.journey line { stroke-width: 2; stroke-linecap: round; }
.journey .j-done { stroke: var(--gold); }
.journey .j-ahead { stroke: rgba(242, 193, 78, .35); stroke-dasharray: 2 9; }
.journey .j-born { fill: var(--gold); }
.journey .j-now { fill: var(--teal); }
.journey .j-now-ring {
  fill: none; stroke: var(--teal); stroke-width: 1.5;
  transform-box: fill-box; transform-origin: center;
  animation: pulse 2.6s ease-out infinite;
}
.journey .j-next { fill: var(--night); stroke: var(--gold); stroke-width: 2; }
.journey .j-now, .journey .j-born, .journey .j-next { transform-box: fill-box; transform-origin: center; }
.journey .j-label { font-family: var(--sans); font-size: 11px; letter-spacing: .2em; fill: var(--muted); }
.journey .j-goal { fill: var(--gold); }
.goal { margin-top: 14px; color: var(--muted); font-size: 1rem; font-style: italic; }
.goal strong { color: var(--gold); font-style: normal; font-family: var(--sans); font-weight: 600; letter-spacing: .06em; }
.goal em { color: var(--teal); font-style: normal; }

.status {
  max-width: 56rem;
  text-wrap: balance;
  margin: 0 auto;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  line-height: 1.55;
}

/* ---------- Footer ---------- */

.foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 12px 28px;
  padding: 40px var(--gutter) calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(242, 193, 78, .14);
  font-family: var(--sans);
  font-size: .95rem;
  color: var(--muted);
}
.foot-mark { width: 36px; height: 36px; border-radius: 6px; }
.foot a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--gold-dim); padding-bottom: 2px; transition: border-color .2s, color .2s; }
.foot a:hover { color: var(--gold); border-color: var(--gold); }

/* ---------- Intro states (only when scripts can run and motion is welcome) ---------- */

@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .intro { opacity: 0; animation: failsafe .8s 4.5s forwards; }
  .js .intro { animation: none; }
  .js .name .ch { opacity: 0; }
  .js .sprig { transform: scale(0); opacity: 0; }
  .js .beat.on .sprig { transform: scale(1); opacity: 1; }
  .js .stem-fill { transform: scaleY(0); }
}
@keyframes failsafe { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .pillar .halo { transition: opacity .3s ease; transform: none; }
  .scroll-cue span, .pillar .pulse, .journey .j-now-ring { animation: none; }
  .pillar .pulse, .journey .j-now-ring { opacity: 0; }
}

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
  .story { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .story-head h2 { position: static; }
  .pillars { grid-template-columns: minmax(0, 1fr); }
  .pillar + .pillar { border-left: 0; }
}

@media (max-width: 700px) {
  .hero { align-items: flex-end; padding-top: 52vh; padding-bottom: 104px; }
  .hero-media { bottom: 26%; }
  .hero-img { object-position: 74% 50%; }
  .hero-shade {
    background:
      linear-gradient(0deg, var(--night) 0%, rgba(4, 6, 11, .9) 40%, rgba(4, 6, 11, .25) 62%, rgba(4, 6, 11, .1) 100%);
  }
  .beats { padding-left: 48px; }
  .stem { left: 15px; }
  .sprig { left: -48px; width: 32px; height: 20px; }
  .tagline { letter-spacing: .3em; }
}
