/* ============================================================
   Evalium — Fracture Dark design system
   Base black, ember-gradient accents, backlit shard motif.
   ============================================================ */

:root {
  --bg: #151516;
  --panel: #1d1d20;
  --surface: #242427;
  --surface-2: #2a2a2e;
  --line: #333336;
  --line-soft: #29292c;
  --text: #f1f0ec;
  --dim: #97968f;
  --dim-2: #6f6e68;
  --orange: #d9661c;
  --orange-hi: #ec8f3e;
  --orange-deep: #9a3409;
  --ember: linear-gradient(135deg, #ec8f3e 0%, #d9661c 42%, #9a3409 100%);
  /* glow stays warm/bright — it's light, not pigment */
  --glow: rgba(255, 138, 30, 0.35);
  --glow-soft: rgba(255, 138, 30, 0.14);
  --pass: #8fd9a8;
  --font-head: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 24px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(255, 138, 30, 0.35); color: #fff; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- typography ---------- */

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }

.display {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  letter-spacing: -0.02em;
}

.h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.h3 { font-size: 1.25rem; }

.lead { color: var(--dim); font-size: 1.08rem; max-width: 620px; }

.kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--orange);
  display: block;
  margin-bottom: 14px;
}

.glow-word {
  background: var(--ember);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 28px var(--glow);
}

.mono { font-family: var(--font-mono); }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(21, 21, 22, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.nav-logo img { height: 24px; }

.nav-links { display: flex; align-items: center; gap: 28px; }

.nav-links a {
  color: var(--dim);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

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

/* the .nav-links a rule outranks .btn-primary — restore dark text on the CTA */
.nav-links a.btn-primary, .nav-links a.btn-primary:hover { color: #160a00; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 13px 26px;
  border-radius: 999px;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: 0;
}

.btn-primary {
  /* deeper burnt orange — dark text still clears contrast at the pill center */
  background: linear-gradient(135deg, #e58a37 0%, #d1611a 55%, #b0480e 100%);
  color: #160a00;
  font-weight: 700;
  box-shadow: 0 0 26px var(--glow);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 40px var(--glow); }

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--text);
  background: transparent;
}

.btn-ghost:hover { border-color: var(--dim); }

.btn-sm { padding: 9px 18px; font-size: 0.8rem; }
.nav .btn-primary { box-shadow: 0 0 12px var(--glow-soft); }
.nav .btn-primary:hover { box-shadow: 0 0 20px var(--glow); }

/* ---------- panels & sections ---------- */

.section { padding: 96px 0; }
.section-tight { padding: 64px 0; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head p { color: var(--dim); margin-top: 14px; }

/* ---------- hero ---------- */

.hero-panel {
  /* no box — the hero floats directly on the fluid background */
  background: transparent;
  border: 0;
  margin-top: 12px;
  padding: clamp(40px, 6vw, 88px) clamp(4px, 2vw, 24px);
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* the static SVG art is replaced by the fixed hexagon explosion */
.hero-art { display: none; }

.hero-content { position: relative; z-index: 2; max-width: 560px; }

.hero-content .lead { margin: 22px 0 34px; }

.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.eval-strip {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--dim);
  position: relative;
}

.eval-strip { z-index: 2; }
.eval-strip .pass { color: var(--pass); }
.eval-strip .break { color: var(--orange); text-shadow: 0 0 12px var(--glow); }

/* ---------- loop ---------- */

.loop-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.loop-step {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 28px 24px;
  position: relative;
}

.loop-step .num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--orange);
  letter-spacing: 0.15em;
}

.loop-step h3 { margin: 12px 0 10px; font-size: 1.1rem; }
.loop-step p { color: var(--dim); font-size: 0.9rem; }

/* ---------- cards ---------- */

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 32px 28px;
  transition: border-color 0.25s, background 0.25s;
  position: relative;
  overflow: hidden;
}

.card:hover { border-color: rgba(255, 138, 30, 0.4); }

