/* ─────────────────────────────────────────────────────────────
     OCTOLUS — deep-sea bioluminescence.
     Single theme, deliberately: the subject is underwater.
     Palette read from the supplied wordmark; the gradient IS the brand,
     running warm at the outer whorl to cold at the spiral's core.
     ───────────────────────────────────────────────────────────── */
  :root {
    /* Sampled from the supplied wordmark, not eyeballed.
       Ground reads #010011 in every corner: blue-black, not neutral. */
    --abyss:    #010011;
    --trench:   #06021C;
    --ink:      #0D0526;

    --amber:    #FFBC34;
    --ember:    #FF973A;
    --flame:    #FF524D;
    --rose:     #FF2D62;
    --pink:     #FA1891;
    --magenta:  #ED05CE;
    --orchid:   #BB00FD;
    --violet:   #8417FF;
    --ultra:    #6119FF;

    /* neutrals carry a violet bias so they belong to the palette */
    --silt-100: #EDE6FB;
    --silt-300: #B4A4D6;
    --silt-500: #77669B;
    --silt-700: #362A57;

    --stage-h: 100svh;

    --step--1: clamp(.72rem, .68rem + .18vw, .82rem);
    --step-0:  clamp(.95rem, .9rem + .25vw, 1.06rem);
    --step-1:  clamp(1.15rem, 1.05rem + .5vw, 1.4rem);
    --step-2:  clamp(1.6rem, 1.3rem + 1.4vw, 2.4rem);
    --step-3:  clamp(2.4rem, 1.6rem + 3.6vw, 5rem);

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

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

  html { -webkit-text-size-adjust: 100%; }

  body {
    margin: 0;
    background: var(--abyss);   /* #ambient paints over this */
    color: var(--silt-100);
    font-family: var(--sans);
    font-size: var(--step-0);
    line-height: 1.6;
    overflow-x: hidden;
  }

  /* keyboard focus must always be visible against the dark */
  a:focus-visible, button:focus-visible {
    outline: 2px solid var(--pink);
    outline-offset: 3px;
    border-radius: 3px;
  }

  /* ── STAGE ─────────────────────────────────────────────────── */
  .stage {
    position: relative;
    height: var(--stage-h);
    min-height: 34rem;
    overflow: hidden;
    isolation: isolate;
  }

  /* Full-page water. Fixed and behind everything; the hero canvas sits on top of it. */
  #ambient {
    position: fixed;
    inset: 0;
    width: 100%; height: 100%;
    z-index: -1;
    display: block;
    pointer-events: none;
  }
  @media (prefers-reduced-motion: reduce) { #ambient { display: none; } }

  #tank {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
  }

  /* wordmark sits above the creature, tracked wide like the logo */
  .brand {
    position: absolute;
    top: clamp(1.6rem, 5vh, 3.4rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    text-align: center;
    width: min(92vw, 60rem);
    pointer-events: none;
  }

  .brand h1 {
    margin: 0;
    font-size: var(--step-3);
    font-weight: 800;
    letter-spacing: .22em;
    text-indent: .22em;              /* optical: cancel trailing track */
    line-height: 1;
    text-wrap: balance;
    background: linear-gradient(100deg,
      var(--amber) 0%, var(--ember) 14%, var(--flame) 30%,
      var(--pink) 50%, var(--magenta) 66%, var(--violet) 84%,
      var(--ultra) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    opacity: 0;
    animation: rise 1.4s cubic-bezier(.2,.7,.3,1) 2.3s forwards;
  }

  .brand p {
    margin: 1.1rem 0 0;
    font-size: var(--step--1);
    font-weight: 600;
    letter-spacing: .34em;
    text-indent: .34em;
    text-transform: uppercase;
    color: var(--silt-500);
    opacity: 0;
    animation: rise 1.4s cubic-bezier(.2,.7,.3,1) 2.75s forwards;
  }

  @keyframes rise {
    from { opacity: 0; transform: translateY(.7rem); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* ── VENTURE NODES (positioned each frame at tentacle tips) ── */
  .nodes { position: absolute; inset: 0; z-index: 2; }

  .node {
    position: absolute;
    transform: translate(-50%, -50%);
    display: block;
    text-decoration: none;
    color: inherit;
    white-space: nowrap;
    opacity: 0;
    transition: opacity .5s ease;
  }
  .node.lit { opacity: 1; }

  .node-inner {
    display: flex;
    flex-direction: column;
    gap: .12rem;
    padding: .42rem .7rem;
    border-radius: .55rem;
    background: color-mix(in oklab, var(--abyss) 76%, transparent);
    border: 1px solid color-mix(in oklab, var(--arm, var(--pink)) 34%, transparent);
    backdrop-filter: blur(7px);
    transition: border-color .25s ease, background .25s ease, transform .25s ease;
  }

  .node-name {
    font-size: var(--step--1);
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--silt-100);
    line-height: 1.2;
  }

  .node-url {
    font-family: var(--mono);
    font-size: .66rem;
    letter-spacing: .02em;
    color: var(--arm, var(--pink));
    line-height: 1.2;
  }

  .node:hover .node-inner,
  .node:focus-visible .node-inner {
    background: color-mix(in oklab, var(--arm, var(--pink)) 16%, var(--abyss));
    border-color: var(--arm, var(--pink));
    transform: translateY(-2px);
  }

  /* ── SCROLL CUE ────────────────────────────────────────────── */
  .cue {
    position: absolute;
    bottom: 1.3rem; left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    font-family: var(--mono);
    font-size: .66rem;
    letter-spacing: .3em;
    text-indent: .3em;
    text-transform: uppercase;
    color: var(--silt-700);
    opacity: 0;
    animation: rise 1.2s ease 4.6s forwards;
  }

  /* ── VENTURE SECTIONS ──────────────────────────────────────── */
  .roster {
    max-width: 74rem;
    margin: 0 auto;
    padding: clamp(4rem, 11vh, 7rem) clamp(1.15rem, 5vw, 2.5rem) 3rem;
  }

  .roster-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .5rem 1.4rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--silt-700);
  }
  .roster-head h2 {
    margin: 0;
    font-size: var(--step-2);
    font-weight: 800;
    letter-spacing: .04em;
    text-wrap: balance;
  }
  .roster-head span {
    font-family: var(--mono);
    font-size: var(--step--1);
    color: var(--silt-500);
    font-variant-numeric: tabular-nums;
  }
  .roster-note {
    margin: 1.4rem 0 0;
    max-width: 52ch;
    color: var(--silt-300);
  }

  .arms { list-style: none; margin: 0; padding: 0; }

  .arm {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(1.5rem, 4vw, 3.4rem);
    padding: clamp(2.6rem, 7vw, 4.6rem) clamp(1.15rem, 5vw, 2.5rem);
    max-width: 74rem;
    margin: 0 auto;
    position: relative;
    scroll-margin-top: 12vh;
  }
  /* alternate sides so eight bands never read as a table */
  .arm:nth-child(even) .arm-media { order: 2; }

  .arm + .arm::before {
    content: "";
    position: absolute;
    top: 0; left: clamp(1.15rem, 5vw, 2.5rem); right: clamp(1.15rem, 5vw, 2.5rem);
    height: 1px;
    background: linear-gradient(90deg,
      transparent, color-mix(in oklab, var(--silt-700) 90%, transparent), transparent);
  }

  /* ── cover ── */
  .arm-media {
    position: relative;
    border-radius: .9rem;
    overflow: hidden;
    aspect-ratio: 880 / 462;
    background: var(--trench);
    border: 1px solid color-mix(in oklab, var(--arm) 26%, transparent);
    box-shadow: 0 18px 50px -26px var(--arm),
                0 0 0 1px color-mix(in oklab, var(--arm) 10%, transparent);
  }
  .arm-media img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(1.03);
  }
  /* tint the cover toward its arm colour so eight screenshots read as one page */
  .arm-media::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(145deg,
      color-mix(in oklab, var(--arm) 20%, transparent), transparent 55%),
      linear-gradient(0deg, color-mix(in oklab, var(--abyss) 42%, transparent), transparent 60%);
    pointer-events: none;
  }

  /* ── body ── */
  .arm-body { display: flex; flex-direction: column; gap: .85rem; align-items: flex-start; }

  .arm-eyebrow {
    display: flex; align-items: center; gap: .6rem;
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--silt-500);
  }
  .arm-index { color: var(--arm); font-variant-numeric: tabular-nums; }
  .arm-cat {
    padding: .12rem .5rem;
    border-radius: .3rem;
    border: 1px solid color-mix(in oklab, var(--arm) 34%, transparent);
    color: color-mix(in oklab, var(--arm) 78%, var(--silt-100));
    letter-spacing: .14em;
  }

  .arm-title { display: flex; align-items: center; gap: .7rem; }
  .arm-icon {
    width: 2rem; height: 2rem; border-radius: .45rem;
    object-fit: contain;
    background: color-mix(in oklab, var(--abyss) 60%, transparent);
    padding: .18rem;
  }
  .arm-mark {
    width: 1.5rem; height: 1.5rem; border-radius: 50%;
    flex: none;
    background: radial-gradient(circle at 34% 30%,
      color-mix(in oklab, var(--arm) 90%, white 10%) 0%, var(--arm) 42%,
      color-mix(in oklab, var(--arm) 40%, var(--abyss)) 100%);
    box-shadow: 0 0 18px -4px var(--arm);
  }
  .arm-name {
    font-size: var(--step-2);
    font-weight: 800;
    letter-spacing: .005em;
    color: var(--silt-100);
    line-height: 1.1;
    text-wrap: balance;
  }

  .arm-what {
    margin: 0;
    color: var(--silt-300);
    font-size: var(--step-0);
    max-width: 46ch;
  }

  .arm-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: .2rem; }
  .arm-url {
    font-family: var(--mono);
    font-size: var(--step--1);
    color: var(--silt-500);
  }
  .arm-go {
    padding: .48rem .95rem;
    border-radius: .5rem;
    font-family: var(--mono);
    font-size: var(--step--1);
    text-decoration: none;
    color: var(--arm);
    border: 1px solid color-mix(in oklab, var(--arm) 42%, transparent);
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
  }
  .arm-go:hover {
    background: color-mix(in oklab, var(--arm) 16%, transparent);
    border-color: var(--arm);
    transform: translateY(-1px);
  }

  .arm.landed { animation: landed 2.4s ease-out; border-radius: 1rem; }
  @keyframes landed {
    0%   { background: color-mix(in oklab, var(--arm) 15%, transparent); }
    100% { background: transparent; }
  }

  .node-cue { opacity: .75; }

  @media (max-width: 54rem) {
    .arm { grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
    .arm:nth-child(even) .arm-media { order: 0; }
    .arm-name { font-size: var(--step-1); }
  }

  footer {
    max-width: 62rem;
    margin: 0 auto;
    padding: 0 clamp(1.15rem, 5vw, 2.5rem) 4rem;
    color: var(--silt-700);
    font-family: var(--mono);
    font-size: var(--step--1);
  }

  @media (max-width: 40rem) {
    .node-url { display: none; }
  }


  /* ── REDUCED MOTION ────────────────────────────────────────────
     A stilled canvas is a worse answer than the real thing. Anyone
     who asks for less motion gets the actual creature instead.     */
  .poster { display: none; }

  @media (prefers-reduced-motion: reduce) {
    #tank, .cue { display: none; }
    .poster {
      display: block;
      position: absolute;
      top: 50%; left: 50%;
      transform: translate(-50%, -46%);
      width: min(74vw, 40rem);
      height: auto;
      z-index: 1;
      mix-blend-mode: screen;   /* drops the artwork's black ground */
    }
    .node { opacity: 1; }
  }

  @media (prefers-reduced-motion: reduce) {
    .brand h1, .brand p, .cue { animation-duration: .01ms; animation-delay: .01ms; }
    .arm.landed { animation: none; outline: 2px solid var(--arm); }
  }
