/* Algorithmic Kitchen — the public landing page.
 *
 * Built 1-1 from two Figma boards (file uBZgdCh71Mdr1ayOibjZ5S, read 23 Nov 2026):
 * node 17:326 is the closed state, node 20:449 the open navigation. Both boards are
 * 2568 x 1697. Every size in them reads as a literal CSS value — 16/20/24/32/96px type,
 * 6/8/10/20px radii, 28/32px padding — and 2568 is a hair over a 2560-wide desktop, so
 * this is built at 1:1 CSS pixels rather than as a canvas that scales. The one thing
 * that does scale with the viewport is the logo window, because it is a graphic.
 *
 * This file is deliberately separate from styles.css: that one belongs to the gated
 * deck and carries a print stylesheet with a 167mm page box. Nothing here prints.
 */

/* --------------------------------------------------------------- the fonts */
/* Latin subsets only, pulled from Google Fonts and self-hosted — the gate serves
   /fonts/ before anyone is authorised, and a runtime CDN request would hand a
   visitor's IP to a third party on a page that is otherwise unannounced. Both
   families are SIL OFL. */
@font-face {
  font-family: "42dot Sans";
  src: url("fonts/42dotSans-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("fonts/Manrope-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("fonts/Manrope-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #434343;
  --page: #d9d9d9;
  --rule: rgba(67, 67, 67, 0.45);   /* the pill's border: --ink at 45% */
  --dim: rgba(0, 0, 0, 0.45);       /* the scrim behind the open menu */
  --card-rule: rgba(0, 0, 0, 0.06);
  --chip: rgba(0, 0, 0, 0.02);      /* the close button at rest, the nav pill on hover */
  --display: "42dot Sans", system-ui, sans-serif;
  --body: "Manrope", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 500;
  /* The design has no scrollable content below the fold. */
  overflow-x: hidden;
}

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

.hero {
  position: relative;
  min-height: 100svh;
  /* The window reaches 31.4% down the board and the type sits above it, so the
     stack is top-aligned rather than centred. */
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;

  /* The type stack is a fixed height, because the type is literal: 30 top + 76.24
     pill + 109.6 gap + 48 tagline + 38 gap + 86.4 title = 388.2px, and the board puts
     the window's top edge 144.5px below that, at 532.7px. That distance does not change
     with the viewport, so the window is pinned to it rather than to a fraction of the
     height. (The pill shrank 20% on 23 Nov 2026 and the tagline's margin grew by what
     it lost, so this total is unchanged and so is the 532.7.)

     --win is the window's width, and it is 85.134% of the page: the board drew 70.945%
     and it was widened 20% on 23 Nov 2026 so that more of the fry station and the space
     around it falls inside the letterforms. The video is 1280x720 and `cover` already
     renders it at the smallest size that covers the page, so the window is the only
     lever on how much of the scene shows — at 70.945% it framed 60% of the video's
     width, at 85.134% it frames 72%.

     Below about 1700px of viewport height the full-width window no longer fits under
     the type, so it is also capped by the room actually left. That is the second term:
     the available height is 100svh - 532.7px, and the window plus the gap the board
     leaves beneath it (71.2 of its 1093.1 of height) comes to 0.5326 of its width, so
     the widest that fits is (100svh - 532.7px) / 0.5326. On the board's own 2568x1697
     the two terms land within a tenth of a pixel of each other, which is the check that
     they describe the same rectangle rather than an approximation of it.

     The 220px floor is not cosmetic: under 532.7px of viewport height the second term
     goes negative, and a negative mask-size is invalid — the mask drops and the video
     plays full-bleed across the whole page with no logo at all. */
  --win: max(220px, min(85.134vw, (100svh - 532.7px) * 1.8776));
}

/* The video and the logotype window are ONE box, not two.
 *
 * The first build gave the video `inset: 0` so it covered the whole page, with the mask
 * floating over it — which is how the Figma board builds it, and what "centred, scaling
 * to the page" describes. The trouble is that the window is much smaller than the page,
 * so the letterforms framed a small centre slice of the video and *which* slice moved
 * with the viewport: at 2568x1697 you got the fry station, at 1440x950 you got the base
 * of the robot and a blank steel panel. Widening the window 20% helped at the board's
 * own size and did not fix the laptop.
 *
 * So the video's box IS the window: same width, same 2:1 shape, same 532.7px from the
 * top. `object-fit: cover` then frames the scene against the letterforms rather than
 * against the page, identically at every viewport — full width of the 1280x720 frame and
 * 89% of its height, which is the framing the design references show. Nothing is lost by
 * giving up page coverage, because everything outside the letterforms was never visible:
 * the page background was already the sheet.
 *
 * mask-size is 100% 100% rather than a length: the box is 2:1 and the SVG's viewBox is
 * 42x21, also 2:1, so stretching it to the box is not a distortion. The ink is 42x20.09
 * and flush to the viewBox's top, so it fills the top 95.7% and the spare falls below. */
.hero__video {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  top: 532.7px;
  width: var(--win);
  height: calc(var(--win) / 2);
  object-fit: cover;
  pointer-events: none;
  -webkit-mask-image: url("public/ak-logotype.svg");
          mask-image: url("public/ak-logotype.svg");
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
          mask-size: 100% 100%;
  -webkit-mask-position: center;
          mask-position: center;
}

/* ------------------------------------------------------- the header pill */

/* The header is the landmark and carries the offset; the pill itself is the button. */
.bar-head {
  position: relative;
  z-index: 2;
  margin-top: 30px;
  max-width: calc(100% - 32px);
}

/* The whole pill is the control, not the icon inside it — so it is a <button> with the
   wordmark and the icon as its content, rather than a <header> wrapping a small button.
   That is why the appearance reset is here: a button brings its own border, padding,
   font and background, all of which have to go before the board's values apply. */
.bar {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  /* 20% off the board's 540 x 94.8 pill, 23 Nov 2026: every dimension it has scaled by
     0.8 together — width, both paddings, the type, the icon and the corner — so it is
     the same shape, smaller, rather than a shape with different proportions. */
  width: 432px;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12.8px;
  padding: 25.6px 22.4px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: clip;
  /* Transparent rather than unset, so there is a colour to interpolate from on hover. */
  background: transparent;
  transition: background 0.18s ease-in-out;
}

/* 2% black on hover — the same value the close button rests at. */
.bar:hover { background: var(--chip); }
.bar:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

.bar__name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 25.6px;
  line-height: 0.9;
  letter-spacing: -1.28px;
  white-space: nowrap;
}

/* 35x18 rather than the 32x15 box Figma reports: the two 3px strokes have round
   caps that bleed past the box on every side, and drawing it at the stroke's own
   size is the same picture without a scale factor. */
.bar__menu {
  display: grid;
  place-items: center;
  width: 28px;
  height: 14.4px;
  color: var(--ink);
  flex: none;
}
.bar__menu svg { display: block; width: 28px; height: 14.4px; }

/* --------------------------------------------------------------- the type */

/* 109.6px, and it moved with the pill rather than staying put. The board puts the
   tagline's centre at y=240; the pill's own box used to end at 124.8 and now ends at
   106.24 (30 top + 51.2 padding + 23.04 line + 2 border), so the gap to a 48px-tall
   two-line block grew by the 18.56 the pill lost: 216 - 106.24. The tagline and the
   title therefore sit exactly where the board puts them, which is also what keeps the
   mask's 532.7px offset correct — only the nav was asked to shrink. */
.hero__tagline {
  position: relative;
  z-index: 2;
  margin: 109.6px 0 0;
  width: 234px;
  max-width: calc(100% - 32px);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.16px;
  text-align: center;
}

/* Board: top 302, i.e. 38px under the tagline block. */
.hero__title {
  position: relative;
  z-index: 2;
  margin: 38px 0 0;
  font-family: var(--display);
  font-weight: 600;
  /* Literal 96px wherever it fits. "Say hello to Soyer" sets about 746px wide at
     that size, so it holds down to roughly a 1070px viewport and shrinks below. */
  font-size: clamp(2.5rem, 9vw, 96px);
  line-height: 0.9;
  letter-spacing: -0.05em;
  text-align: center;
  white-space: nowrap;
}

/* ----------------------------------------------------------- the open menu */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--dim);
  border: 0;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s var(--ease), visibility 0s linear 0.24s;
}
.scrim[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.24s var(--ease);
}

