/* Racine Lab — palette & type from the brand kit */
:root {
  --abysse: #071512;
  --foret: #0F2B24;
  --profond: #0E2E2A;
  --ivoire: #F2F7F4;
  --menthe: #6CF0B8;
  --sarcelle: #19B6A0;
  --sauge: #8FBDAF;
  --line: rgba(143, 189, 175, .18);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* layout system: one container, one gutter, one vertical rhythm */
  --pad: clamp(20px, 3.4vw, 56px);
  --maxw: 1480px;
  --gut: max(var(--pad), calc((100vw - var(--maxw)) / 2));
  --top: clamp(64px, 9vh, 96px);
  --bot: clamp(22px, 4.6vh, 48px);
  --gap: clamp(18px, 3vw, 56px);

  /* type scale reacts to both width and height, so short and tall screens both hold */
  --f-hero: clamp(38px, min(5.6vw, 10.5vh), 84px);
  --f-h2: clamp(27px, min(3.3vw, 6.2vh), 52px);
  --f-xl: clamp(31px, min(4.1vw, 7.6vh), 66px);
  --f-body: clamp(13.5px, min(1.05vw, 2vh), 16px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--abysse); scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ivoire);
  background: var(--abysse);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
::selection { background: var(--menthe); color: var(--abysse); }
:focus-visible { outline: 1px solid var(--menthe); outline-offset: 4px; border-radius: 4px; }

/* ---------- fixed atmosphere ---------- */
#gl, .glow, .rays, .vignette, .grain, .floor { position: fixed; inset: 0; pointer-events: none; }
#gl { width: 100%; height: 100%; z-index: 1; display: block; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(120deg, var(--abysse) 20%, var(--profond) 100%);
}
.glow { /* teal glow that follows the particle shape */
  z-index: 0;
  background: radial-gradient(circle at var(--sx, 50%) var(--sy, 50%), rgba(25, 182, 160, .17), rgba(25, 182, 160, .05) 26vmin, transparent 52vmin);
}
.rays {
  z-index: 1; inset: -30%;
  background: repeating-linear-gradient(118deg,
    transparent 0 7%, rgba(143, 189, 175, .05) 9%, transparent 13%,
    transparent 21%, rgba(108, 240, 184, .035) 24%, transparent 30%,
    transparent 38%, rgba(242, 247, 244, .04) 40%, transparent 46%);
  filter: blur(22px);
  animation: rays 26s ease-in-out infinite alternate;
}
@keyframes rays { from { transform: translate3d(-4%, 0, 0); } to { transform: translate3d(5%, 2%, 0); } }
.floor {
  z-index: 1; top: auto; height: 42vh; opacity: 0;
  background:
    linear-gradient(rgba(143, 189, 175, .22) 1px, transparent 1px) 0 0 / 100% 34px,
    linear-gradient(90deg, rgba(143, 189, 175, .22) 1px, transparent 1px) 50% 0 / 70px 100%;
  transform: perspective(520px) rotateX(64deg) scale(1.9);
  transform-origin: 50% 0;
  -webkit-mask-image: radial-gradient(60% 90% at 50% 0, #000, transparent 75%);
  mask-image: radial-gradient(60% 90% at 50% 0, #000, transparent 75%);
}
.vignette { z-index: 2; background: radial-gradient(120% 90% at 50% 45%, transparent 45%, rgba(4, 12, 10, .78) 100%); }
.grain {
  z-index: 3; opacity: .08; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.cursor {
  position: fixed; z-index: 40; left: 0; top: 0; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border: 1px solid rgba(143, 189, 175, .55); border-radius: 50%; pointer-events: none; opacity: 0;
  transition: opacity .3s, width .25s, height .25s, margin .25s, border-color .25s, background .25s;
}
.cursor::after { content: ""; position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; margin: -1.5px; border-radius: 50%; background: var(--menthe); }
.cursor.is-on { opacity: 1; }
.cursor.is-hot { width: 52px; height: 52px; margin: -26px 0 0 -26px; border-color: var(--menthe); background: rgba(108, 240, 184, .07); }

/* ---------- nav ---------- */
.nav {
  position: fixed; z-index: 20; top: 0; left: 0; right: 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: clamp(14px, 2.2vh, 22px) var(--gut);
  font-size: 12.5px; color: var(--sauge);
  transition: opacity 1s .3s, transform 1s .3s;
}
.js.intro .nav, .js.intro .hud { opacity: 0; }
.js.intro .nav { transform: translateY(-8px); }
.nav a, .lang { transition: color .25s; }
.nav a:hover, .lang:hover, .nav a.is-on { color: var(--ivoire); }
.nav-l a, .nav-r > a:not(.hello) { position: relative; }
.nav-l a::after, .nav-r > a:not(.hello)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 1px; background: var(--menthe);
  transform: scaleX(0); transform-origin: left; transition: transform .4s;
}
.nav a.is-on::after { transform: scaleX(1); }
.nav-l, .nav-r { display: flex; gap: clamp(14px, 2vw, 30px); align-items: center; }
.nav-r { justify-content: flex-end; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ivoire); font-weight: 300; letter-spacing: .22em; font-size: 12.5px; }
.brand svg { color: var(--menthe); }
.brand em { font-style: normal; color: var(--menthe); font-size: .82em; letter-spacing: .16em; }
.brand i { width: 26px; height: 1px; background: var(--line); }
.hello { color: var(--ivoire); border-bottom: 1px solid var(--menthe); padding-bottom: 2px; }
.lang {
  font: 500 10.5px var(--mono); letter-spacing: .14em; color: var(--sauge); cursor: pointer;
  background: none; border: 1px solid var(--line); border-radius: 99px; padding: 4px 9px;
}

/* ---------- side HUD: lives in the gutter, outside the content container ---------- */
.hud {
  position: fixed; z-index: 15; top: 50%; transform: translateY(-50%);
  right: max(7px, calc(var(--gut) - 38px));
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font: 400 9px var(--mono); letter-spacing: .3em; color: var(--sauge);
  transition: opacity 1s .6s;
}
.hud-bar { width: 1px; height: 72px; background: var(--line); position: relative; }
.hud-bar b { position: absolute; left: 0; top: 0; width: 1px; height: 100%; background: var(--menthe); transform-origin: top; transform: scaleY(0); }
.hud-l { opacity: .7; white-space: nowrap; writing-mode: vertical-rl; }

/* ---------- shared type ---------- */
.mono { font-family: var(--mono); font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--sauge); }
.chip { display: inline-flex; align-items: center; gap: 9px; font-size: 11.5px; color: var(--ivoire); letter-spacing: .01em; }
.chip b { flex: none; width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--menthe); box-shadow: 0 0 10px var(--menthe); }
h2 {
  font-weight: 300; letter-spacing: -.025em; line-height: 1.07;
  font-size: var(--f-h2); margin-top: .3em;
  text-shadow: 0 0 40px rgba(7, 21, 18, .9);
}
h2.xl { font-size: var(--f-xl); }
.body { color: var(--sauge); font-size: var(--f-body); line-height: 1.6; max-width: 44ch; text-shadow: 0 0 18px var(--abysse), 0 0 6px var(--abysse); }
.big { font-weight: 300; font-size: clamp(24px, min(2.4vw, 4.6vh), 38px); letter-spacing: -.02em; line-height: 1.1; color: var(--ivoire); }
.row { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 12px 18px; border-radius: 99px; font-size: 13px; white-space: nowrap;
  background: rgba(143, 189, 175, .12); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background .3s, border-color .3s, color .3s;
}
.btn i { font-style: normal; color: var(--menthe); transition: transform .3s, color .3s; }
.btn:hover { background: var(--menthe); border-color: var(--menthe); color: var(--abysse); }
.btn:hover i { transform: translate(2px, -2px); color: var(--abysse); }
.link { font-size: 13px; white-space: nowrap; border-bottom: 1px solid transparent; transition: border-color .3s; }
.link:hover { border-color: var(--menthe); }

