:root {
  --color-black: #050505;
  --color-black-soft: #101010;
  --color-card: #171717;
  --color-border: #292929;
  --color-text: #f5f5f5;
  --color-muted: #9a9a9a;
  --color-accent: #7657ff;
  --color-accent-soft: rgba(118, 87, 255, 0.16);
  --font-title: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --container: 1080px;
  --header-height: 68px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--color-text);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 80% 12%, rgba(118, 87, 255, 0.08), transparent 28rem),
    linear-gradient(180deg, #050505 0%, #070707 48%, #050505 100%);
  line-height: 1.6;
}

body.menu-open {
  overflow: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px);
  background-size: 5.5rem 5.5rem;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
  content: "";
}

main,
.site-footer {
  position: relative;
  z-index: 1;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-title);
  letter-spacing: 0;
  line-height: 1;
}

p {
  color: var(--color-muted);
}

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

.ambient-subtitle-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  perspective: 900px;
  pointer-events: none;
  transform-style: preserve-3d;
}

.ambient-subtitle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  max-width: none;
  color: rgba(245, 245, 245, 0.34);
  font-family: var(--font-mono);
  font-size: clamp(1.05rem, 2.15vw, 2.35rem);
  font-weight: 700;
  line-height: 1.16;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.4),
    0 0 18px rgba(255, 255, 255, 0.24),
    0 0 42px rgba(118, 87, 255, 0.18);
  opacity: calc(0.68 * var(--intensity, 1));
  filter: blur(0.2px) drop-shadow(0 0 18px rgba(118, 87, 255, 0.16));
  mix-blend-mode: screen;
  transform:
    translate3d(-50%, -50%, var(--z))
    rotateX(var(--rx))
    rotateY(var(--ry))
    rotateZ(var(--rz))
    scale(var(--size, 0.74));
  transform-origin: center;
  transition:
    opacity var(--phrase-dissolve-duration, 1480ms) cubic-bezier(0.16, 1, 0.3, 1),
    filter var(--phrase-dissolve-duration, 1480ms) cubic-bezier(0.16, 1, 0.3, 1),
    text-shadow var(--phrase-dissolve-duration, 1480ms) ease-out;
  will-change: transform, opacity, filter;
}

.ambient-subtitle::before {
  position: absolute;
  inset: -0.45em -0.7em;
  z-index: -1;
  background: radial-gradient(
    ellipse at center,
    rgba(245, 245, 245, 0.18),
    rgba(118, 87, 255, 0.1) 34%,
    transparent 70%
  );
  filter: blur(20px);
  opacity: 0.74;
  content: "";
  transition:
    opacity var(--phrase-dissolve-duration, 1480ms) ease-out,
    filter var(--phrase-dissolve-duration, 1480ms) ease-out;
}

.ambient-subtitle.is-drifting {
  animation: ambient-drift var(--drift-duration, 8s) ease-in-out forwards;
}

.ambient-subtitle.is-disintegrating {
  opacity: 0;
  filter: blur(5px);
  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.2),
    0 0 18px rgba(118, 87, 255, 0.08);
}

.ambient-subtitle.is-disintegrating::before {
  opacity: 0;
  filter: blur(22px);
}

.ambient-letter {
  display: inline-block;
  opacity: 0;
  filter: blur(7px);
  transform: translate3d(0, 0.12em, -44px) scale(0.88);
  transform-origin: center;
  will-change: opacity, filter, transform;
}

.ambient-letter.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translate3d(0, 0, 0) scale(1);
  transition:
    opacity 180ms ease,
    filter 220ms ease,
    transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ambient-letter.is-space {
  width: 0.62ch;
}

.ambient-letter.is-punctuation {
  opacity: 0.72;
}

.ambient-subtitle.is-disintegrating .ambient-letter {
  animation: ambient-dissolve var(--dur, 980ms) cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--delay, 0ms);
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  background: rgba(5, 5, 5, 0.74);
  border-bottom: 1px solid rgba(41, 41, 41, 0.74);
  backdrop-filter: blur(18px);
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 2rem, var(--container));
  min-height: var(--header-height);
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
}

