/* ───────────────────────────────────────────────────────────
   yedi.net — tokens & base
   ─────────────────────────────────────────────────────────── */
@property --ang {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

:root {
  --bg: #07060b;
  --surface: #0d0c14;
  --text: #eceaf4;
  --muted: #9c97ad;
  --line: rgba(236, 234, 244, 0.08);
  --violet: #8b74f5;
  --violet-soft: #9379f2;
  --amber: #e9b161;
  --grad: linear-gradient(100deg, var(--violet-soft) 10%, var(--amber) 90%);
  --ease-out: cubic-bezier(0.19, 1, 0.22, 1);
  --font-display: "Instrument Serif", Georgia, serif;
  --font-body: "Inter", -apple-system, system-ui, sans-serif;
}

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

html {
  background: var(--bg);
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(139, 116, 245, 0.35); }

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

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

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

/* ── atmosphere layers ── */
#net {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 50;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  will-change: transform;
  animation: grain-shift 7s steps(8) infinite;
}

@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  12%  { transform: translate(-2%, 1%); }
  25%  { transform: translate(1%, -2%); }
  37%  { transform: translate(-1%, 2%); }
  50%  { transform: translate(2%, 1%); }
  62%  { transform: translate(-2%, -1%); }
  75%  { transform: translate(1%, 2%); }
  87%  { transform: translate(2%, -2%); }
  100% { transform: translate(0, 0); }
}

/* ── custom cursor ── */
.cursor { display: none; }

.has-cursor .cursor {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.has-cursor, .has-cursor a, .has-cursor button { cursor: none; }

.cursor-dot {
  position: fixed;
  top: -3px;
  left: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text);
}

.cursor-ring {
  position: fixed;
  top: -17px;
  left: -17px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(236, 234, 244, 0.35);
  transition: border-color 0.25s ease;
}

.cursor.on-link .cursor-ring { border-color: var(--violet); }
.cursor.hidden { opacity: 0; }

/* ───────────────────────────────────────────────────────────
   nav
   ─────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem clamp(1.25rem, 4vw, 3.5rem);
  transition: background 0.4s ease, border-color 0.4s ease, opacity 1s ease 1.15s, transform 1s var(--ease-out) 1.15s;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(7, 6, 11, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.wordmark-text {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
}

.wordmark-text em { font-style: normal; color: var(--muted); font-weight: 500; }

.nav nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav nav a {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--muted);
  transition: color 0.25s ease;
}

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

.nav-launch {
  padding: 0.45rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text) !important;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.nav-launch:hover {
  border-color: rgba(139, 116, 245, 0.6);
  box-shadow: 0 0 24px rgba(139, 116, 245, 0.25);
}

/* ───────────────────────────────────────────────────────────
   hero
   ─────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7rem clamp(1.25rem, 5vw, 4rem) 5rem;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(640px 420px at 50% 38%, rgba(110, 84, 224, 0.16), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 60rem;
  will-change: transform, opacity;
}

.overline {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2.2rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.9rem, 9.5vw, 7rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.hero h1 .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.hero h1 .line > span { display: inline-block; }

.hero h1 em,
.statement em {
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sub {
  max-width: 36rem;
  margin: 2.2rem auto 0;
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  color: var(--muted);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 2.8rem;
}

/* ── intro choreography (pre-load state, JS only) ── */
.js .overline {
  opacity: 0;
  filter: blur(10px);
  letter-spacing: 0.6em;
  transition: opacity 1.3s ease 0.1s, filter 1.3s ease 0.1s, letter-spacing 1.6s var(--ease-out) 0.1s;
}

.js .hero h1 .line > span {
  transform: translateY(115%);
  transition: transform 1.15s var(--ease-out);
}

.js .hero h1 .line:nth-child(1) > span { transition-delay: 0.25s; }
.js .hero h1 .line:nth-child(2) > span { transition-delay: 0.42s; }

.js .sub,
.js .cta-row {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s ease, transform 1s var(--ease-out);
}

.js .sub { transition-delay: 0.8s; }
.js .cta-row { transition-delay: 1s; }

.js .nav {
  opacity: 0;
  transform: translateY(-12px);
}

.js .scroll-hint {
  opacity: 0;
  transition: opacity 1.2s ease 1.5s;
}

.js.is-loaded .overline { opacity: 1; filter: blur(0); letter-spacing: 0.32em; }
.js.is-loaded .hero h1 .line > span { transform: translateY(0); }
.js.is-loaded .sub,
.js.is-loaded .cta-row { opacity: 1; transform: translateY(0); }
.js.is-loaded .nav { opacity: 1; transform: translateY(0); }
.js.is-loaded .scroll-hint { opacity: 1; }

/* ── buttons ── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.9rem 1.7rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform 0.45s var(--ease-out), border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

.btn-primary {
  background: var(--text);
  color: #0b0a12;
  border-color: transparent;
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(147, 121, 242, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.8s var(--ease-out);
}

.btn-primary:hover::after { transform: translateX(120%); }

.btn-primary:hover {
  box-shadow: 0 8px 44px rgba(139, 116, 245, 0.4);
}

.btn-ghost {
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(139, 116, 245, 0.5);
}

/* ── scroll hint ── */
.scroll-hint {
  position: absolute;
  bottom: 2.4rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 3.4rem;
  background: var(--line);
  overflow: hidden;
}

