/* ==========================================================================
   The Innovative Hub
   Motion lives in app.js (springs). This file owns colour, type, material
   and layout only — no gesture-driven transitions, since CSS transitions
   cannot be grabbed and reversed mid-flight.
   ========================================================================== */

:root {
  /* ground */
  --bg:          #07090d;
  --bg-raised:   #0c1017;

  /* surfaces are alpha so they compose over the ambient wash */
  --surface:     rgba(255, 255, 255, .030);
  --surface-2:   rgba(255, 255, 255, .052);
  --line:        rgba(255, 255, 255, .11);
  --line-soft:   rgba(255, 255, 255, .065);

  /* ink — vibrancy: over translucent material, text goes brighter, not grey */
  --ink:         #eef2f8;
  --ink-2:       #b3bdcc;
  --ink-3:       #78849a;

  /* operating companies */
  --prep:        #f2b544;
  --infra:       #4bc3e8;
  --studio:      #a98cf5;

  /* material */
  --glass:       rgba(10, 13, 19, .62);
  --glass-blur:  blur(24px) saturate(180%);

  /* rhythm — rem so the layout scales with the reader's text size */
  --gap:         1.375rem;
  --radius:      1rem;
  --radius-lg:   1.375rem;
  --maxw:        70rem;
  --pad:         1.5rem;

  --font: "Inter var", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
          Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;      /* native smooth scroll stays interruptible by user input */
  scroll-padding-top: 5.5rem;   /* anchors clear the floating header */
}

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

a { color: inherit; }

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

/* --- ambient ground ------------------------------------------------------ */

.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.bg::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(48rem 26rem at 50% -6%,  rgba(120, 150, 255, .16), transparent 65%),
    radial-gradient(39rem 29rem at 6%  40%,  rgba(242, 181,  68, .05), transparent 60%),
    radial-gradient(39rem 29rem at 95% 60%,  rgba(169, 140, 245, .07), transparent 60%);
}
.bg::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .026) 1px, transparent 1px);
  background-size: 4rem 4rem;
  -webkit-mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 20%, transparent 78%);
          mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 20%, transparent 78%);
}

/* --- header: translucent chrome, content scrolls underneath -------------- */

.header {
  position: sticky; top: 0; z-index: 50;
  /* the material itself is animated in by JS (opacity/backdrop strength) */
}
.header::before {
  content: ""; position: absolute; inset: 0;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
          backdrop-filter: var(--glass-blur);
  opacity: 0;
  pointer-events: none;
  transition: opacity .32s cubic-bezier(.22, .7, .3, 1);
}
/* scroll edge effect — a fade where content meets floating chrome, not a 1px rule */
.header::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 1.5rem;
  background: linear-gradient(to bottom, var(--glass), transparent);
  opacity: 0; pointer-events: none;
  transition: opacity .32s cubic-bezier(.22, .7, .3, 1);
}
.header.is-lifted::before { opacity: 1; }
.header.is-lifted::after  { opacity: .8; }

.nav {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding: 1.125rem 0;
}
.brand {
  display: inline-flex; align-items: center; gap: .7rem;
  text-decoration: none; font-weight: 600;
  font-size: 1.0625rem; letter-spacing: -.02em;
}
.brand svg { width: 1.75rem; height: 1.75rem; display: block; color: var(--ink); }
.nav-links { display: flex; gap: 1.75rem; font-size: .875rem; color: var(--ink-2); }
.nav-links a { text-decoration: none; }
@media (max-width: 46rem) { .nav-links { display: none; } }

/* --- press feedback ------------------------------------------------------
   Applied by JS on pointerdown so it fires on press, not on click.        */
.pressable { touch-action: manipulation; }

/* --- reveal --------------------------------------------------------------
   Content is visible by default; JS only arms (hides) an element once it can
   also un-arm it, so a blocked script can never leave the page blank.
   A cross-fade is not gesture-driven, so a transition is right here — and it
   survives the rAF throttling a background tab applies to a JS spring.     */
[data-reveal] { transition: opacity .5s cubic-bezier(.22, .7, .3, 1); }
.reveal-armed { opacity: 0; }

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

.hero { padding: 4.5rem 0 1.5rem; text-align: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .75rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--line-soft); background: var(--surface);
  padding: .4rem .9rem; border-radius: 100px; margin-bottom: 1.6rem;
}
.eyebrow .dot {
  width: .375rem; height: .375rem; border-radius: 50%;
  background: var(--infra); box-shadow: 0 0 .625rem var(--infra);
}