/* The pill grows into this: same 30px from the top, 540 -> 957 wide,
   94.8 -> 510 tall. */
.menu {
  position: fixed;
  z-index: 11;
  top: 30px;
  left: 50%;
  translate: -50% 0;
  width: 957px;
  max-width: calc(100% - 32px);
  height: 510px;
  max-height: calc(100svh - 60px);
  background: #fff;
  border-radius: 20px;
  overflow: clip;
  opacity: 0;
  visibility: hidden;
  transform-origin: top center;
  scale: 0.985;
  transition: opacity 0.24s var(--ease), scale 0.24s var(--ease),
              visibility 0s linear 0.24s;
}
.menu[data-open="true"] {
  opacity: 1;
  visibility: visible;
  scale: 1;
  transition: opacity 0.24s var(--ease), scale 0.24s var(--ease);
}

.menu__head {
  position: relative;
  height: 77px;            /* the cards start at 104, the mark sits at 26 */
  display: flex;
  align-items: center;
  padding: 0 22px;
}
.menu__mark { display: block; width: 42px; height: 20.09px; margin-top: 6px; }
.menu__name {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  top: 25px;
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 24px;
  line-height: 0.9;
  letter-spacing: -1.2px;
  white-space: nowrap;
}
.menu__close {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  top: 16px;
  right: 13px;
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--chip);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.18s var(--ease);
}
.menu__close:hover { background: rgba(0, 0, 0, 0.06); }
.menu__close:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* A plus turned 45 degrees, which is how the board draws it. */
.menu__close svg { display: block; width: 22px; height: 22px; rotate: -45deg; }

