:root {
  color-scheme: dark;
  --ink: #f4f0e7;
  --muted: #b9c4b6;
  --moss: #95c66b;
  --lichen: #d6e77f;
  --rust: #d66b3d;
  --slate: #87a6a0;
  --deep: #07100b;
  --panel: rgba(9, 20, 14, 0.68);
  --line: rgba(244, 240, 231, 0.2);
  --mx: 50%;
  --my: 50%;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--deep);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background: #07100b;
  cursor: crosshair;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  min-height: 100vh;
  overflow: hidden;
}

.cursor-aura {
  position: fixed;
  left: var(--mx);
  top: var(--my);
  width: 34vmin;
  height: 34vmin;
  pointer-events: none;
  z-index: 20;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle, rgba(214, 231, 127, 0.22), rgba(149, 198, 107, 0.08) 38%, transparent 68%);
  mix-blend-mode: screen;
  transition: opacity 220ms ease;
}

body.is-active .cursor-aura {
  opacity: 1;
}

.hero {
  position: relative;
  min-height: 78vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(22px, 4vw, 56px);
  isolation: isolate;
  perspective: 1200px;
}

.image-plane {
  position: absolute;
  inset: 0;
  z-index: -3;
  background-image: url("/assets/moss-stone-hero.png");
  background-size: cover;
  background-position: center right;
  transform: scale(1.012);
  filter: saturate(0.9) contrast(1.08);
  will-change: transform;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(214, 231, 127, 0.18), transparent 24vmin),
    linear-gradient(90deg, rgba(5, 10, 7, 0.96), rgba(5, 10, 7, 0.72) 40%, rgba(5, 10, 7, 0.18) 76%),
    linear-gradient(180deg, rgba(5, 10, 7, 0.25), rgba(5, 10, 7, 0.72));
}

.grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.2;
  mix-blend-mode: overlay;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.24) 0 1px, transparent 1px),
    radial-gradient(circle at 80% 60%, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px);
  background-size: 5px 5px, 7px 7px;
  animation: grain-drift 600ms steps(2) infinite;
}

.scan-field {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.22;
  background:
    linear-gradient(transparent 0 48%, rgba(214, 231, 127, 0.18) 50%, transparent 52%),
    linear-gradient(90deg, transparent 0 48%, rgba(135, 166, 160, 0.1) 50%, transparent 52%);
  background-size: 100% 11px, 13px 100%;
  mask-image: linear-gradient(90deg, black, transparent 80%);
  animation: scan 9s linear infinite;
}

.trace-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.trace-field span {
  position: absolute;
  width: clamp(46px, 8vw, 112px);
  height: clamp(12px, 2vw, 24px);
  border: 1px solid rgba(214, 231, 127, 0.28);
  border-radius: 999px 16px 999px 16px;
  background: linear-gradient(90deg, rgba(149, 198, 107, 0.18), rgba(214, 231, 127, 0.04));
  filter: blur(0.2px);
  opacity: 0;
  transform: rotate(-18deg);
  animation: trace-rise 7s ease-in-out infinite;
}

.trace-field span:nth-child(1) { left: 58%; top: 22%; animation-delay: .2s; }
.trace-field span:nth-child(2) { left: 71%; top: 30%; animation-delay: 1.1s; }
.trace-field span:nth-child(3) { left: 62%; top: 48%; animation-delay: 2.2s; }
.trace-field span:nth-child(4) { left: 82%; top: 58%; animation-delay: 3.4s; }
.trace-field span:nth-child(5) { left: 48%; top: 66%; animation-delay: 4.5s; }
.trace-field span:nth-child(6) { left: 76%; top: 78%; animation-delay: 5.1s; }
.trace-field span:nth-child(7) { left: 90%; top: 38%; animation-delay: 6.1s; }
.trace-field span:nth-child(8) { left: 54%; top: 84%; animation-delay: 6.8s; }
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: rgba(244, 240, 231, 0.72);
  font-size: 12px;
  text-transform: uppercase;
  position: relative;
  z-index: 2;
}

.wordmark {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 34px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(7, 16, 11, 0.46);
  overflow: hidden;
  position: relative;
}

.wordmark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(214, 231, 127, 0.28), transparent);
  transform: translateX(-120%);
  animation: flashline 4.5s ease-in-out infinite;
}