.scroll-hint span {
  display: block;
  width: 100%;
  height: 38%;
  background: linear-gradient(var(--violet-soft), var(--amber));
  animation: scroll-hint 2.3s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes scroll-hint {
  0%   { transform: translateY(-110%); }
  100% { transform: translateY(290%); }
}

/* ───────────────────────────────────────────────────────────
   sections
   ─────────────────────────────────────────────────────────── */
.section {
  position: relative;
  max-width: 75rem;
  margin: 0 auto;
  padding: clamp(6rem, 14vh, 10rem) clamp(1.25rem, 4vw, 3.5rem);
  display: grid;
  grid-template-columns: 13rem 1fr;
  gap: 3rem;
  align-items: start;
}

.label {
  position: sticky;
  top: 7rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

.statement {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 3.4vw, 2.75rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
  max-width: 44rem;
}

.principles {
  list-style: none;
  margin-top: 4.5rem;
}

.principles li {
  display: grid;
  grid-template-columns: 4rem 11rem 1fr;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.9rem 0;
  border-top: 1px solid var(--line);
  transition: background 0.4s ease, padding-left 0.4s ease;
}

.principles li:hover {
  background: linear-gradient(90deg, rgba(139, 116, 245, 0.05), transparent 65%);
  padding-left: 0.75rem;
}

.p-num {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.principles h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: 1.5rem;
  letter-spacing: 0.01em;
}

.principles p {
  font-size: 0.95rem;
  color: var(--muted);
}

/* ───────────────────────────────────────────────────────────
   arkana
   ─────────────────────────────────────────────────────────── */
.arkana-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3rem;
  padding: clamp(2rem, 4.5vw, 3.75rem);
  background: linear-gradient(160deg, rgba(20, 17, 32, 0.85), rgba(13, 12, 20, 0.9));
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
}

/* travelling light along the card border */
.arkana-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 25px;
  padding: 1px;
  background: conic-gradient(
    from var(--ang),
    transparent 0%,
    transparent 62%,
    rgba(147, 121, 242, 0.9) 76%,
    rgba(233, 177, 97, 0.9) 86%,
    transparent 96%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: border-orbit 7s linear infinite;
  pointer-events: none;
}

@keyframes border-orbit {
  to { --ang: 360deg; }
}

.tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1.2rem;
}

.arkana h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 5.5vw, 4.25rem);
  letter-spacing: 0.06em;
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1.4rem;
}

.arkana-copy {
  font-size: 1.02rem;
  color: var(--muted);
  max-width: 30rem;
}

.features {
  list-style: none;
  margin: 1.8rem 0 2.4rem;
}

.features li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.6rem;
  font-size: 0.93rem;
  color: var(--muted);
}

.features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.05rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 10px rgba(139, 116, 245, 0.7);
}

/* ── schema lattice visual ── */
.arkana-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 900px;
}

.lattice {
  width: 100%;
  max-width: 22rem;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 6px;
  transform: rotateY(-12deg) rotateX(4deg);
  transition: transform 1.2s var(--ease-out);
}

.arkana-card:hover .lattice {
  transform: rotateY(-4deg) rotateX(1deg);
}

.lattice i {
  display: block;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 5px;
  animation: cell-glow 7s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

.lattice i.node { position: relative; }

.lattice i.node::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 12px var(--violet);
  animation: node-glow 7s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

.lattice i.node-b::after {
  background: var(--amber);
  box-shadow: 0 0 12px var(--amber);
}

@keyframes cell-glow {
  0%, 100% { background: transparent; border-color: var(--line); }
  50% { background: rgba(139, 116, 245, 0.08); border-color: rgba(139, 116, 245, 0.35); }
}

@keyframes node-glow {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

/* ───────────────────────────────────────────────────────────
   footer
   ─────────────────────────────────────────────────────────── */
footer {
  position: relative;
  overflow: hidden;
  padding: clamp(4rem, 10vh, 7rem) clamp(1.25rem, 4vw, 3.5rem) 2.5rem;
  max-width: 75rem;
  margin: 0 auto;
}

.footer-mark {
  font-family: var(--font-display);
  font-size: clamp(7rem, 24vw, 19rem);
  line-height: 0.78;
  text-align: center;
  letter-spacing: 0.08em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(236, 234, 244, 0.1);
  user-select: none;
  pointer-events: none;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}

.footer-row a {
  color: var(--muted);
  transition: color 0.25s ease;
}

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

/* ───────────────────────────────────────────────────────────
   reveals & responsive
   ─────────────────────────────────────────────────────────── */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.95s ease var(--rd, 0s), transform 0.95s var(--ease-out) var(--rd, 0s);
}

.js .reveal.in {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 860px) {
  .section {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .label { position: static; }

  .principles li {
    grid-template-columns: 2.6rem 1fr;
    grid-template-rows: auto auto;
  }

  .principles li p {
    grid-column: 2;
  }

  .arkana-card { grid-template-columns: 1fr; }

  .arkana-visual { order: -1; }

  .lattice {
    max-width: 17rem;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .js .overline,
  .js .hero h1 .line > span,
  .js .sub,
  .js .cta-row,
  .js .nav,
  .js .scroll-hint,
  .js .reveal {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .grain { animation: none; }
}
