/* Hypersquid site. Tokens come from design-brief.md. Colours are deliberately off the lead reference's. */
@font-face { font-family: "Rubik"; src: url("../fonts/Rubik-var.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/InstrumentSans-var.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --c-cream: #F8F0DF;
  --c-surface: #FBF2DF;
  --c-orange: #E0502C;
  --c-ink: #1D2037;
  --c-orange-light: #F0712F;      /* the lighter orange (badges, 404 button, ink-band focus ring); replaced the pale green at the owner's request */
  --c-muted: #857A63;
  --c-muted-ink: #9093AB;
  --c-flame: #FF4F1A;
  --c-butter: #F5DB81;           /* owner's pick for the alternate band (round 2): a pale butter tone, 0.084 from the reference gold */
  --c-orange-deep: #D64A22;      /* headline orange on butter: 3.15 to 1, the plain orange is 2.86 */
  /* the alternate band: butter (default), dark ink (?bands=ink) or bright orange (?bands=orange) */
  --alt-bg: var(--c-butter);
  --alt-fg: var(--c-ink);
  --alt-h: var(--c-orange-deep);
  --wave-h: 60px;
  --wave-w: 420px;
  --f-display: "Rubik", system-ui, sans-serif;
  --f-body: "Instrument Sans", system-ui, sans-serif;
  --ease: cubic-bezier(.22, .8, .2, 1);
  --page: 64px;
  --stage-h: 0px;
  --h-size: clamp(40px, 6.2vw, 104px);
  --amber: #ffa600;   /* owner's colour for the hero headline and its button (not a --c-* token on purpose: the palette checks read those) */
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--f-body); font-size: 18px; line-height: 1.5; color: var(--c-ink); background: var(--c-cream); overflow-x: clip; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--c-orange); outline-offset: 4px; border-radius: 6px; }
.band--ink :focus-visible, .bar[data-theme="ink"] :focus-visible { outline-color: var(--c-orange-light); }
html[data-bands="ink"] { --alt-bg: var(--c-ink); --alt-fg: var(--c-cream); --alt-h: var(--c-orange); }
html[data-bands="orange"] { --alt-bg: var(--c-flame); --alt-fg: var(--c-ink); --alt-h: var(--c-cream); }

/* squid canvas sits above the bands and copy; it never catches pointer events */
#squid { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; z-index: 5; pointer-events: none; }
.stage-bg { display: none; }
html[data-bands="ink"][data-stage="ink"] { --stage-ring: var(--c-cream); }
.squid-fallback { display: none; }
.no-webgl #squid { display: none; }