.menu__cards {
  display: flex;
  gap: 16px;
  padding: 0 22px;
}

.menu__card {
  height: 350px;
  border-radius: 6px;
  background: #fff;
  overflow: clip;
  position: relative;
}
/* 451 and 444 in the board — not equal, and not rounded to equal here. */
.menu__card--access { flex: 0 1 451px; border: 1px solid var(--card-rule); }
.menu__card--image  { flex: 0 1 444px; border: 0; }

/* A link, because it is the only way through to the gated deck. The board gives
   it no hover state; this is the lightest one that still says it is clickable. */
a.menu__card--access {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s var(--ease);
}
a.menu__card--access:hover { border-color: rgba(0, 0, 0, 0.18); }
a.menu__card--access:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.menu__card--access span {
  position: absolute;
  top: 157px;
  left: 50%;
  translate: -50% 0;
  font-weight: 600;
  font-size: 20px;
  line-height: 0.9;
  letter-spacing: -0.6px;
  white-space: nowrap;
}

/* The line drawing is larger than its frame and offset inside it: 905x505 placed
   at -223,-73 on a 444x350 card. */
.menu__card--image img {
  position: absolute;
  left: -223px;
  top: -73px;
  width: 905px;
  height: 505px;
  max-width: none;
  object-fit: cover;
  pointer-events: none;
}

.menu__foot {
  position: absolute;
  left: 22px;
  right: 25px;
  top: 486px;
  translate: 0 -50%;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  letter-spacing: 0.24px;
}
.menu__foot p { margin: 0; }

/* ------------------------------------------------------------ small screens */

/* There is no board for a phone, so everything in here is a judgement rather than a
   measurement. The type comes down, the gaps close up, and the window is re-pinned:
   the stack now ends at about 252px instead of 388, and 532.7px of offset would
   leave a third of the screen empty above it. */
@media (max-width: 760px) {
  .bar { padding: 16px; }
  .bar__name { font-size: 17.6px; letter-spacing: -0.88px; }
  .hero__tagline { margin-top: 48px; }
  .hero__title { white-space: normal; margin-top: 28px; }
  /* The box moves, not the mask inside it: the mask is now `center` of the video's own
     box, so the offset lives on `top`. */
  .hero { --win: min(92vw, (100svh - 445px) * 1.8776); }
  /* 445, not 380: the stack ends at about 252 and the window is 173 tall at 92vw, so
     this centres it in what is left rather than leaving 260px of dead grey underneath. */
  .hero__video { top: 445px; }

  .menu { height: auto; padding-bottom: 72px; }
  .menu__cards { flex-direction: column; }
  .menu__card { height: 220px; flex: none; }
  .menu__card--access span { top: 50%; translate: -50% -50%; }
  .menu__card--image img { left: -50%; top: 0; width: 200%; height: 100%; }
  .menu__foot { position: static; translate: none; padding: 20px 22px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bar, .scrim, .menu, .menu__close, a.menu__card--access { transition: none; }
}