.card h3 { font-size: 1.15rem; margin-bottom: 12px; }
.card p { color: var(--dim); font-size: 0.92rem; }

.card .card-link {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--orange);
}

/* domain tiles */
.domain-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.domain-tile {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 26px 24px;
  transition: border-color 0.25s;
}

.domain-tile:hover { border-color: rgba(255, 138, 30, 0.4); }
.domain-tile h3 { font-size: 1rem; margin-bottom: 8px; }
.domain-tile p { color: var(--dim); font-size: 0.86rem; }

/* ---------- content pages ---------- */

.page-hero { padding: 88px 0 56px; }
.page-hero .lead { margin-top: 18px; }

.block { padding: 56px 0; border-top: 1px solid var(--line-soft); }
.block h2 { margin-bottom: 10px; }
.block > .container > p.intro { color: var(--dim); max-width: 640px; margin-bottom: 30px; }

.feature-list { list-style: none; display: grid; gap: 16px; max-width: 780px; }

.feature-list li {
  padding: 18px 22px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  color: var(--dim);
  font-size: 0.95rem;
}

.feature-list li strong { color: var(--text); font-weight: 600; display: block; margin-bottom: 4px; font-family: var(--font-head); }

.note {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--dim-2);
  margin-top: 22px;
}

.guarantee {
  margin-top: 34px;
  padding: 26px 30px;
  border-radius: 16px;
  border: 1px solid rgba(255, 138, 30, 0.35);
  background: linear-gradient(135deg, rgba(255, 138, 30, 0.08), rgba(194, 65, 12, 0.04));
  max-width: 780px;
}

.guarantee strong { color: var(--orange); font-family: var(--font-head); }
.guarantee p { color: var(--dim); font-size: 0.95rem; margin-top: 6px; }

/* ---------- research ---------- */

.pub {
  padding: 26px 0;
  border-bottom: 1px solid var(--line-soft);
  max-width: 820px;
}

.pub h3 { font-size: 1.08rem; }
.pub .authors { color: var(--dim); font-size: 0.88rem; margin-top: 6px; }
.pub .abstract { color: var(--dim); font-size: 0.92rem; margin-top: 10px; }

.venue {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--text);
  margin-top: 12px;
}

.venue.peer { border-color: rgba(143, 217, 168, 0.5); color: var(--pass); }
.venue.preprint { border-color: var(--line); color: var(--dim); }

/* ---------- founders ---------- */

.founder-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.founder {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 32px 28px;
}

.founder .role { font-family: var(--font-mono); font-size: 0.74rem; color: var(--orange); letter-spacing: 0.12em; text-transform: uppercase; }
.founder h3 { margin: 10px 0 12px; font-size: 1.2rem; }
.founder p { color: var(--dim); font-size: 0.92rem; }

.belief-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 900px; }

.belief h3 { font-size: 1.02rem; margin-bottom: 8px; }
.belief p { color: var(--dim); font-size: 0.92rem; }

/* ---------- CTA band ---------- */

.cta-band {
  text-align: center;
  padding: clamp(56px, 8vw, 96px) 32px;
}

.cta-band h2 { margin-bottom: 14px; }
.cta-band p { color: var(--dim); max-width: 520px; margin: 0 auto 32px; }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--line-soft);
  padding: 48px 0 40px;
  margin-top: 48px;
}

.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; flex-wrap: wrap; }

.footer-tag { color: var(--dim); font-size: 0.9rem; max-width: 300px; }
.footer-tag img { height: 20px; margin-bottom: 14px; }

.footer-links { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-links div { display: flex; flex-direction: column; gap: 10px; }

.footer-links span { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--dim-2); margin-bottom: 4px; }
.footer-links a { color: var(--dim); font-size: 0.86rem; }
.footer-links a:hover { color: var(--text); }

.footer-legal { margin-top: 40px; color: var(--dim-2); font-size: 0.78rem; font-family: var(--font-mono); }

/* ---------- reveal animation ---------- */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.38s ease, transform 0.38s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- home: fluid morphing background + parallax fracture field ---------- */