/* ---------- scenes ----------
   Every scene is a grid. The empty .stage cell is where the particle shape is drawn:
   the script measures it and fits the shape inside, so text and shape cannot collide. */
main { position: relative; z-index: 10; }
.scene { min-height: 100vh; }
.pin {
  position: relative; min-height: 100vh; display: grid; gap: var(--gap);
  padding: var(--top) var(--gut) var(--bot);
}
.stage { min-width: 0; min-height: 0; align-self: stretch; justify-self: stretch; }

.js .scene { height: 140vh; min-height: 0; }
.js .scene:last-child { height: 100vh; }
.js .pin {
  position: fixed; inset: 0; min-height: 0; height: 100vh; height: 100dvh;
  visibility: hidden; pointer-events: none;
}
.js .pin.on { visibility: visible; }
.js .pin.live { pointer-events: auto; }
.js .rv { opacity: 0; will-change: opacity, transform, filter; }

/* 0 · hero */
.s-hero .pin { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr) auto; row-gap: clamp(10px, 2.4vh, 28px); }
.top-chip { grid-column: 1 / -1; grid-row: 1; justify-self: center; text-align: center; }
.split { display: contents; font-weight: 200; }
.split span { grid-row: 2; align-self: center; font-size: var(--f-hero); line-height: 1; letter-spacing: .12em; white-space: nowrap; }
.split .w-l { grid-column: 1; }
.split .w-r { grid-column: 3; color: var(--menthe); font-weight: 300; font-size: calc(var(--f-hero) * .58); margin-right: -.12em; }
.s-hero .stage { grid-column: 2; grid-row: 2; }
.hero-bl { grid-column: 1 / 3; grid-row: 3; justify-self: start; align-self: end; }
.lede { font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; line-height: 1.55; max-width: 62ch; }
.tags { display: flex; flex-wrap: nowrap; gap: 8px; margin-top: 14px; }
.tags li { white-space: nowrap; font-size: 11px; color: var(--sauge); padding: 6px 11px; border-radius: 6px; background: rgba(143, 189, 175, .09); border: 1px solid rgba(143, 189, 175, .1); }
.hero-br { grid-column: 2 / 4; grid-row: 3; justify-self: end; align-self: end; display: flex; gap: 26px; align-items: center; }
.scroll-hint {
  grid-column: 1 / -1; grid-row: 3; justify-self: center; align-self: end;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font: 400 9px var(--mono); letter-spacing: .34em; text-transform: uppercase; color: var(--sauge);
}
.scroll-hint span { margin-right: -.34em; }
.scroll-hint i { width: 1px; height: 38px; background: var(--line); position: relative; overflow: hidden; }
.scroll-hint i::after { content: ""; position: absolute; inset: 0; background: var(--menthe); animation: hint 2.2s cubic-bezier(.7, 0, .2, 1) infinite; }
@keyframes hint { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

/* 1 · one spore */
.s-unit .pin { grid-template-columns: minmax(0, 1.1fr) minmax(0, .95fr) minmax(0, 1fr); align-items: center; }
.s-unit .stage { height: 100%; }
.unit-r { justify-self: end; max-width: 36ch; }

/* 2 · at scale */
.s-scale .pin { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); row-gap: clamp(8px, 2vh, 24px); }
.head { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.s-scale .stage { grid-column: 2; grid-row: 2; }
.card {
  width: min(320px, 100%); padding: clamp(16px, 2.6vh, 24px) clamp(16px, 1.7vw, 24px);
  background: rgba(14, 46, 42, .38); border: 1px solid var(--line); border-radius: 6px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.card .big { margin: clamp(8px, 1.8vh, 16px) 0 clamp(6px, 1.4vh, 12px); }
.card .big span { font-size: .8em; }
.card-t { font-size: 13px; font-weight: 500; }
.card-p { font-size: 12.5px; color: var(--sauge); margin-top: 6px; line-height: 1.55; }
.card-l { grid-column: 1; grid-row: 2; justify-self: start; align-self: center; }
.card-r { grid-column: 3; grid-row: 2; justify-self: end; align-self: end; margin-bottom: 6vh; }

/* 3 · below the line */
.s-roots .pin { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
.s-roots .stage { height: 100%; }
.txt .body { margin-top: 1.3em; }

/* 4, 5 · centred copy inside the particle field */
.s-inside .pin, .s-cta .pin { place-items: center; }
.center { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 100%; }
.center .body { margin-top: 1.2em; }
.center .row { margin-top: clamp(18px, 3.4vh, 30px); justify-content: center; }
.center::before { /* soft dark halo keeps copy readable over particles */
  content: ""; position: absolute; z-index: -1; inset: -22% -18%;
  background: radial-gradient(closest-side, rgba(7, 21, 18, .86), rgba(7, 21, 18, .5) 60%, transparent);
}
.steps { display: flex; gap: clamp(28px, 8vw, 130px); margin-top: clamp(24px, 6vh, 56px); justify-content: center; }
.steps li { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.steps b { font-weight: 500; font-size: 13px; }

/* ---------- footer ---------- */
.foot {
  position: relative; z-index: 16; background: #06110f; border-top: 1px solid var(--line);
  padding: clamp(60px, 13vh, 150px) var(--gut) 22px;
}
.foot-main { display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap; }
.foot-l h2 { margin: 0 0 18px; }
.foot-l .row { margin-top: 30px; }
.foot-cols { display: flex; gap: clamp(28px, 6vw, 90px); font-size: 13px; flex-wrap: wrap; }
.foot-cols div { display: flex; flex-direction: column; gap: 12px; }
.foot-cols .mono { margin-bottom: 6px; }
.foot-cols a:hover { color: var(--menthe); }
.foot-cols .dim { color: var(--sauge); font-size: 11.5px; margin-top: -9px; opacity: .75; }
.foot-base { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-top: clamp(50px, 11vh, 130px); padding-top: 18px; border-top: 1px solid var(--line); font-size: 9px; opacity: .8; }

/* ---------- contact form ---------- */
.modal {
  margin: auto; width: min(680px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); overflow: auto;
  padding: clamp(24px, 4vw, 44px); color: var(--ivoire); font-family: var(--sans);
  background: linear-gradient(140deg, rgba(9, 27, 23, .97), rgba(14, 46, 42, .97));
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 40px 120px rgba(0, 0, 0, .6);
}
.modal::backdrop { background: rgba(4, 12, 10, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.modal[open] { animation: modal-in .45s cubic-bezier(.2, .7, .2, 1); }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px); filter: blur(8px); } }
.modal h2 { font-size: clamp(24px, 3.2vw, 36px); margin: 10px 0 10px; text-shadow: none; }
.modal .body { text-shadow: none; }
.modal-x {
  position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  background: none; border: 1px solid var(--line); color: var(--sauge); font-size: 20px; line-height: 1; transition: color .25s, border-color .25s;
}
.modal-x:hover { color: var(--ivoire); border-color: var(--menthe); }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; margin-top: 24px; }
.f { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.f.wide { grid-column: 1 / -1; }
.f > span { font: 400 9.5px var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--sauge); }
.f > span em { font-style: normal; opacity: .6; letter-spacing: .1em; }
.f input, .f select, .f textarea {
  width: 100%; font: 400 15px/1.4 var(--sans); color: var(--ivoire); padding: 11px 12px;
  background: rgba(143, 189, 175, .07); border: 1px solid var(--line); border-radius: 6px;
  transition: border-color .25s, background .25s; -webkit-appearance: none; appearance: none;
}
.f textarea { resize: vertical; min-height: 110px; }
.f select { background-image: linear-gradient(45deg, transparent 50%, var(--sauge) 50%), linear-gradient(135deg, var(--sauge) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.f select option { background: var(--foret); color: var(--ivoire); }
.f input:focus, .f select:focus, .f textarea:focus { outline: none; border-color: var(--menthe); background: rgba(108, 240, 184, .07); }
.f .bad { border-color: #F0A58A; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-err { min-height: 1.4em; margin-top: 12px; font-size: 13px; color: #F0B49C; }
.cf-foot { margin-top: 6px; gap: 14px 20px; }
.cf-note { font-size: 11.5px; color: var(--sauge); opacity: .8; flex: 1 1 200px; }
.modal .btn { cursor: pointer; color: var(--ivoire); font-family: var(--sans); }
.modal .btn:hover { color: var(--abysse); }
.modal .btn[disabled] { opacity: .55; pointer-events: none; }
.cf-done .row { margin-top: 26px; }
@media (max-width: 560px) { .fgrid { grid-template-columns: 1fr; } }

/* ---------- medium screens: tighten the side columns ---------- */
@media (max-width: 1180px) and (min-width: 901px) {
  .scroll-hint { display: none; }
  .card-p { display: none; }
}

/* ---------- portrait tablets & phones: everything stacks, stage sits between text blocks ---------- */
@media (max-width: 900px) {
  :root {
    --f-hero: clamp(40px, min(13.5vw, 9vh), 96px);
    --f-h2: clamp(26px, min(7vw, 5vh), 44px);
    --f-xl: clamp(28px, min(8vw, 5.6vh), 50px);
    --f-body: clamp(13.5px, min(3.6vw, 2vh), 16px);
    --gap: clamp(10px, 2vh, 22px);
  }
  .nav { grid-template-columns: auto 1fr; }
  .nav-l, .brand i, .nav-r a:not(.hello) { display: none; }
  .hud, .scroll-hint, .cursor { display: none; }

  .s-hero .pin { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto; }
  .split { display: flex; flex-direction: column; align-items: center; gap: .12em; grid-row: 2; }
  .split .w-r { margin: 0; }
  .s-hero .stage { grid-column: 1; grid-row: 3; }
  .hero-bl { grid-column: 1; grid-row: 4; }
  .tags { flex-wrap: wrap; }
  .top-chip { font-size: 10.5px; }
  .hero-br { grid-column: 1; grid-row: 5; justify-self: start; }

  .s-unit .pin { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; align-items: stretch; }
  .unit-r { justify-self: start; max-width: 46ch; }

  .s-scale .pin { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; column-gap: 12px; }
  .s-scale .stage { grid-column: 1 / -1; grid-row: 2; }
  .card { width: 100%; align-self: stretch; }
  .card-l, .card-r { grid-row: 3; justify-self: stretch; align-self: stretch; margin: 0; }
  .card-l { grid-column: 1; } .card-r { grid-column: 2; }
  .card-p { display: none; }

  .s-roots .pin { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); align-items: stretch; }

  .steps { gap: clamp(18px, 7vw, 60px); }
  .steps .mono { font-size: 8px; letter-spacing: .16em; }
}

@media (max-width: 560px) {
  .tags { display: grid; grid-template-columns: 1fr 1fr; }
  .tags li { text-align: center; }
}

/* very short landscape windows */
@media (max-height: 560px) and (min-width: 901px) {
  .tags, .card-p, .scroll-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rays, .scroll-hint i::after { animation: none; }
}
