/* =========================================================================
   Version2 Labs — "The System"
   A parent brand as a small solar system: a warm core (the studio / the
   method) with apps orbiting it. Deep indigo void, one warm star colour for
   energy + conclusions, one cool ion colour for structure. Each app keeps a
   quiet hue of its own. Wonder, executed with restraint.
   ========================================================================= */

:root {
  --void:    #07060f;
  --space:   #0b0a18;
  --rise:    #100e22;       /* faint panel lift */
  --text:    #f4f1ea;
  --mute:    #9c97b3;
  --faint:   #837ea3;
  --line:    rgba(244, 241, 234, 0.10);
  --line-2:  rgba(244, 241, 234, 0.16);

  --star:    #ffb85c;       /* warm: energy, CTA, the ∴ conclusion */
  --star-hot:#ff8a4d;
  --ion:     #8a93ff;       /* cool: structure, links, orbits */

  /* each app, a quiet planet */
  --rooftop: #ffc262;
  --wellfam: #5fe0b0;
  --sizzle:  #ff876b;
  --expresso: #a18cff;
  --renewrn: #2a9d9a;

  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans:  "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  --measure: 1180px;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --section-y: clamp(4.5rem, 9vw, 8rem);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.25vw, 1.075rem);
  line-height: 1.62;
  letter-spacing: -0.004em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}

/* faint vertical glow seam down the page to feel like deep space */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(120% 80% at 78% -10%, rgba(138,147,255,0.10), transparent 60%),
    radial-gradient(90% 60% at 12% 110%, rgba(255,138,77,0.06), transparent 55%);
  pointer-events: none; z-index: 0;
}

/* fixed ambient starfield (inner pages + behind everything) */
#starfield {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

.wrap { width: 100%; max-width: var(--measure); margin-inline: auto; padding-inline: var(--gutter); position: relative; z-index: 2; }
.section { padding-block: var(--section-y); position: relative; z-index: 2; }
.section + .section { padding-top: 0; }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

a { color: inherit; }

/* ---- shared marks ----------------------------------------------------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 1rem;
}
.eyebrow .dot { color: var(--star); }
.therefore {
  font-family: var(--mono); color: var(--star);
  font-size: 1.4rem; line-height: 1; display: inline-block;
  text-shadow: 0 0 18px rgba(255,184,92,0.5);
}

/* ---- nav -------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--void) 72%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.05rem; }
.brand {
  font-family: var(--sans); font-weight: 600; font-size: 1.06rem;
  letter-spacing: -0.02em; text-decoration: none; color: var(--text); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.brand .glyph {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #fff, var(--star) 38%, var(--star-hot) 70%);
  box-shadow: 0 0 12px rgba(255,160,80,0.7);
}
.brand .labs {
  font-family: var(--mono); font-weight: 500; font-size: 0.7rem;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint);
}
.nav-links { display: flex; gap: clamp(1rem, 3vw, 2.4rem); font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em; }
.nav-links a { text-decoration: none; color: var(--mute); padding: 0.25rem 0; position: relative; transition: color 0.18s ease; }
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1.5px; background: var(--star); box-shadow: 0 0 10px var(--star); }
@media (max-width: 600px) {
  .brand .labs { display: none; }
  .nav-links { gap: 1.1rem; font-size: 0.72rem; }
  .nav-inner { padding-block: 0.9rem; }
}

/* ---- display type ----------------------------------------------------- */
.display { font-family: var(--serif); font-weight: 400; line-height: 1.0; letter-spacing: -0.012em; margin: 0; }
.display em { font-style: italic; }
.display .lit { color: var(--star); font-style: italic; text-shadow: 0 0 26px rgba(255,184,92,0.35); }
h1.display { font-size: clamp(2.9rem, 1.5rem + 6.2vw, 6.2rem); }
h2.display { font-size: clamp(2.1rem, 1.4rem + 3.3vw, 3.8rem); }

.lede { max-width: 48ch; color: var(--mute); font-size: clamp(1.08rem, 1rem + 0.45vw, 1.3rem); line-height: 1.55; }

/* ====================================================================== */
/*  HERO — the living system                                              */
/* ====================================================================== */
.stage { position: relative; min-height: clamp(620px, 92vh, 1000px); display: flex; align-items: center; overflow: hidden; }
/* static core glow — keeps the hero alive before the canvas paints (or without JS);
   cosmos.js adds .cosmos-live once the animation is running and this fades away */