body.home { position: relative; overflow-x: hidden; }

/* fluid morphing glow layer — fixed so it drifts fluidly behind the whole page.
   z-index:-1 keeps it behind normal-flow content on every page automatically. */
.fluid-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.blob-wrap { position: absolute; will-change: transform; }

.blob {
  width: 100%;
  height: 100%;
  filter: blur(60px);
  opacity: 0.55;
  border-radius: 42% 58% 63% 37% / 45% 46% 54% 55%;
}

.blob.b-a { background: radial-gradient(circle at 42% 40%, rgba(255, 138, 30, 0.55), rgba(194, 65, 12, 0.16) 55%, transparent 72%); }
.blob.b-b { background: radial-gradient(circle at 55% 50%, rgba(217, 102, 28, 0.5),  rgba(122, 45, 6, 0.14) 55%, transparent 72%); }
.blob.b-c { background: radial-gradient(circle at 45% 55%, rgba(255, 160, 70, 0.42), rgba(194, 65, 12, 0.12) 55%, transparent 72%); }

.scroll-shards {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.3s linear;
}

/* lift real content above the drifting background */
.home > nav,
.home > header,
.home > section,
.home > footer { position: relative; z-index: 1; }

.scroll-shards .shard {
  position: absolute;
  display: block;
  will-change: transform;
}

.shard.tri  { clip-path: polygon(50% 0%, 100% 100%, 0% 100%); }
.shard.quad { clip-path: polygon(22% 0%, 100% 20%, 82% 100%, 0% 78%); }
.shard.pent { clip-path: polygon(50% 0%, 96% 34%, 78% 100%, 18% 88%, 0% 28%); }
.shard.hex  { clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); }
.shard.slab { clip-path: polygon(18% 0%, 100% 9%, 90% 100%, 0% 86%); }
.shard.line { clip-path: polygon(0% 22%, 100% 0%, 100% 56%, 0% 100%); }

.shard.dark {
  background: linear-gradient(140deg, #2c2c30 0%, #17171a 100%);
  opacity: 0.5;
}

.shard.ember {
  background: var(--ember);
  opacity: 0.13;
  filter: blur(0.4px);
}

/* fixed hexagon explosion in the background (home only) — center is locked to the screen */
.hero-tiles {
  position: fixed;
  right: 12%;
  top: 46%;
  width: clamp(340px, 46%, 620px);
  aspect-ratio: 1 / 1;
  transform: translateY(-50%);
  z-index: -1;
  pointer-events: none;
}

.hero-tiles::before {
  content: "";
  position: absolute;
  left: 49%;
  top: 43%;
  width: 34%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 138, 30, 0.62) 0%, rgba(217, 102, 28, 0.28) 38%, rgba(95, 34, 5, 0.04) 72%, transparent 100%);
  filter: blur(18px);
  opacity: 0.9;
}

.hero-tiles .shard {
  position: absolute;
  display: block;
  will-change: transform, opacity;
  transform-origin: 50% 50%;
}

/* the right hero artwork uses broad burnt plates with a dark mesh, closer to the reference */
.hero-tiles .shard.ember {
  background:
    radial-gradient(rgba(13, 9, 6, 0.32) 0.9px, transparent 1.3px) 0 0 / 6px 6px,
    linear-gradient(135deg, rgba(236, 143, 62, 0.72), rgba(217, 102, 28, 0.52) 48%, rgba(95, 34, 5, 0.42));
  box-shadow: inset 0 0 36px rgba(18, 9, 0, 0.42), 0 0 34px rgba(255, 138, 30, 0.16);
  opacity: 0.86;
}

.hero-tiles .shard.dark {
  background: linear-gradient(145deg, rgba(48, 48, 51, 0.84), rgba(17, 17, 19, 0.92));
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.45);
  opacity: 0.88;
}

.hero-tiles .shard.line {
  opacity: 0.38;
  box-shadow: 0 0 18px rgba(255, 138, 30, 0.14);
}