.brand img {
  width: 1.9rem;
  height: 1.9rem;
  object-fit: contain;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  color: var(--color-muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.nav-menu a {
  transition: color 180ms ease;
}

.nav-menu a:hover {
  color: var(--color-text);
}

.nav-toggle {
  display: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  color: var(--color-text);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  cursor: pointer;
}

.nav-toggle span[aria-hidden="true"],
.nav-toggle span[aria-hidden="true"]::before,
.nav-toggle span[aria-hidden="true"]::after {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: currentColor;
  content: "";
  transition: transform 180ms ease, opacity 180ms ease;
}

.nav-toggle span[aria-hidden="true"]::before {
  transform: translateY(-0.4rem);
}

.nav-toggle span[aria-hidden="true"]::after {
  transform: translateY(0.28rem);
}

.nav-toggle[aria-expanded="true"] span[aria-hidden="true"] {
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span[aria-hidden="true"]::before {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span[aria-hidden="true"]::after {
  transform: translateY(-0.12rem) rotate(-90deg);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0 1.15rem;
  color: var(--color-text);
  font-weight: 700;
  border: 1px solid var(--color-border);
  border-radius: 0.45rem;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(118, 87, 255, 0.2);
}

.button-primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.03);
}

.button-small {
  min-height: 2.45rem;
  padding: 0 0.9rem;
  color: var(--color-text);
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.section-grid,
.content-section,
.site-footer {
  width: min(100% - 2rem, var(--container));
  margin: 0 auto;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(20rem, 0.78fr);
  gap: 3.4rem;
  align-items: center;
  min-height: 760px;
  padding: calc(var(--header-height) + 3.5rem) 0 3.5rem;
}

@media (max-width: 1180px) {
  :root {
    --container: 960px;
  }

  .hero-section {
    grid-template-columns: minmax(0, 0.95fr) minmax(17rem, 0.7fr);
    gap: 2.3rem;
  }

  .hero-copy h1 {
    font-size: clamp(2.45rem, 5.1vw, 4.2rem);
  }

  .symbol-field img {
    width: min(36vw, 27rem);
  }

  .area-grid,
  .activity-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.hero-copy {
  max-width: 48rem;
}

.section-kicker,
.card-index,
.card-icon,
.principle-card span,
.journey-list span {
  font-family: var(--font-mono);
}

.hero-copy h1 {
  max-width: 12.5ch;
  margin-bottom: 1.15rem;
  font-size: clamp(2.55rem, 5.45vw, 4.75rem);
}

.hero-copy p {
  max-width: 41rem;
  margin-bottom: 1.6rem;
  font-size: 1rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.hero-symbol {
  position: relative;
  min-height: 29rem;
}

.symbol-field {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.symbol-field img {
  position: relative;
  z-index: 1;
  width: min(92vw, 31rem);
  opacity: 0.18;
  filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.07));
}

.data-line {
  position: absolute;
  width: 11rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 245, 245, 0.42), transparent);
  animation: data-slide 8s linear infinite;
}

.data-line-one {
  top: 28%;
  left: 4%;
}

.data-line-two {
  right: 2%;
  bottom: 32%;
  animation-delay: -3s;
}

.data-line-three {
  bottom: 16%;
  left: 23%;
  width: 7rem;
  animation-delay: -5s;
}

.content-section {
  padding: 5.5rem 0;
}

.section-muted {
  width: 100%;
  max-width: none;
  padding-right: max(1rem, calc((100% - var(--container)) / 2));
  padding-left: max(1rem, calc((100% - var(--container)) / 2));
  background: var(--color-black-soft);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.section-heading {
  max-width: 48rem;
  margin-bottom: 2rem;
}

.section-kicker {
  position: relative;
  display: inline-flex;
  margin-bottom: 1.15rem;
  padding: 0 0 0.72rem;
  color: var(--color-accent);
  font-size: 0.75rem;
  font-weight: 700;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.section-kicker::after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 3.8rem;
  height: 1px;
  background: linear-gradient(90deg, var(--color-accent), transparent);
  content: "";
}

.section-heading h2,
.beginner-copy h2,
.project-panel h2,
.ethics-content h2,
.final-content h2 {
  margin-bottom: 1.1rem;
  font-size: clamp(2rem, 4vw, 3.35rem);
}

.section-heading p,
.beginner-copy p,
.project-panel p,
.ethics-content p,
.final-content p {
  max-width: 48rem;
  font-size: 0.98rem;
}

.principles-grid,
.area-grid,
.activity-grid {
  display: grid;
  gap: 1rem;
}

.principles-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.principle-card,
.area-card,
.project-panel {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
}

.principle-card,
.area-card {
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.principle-card:hover,
.area-card:hover {
  transform: translateY(-4px);
  border-color: rgba(118, 87, 255, 0.48);
  background: #1a1a1a;
}

.principle-card {
  padding: 1.25rem;
}

.principle-card span {
  display: inline-flex;
  margin-bottom: 1.45rem;
  color: var(--color-accent);
  font-size: 0.8rem;
}

.principle-card h3,
.area-card h3 {
  margin-bottom: 0.7rem;
  font-size: 1.18rem;
}

.principle-card p,
.area-card p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.area-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.area-card {
  position: relative;
  min-height: 12.8rem;
  padding: 1rem;
}

.card-index {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  color: var(--color-muted);
  font-size: 0.72rem;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  margin-bottom: 1.9rem;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  border: 1px solid rgba(118, 87, 255, 0.24);
  border-radius: 0.42rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.beginner-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(19rem, 0.72fr);
  gap: 3rem;
  align-items: center;
}

.beginner-copy .button {
  margin-top: 0.7rem;
}

.journey-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.journey-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 3.75rem;
  padding: 0.85rem 1rem;
  color: var(--color-text);
  background: linear-gradient(90deg, var(--color-card), rgba(23, 23, 23, 0.45));
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
}

.journey-list span {
  color: var(--color-accent);
  font-size: 0.78rem;
}

.activity-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.activity-chip {
  min-height: 3.55rem;
  padding: 0.95rem;
  color: var(--color-text);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
}

.projects-section {
  display: grid;
  place-items: center;
}

.project-panel {
  width: min(100%, 54rem);
  padding: clamp(1.4rem, 4vw, 2.4rem);
  background:
    linear-gradient(120deg, rgba(118, 87, 255, 0.1), transparent 36%),
    var(--color-card);
}

.ethics-section {
  width: 100%;
  max-width: none;
  padding-right: max(1rem, calc((100% - var(--container)) / 2));
  padding-left: max(1rem, calc((100% - var(--container)) / 2));
  background: #080808;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.ethics-content {
  max-width: 56rem;
}

.ethics-content strong {
  display: inline-flex;
  margin-top: 1rem;
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2vw, 1.35rem);
}

.final-section {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 28rem;
  overflow: hidden;
  text-align: center;
}

.final-section > img {
  position: absolute;
  width: min(90vw, 34rem);
  opacity: 0.045;
}

.final-content {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  max-width: 48rem;
}

.final-content .action-row {
  justify-content: center;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 3rem 0;
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
}

.footer-brand {
  max-width: 25rem;
}

.footer-brand p {
  margin: 1rem 0 0.3rem;
}

.footer-brand small {
  color: var(--color-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.8rem 1.2rem;
  max-width: 31rem;
}

.footer-links a {
  color: var(--color-muted);
  transition: color 180ms ease;
}

.footer-links a:hover {
  color: var(--color-text);
}

.has-js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes ambient-drift {
  from {
    transform:
      translate3d(-50%, -50%, var(--z))
      rotateX(var(--rx))
      rotateY(var(--ry))
      rotateZ(var(--rz))
      scale(var(--size, 0.74));
  }

  to {
    transform:
      translate3d(calc(-50% + var(--float-x)), calc(-50% + var(--float-y)), var(--z-end))
      rotateX(calc(var(--rx) + var(--drift-rx)))
      rotateY(calc(var(--ry) + var(--drift-ry)))
      rotateZ(calc(var(--rz) + var(--drift-rz)))
      scale(var(--size, 0.74));
  }
}

@keyframes ambient-dissolve {
  0% {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }

  62% {
    opacity: 0.72;
    filter: blur(1px);
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
    text-shadow:
      0 0 8px rgba(255, 255, 255, 0.28),
      0 0 18px rgba(118, 87, 255, 0.1);
  }

  88% {
    opacity: 0.14;
    filter: blur(3px);
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }

  100% {
    opacity: 0;
    filter: blur(5.5px);
    transform:
      translate3d(var(--dx), var(--dy), var(--dz))
      rotate(var(--rot))
      scale(var(--scale));
  }
}

@keyframes data-slide {
  0% {
    transform: translateX(-1.5rem);
    opacity: 0;
  }

  20%,
  70% {
    opacity: 1;
  }

  100% {
    transform: translateX(1.5rem);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }
}

@media (max-width: 980px) {
  .nav-toggle {
    display: grid;
  }

  .nav-menu {
    position: fixed;
    top: var(--header-height);
    right: 1rem;
    left: 1rem;
    display: grid;
    gap: 0.2rem;
    padding: 1rem;
    background: rgba(16, 16, 16, 0.96);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-0.7rem);
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
  }

  .nav-menu.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }

  .nav-menu a {
    padding: 0.8rem;
  }

  .nav-menu .button {
    margin-top: 0.4rem;
  }

  .hero-section {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: calc(var(--header-height) + 3rem);
    text-align: center;
  }

  .hero-copy,
  .hero-copy p {
    max-width: none;
  }

  .hero-copy h1 {
    max-width: 13ch;
    margin-right: auto;
    margin-left: auto;
    font-size: clamp(2.25rem, 7.2vw, 3.2rem);
  }

  .action-row {
    justify-content: center;
  }

  .hero-symbol {
    min-height: 13rem;
    order: -1;
  }

  .data-line {
    display: none;
  }

  .symbol-field img {
    width: min(54vw, 13.5rem);
    opacity: 0.18;
  }

  .principles-grid,
  .activity-grid,
  .beginner-section {
    grid-template-columns: 1fr 1fr;
  }

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

  .beginner-section {
    gap: 2rem;
  }
}

@media (max-width: 680px) {
  :root {
    --header-height: 68px;
  }

  .content-section {
    padding: 4rem 0;
  }

  .section-muted,
  .ethics-section {
    padding: 4rem 1rem;
  }

  .principles-grid,
  .area-grid,
  .activity-grid,
  .beginner-section {
    grid-template-columns: 1fr;
  }

  .hero-section {
    gap: 1.6rem;
    padding-bottom: 3rem;
  }

  .hero-symbol {
    display: none;
  }

  .hero-copy h1 {
    font-size: clamp(2rem, 9.2vw, 2.75rem);
  }

  .ambient-subtitle-field {
    opacity: 0.9;
  }

  .ambient-subtitle {
    font-size: clamp(1.05rem, 7vw, 2.05rem);
    opacity: 0.48;
    filter: blur(0.35px);
  }

  .button {
    width: 100%;
  }

  .area-card {
    min-height: 11.5rem;
  }

  .site-footer {
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 420px) {
  .section-grid,
  .content-section,
  .site-footer {
    width: min(100% - 1.5rem, var(--container));
  }

  .nav-shell {
    width: min(100% - 1.5rem, var(--container));
  }

  .brand {
    font-size: 0.98rem;
  }

  .hero-copy h1 {
    font-size: clamp(1.86rem, 9.2vw, 2.35rem);
  }

  .hero-copy p,
  .section-heading p,
  .beginner-copy p,
  .project-panel p,
  .ethics-content p,
  .final-content p {
    font-size: 0.94rem;
  }

  .section-heading h2,
  .beginner-copy h2,
  .project-panel h2,
  .ethics-content h2,
  .final-content h2 {
    font-size: clamp(1.7rem, 8vw, 2.25rem);
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  .hero-section {
    min-height: auto;
    padding-top: calc(var(--header-height) + 2rem);
    padding-bottom: 2.5rem;
  }

  .hero-copy h1 {
    font-size: clamp(2rem, 7vw, 3.4rem);
  }

  .hero-symbol {
    min-height: 18rem;
  }
}