h1 {
  margin: 0 0 1.15rem;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.02;          /* tight leading for display sizes */
  letter-spacing: -.038em;    /* negative tracking as type grows */
  font-weight: 600;
  font-optical-sizing: auto;
}
h1 .grad {
  background: linear-gradient(102deg, #fff 8%, #c6d2e6 46%, #93a6c6 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.lede {
  max-width: 38rem; margin: 0 auto;
  font-size: clamp(1.02rem, 1.9vw, 1.1875rem);
  line-height: 1.62; letter-spacing: 0;   /* body sits at neutral tracking */
  color: var(--ink-2);
}

.define {
  margin: 2rem auto 0; max-width: 35rem;
  border-left: 2px solid var(--line);
  padding: .125rem 0 .125rem 1.125rem; text-align: left;
  font-size: .9rem; color: var(--ink-3);
}
.define b { color: var(--ink-2); font-weight: 600; }
.define i { font-family: var(--mono); font-style: normal; font-size: .8125rem; }

/* --- section chrome ------------------------------------------------------ */

.sec-head { margin: 0 0 2.75rem; text-align: center; }
.sec-kicker {
  font-size: .71rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 .7rem;
}
.sec-head h2 {
  margin: 0; font-weight: 600;
  font-size: clamp(1.6rem, 3.4vw, 2.15rem);
  line-height: 1.14; letter-spacing: -.028em;
}
.sec-head p {
  margin: .85rem auto 0; max-width: 35rem;
  color: var(--ink-2); font-size: .97rem;
}

/* --- org tree ------------------------------------------------------------ */

.structure { padding: 5.5rem 0 6rem; }
.tree { margin: 0 auto; max-width: 62.5rem; }

.node {
  position: relative; display: block; text-decoration: none;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.375rem 1.5rem;
  will-change: transform;
}
.node::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .34), transparent);
  opacity: .55;
}
.node-top { display: flex; align-items: center; gap: .75rem; margin-bottom: .55rem; }
.glyph {
  width: 2.25rem; height: 2.25rem; flex: none; border-radius: .625rem;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .045);
}
.glyph svg { width: 1.1875rem; height: 1.1875rem; display: block; }
.node-name { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.018em; line-height: 1.25; }
.node-role { font-size: .78rem; color: var(--ink-3); letter-spacing: .015em; }
.node-domain {
  font-family: var(--mono); font-size: .75rem; color: var(--ink-3);
  display: inline-block; margin-top: .125rem;
}
.node-desc { font-size: .875rem; color: var(--ink-2); margin: .625rem 0 0; line-height: 1.55; }

.parent {
  max-width: 32.5rem; margin: 0 auto; text-align: center;
  padding: 1.625rem 1.75rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .03));
  border-color: rgba(255, 255, 255, .2);
  box-shadow: 0 1.5rem 3.75rem -1.875rem rgba(90, 130, 255, .5);
}
.parent .node-top { justify-content: center; margin-bottom: .375rem; }
.parent .node-name { font-size: 1.25rem; }

/* connectors — transform-origin set so they grow out of the parent */
.stem { height: 2.5rem; position: relative; }
.stem::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .34), var(--line));
  transform-origin: top center;
}
.children {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  list-style: none; margin: 0 -.6875rem; padding: 0;
}
.children > li { position: relative; padding: 2.5rem .6875rem 0; }
.children > li::before {                       /* horizontal bar segment */
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 1px;
  background: var(--line); transform-origin: center;
}
.children > li:first-child::before { left: 50%; width: 50%; transform-origin: left center; }
.children > li:last-child::before  { width: 50%; transform-origin: right center; }
.children > li::after {                        /* vertical stub */
  content: ""; position: absolute; top: 0; left: 50%; width: 1px; height: 2.5rem;
  background: linear-gradient(180deg, var(--line), rgba(255, 255, 255, .22));
  transform-origin: top center;
}

/* connectors draw themselves once the tree is reached. These are decorative
   and never gesture-driven, so a transition is the right tool here. */
.tree .stem::before,
.tree .children > li::before,
.tree .children > li::after {
  transform: scale(0);
  transition: transform .5s cubic-bezier(.22, .7, .3, 1);
}
.tree.is-drawn .stem::before        { transform: scaleY(1); }
.tree.is-drawn .children > li::before { transform: scaleX(1); transition-delay: .16s; }
.tree.is-drawn .children > li::after  { transform: scaleY(1); transition-delay: .3s; }

.u-prep   .glyph { border-color: rgba(242, 181,  68, .4); background: rgba(242, 181,  68, .12); color: var(--prep); }
.u-infra  .glyph { border-color: rgba( 75, 195, 232, .4); background: rgba( 75, 195, 232, .12); color: var(--infra); }
.u-studio .glyph { border-color: rgba(169, 140, 245, .4); background: rgba(169, 140, 245, .12); color: var(--studio); }

@media (max-width: 54rem) {
  .children { grid-template-columns: 1fr; margin: 0 0 0 1.375rem; }
  .children > li { padding: 0 0 1.25rem 1.625rem; }
  .children > li::before,
  .children > li:first-child::before,
  .children > li:last-child::before { top: 2.125rem; left: 0; width: 1.625rem; }
  .children > li::after { top: 0; left: 0; height: 100%; }
  .children > li:last-child::after { height: 2.125rem; }
  .stem { height: 1.5rem; }
  .stem::before { left: 1.375rem; }
  .parent { max-width: none; text-align: left; }
  .parent .node-top { justify-content: flex-start; }
}

/* --- company deck --------------------------------------------------------
   ≥ 56rem: a static grid. Below that: a draggable, momentum-snapping deck
   driven by app.js. touch-action keeps vertical page scroll native.       */

.deck-section { padding: .5rem 0 5.5rem; }