.stage::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(circle at 66% 52%, rgba(255,214,150,0.16), rgba(255,138,77,0.06) 22%, transparent 52%);
  transition: opacity 1.2s ease;
}
.stage.cosmos-live::before { opacity: 0; }
@media (max-width: 760px) {
  .stage::before { background: radial-gradient(circle at 50% 30%, rgba(255,214,150,0.14), rgba(255,138,77,0.05) 22%, transparent 52%); }
}
#cosmos-hero { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
/* legibility scrim — darkens the left where the words live */
.stage::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(95deg, var(--void) 8%, color-mix(in srgb, var(--void) 55%, transparent) 38%, transparent 62%);
}
.stage-content { position: relative; z-index: 3; width: 100%; }
.stage .eyebrow { margin-bottom: 1.4rem; }
.stage h1.display { max-width: 16ch; }
.stage .sub { max-width: 40ch; color: var(--mute); font-size: clamp(1.05rem, 1rem + 0.4vw, 1.22rem); margin: 1.8rem 0 0; }

@media (max-width: 760px) {
  .stage { min-height: 88vh; align-items: flex-end; padding-bottom: clamp(2rem, 8vw, 4rem); }
  .stage::after { background: linear-gradient(180deg, transparent 18%, color-mix(in srgb, var(--void) 50%, transparent) 48%, var(--void) 86%); }
}

/* staged reveal of the words */
.reveal { opacity: 0; transform: translateY(14px); animation: rise 0.8s cubic-bezier(.2,.7,.2,1) forwards; }
.reveal.d1 { animation-delay: 0.15s; }
.reveal.d2 { animation-delay: 0.45s; }
.reveal.d3 { animation-delay: 0.8s; }
.reveal.d4 { animation-delay: 1.15s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---- buttons ---------------------------------------------------------- */
.actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2.6rem; }
.btn {
  font-family: var(--mono); font-size: 0.83rem; letter-spacing: 0.01em;
  text-decoration: none; padding: 0.78rem 1.2rem; border-radius: 7px;
  display: inline-flex; align-items: center; gap: 0.5rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  border: 1px solid transparent;
}
.btn .arrow { transition: transform 0.18s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.btn--solid {
  color: #1b1004;
  background: linear-gradient(135deg, var(--star) 0%, var(--star-hot) 100%);
  box-shadow: 0 6px 28px -8px rgba(255,150,70,0.6);
  font-weight: 500;
}
.btn--solid:hover { transform: translateY(-1px); box-shadow: 0 10px 34px -8px rgba(255,150,70,0.75); }
.btn--ghost { color: var(--text); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--ion); color: #fff; box-shadow: 0 0 0 1px rgba(138,147,255,0.3); }

/* ---- split intro ------------------------------------------------------ */
.split { display: grid; grid-template-columns: minmax(0, 0.36fr) minmax(0, 0.64fr); gap: clamp(1.5rem, 5vw, 4.5rem); align-items: start; }
@media (max-width: 780px) { .split { grid-template-columns: 1fr; } }

/* ---- projects / work -------------------------------------------------- */
.work-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.work {
  display: grid; grid-template-columns: minmax(0, 0.36fr) minmax(0, 0.64fr);
  gap: clamp(1rem, 4vw, 3rem); padding-block: clamp(2.2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line); position: relative;
}
@media (max-width: 740px) { .work { grid-template-columns: 1fr; gap: 1.1rem; } }
.planet {
  width: 13px; height: 13px; border-radius: 50%; display: inline-block; vertical-align: middle;
  margin-right: 0.7rem; flex: none;
  background: radial-gradient(circle at 36% 32%, #fff6, var(--c) 55%);
  background-color: var(--c);
  box-shadow: 0 0 16px -1px var(--c);
}
.work-name-row { display: flex; align-items: center; }
.work-head .work-name { font-family: var(--serif); font-size: clamp(1.9rem, 1.4rem + 1.7vw, 2.7rem); line-height: 1.04; margin: 0; }
.work-domain { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.03em; color: var(--ion); text-decoration: none; display: inline-block; margin-top: 0.55rem; }
.work-domain:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.work-status {
  display: inline-block; margin-top: 0.95rem; font-family: var(--mono);
  font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mute);
  border: 1px solid var(--line-2); border-radius: 100px; padding: 0.22rem 0.65rem;
}
.work-body .label { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); display: block; margin-bottom: 0.45rem; }
.work-problem { margin: 0 0 1.2rem; max-width: 58ch; color: var(--mute); }
.work-derived { display: flex; gap: 0.9rem; max-width: 58ch; }
.work-derived .conclusion { font-family: var(--serif); font-size: clamp(1.2rem, 1.05rem + 0.55vw, 1.55rem); line-height: 1.25; margin: 0; color: var(--text); }

