/* Havnar Labs — home page, on top of site.css.
   Darker and bolder than the inner pages: a floating 3D head in white ceramic
   and black glass on near-black with a soft electric-blue halo, and motion clips
   for each service. Electric blue (--blue, the same as --sky) is the one
   accent, never tinted; small text on black stays white or grey. */

:root {
  --blue: #0004f6;
  --navy: #000156;
  --night: #04030f;
  --ink: #201d1d;
  --paper: #f2f2f2;   /* the screen the camera flies into, and the light sections */
}

/* the blue button: flat and solid */
.btn--blue { background: var(--blue); border-color: var(--blue); color: var(--white); transition: background .3s, border-color .3s, color .3s; }
.btn--blue:hover { background: var(--white); border-color: var(--white); color: var(--blue); }

/* ---------- loading: no scrolling until the hero's image and fonts are in ---------- */
/* the class is set by the inline script in the head, before the first paint,
   and home.js removes it once the robot has decoded (five seconds at most) */
html.is-loading, html.is-loading body { overflow: hidden; height: 100%; overscroll-behavior: none; }

/* ---------- boot screen ---------- */
.boot { display: none; }
.js .boot {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end;
  padding: var(--gutter) var(--gutter) calc(var(--gutter) + 24px); background: var(--night); color: var(--white);
  transition: opacity .9s var(--ease), visibility 0s .9s;
}
.boot.is-out { opacity: 0; visibility: hidden; }
.boot__lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.boot__lines li { opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.boot__lines li.is-on { opacity: 1; transform: none; }
.boot__lines li:last-child { color: var(--white); }

/* ---------- hero: the robot ---------- */
.unit { position: relative; background: var(--night); color: var(--white); }
.unit ::selection { background: var(--blue); color: var(--white); }
.unit__stage { position: relative; }
.unit__ascii { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100vh; height: 100svh; display: block; }
.unit__clip { position: absolute; }

/* the robot: centred, rising from the bottom, the headline split either side of its head */
.unit__robot {
  position: absolute; z-index: 2; margin: 0; pointer-events: none;
  left: 50%; bottom: -5%; width: min(84vw, 128vh); margin-left: calc(min(84vw, 128vh) / -2);
  will-change: transform; transform-style: preserve-3d; filter: drop-shadow(0 40px 70px rgba(0, 0, 0, .75));
}
.unit__robot img { display: block; width: 100%; height: auto; }

/* the visor panel: clipped to the glass's outline, feathered at the rim so
   nothing reads as a rectangle, mostly clear so the render's own glass shows */
.visor {
  position: absolute; clip-path: url(#visor-clip);
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 58%, transparent 100%); mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 58%, transparent 100%);
  background: radial-gradient(60% 60% at 50% 40%, rgba(0, 4, 246, .28), rgba(0, 4, 246, 0) 100%), linear-gradient(180deg, rgba(8, 10, 30, .55), rgba(2, 2, 8, .35));
  color: var(--white);
}
.visor::before {  /* the glass: a soft curved sheen across the top */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(80% 45% at 50% -8%, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 70%);
}
.visor::after {  /* turns to paper as the camera arrives, so the intro can take over */
  content: ""; position: absolute; inset: 0; background: var(--paper); opacity: var(--to-paper, 0); pointer-events: none;
}
/* the contents sit inside the glass, bowed in perspective so they read as curved */
.visor__in {
  position: absolute; left: 14%; right: 14%; top: 17%; bottom: 20%;
  display: grid; grid-template-rows: auto 1fr; gap: calc(var(--vw, 160px) * 0.03);
  /* the bottom recedes, as the glass curves back under the chin */
  transform: perspective(calc(var(--vw, 160px) * 2.2)) rotateX(-6deg); transform-origin: 50% 40%;
}
.visor__top { display: flex; justify-content: space-between; gap: calc(var(--vw, 160px) * 0.02); font-size: calc(var(--vw, 160px) * 0.034); color: rgba(255, 255, 255, .55); }
.visor__live { color: var(--white); }
.visor__live::before { content: "●"; margin-right: .6em; color: var(--blue); text-shadow: 0 0 8px rgba(0, 4, 246, .9); }
.visor__list { list-style: none; margin: 0; padding: 0; display: grid; align-content: start; gap: calc(var(--vw, 160px) * 0.012); }
.visor__list li {
  position: relative; display: flex; align-items: center; gap: calc(var(--vw, 160px) * 0.026); padding: calc(var(--vw, 160px) * 0.02) calc(var(--vw, 160px) * 0.03); border-radius: calc(var(--vw, 160px) * 0.02);
  font-size: calc(var(--vw, 160px) * 0.064); font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap; color: rgba(255, 255, 255, .62);
  opacity: 0; transform: translateX(calc(var(--vw, 160px) * -0.06)); transition: opacity .5s var(--ease), transform .5s var(--ease), color .3s, background .3s;
}
.visor__list li .mono { font-size: calc(var(--vw, 160px) * 0.03); color: rgba(255, 255, 255, .4); }
.visor__list li.is-shown { opacity: 1; transform: none; }
.visor__list li.is-on { color: var(--white); background: rgba(0, 4, 246, .75); }
.visor__list li.is-on .mono { color: var(--white); }
.visor__list li.is-on::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: calc(var(--p, 0) * 100%); background: var(--white); }
/* the glass narrows toward the chin: the lower rows pull in from the rim */
.visor__list li:nth-child(4) { margin-inline: 2%; }
.visor__list li:nth-child(5) { margin-inline: 9%; }