/* header */
.bar { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 18px var(--page); color: var(--c-ink); transition: color .3s var(--ease); pointer-events: none; }
.bar > * { pointer-events: auto; }
.bar .pill { display: none; }   /* owner: no "Say hello" in the header, on any width */
.bar.hide-cta .pill { opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
.bar[data-theme="ink"] { color: var(--alt-fg); }
.bar__mark { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 20px/1 var(--f-display); letter-spacing: -.01em; text-transform: uppercase; opacity: 0; transform: translateY(-8px); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.bar.is-docked .bar__mark { opacity: 1; transform: none; }
.bar__mark img { display: block; height: 28px; width: auto; }
.bar__mark .bar__logo { display: none; }   /* owner: the header shows the squid mark only, no type */
.bar__mark .bar__squid { display: block; height: 88px; }
.bar__mark .bar__squid--white { display: none; }
/* on the butter bands the mark's own soft disc would vanish into the band, so the header swaps to the white-disc mark there */
html[data-bands="butter"] .bar[data-theme="ink"] .bar__squid:not(.bar__squid--white) { display: none; }
html[data-bands="butter"] .bar[data-theme="ink"] .bar__squid--white { display: block; }

.pill { white-space: nowrap; display: inline-flex; align-items: center; gap: .5em; padding: .65em 1.2em; border-radius: 999px; font: 600 15px/1 var(--f-display); letter-spacing: .01em; text-decoration: none; color: var(--c-ink); background: var(--c-orange-light); transition: transform .16s var(--ease); }
.pill:hover { transform: translateY(-2px); }
.pill--big { font-size: 18px; padding: .8em 1.5em; }

/* bands */
.band { position: relative; min-height: 100vh; padding: 168px var(--page); }
#make { min-height: 170vh; }   /* long enough for the squid to turn its head to the front while the text climbs */
#how { min-height: 130vh; align-items: center; }   /* the squid tinkers while the band passes; it needs no scroll story */
.band--cream { background: var(--c-cream); color: var(--c-ink); --band-bg: var(--c-cream); }
.band--ink { background: var(--alt-bg); color: var(--alt-fg); --band-bg: var(--alt-bg); }
.band--ink h1, .band--ink h2 { color: var(--alt-h); }
html[data-bands="orange"] .band--ink .badge--orange use { fill: var(--c-ink); }
html[data-bands="orange"] .band--ink .tag b { border-color: var(--c-ink); }
/* abstract wavy edge where the colour changes (no scenery): a sine mask filled with the band colour */
.band + .band::before {
  content: ""; position: absolute; left: 0; right: 0; top: calc(1px - var(--wave-h)); height: var(--wave-h); background: var(--band-bg); pointer-events: none;
  -webkit-mask: var(--wave) repeat-x 0 0 / var(--wave-w) var(--wave-h); mask: var(--wave) repeat-x 0 0 / var(--wave-w) var(--wave-h);
  animation: drift 14s linear infinite;
}
:root { --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 420 60' preserveAspectRatio='none'%3E%3Cpath d='M0 30C52.5 0 157.5 0 210 30S367.5 60 420 30V60H0Z'/%3E%3C/svg%3E"); }
@keyframes drift { to { -webkit-mask-position: var(--wave-w) 0; mask-position: var(--wave-w) 0; } }

/* type */
h1, h2, .wordmark { font-family: var(--f-display); font-weight: 800; text-transform: uppercase; letter-spacing: -.01em; line-height: .95; margin: 0; color: var(--c-orange); }
h1, h2 { font-size: var(--h-size); }
.lede { font-size: 20px; max-width: 34ch; margin: 28px 0 0; }
.tag { display: inline-flex; align-items: center; gap: 12px; margin: 0 0 28px; font: 600 12px/1 var(--f-display); letter-spacing: .08em; text-transform: uppercase; }
.tag b { font-weight: 600; border: 2px solid currentColor; border-radius: 6px; padding: 5px 8px; }

/* hero */
#hero { padding-top: 0; display: flex; flex-direction: column; justify-content: space-between; gap: clamp(36px, 6vh, 80px); }
.wordmark { padding-top: 88px; position: relative; z-index: 1; }
.wordmark img { display: block; width: calc(100% + 3.6%); height: auto; margin-left: -1.8%; }   /* the logo carries about 2 percent padding each side */
.hero__body { display: flex; justify-content: flex-end; padding: 0 0 110px; }
.copy { max-width: 46vw; position: relative; z-index: 2; }
.copy--right { margin-left: auto; }
.copy--left { margin-right: auto; }
#hero .pill { margin-top: 36px; background: var(--amber); color: var(--c-ink); }
#hero h1 { color: var(--amber); font-size: 60px; }   /* owner: 60px (phone keeps its scaled size below) */

/* what we make / how we make it */
#make, #how, #contact { display: flex; align-items: center; }
#how .copy { width: 46vw; }

/* contact */
#contact { display: flex; align-items: center; }
.mail { display: inline-block; margin-top: 36px; font: 800 clamp(22px, 2.6vw, 42px)/1 var(--f-display); text-decoration: none; color: var(--c-surface); background: var(--c-orange); padding: .5em .85em; border-radius: 999px; transition: transform .16s var(--ease); }
.mail:hover { transform: translateY(-2px); }
.fine { margin: 40px 0 0; font-size: 14px; opacity: .7; }
#contact .fine { position: absolute; left: var(--page); bottom: 28px; margin: 0; }   /* copyright sits at the very bottom of the page */

/* sticker badges */
.badge { position: absolute; left: min(var(--x), calc(100% - var(--s, 96px) - 16px)); top: var(--y); width: var(--s, 96px); height: var(--s, 96px); z-index: 3; animation: bob 5s ease-in-out var(--d) infinite; pointer-events: none; }
.badge use { fill: var(--c-orange-light); }
.badge--orange use { fill: var(--c-orange); }
.badge--amber use { fill: var(--amber); }
.badge--amber { z-index: 0; }   /* the big corner sticker bleeds off the page and sits behind the wordmark and header mark */
.badge--cream use { fill: var(--c-surface); }
.badge__ink { fill: none; stroke: var(--c-ink); stroke-width: 6; stroke-linecap: round; }
.badge__ink--cream { stroke: var(--c-cream); }
.badge__dot { fill: var(--c-ink); }
.badge--orange .badge__dot { fill: var(--c-ink); }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-8px) rotate(6deg); } }

