/* whomadethis.uk holding page.
   Night theme only: the site is the app's world. Tokens are copied from the whomadethis design system
   (tokens.json, v2.1); nothing below sets a colour that isn't one of them.
   Composition from the brand book's Layout section: eyebrow, headline, one object, facts on a hairline, signature. */

@font-face { font-family: "Archivo W62"; src: url("/assets/fonts/ArchivoW62.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }
@font-face { font-family: "Archivo W72"; src: url("/assets/fonts/ArchivoW72.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/assets/fonts/InstrumentSans.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/JetBrainsMono.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  color-scheme: dark;

  /* interface, Night theme */
  --bg: #0e0e11;
  --bg-raised: #17171b;
  --line: #2a2a31;
  --text: #f1f0ec;
  --text-muted: #8d8c95;
  --text-dim: #807f88;
  --answer: #f5d53f;
  --focus: #f1f0ec;

  /* identity */
  --night: #1d0f38;
  --paper: #f3f1ec;
  --yuzu: #f5d53f;

  /* type */
  --font-display: "Archivo W62", "Archivo", "Arial Narrow", sans-serif;
  --font-title: "Archivo W72", "Archivo", "Arial Narrow", sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  /* space, radius, motion */
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --radius-xs: 6px;
  --radius-lg: 22px;
  --focus-ring: 0 0 0 2px #0e0e11, 0 0 0 4px #f1f0ec;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-small: 220ms;
  --t-screen: 450ms;
  --margin: clamp(16px, 5.6vw, 80px);
  --header: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/22px var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
p, h1, h2, h3, ol, figure { margin: 0; }
a { color: inherit; }
a:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-xs); }
svg { display: block; }

.wrap {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: max(var(--margin), env(safe-area-inset-left)) max(var(--margin), env(safe-area-inset-right));
}

/* Logos and can labels are outlines and text from WMT. Their fills and faces are classes here rather than
   inline styles, so the Content-Security-Policy can refuse inline styles altogether. */
.wmt-ink { fill: var(--paper); }
.wmt-dot { fill: var(--yuzu); }
.wmt-jp { fill: var(--text-muted); }
.wmt-t-display { font-family: var(--font-display); font-weight: 900; }
.wmt-t-mono { font-family: var(--font-mono); font-weight: 500; }

/* type styles from the system */
.label {
  font: 500 11px/14px var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.smallprint {
  font: 500 10px/14px var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.lead {
  font: 400 20px/28px var(--font-body);
  color: var(--text-muted);
  max-width: 30ch;
  text-wrap: balance;
}
.stop { color: var(--answer); }

/* header: the horizontal lockup, small drawing (under 48 px) */
.top { display: flex; align-items: center; min-height: var(--header); padding-top: env(safe-area-inset-top); }
.brand { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.brand svg { height: 26px; width: auto; }

/* ------------------------------------------------------------------ */
/* the hero: fills the first screen, with the next section's edge showing */
.hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto 1fr;
  column-gap: 24px;
  min-height: calc(100vh - var(--header) - 24px);
  min-height: calc(100svh - var(--header) - 24px);
  padding-block: clamp(24px, 5vh, 64px) clamp(32px, 6vh, 72px);
}
.copy {
  grid-column: 1 / 8;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding-right: var(--space-8);
}
.display {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(44px, min(8.4vw, 12.6vh), 120px);
  font-size: clamp(44px, min(8.4vw, 12.6svh), 120px);
  line-height: .87;
  letter-spacing: -.02em;
  text-wrap: balance;
}

/* the one object: the sealed can in a night window. The 3D can (can3d.js) mounts in .stage;
   the flat can drawn by WMT is its stand-in until then, and stays if 3D can't run. */
.window {
  grid-column: 8 / 13;
  grid-row: 1 / 3;
  align-self: end;
  position: relative;
  height: 100%;
  min-height: 360px;
  max-height: 760px;
  border-radius: var(--radius-lg);
  background: var(--night);
  overflow: hidden;
  container-type: size;
}
.flat {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 2.5cqh;
  transition: opacity 500ms var(--ease);
}
.flat::before {                     /* a contact shadow, as under the 3D can */
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3.3cqh;
  width: min(50cqh, 94cqw);
  height: 6.5cqh;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(6, 3, 16, .72), rgba(6, 3, 16, 0));
}
.can {
  position: relative;
  height: 76%;
  height: min(85.7cqh, 163.5cqw);
  width: auto;
  aspect-ratio: 44 / 91;
  -webkit-tap-highlight-color: transparent;
}
.stage { position: absolute; inset: 0; pointer-events: none; }
.window.is-3d .stage { pointer-events: auto; }
.window.is-3d .flat { opacity: 0; pointer-events: none; }

/* facts on a hairline: the city's row, as on the site's list board */
.status {
  grid-column: 1 / 7;
  grid-row: 2;
  align-self: end;
  padding-top: var(--space-8);
}
.board { list-style: none; padding: 0; border-top: 1px solid var(--text); }
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--space-4);
  align-items: baseline;
  padding-block: var(--space-4) 14px;
  border-bottom: 1px solid var(--line);
}
.city {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1;
  letter-spacing: -.01em;
}
.city svg { flex: none; }
.stat { font: 400 13px/18px var(--font-mono); color: var(--text-muted); text-align: right; }

/* ------------------------------------------------------------------ */
/* what it is: the brand idea (? becomes .) told with the can's own states */
.about {
  border-top: 1px solid var(--line);
  padding-block: clamp(56px, 7vw, 104px);
}
.about-head {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: var(--space-4) var(--space-8);
  align-items: end;
  margin-bottom: var(--space-12);
}
.about-head .label { grid-column: 1 / -1; }
.display-3 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(40px, 4.6vw, 56px);
  line-height: .9;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.about-head p:not(.label) { color: var(--text-muted); max-width: 52ch; font-size: 17px; line-height: 25px; }

.steps {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-6);
  counter-reset: s;
}
.step { counter-increment: s; display: flex; flex-direction: column; gap: var(--space-3); }
.shelf {
  height: 220px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
  margin-bottom: var(--space-2);
}
.shelf svg { height: 190px; width: auto; margin-bottom: -10px; }
.step-title {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 28px;
  line-height: 30px;
  letter-spacing: -.005em;
}
.step-title::before {
  content: counter(s, decimal-leading-zero);
  display: inline-block;
  margin-right: var(--space-3);
  font: 500 11px/14px var(--font-mono);
  letter-spacing: .08em;
  color: var(--text-dim);
  vertical-align: baseline;
}
.step-text { color: var(--text-muted); font-size: 14px; line-height: 20px; max-width: 34ch; }