/* the headline, in two halves around the head */
.unit__head {
  position: relative; z-index: 1; min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-rows: 1fr auto auto 1fr; gap: 0;
  padding-top: calc(104px + env(safe-area-inset-top, 0px)); padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  opacity: calc(1 - var(--out, 0)); transform: translateY(calc(var(--out, 0) * -48px));
}
.unit__side { position: absolute; right: var(--gutter); top: calc(104px + env(safe-area-inset-top, 0px)); margin: 0; text-align: right; color: rgba(255, 255, 255, .6); }
.unit__title {
  grid-row: 2; margin: 0 0 24px;
  display: grid; grid-template-columns: 1fr minmax(22vw, 30vw) 1fr; align-items: end; column-gap: 0;
  font-weight: 600; font-size: clamp(36px, 4.4vw, 80px); line-height: .92; letter-spacing: -0.05em;
}
.unit__title-l { grid-column: 1; text-align: right; justify-self: end; max-width: 7.2em; }
.unit__title-r { grid-column: 3; text-align: left; justify-self: start; max-width: 7.6em; }
.unit__title em {
  /* white on a solid block of the blue: it holds over the moving characters */
  font-style: normal; color: var(--white); background: var(--blue);
  display: inline-block; line-height: .9; padding: .02em .14em .08em; margin: .06em -.02em 0; border-radius: .1em; vertical-align: baseline;
}
/* the button and the scroll hint sit in the outer columns too, clear of the robot */
.unit__foot { grid-row: 3; display: grid; grid-template-columns: 1fr minmax(22vw, 30vw) 1fr; align-items: center; }
.unit__foot .btn { grid-column: 1; justify-self: end; }
.unit__foot .unit__scroll { grid-column: 3; justify-self: start; }
.unit__scroll { text-decoration: none; display: inline-flex; gap: 10px; color: rgba(255, 255, 255, .7); }
.unit__scroll span { display: inline-block; animation: nudge 2s var(--ease) infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }

