/* ============================================================
   Studio Null — Site 22 Sep
   Design and engineering for standout brands
   ============================================================ */

@font-face {
  font-family: "ABC Areal";
  src: url("assets/fonts/ABCAreal-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-bg: #ffffff;
  --color-fg: #000000;
  --color-blue: #0000ff;
  --color-pill-secondary: rgba(0, 0, 0, 0.06);
  --color-pill-secondary-hover: rgba(0, 0, 0, 0.1);
  --color-muted: rgba(0, 0, 0, 0.5); /* section labels */
  --color-line: rgba(0, 0, 0, 0.1); /* dividers */

  --inset: 24px;
  --nav-height: 50px; /* top offset + control row; reserved by .page */
  --font-size-ui: 14px;
  --tracking-ui: -0.07px;

  /* ABC Areal (the design's typeface) is bundled via @font-face above;
     the grotesque fallbacks keep the layout intact before it loads. */
  --font-sans: "ABC Areal", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

html,
body {
  height: 100%;
}

/* Always reserve the scrollbar gutter so opening the overlay (which sets
   overflow:hidden) never shifts the page — and the clock — sideways. */
html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-sans);
  font-size: var(--font-size-ui);
  line-height: 1.3;
  letter-spacing: var(--tracking-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Page shell ---------- */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh; /* account for mobile browser chrome */
  /* top reserves the fixed nav so the hero centres below it */
  padding: var(--nav-height) var(--inset) 22px;
}

/* ---------- Header (fixed; stays put while the overlay scrolls) ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px var(--inset) 0; /* 20 top, 24 sides */
}

.logo img {
  width: 156px;
  height: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 0;
  border-radius: 32px;
  font-family: inherit;
  font-size: var(--font-size-ui);
  letter-spacing: var(--tracking-ui);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.pill--secondary {
  background: var(--color-pill-secondary);
  color: var(--color-fg);
}

.pill--secondary:hover {
  background: var(--color-pill-secondary-hover);
}

/* While the Info overlay is open, the Close pill sits over scrolling text,
   so give it a solid white base (with the same subtle tint on top) instead
   of a see-through fill. */
body.modal-open .pill--secondary {
  background:
    linear-gradient(0deg, var(--color-pill-secondary), var(--color-pill-secondary)),
    #ffffff;
}

body.modal-open .pill--secondary:hover {
  background:
    linear-gradient(0deg, var(--color-pill-secondary-hover), var(--color-pill-secondary-hover)),
    #ffffff;
}

.pill--primary {
  background: var(--color-blue);
  color: #ffffff;
}

/* Invert on hover: white fill, blue text */
.pill--primary:hover {
  background: #ffffff;
  color: var(--color-blue);
}

.pill:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
}

/* ---------- Hero ---------- */
.hero {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  /* nudge slightly above optical centre, matching the design */
  padding-bottom: 31px;
}

.pyramid {
  display: block;
  position: relative;
  /* Source video is a 720×720 square with the pyramid ~91% of its width
     and a white (invisible-on-white) margin; 335px renders the pyramid at
     the design's ~305px. */
  width: 335px;
  aspect-ratio: 1 / 1;
  user-select: none;
}

/* Both clips are stacked; we cross the seam with opacity (no reflow) so the
   direction swap has no flash. The incoming clip is only revealed once it
   has painted the synced frame (see script.js). */
.pyramid__video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  -webkit-user-drag: none;
  opacity: 0;
}

.pyramid__video--active {
  opacity: 1;
}

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.tagline,
.clock {
  margin: 0;
}

.clock {
  white-space: nowrap;
}

/* Reserve the width of "00:00:00" (the widest time — 0 is the fattest digit)
   so the clock's total width is constant and "London," never moves. The time
   is left-aligned inside the slot so it stays snug to "London," (no gap). */
.clock time {
  display: inline-block;
  min-width: 6.8ch;
  text-align: left;
}

/* ---------- Info overlay ---------- */
.info-overlay {
  position: fixed;
  inset: 0;
  z-index: 90; /* below the fixed nav (100) */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(50px);
  backdrop-filter: blur(50px);
}

.info-overlay[hidden] {
  display: none;
}

body.modal-open {
  overflow: hidden;
}

/* Content sheet — pinned to the right half on desktop, matching the design */
.info-sheet {
  width: min(692px, calc(100% - 48px));
  margin-left: auto;
  margin-right: var(--inset);
  padding-top: 210px;
  padding-bottom: 22px; /* usual page bottom margin */
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* label column + body */
.info-block {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: start;
  row-gap: 8px;
}

.info-label {
  margin: 0;
  color: var(--color-muted);
}

.info-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 482px;
}

.info-body p {
  margin: 0;
}

.info-body a,
.stack a {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: from-font;
  transition: color 0.15s ease;
}

.info-body a:hover,
.stack a:hover {
  color: var(--color-blue);
}

/* one-item-per-line lists */
.stack {
  display: flex;
  flex-direction: column;
}

.stack span,
.stack a {
  display: block;
  width: fit-content;
}

/* pricing tiers */
.pricing {
  display: flex;
  flex-direction: column;
}

.pricing-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 272px));
  justify-content: start;
  column-gap: 78px;
  border-top: 1px solid var(--color-line);
  padding: 26px 0;
}

.pricing-row:last-child {
  border-bottom: 1px solid var(--color-line);
}

.tier {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tier p {
  margin: 0;
}

.tier-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-footnote {
  margin: 64px 0 0;
  color: var(--color-muted);
}

/* ---------- Responsive ---------- */

/* Info overlay collapses to a single, full-width column on tablet/phone */
@media (max-width: 760px) {
  .info-sheet {
    width: auto;
    margin: 0 16px;
    padding-top: 166px;
    padding-bottom: 16px; /* usual mobile page bottom margin */
    gap: 40px;
  }

  .info-block {
    grid-template-columns: 1fr; /* label stacks above body */
  }

  .info-body {
    max-width: none;
  }

  /* every tier becomes its own divider-separated block */
  .pricing-row {
    display: contents;
  }

  .tier {
    border-top: 1px solid var(--color-line);
    padding: 26px 0;
  }

  .pricing {
    border-bottom: 1px solid var(--color-line);
  }
}

/* Base page mobile (phones) */
@media (max-width: 640px) {
  .page {
    padding: 42px 16px 16px; /* top reserves the fixed nav; 16 bottom/sides */
  }

  .site-header {
    padding: 12px 16px 0; /* 12 top, 16 sides — mobile design */
  }

  .logo img {
    width: calc(156px * 0.8); /* 0.8× on mobile */
  }

  .hero {
    /* mobile design centres the pyramid in the available space */
    padding-bottom: 0;
  }

  .pyramid {
    /* mobile design pyramid is ~201px wide; the video is 90.8% pyramid,
       so 201 / 0.908 ≈ 221px of video width. */
    width: min(221px, 57vw);
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  .pill {
    transition: none;
  }
}