/* directional reveals used on the home page */
.home .card-grid .reveal { transform: translateY(22px) scale(0.94); }
.home .domain-grid .reveal { transform: translateY(22px); }
.home .domain-grid .reveal:nth-child(3n+1) { transform: translateX(-46px); }
.home .domain-grid .reveal:nth-child(3n)   { transform: translateX(46px); }

/* staggered entrances within each grid */
.home .loop-grid  .reveal:nth-child(2) { transition-delay: 0.04s; }
.home .loop-grid  .reveal:nth-child(3) { transition-delay: 0.08s; }
.home .loop-grid  .reveal:nth-child(4) { transition-delay: 0.12s; }
.home .card-grid  .reveal:nth-child(2) { transition-delay: 0.05s; }
.home .card-grid  .reveal:nth-child(3) { transition-delay: 0.10s; }
.home .domain-grid .reveal:nth-child(2) { transition-delay: 0.04s; }
.home .domain-grid .reveal:nth-child(3) { transition-delay: 0.08s; }
.home .domain-grid .reveal:nth-child(5) { transition-delay: 0.04s; }
.home .domain-grid .reveal:nth-child(6) { transition-delay: 0.08s; }

/* reset — must stay after the transform overrides above */
.home .card-grid .reveal.visible,
.home .domain-grid .reveal.visible { transform: none; }

/* gentle idle life (disabled when the user prefers reduced motion) */
@media (prefers-reduced-motion: no-preference) {
  .scroll-shards .shard { animation: shard-float 15s ease-in-out infinite; }
  .scroll-shards .shard.quad  { animation-duration: 19s; }
  .scroll-shards .shard.ember { animation-duration: 23s; }
  .hero-art { animation: hero-drift 16s ease-in-out infinite; }

  /* fluid blobs: travel across the viewport + morph + scale so they feel alive */
  .blob { animation: blob-move 20s ease-in-out infinite, blob-morph 14s ease-in-out infinite; }
  .blob.b-b { animation-duration: 26s, 18s; animation-direction: alternate, alternate; }
  .blob.b-c { animation-duration: 23s, 16s; animation-direction: reverse, alternate; }
}

@keyframes blob-move {
  0%   { transform: translate(0, 0) rotate(0deg) scale(1); }
  20%  { transform: translate(22%, -26%) rotate(55deg) scale(1.2); }
  40%  { transform: translate(-24%, 14%) rotate(140deg) scale(0.82); }
  60%  { transform: translate(18%, 28%) rotate(215deg) scale(1.15); }
  80%  { transform: translate(-16%, -20%) rotate(300deg) scale(0.95); }
  100% { transform: translate(0, 0) rotate(360deg) scale(1); }
}

@keyframes blob-morph {
  0%, 100% { border-radius: 42% 58% 63% 37% / 45% 46% 54% 55%; }
  25%      { border-radius: 68% 32% 30% 70% / 65% 34% 66% 35%; }
  50%      { border-radius: 33% 67% 58% 42% / 42% 65% 35% 58%; }
  75%      { border-radius: 55% 45% 40% 60% / 58% 40% 60% 42%; }
}

@keyframes shard-float {
  0%, 100% { margin-top: 0; }
  50%      { margin-top: -16px; }
}

@keyframes hero-drift {
  0%, 100% { transform: translateY(-50%) rotate(0deg); }
  50%      { transform: translateY(-54%) rotate(1.4deg); }
}

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .loop-grid { grid-template-columns: 1fr 1fr; }
  .card-grid, .domain-grid { grid-template-columns: 1fr 1fr; }
  .hero-art { opacity: 0.35; right: -80px; }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--panel);
    padding: 24px;
    border-bottom: 1px solid var(--line);
    gap: 18px;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .loop-grid, .card-grid, .domain-grid, .founder-grid, .belief-grid { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .hero-panel { min-height: 0; }
  .hero-art,
  .hero-tiles { display: none; }
  .scroll-shards { display: none; }
  .blob { filter: blur(48px); }
}
