/*
 * Mackerel Solutions — Global Styles
 * Site-wide palette, typography and layout rules.
 * Extracted verbatim from the original single-file build (mackerel-solutions.html).
 * See site-structure.md for the design language this file implements.
 */

  html { margin: 0; background: #021634; overflow-x: hidden;
         scrollbar-width: thin; scrollbar-color: rgba(120,180,220,.28) transparent; }
  body { margin: 0; background: #021634; }
  ::-webkit-scrollbar { width: 10px; }
  ::-webkit-scrollbar-thumb { background: rgba(120,180,220,.28); border-radius: 5px; }
  ::-webkit-scrollbar-track { background: transparent; }
  @media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
  canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

  .brand {
    position: fixed; left: 0; right: 0; bottom: 7vh;
    transform-origin: top center;
    text-align: center; color: #eaf6ff; pointer-events: none;
    padding: 0 16px;
  }
  .brand h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300; white-space: nowrap;   /* single line — keeps the fish 'a' locked to the real glyph */
    font-size: clamp(2.4rem, 6.2vw, 5.4rem);
    letter-spacing: 0.04em;
    line-height: 1;
    margin: 0;
    text-shadow: 0 2px 30px rgba(0, 20, 50, 0.65);
    opacity: 0; animation: rise 2.4s 0.8s cubic-bezier(.2,.7,.2,1) forwards;
  }
  .brand .rule {
    width: 72px; height: 1px; margin: 1.2rem auto;
    background: linear-gradient(90deg, transparent, rgba(220,240,255,.85), transparent);
    opacity: 0; animation: fade 2s 1.6s forwards;
  }
  .brand p {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 300; text-transform: uppercase;
    letter-spacing: 0.55em; padding-left: 0.55em;
    font-size: clamp(0.7rem, 1.25vw, 0.95rem);
    margin: 0; color: rgba(220, 240, 255, 0.88);
    text-shadow: 0 1px 14px rgba(0, 20, 50, 0.7);
    opacity: 0; animation: rise 2.2s 2s cubic-bezier(.2,.7,.2,1) forwards;
  }
  .hint {
    position: fixed; right: 20px; bottom: 18px;
    font: 300 11px/1 'Inter', system-ui, sans-serif;
    letter-spacing: 0.2em; text-transform: uppercase;
    color: rgba(210, 235, 255, 0.45); pointer-events: none;
    opacity: 0; animation: fade 2s 4s forwards; transition: opacity 1.5s;
  }
  .hint.gone { opacity: 0 !important; animation: none; }

  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @keyframes fade { to { opacity: 1; } }

  /* Fish-rendered headline: JS hides the DOM h1 and reveals rule/tagline on resolve */
  body.fish-title h1 { opacity: 0; animation: none; }
  body.fish-title h1 .fish-a { opacity: 0; }   /* the 'a' is rendered by fish on the canvas */
  body.fish-title .rule, body.fish-title .brand p { opacity: 0; animation: none; }
  body.fish-title.title-resolved h1 { opacity: 1; transition: opacity 1.8s ease .2s; }
  body.fish-title .rule, body.fish-title .brand p { opacity: 0; animation: none; }
  body.fish-title.title-resolved .rule { opacity: 0; animation: fade 2s .3s forwards; }
  body.fish-title.title-resolved .brand p { opacity: 0; animation: rise 2.2s .5s cubic-bezier(.2,.7,.2,1) forwards; }
  @media (prefers-reduced-motion: reduce) {
    body.fish-title h1, body.fish-title .rule, body.fish-title .brand p { opacity: 1; animation: none; }
  }
  @media (max-width: 600px) { .hint { display: none; } }

  /* ---------- Vertical menu (left) — fish swim out of the words on hover ---------- */
  .menu {
    position: fixed; left: 34px; top: 50%; transform: translateY(-50%);
    display: flex; flex-direction: column; align-items: flex-start; gap: 22px;
    z-index: 5; font-family: 'Inter', system-ui, sans-serif;
    opacity: 0; animation: fade 2s 2.4s forwards;
  }
  .menu a {
    position: relative; display: block; white-space: nowrap;
    font-weight: 300; font-size: 11px; letter-spacing: 0.24em;
    text-transform: uppercase; text-decoration: none; cursor: pointer;
    color: rgba(210, 235, 255, 0.52);
    text-shadow: 0 1px 12px rgba(0, 20, 50, 0.6);
    transition: color .35s ease, letter-spacing .35s ease;
  }
  .menu a:hover, .menu a:focus-visible { color: #eaf6ff; letter-spacing: 0.3em; }
  .m-fish {
    position: absolute; left: 100%; top: 50%; margin: -4px 0 0 -7px;
    width: 13px; height: 7px; color: currentColor;
    opacity: 0; pointer-events: none;
    --dx: calc(46px + var(--i) * 17px);   /* swim distance grows per fish */
    --dy: calc(var(--i) * 7px - 14px);    /* fan out vertically: -14..+14px */
  }
  @media (prefers-reduced-motion: no-preference) {
    .menu a:hover .m-fish {
      animation: m-swim calc(1.15s + var(--i) * .09s) cubic-bezier(.25,.6,.3,1) calc(var(--i) * .13s) both;
    }
  }
  @keyframes m-swim {
    0%   { transform: translate(0, 0) scale(.45); opacity: 0; }
    10%  { opacity: .95; }
    35%  { transform: translate(calc(var(--dx) * .38), calc(var(--dy) * .55 - 2px)) scale(.95); }
    60%  { transform: translate(calc(var(--dx) * .66), calc(var(--dy) * .85 + 2px)); }
    82%  { transform: translate(calc(var(--dx) * .88), calc(var(--dy) - 2px)); opacity: .8; }
    100% { transform: translate(var(--dx), var(--dy)); opacity: 0; }
  }
  @media (max-width: 600px) {
    .menu { left: 18px; gap: 16px; }
    .menu a { font-size: 10px; }
    .m-fish { --dx: calc(26px + var(--i) * 9px); }
  }

  /* ---------- The dive: sections below the hero ---------- */
  .depth-spacer { height: 100vh; height: 100svh; }
  .panel {
    position: relative; min-height: 100vh; min-height: 100svh;
    display: grid; place-items: center; padding: 0 24px;
  }
  .panel-inner { max-width: 680px; text-align: center; }
  .panel .overline {
    font-family: 'Inter', system-ui, sans-serif; font-weight: 300;
    font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
    color: rgba(210, 235, 255, 0.5); margin: 0 0 1.5rem;
  }
  .panel h2 {
    font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 300;
    font-size: clamp(1.9rem, 3.6vw, 3.2rem); letter-spacing: 0.02em;
    line-height: 1.15; color: #eaf6ff; margin: 0 0 1.4rem;
    text-shadow: 0 2px 30px rgba(0, 20, 50, 0.65);
  }
  .panel .p-rule {
    width: 52px; height: 1px; margin: 0 auto 1.7rem;
    background: linear-gradient(90deg, transparent, rgba(220,240,255,.7), transparent);
  }
  .panel p.copy {
    font-family: 'Inter', system-ui, sans-serif; font-weight: 300;
    font-size: 15px; line-height: 1.85; color: rgba(214, 236, 255, 0.78);
    max-width: 58ch; margin: 0 auto 1.15rem;
  }
  .panel p.copy:last-child { margin-bottom: 0; }

  /* Brand floats up and docks at the top while you're below the hero.
     bottom:7vh puts the block's top edge at 93vh − height; translateY by
     (24px − 93vh + 100%) lands that edge at 24px, then scale shrinks it in place. */
  body.at-depth .brand { transform: translateY(calc(24px - 93vh + 100%)) scale(0.62); }
  @media (prefers-reduced-motion: no-preference) {
    .brand { transition: transform 1.5s cubic-bezier(.22,.61,.21,1); will-change: transform; }
    .panel-inner {
      opacity: 0; transform: translateY(30px);
      transition: opacity 1.2s ease, transform 1.2s cubic-bezier(.2,.7,.2,1);
    }
    .panel.in-view .panel-inner { opacity: 1; transform: none; }
  }

  /* On phones the menu becomes a bottom bar so it never collides with section text */
  @media (max-width: 600px) {
    .menu {
      top: auto; bottom: 16px; left: 18px; right: 18px; transform: none;
      flex-direction: row; justify-content: space-between; gap: 12px;
    }
    .panel { padding: 0 18px; }
  }