/* phone: the squid stands in the open space under each section's text (main.js stageFor). Circle mode is kept behind PHONE_CIRCLE in main.js:
   the squid lives in a small inset circle in the fixed header, top right; the top of its head pokes out above the rim.
   The circle sits inside the header band (solid), so page text scrolls under the band and never under the circle (round 3 fix). */
@media (max-width: 760px) {
  :root { --page: 24px; --d: clamp(84px, 23vw, 96px); --disc-top: 20px; --bar-h: 114px; --h-size: clamp(34px, 10vw, 56px); --wave-h: 36px; --wave-w: 260px; }
  html.phone-circle { --bar-h: calc(var(--disc-top) + var(--d) + 12px); }   /* circle mode (main.js PHONE_CIRCLE): the header band holds the circle */
  body { font-size: 17px; }
  #hero h1 { font-size: var(--h-size); }
  html.phone-circle .stage-bg { opacity: clamp(0, calc((var(--disc, 0) - .6) * 2.5), 1); transform: scale(calc(.7 + .3 * var(--disc, 0))); display: block; position: fixed; top: var(--disc-top); right: var(--page); width: var(--d); height: var(--d); border-radius: 50%; background: var(--c-ink); border: 5px solid var(--stage-ring, var(--c-ink)); z-index: 4; transition: border-color .3s var(--ease); }
  .band { padding: calc(var(--bar-h) + 24px) var(--page) 104px; min-height: 100vh; }
  #make { min-height: 120vh; }
  #how { min-height: 100vh; }
  #hero { padding-top: 76px; }
  .wordmark { padding-top: 0; }
  .hero__body { padding-bottom: 40px; margin-top: 28px; justify-content: flex-start; }
  .copy, #how .copy { max-width: none; width: auto; margin: 0; }
  .lede { font-size: 18px; }
  #make,   #contact { align-items: flex-start; }
  .mail { font-size: clamp(18px, 5.4vw, 24px); }
  .bar { flex-direction: column-reverse; align-items: flex-start; justify-content: flex-start; gap: 10px; padding: 12px var(--page); z-index: 3; background: var(--c-cream); transition: color .3s var(--ease), background-color .3s var(--ease), min-height .3s var(--ease); }
  .bar.is-docked { min-height: var(--bar-h); box-sizing: border-box; }
  .bar:not(.is-docked) .bar__mark { display: none; }   /* the hero already shows the big logo */
  .bar:not(.is-docked) { padding: 0; }                   /* nothing to hold, so no empty strip above the hero */
  .bar[data-theme="ink"] { background: var(--alt-bg); }
}

/* narrow windows keep their stickers: they move to the free margins above and below the content (own --nx, --ny, --ns per sticker) and shrink a little */
@media (max-width: 1200px) { .badge { left: min(var(--nx), calc(100% - var(--ns) - 12px)); top: var(--ny); width: var(--ns); height: var(--ns); } }

/* no WebGL: the still squid travels between sections like the 3D one (main.js sets left, top, height, rotation) */
.no-webgl .squid-fallback { display: block; position: fixed; left: 0; top: 0; width: auto; z-index: 5; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .badge, .band + .band::before { animation: none; }
  .pill, .mail, .bar__mark { transition: none; }
}

.compare { position: fixed; left: 16px; bottom: 16px; z-index: 12; display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--c-surface); box-shadow: 0 0 0 2px var(--c-ink); font: 600 13px/1 var(--f-display); }
.compare button { all: unset; cursor: pointer; padding: 8px 14px; border-radius: 999px; color: var(--c-ink); }
.compare button[aria-pressed="true"] { background: var(--c-ink); color: var(--c-cream); }

/* 404 */
.notfound { display: flex; align-items: center; gap: 7vw; padding-top: 120px; }
.notfound__squid { height: min(64vh, 40vw); width: auto; transform: rotate(-12deg); margin-left: 4vw; }
.notfound .copy { max-width: 46vw; }
.notfound .pill { margin-top: 32px; }
@media (max-width: 760px) { .notfound { flex-direction: column; align-items: flex-start; padding-top: 96px; } .notfound__squid { height: 34vh; margin-left: 0; } .notfound .copy { max-width: none; } }