/* first screen: rises in once the boot screen has gone */
.js .unit__head > * { opacity: 0; transform: translateY(28px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.js .unit.is-in .unit__head > * { opacity: 1; transform: none; }
.js .unit.is-in .unit__title { transition-delay: .15s; }
.js .unit.is-in .unit__foot { transition-delay: .35s; }
.js .unit__robot { opacity: 0; transition: opacity 1.4s var(--ease) .1s; }
.js .unit.is-in .unit__robot { opacity: 1; }

/* the intro, the screen's contents */
.shot { position: relative; z-index: 4; background: var(--paper); color: var(--black); overflow: hidden; }
.shot__inner {
  min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; gap: 32px;
  padding: calc(108px + env(safe-area-inset-top, 0px)) 0 clamp(24px, 4vh, 40px);
}
.shot__top { display: flex; justify-content: space-between; gap: 16px; color: var(--g4); }
.shot__body { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px var(--gutter); align-items: end; }
.shot__lead { margin: 0; font-size: clamp(30px, 4.3vw, 78px); line-height: 1.02; letter-spacing: -0.045em; max-width: 19ch; text-wrap: balance; }
.shot__side p { margin: 0 0 24px; font-size: clamp(17px, 1.3vw, 21px); color: #4a4646; max-width: 40ch; }
.shot__ticker { overflow: hidden; border-top: 1px solid var(--black); padding-top: 16px; }
.ticker { display: flex; width: max-content; animation: ticker 48s linear infinite; }
.ticker span { flex: none; font-size: clamp(30px, 4.6vw, 80px); line-height: 1; letter-spacing: -0.05em; white-space: nowrap; }
.ticker span::after { content: "+"; display: inline-block; margin: 0 .45em; color: var(--blue); font-weight: 300; }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (max-width: 860px) {
  .shot__body { grid-template-columns: 1fr; align-items: start; }
  .shot__top span + span { display: none; }
}

/* live: the hero pins while the page scrolls into the visor */
.unit.is-live { height: 260vh; }
.unit.is-live .unit__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.unit.is-live .unit__head { position: absolute; inset: 0; pointer-events: none; }
.unit.is-live .unit__head a { pointer-events: auto; }
.unit.is-live .shot { position: absolute; left: 0; top: 0; width: 100%; height: 100%; visibility: hidden; transform-origin: 0 0; will-change: transform, width, height; }
.unit.is-live .shot__inner { width: 100vw; min-height: 0; height: 100%; transform-origin: 0 0; }
/* the glass of the screen: scanlines and a soft vignette, fading as it opens up */
.shot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: var(--crt, 0);
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .06) 0 1px, transparent 1px 4px);
  box-shadow: inset 0 0 12vmin rgba(0, 0, 0, .45);
}

@media (max-width: 1100px) { .unit__side { display: none; } }
@media (max-width: 760px) {
  .unit__head { grid-template-rows: auto auto auto 1fr; padding-top: calc(96px + env(safe-area-inset-top, 0px)); }
  .unit__title { grid-row: 1; grid-template-columns: 1fr; margin-bottom: 22px; font-size: clamp(32px, 9vw, 52px); text-align: center; }
  .unit__foot { grid-row: 2; }
  .unit__title-l, .unit__title-r { grid-column: 1; text-align: center; justify-self: center; max-width: none; }
  .unit__title-r { margin-top: .1em; }
  .unit__scroll { display: none; }
  .unit__foot { grid-template-columns: 1fr; }
  .unit__foot .btn { justify-self: center; }
  .unit__robot { width: min(140vw, 66vh); margin-left: calc(min(140vw, 66vh) / -2); bottom: -4%; }
}

/* ---------- the reel ---------- */
.reel { position: relative; background: var(--night); color: var(--white); --open: 1; --cap: 1; }
.reel__stage { position: relative; height: 100vh; height: 100svh; overflow: hidden; }
.reel.is-live { height: 260vh; --open: 0; --cap: 0; }
.reel.is-live .reel__stage { position: sticky; top: 0; }
.reel__frame {
  position: absolute; inset: 0; margin: 0; overflow: hidden;
  clip-path: inset(calc((1 - var(--open)) * 27vh) calc((1 - var(--open)) * 31vw) round calc((1 - var(--open)) * 28px));
}
.reel__frame video { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(calc(1.2 - .2 * var(--open))); }
.reel__frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, .75), rgba(0, 0, 0, 0) 55%); opacity: var(--cap); }
.reel__word {
  position: absolute; top: 50%; margin: 0; z-index: 1;
  font-size: clamp(56px, 12vw, 240px); font-weight: 600; line-height: 1; letter-spacing: -0.06em;
  opacity: calc(1 - var(--open) * 1.4);
}
.reel__word--l { left: var(--gutter); transform: translate(calc(var(--open) * -40vw), -50%); }
.reel__word--r { right: var(--gutter); transform: translate(calc(var(--open) * 40vw), -50%); color: var(--white); }
.reel__cap {
  position: absolute; left: 0; right: 0; bottom: clamp(28px, 6vh, 64px); z-index: 2; display: grid; gap: 18px;
  opacity: var(--cap); transform: translateY(calc((1 - var(--cap)) * 30px));
}
.reel__line { font-size: clamp(32px, 5vw, 92px); line-height: .95; letter-spacing: -0.055em; max-width: 15ch; text-wrap: balance; }
@media (max-width: 760px) {
  .reel__frame { clip-path: inset(calc((1 - var(--open)) * 30vh) calc((1 - var(--open)) * 10vw) round calc((1 - var(--open)) * 20px)); }
  /* the clips are interfaces: on a tall screen show the whole frame rather than a sliver */
  .reel__frame video { object-fit: contain; transform: none; }
  .reel__word { top: calc(50% - 26vh); font-size: 18vw; }
  .reel__word--r { top: calc(50% + 26vh); }
}