.deck { position: relative; }
.deck-track {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap);
  list-style: none; margin: 0; padding: 0;
}

.card {
  position: relative; display: flex; flex-direction: column; height: 100%;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.625rem 1.5rem 1.5rem;
  text-decoration: none; will-change: transform;
}
.card::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .3), transparent);
}
.card-badge {
  align-self: flex-start;
  font-size: .69rem; letter-spacing: .14em; text-transform: uppercase;
  padding: .35rem .7rem; border-radius: 100px;
  border: 1px solid var(--line); color: var(--ink-2); background: var(--surface);
}
.card h3 { margin: 1rem 0 .3rem; font-size: 1.3rem; letter-spacing: -.025em; font-weight: 600; }
.card .dom { font-family: var(--mono); font-size: .78rem; color: var(--ink-3); }
.card p { margin: .95rem 0 1.15rem; color: var(--ink-2); font-size: .92rem; line-height: 1.58; }
.caps { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; margin: auto 0 0; padding: 0; }
.caps li {
  font-size: .78rem; color: var(--ink-2);
  border: 1px solid var(--line-soft); border-radius: .5rem;
  padding: .3rem .6rem; background: var(--surface);
}
.rule { width: 2.125rem; height: 2px; border-radius: 2px; margin-top: .8rem; }
.u-prep-rule   { background: var(--prep); }
.u-infra-rule  { background: var(--infra); }
.u-studio-rule { background: var(--studio); }

/* drag mode */
.deck.is-draggable { overflow: hidden; margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad); }
.deck.is-draggable .deck-track {
  grid-template-columns: none; grid-auto-flow: column;
  grid-auto-columns: min(78vw, 20rem);
  touch-action: pan-y;                 /* horizontal is ours, vertical stays native */
  cursor: grab; will-change: transform;
}
.deck.is-draggable .deck-track.is-grabbed { cursor: grabbing; }
.deck.is-draggable .card { height: auto; }

.deck-dots { display: none; justify-content: center; gap: .45rem; margin-top: 1.5rem; }
.deck.is-draggable ~ .deck-dots { display: flex; }
.deck-dots button {
  width: .45rem; height: .45rem; padding: 0; border: 0; border-radius: 50%;
  background: var(--line); cursor: pointer;
}
.deck-dots button[aria-current="true"] { background: var(--ink-2); }

/* --- principles ---------------------------------------------------------- */

.principles { padding: 0 0 5.5rem; }
.grid-3 {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--gap); list-style: none; margin: 0; padding: 0;
}
.principle {
  border-top: 1px solid var(--line); padding-top: 1.1rem;
}
.principle h3 { margin: 0 0 .45rem; font-size: 1rem; font-weight: 600; letter-spacing: -.012em; }
.principle p { margin: 0; color: var(--ink-2); font-size: .9rem; line-height: 1.6; }

/* --- contact ------------------------------------------------------------- */

.contact { padding: 0 0 5.5rem; }
.panel {
  position: relative; overflow: hidden; text-align: center;
  border: 1px solid var(--line); border-radius: 1.375rem;
  background: linear-gradient(160deg, rgba(255, 255, 255, .062), rgba(255, 255, 255, .018));
  padding: 3rem 2.5rem;
}
.panel::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .4), transparent);
}
.panel h2 { margin: 0 0 .7rem; font-size: clamp(1.5rem, 3.2vw, 2rem); letter-spacing: -.028em; font-weight: 600; }
.panel p { margin: 0 auto 1.6rem; max-width: 30rem; color: var(--ink-2); font-size: .97rem; }
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  background: var(--ink); color: #07090d; text-decoration: none;
  font-weight: 600; font-size: .9rem; letter-spacing: -.004em;
  padding: .8rem 1.5rem; border-radius: .7rem;
  will-change: transform;
}

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

.footer { border-top: 1px solid var(--line-soft); padding: 2rem 0 2.75rem; }
.foot {
  display: flex; flex-wrap: wrap; gap: 1.1rem 1.9rem;
  align-items: center; justify-content: space-between;
  font-size: .8125rem; color: var(--ink-3);
}
.foot nav { display: flex; flex-wrap: wrap; gap: 1.375rem; }
.foot a { text-decoration: none; }

/* ==========================================================================
   Accessibility preferences — three independent signals
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal-armed { opacity: 1 !important; }
  /* Dragging stays available — it is 1:1 with the user's own finger, not
     autonomous motion. app.js drops the momentum spring and snaps instead. */
  .tree .stem::before,
  .tree .children > li::before,
  .tree .children > li::after { transition: none; transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
  :root { --glass: #0b0e14; }
  .header::before { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .node, .card, .panel { background: var(--bg-raised); }
  .bg::before, .bg::after { display: none; }
}

@media (prefers-contrast: more) {
  :root {
    --ink-2: #dbe2ec;
    --ink-3: #b6c0cf;
    --line: rgba(255, 255, 255, .38);
    --line-soft: rgba(255, 255, 255, .28);
    --glass: #090c11;
  }
  .node, .card, .panel, .caps li { background: #0d1118; }
  .bg::before, .bg::after { display: none; }
}