/* ------------------------------------------------------------------ */
/* footer: the signature */
.foot { border-top: 1px solid var(--line); }
.foot-in {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6) var(--space-8);
  padding-block: var(--space-8) max(var(--space-8), env(safe-area-inset-bottom));
}
.sig { display: flex; align-items: flex-end; flex-wrap: wrap; gap: var(--space-3) var(--space-6); }
.sig .wm svg { height: 32px; width: auto; }
.sig .q svg { height: 18px; width: auto; margin-bottom: 3px; }
.co { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); text-align: right; }
.co a {
  font: 400 13px/20px var(--font-mono);
  color: var(--text-muted);
  text-decoration: none;
  padding-block: 4px;
}
.co a:hover { color: var(--text); }

/* ------------------------------------------------------------------ */
@media (max-width: 1080px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--space-8); }
}
/* phones and narrow windows: headline, object, facts, then what it is, then the signature */
@media (max-width: 720px) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; row-gap: var(--space-8); min-height: 0; }
  .copy, .window, .status { grid-column: 1; grid-row: auto; }
  .copy { padding-right: 0; }
  .display { font-size: clamp(44px, 12.4vw, 72px); max-width: 12ch; }
  .lead { font-size: 18px; line-height: 26px; }
  .window { height: clamp(320px, 46vh, 440px); height: clamp(320px, 46svh, 440px); min-height: 0; }
  .status { padding-top: 0; }
  .about-head { grid-template-columns: minmax(0, 1fr); margin-bottom: var(--space-8); }
  .co { align-items: flex-start; text-align: left; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-6); }
  .step { display: grid; grid-template-columns: 112px minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: var(--space-4); row-gap: var(--space-2); align-items: start; }
  .shelf { grid-row: 1 / 3; height: 136px; margin-bottom: 0; }
  .shelf svg { height: 118px; margin-bottom: -6px; }
  .step-title { font-size: 24px; line-height: 26px; padding-top: var(--space-2); }
}
@media (max-width: 420px) {
  .brand svg { height: 22px; }
}

/* ------------------------------------------------------------------ */
/* Motion: one moment, once. Without the 3D can (no JavaScript, no WebGL), the flat can seals itself as the
   page arrives (the brand's Post moment: the cap drops on, screws down, frost blooms), then a glint crosses
   the shoulder. Nothing loops. A tap on either can gives it the short Need shake. */
.can { transform-origin: 50% 100%; }
.can .cap { transform-box: fill-box; transform-origin: 50% 100%; }
.can .glint { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  html:not(.js) .can .cap, .window.seal .can .cap { animation: cap-on var(--t-screen) var(--ease) 160ms both; }
  html:not(.js) .can .frost, .window.seal .can .frost { animation: frost 520ms var(--ease) 420ms both; }
  html:not(.js) .can .glint, .window.seal .can .glint { animation: glint 900ms var(--ease) 820ms both; }
  .can.shake { animation: need var(--t-small) var(--ease); }
}
@media (prefers-reduced-motion: reduce) {
  html:not(.js) .can, .window.seal .can { animation: fade var(--t-small) linear both; }
  .flat { transition-duration: var(--t-small); }
}

@keyframes cap-on {
  0%   { transform: translateY(-8px) rotate(-6deg); opacity: 0; }
  55%  { transform: translateY(.5px) rotate(2deg); opacity: 1; }
  75%  { transform: translateY(0) scaleY(.94) rotate(-1deg); }
  100% { transform: none; opacity: 1; }
}
@keyframes frost { from { opacity: 0; } to { opacity: 1; } }
@keyframes glint {
  0%   { transform: translateX(-34px); opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateX(46px); opacity: 0; }
}
@keyframes need {
  0%, 100% { transform: none; }
  25% { transform: rotate(-3deg); }
  50% { transform: rotate(2.5deg); }
  75% { transform: rotate(-1.5deg); }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* the 404 page */
.lost .hero { min-height: calc(100vh - var(--header) - 140px); min-height: calc(100svh - var(--header) - 140px); }
.lost .display { max-width: 12ch; line-height: .95; }
.back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 9999px;
  background: var(--text);
  color: var(--bg);
  font: 600 15px/22px var(--font-body);
  text-decoration: none;
}
.back:focus-visible { border-radius: 9999px; }