/* ---- featured cards on home ------------------------------------------ */
.constellation { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
@media (max-width: 680px) { .constellation { grid-template-columns: 1fr; } }
.node {
  background: linear-gradient(180deg, rgba(255,255,255,0.018), transparent);
  padding: clamp(1.5rem, 3vw, 2.2rem); text-decoration: none; color: var(--text);
  display: block; position: relative; transition: background 0.25s ease;
}
.node:hover { background: rgba(138,147,255,0.05); }
.node .orb { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 36% 32%, #fff8, var(--c) 58%); box-shadow: 0 0 24px -2px var(--c); margin-bottom: 1.1rem; }
.node h3 { font-family: var(--serif); font-size: 1.7rem; margin: 0 0 0.3rem; line-height: 1; }
.node .tag { color: var(--mute); margin: 0; font-size: 0.97rem; }
.node .go { font-family: var(--mono); font-size: 0.72rem; color: var(--ion); margin-top: 1.1rem; display: inline-block; }

/* ---- principles / axioms ---------------------------------------------- */
.axioms { display: grid; gap: 0; border-top: 1px solid var(--line); position: relative; }
.axiom { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: clamp(1rem, 3vw, 2.5rem); padding-block: clamp(1.9rem, 3.5vw, 2.7rem); border-bottom: 1px solid var(--line); }
@media (max-width: 640px) { .axiom { grid-template-columns: 1fr; gap: 0.5rem; } }
.axiom-no { font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.08em; color: var(--star); padding-top: 0.5rem; text-shadow: 0 0 14px rgba(255,184,92,0.45); }
.axiom-title { font-family: var(--serif); font-size: clamp(1.55rem, 1.2rem + 1.3vw, 2.2rem); line-height: 1.08; margin: 0 0 0.6rem; }
.axiom-note { margin: 0; color: var(--mute); max-width: 56ch; }

/* ---- contact ---------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 0.45fr) minmax(0, 0.55fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.channels { list-style: none; padding: 0; margin: 2rem 0 0; }
.channels li { padding-block: 1rem; border-top: 1px solid var(--line); }
.channels li:last-child { border-bottom: 1px solid var(--line); }
.channels .k { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); display: block; margin-bottom: 0.3rem; }
.channels a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--ion); padding-bottom: 1px; }
.channels a:hover { color: var(--ion); }
form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.field input, .field textarea {
  font-family: var(--sans); font-size: 1rem; color: var(--text);
  background: rgba(255,255,255,0.025); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 0.75rem 0.85rem; transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--star); background: rgba(255,255,255,0.04); box-shadow: 0 0 0 3px rgba(255,184,92,0.16); }
.field textarea { resize: vertical; min-height: 7rem; }
.form-note { font-family: var(--mono); font-size: 0.72rem; color: var(--faint); margin: 0.25rem 0 0; }
button.btn { cursor: pointer; font-family: var(--mono); }

/* ---- footer ----------------------------------------------------------- */
.foot { border-top: 1px solid var(--line); position: relative; z-index: 2; }
.foot-inner { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; padding-block: 2.4rem 3rem; }
.foot .mark { font-weight: 600; letter-spacing: -0.02em; display: inline-flex; align-items: center; gap: 0.5rem; }
.foot .mark .glyph { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 38% 34%, #fff, var(--star) 40%, var(--star-hot) 72%); box-shadow: 0 0 10px rgba(255,160,80,0.6); }
.foot nav { display: flex; gap: 1.5rem; font-family: var(--mono); font-size: 0.76rem; }
.foot nav a { color: var(--mute); text-decoration: none; }
.foot nav a:hover { color: var(--text); }
.foot .fine { font-family: var(--mono); font-size: 0.7rem; color: var(--faint); width: 100%; letter-spacing: 0.02em; }

/* ---- a11y ------------------------------------------------------------- */
:focus-visible { outline: 2px solid var(--star); outline-offset: 3px; border-radius: 3px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--star); color: #1b1004; padding: 0.6rem 1rem; font-family: var(--mono); font-size: 0.8rem; z-index: 60; border-radius: 6px; }
.skip:focus { left: 0.5rem; top: 0.5rem; }