.ticker {
  max-width: min(56vw, 520px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-copy {
  align-self: center;
  max-width: 980px;
  padding: 10vh 0 8vh;
  position: relative;
  z-index: 2;
  transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transform-style: preserve-3d;
  transition: transform 180ms ease-out;
}

.eyebrow {
  max-width: 360px;
  margin: 0 0 24px;
  color: var(--moss);
  font-size: 13px;
  line-height: 1.5;
  text-transform: uppercase;
  animation: slide-in 850ms cubic-bezier(.2, .8, .2, 1) both;
}

h1 {
  margin: 0;
  max-width: 920px;
  font-family: "Noto Serif CJK SC", "Songti SC", "STSong", serif;
  font-size: clamp(72px, 14vw, 178px);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: 0;
}

h1 span {
  display: block;
  width: fit-content;
  position: relative;
  animation: title-in 900ms cubic-bezier(.2, .8, .2, 1) both;
}

h1 span:nth-child(2) {
  animation-delay: 120ms;
}

h1 span:nth-child(3) {
  animation-delay: 240ms;
}

h1 span::before,
h1 span::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

h1 span::before {
  color: var(--lichen);
  transform: translate(0.025em, -0.018em);
  mix-blend-mode: screen;
}

h1 span::after {
  color: var(--rust);
  transform: translate(-0.018em, 0.018em);
  mix-blend-mode: lighten;
}

h1:hover span::before,
h1:hover span::after {
  opacity: 0.42;
  animation: chroma-shift 700ms steps(2, end) infinite;
}

.lede {
  max-width: 520px;
  margin: 28px 0 0;
  color: rgba(244, 240, 231, 0.72);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.65;
  animation: slide-in 850ms 260ms cubic-bezier(.2, .8, .2, 1) both;
}

.glyph-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 11, 0.42);
  backdrop-filter: blur(14px);
  position: relative;
  z-index: 2;
}

.glyph-strip span {
  min-height: 74px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  color: rgba(244, 240, 231, 0.62);
  font-family: "Noto Serif CJK SC", "Songti SC", serif;
  font-size: clamp(24px, 4vw, 46px);
  animation: glyph-pulse 3.2s ease-in-out infinite;
  animation-delay: var(--d);
}

.glyph-strip span:last-child {
  border-right: 0;
}

.below {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: rgba(244, 240, 231, 0.14);
  border-top: 1px solid rgba(244, 240, 231, 0.14);
}

article {
  min-height: 220px;
  padding: clamp(24px, 4vw, 48px);
  background:
    linear-gradient(180deg, rgba(14, 31, 22, 0.98), rgba(7, 16, 11, 0.98));
  position: relative;
  overflow: hidden;
}

article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--moss), var(--rust), transparent);
  transform: translateX(-100%);
  transition: transform 500ms ease;
}

article:hover::before {
  transform: translateX(0);
}

.index {
  color: var(--moss);
  font-size: 12px;
}

h2 {
  margin: 28px 0 14px;
  font-size: 24px;
  font-weight: 500;
}

article p {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

@media (max-width: 760px) {
  .hero {
    min-height: 82vh;
    padding: 20px;
  }

  .topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-copy {
    padding: 7vh 0 5vh;
  }

  h1 {
    font-size: clamp(60px, 24vw, 112px);
  }

  .glyph-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .glyph-strip span:nth-child(2) {
    border-right: 0;
  }

  .glyph-strip span:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .below {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .image-plane {
    animation: breathe 18s ease-in-out infinite alternate;
  }

  @keyframes breathe {
    from {
      transform: scale(1.012) translate3d(0, 0, 0);
    }
    to {
      transform: scale(1.045) translate3d(-1.2%, 0.8%, 0);
    }
  }

  @keyframes grain-drift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(2px, -1px); }
  }

  @keyframes scan {
    from { background-position: 0 -120px, -80px 0; }
    to { background-position: 0 120px, 80px 0; }
  }

  @keyframes trace-rise {
    0%, 100% {
      opacity: 0;
      transform: translate3d(0, 18px, 0) rotate(-18deg) scale(0.82);
    }
    18%, 56% {
      opacity: 0.75;
    }
    72% {
      opacity: 0;
      transform: translate3d(-18px, -30px, 0) rotate(-14deg) scale(1.05);
    }
  }

  @keyframes flashline {
    0%, 62% { transform: translateX(-120%); }
    80%, 100% { transform: translateX(120%); }
  }

  @keyframes title-in {
    from {
      opacity: 0;
      clip-path: inset(0 100% 0 0);
      transform: translate3d(-28px, 18px, 0);
    }
    to {
      opacity: 1;
      clip-path: inset(0);
      transform: translate3d(0, 0, 0);
    }
  }

  @keyframes slide-in {
    from {
      opacity: 0;
      transform: translateY(16px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes chroma-shift {
    0% { clip-path: inset(0 0 72% 0); }
    33% { clip-path: inset(34% 0 28% 0); }
    66% { clip-path: inset(76% 0 0 0); }
    100% { clip-path: inset(8% 0 62% 0); }
  }

  @keyframes glyph-pulse {
    0%, 100% {
      color: rgba(244, 240, 231, 0.5);
      transform: translateY(0);
    }
    45% {
      color: rgba(214, 231, 127, 0.92);
      transform: translateY(-4px);
    }
  }
}