/* ---------- services: four cards, each with a motion clip of the work ---------- */
.lanes { padding: clamp(96px, 12vw, 180px) 0; background: linear-gradient(180deg, #0a0a18, var(--night) 40%); color: var(--white); }
.lanes__grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
/* five services: two large cards, then three */
.lane { grid-column: span 2; }
.lane:nth-child(-n+2) { grid-column: span 3; }
.lane:nth-child(n+3) .lane__name { font-size: clamp(30px, 2.6vw, 46px); }
@media (max-width: 1100px) {
  .lanes__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lane, .lane:nth-child(-n+2) { grid-column: span 1; }
  .lane:last-child { grid-column: 1 / -1; }
}
.lane {
  display: flex; flex-direction: column; overflow: hidden; border-radius: 22px;
  background: linear-gradient(180deg, #15162a, #0f1020); border: 1px solid #272a4a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 30px 60px -30px rgba(0, 0, 0, .9);
  transition: border-color .5s var(--ease), transform .5s var(--ease);
}
.lane:hover { border-color: #3a3fff; transform: translateY(-3px); }
.lane__media { margin: 8px 8px 0; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 15px; background: var(--night); border: 1px solid rgba(255, 255, 255, .05); }
.lane__media video { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.lane:hover .lane__media video { transform: scale(1.03); }
.lane__body { padding: clamp(22px, 2.4vw, 36px); display: grid; gap: 12px; }
.lane__n { margin: 0; color: rgba(255, 255, 255, .55); }
.lane__name { margin: 0; font-weight: 500; font-size: clamp(34px, 3.4vw, 58px); line-height: .95; letter-spacing: -0.055em; }
.lane__hook { margin: 0; font-size: clamp(18px, 1.4vw, 22px); letter-spacing: -0.02em; color: rgba(255, 255, 255, .88); }
.lane__text { margin: 0; color: #b6b7c6; max-width: 50ch; }
.lane__list { list-style: none; margin: 6px 0 0; padding: 14px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; border-top: 1px solid rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .65); }
.lane__list li::before { content: "+ "; color: rgba(255, 255, 255, .45); }
.lanes__more { margin: 48px 0 0; }
@media (max-width: 860px) {
  .lanes__grid { grid-template-columns: 1fr; }
  .lane:last-child { grid-column: auto; }
  .lane__list { grid-template-columns: 1fr; }
}

/* ---------- five signs ---------- */
.signs { padding: clamp(96px, 12vw, 180px) 0; background: var(--paper); }
.signs__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--black); }
.signs__list li {
  display: grid; grid-template-columns: minmax(160px, 1fr) 3fr; gap: 16px var(--gutter); align-items: center;
  padding: clamp(18px, 2.2vw, 30px) 0; border-bottom: 1px solid #d6d6d6;
}
.signs__n { font-size: clamp(54px, 6.4vw, 112px); font-weight: 300; line-height: .85; letter-spacing: -0.06em; color: transparent; -webkit-text-stroke: 1px var(--black); transition: color .5s var(--ease), -webkit-text-stroke-color .5s; }
.signs__list li:hover .signs__n { color: var(--blue); -webkit-text-stroke-color: var(--blue); }
.signs__list p { margin: 0; font-size: clamp(21px, 2.3vw, 38px); line-height: 1.12; letter-spacing: -0.035em; max-width: 30ch; transition: transform .6s var(--ease); }
.signs__list li:hover p { transform: translateX(14px); }
@media (max-width: 860px) { .signs__list li { grid-template-columns: 64px 1fr; } .signs__n { font-size: 48px; } }

/* ---------- process, on black with the blue rising from below ---------- */
.process.dark { position: relative; overflow: hidden; background: radial-gradient(80% 70% at 80% 120%, rgba(0, 4, 246, .75), rgba(0, 1, 86, .5) 45%, rgba(4, 3, 15, 0) 80%), var(--night); }
.process.dark .steps { border-top-color: var(--white); }
.process.dark .steps li { border-color: rgba(255, 255, 255, .16); }
.process.dark .steps p { color: rgba(255, 255, 255, .72); }
.process.dark .steps .mono { color: rgba(255, 255, 255, .55); }

@media (prefers-reduced-motion: reduce) {
  .ticker, .unit__scroll span { animation: none; }
  .js .unit__head > * { opacity: 1; transform: none; transition: none; }
}
