/* =========================================================
   PROBABLY HUMAN — everything is a square
   ========================================================= */

@font-face {
  font-family: "Bebas Neue";
  src: url("fonts/bebas-neue.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Silkscreen";
  src: url("fonts/silkscreen.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --charcoal: #252525;
  --charcoal-2: #2e2d2b;
  --charcoal-3: #3a3833;
  --cream: #f2e7d1;
  --cream-2: #e6d9bf;
  --stone: #a8a08c;
  --stone-dark: #676359;
  --gold: #c8962f;
  --gold-dark: #a1792f;

  --font-display: "Bebas Neue", "Impact", "Arial Narrow", sans-serif;
  --font-body: "Newsreader", "Times New Roman", Georgia, serif;
  --font-pixel: "Silkscreen", ui-monospace, monospace;

  --gap: 10px;
  --pad: clamp(12px, 3vw, 32px);
  --max: 1320px;
  --header-h: 68px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--charcoal);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.01em;
  margin: 0;
  text-transform: uppercase;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--font-pixel);
  font-size: 13px;
  text-decoration: none;
}

.skip-link:focus {
  top: 8px;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(37, 37, 37, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--charcoal-3);
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.site-header .brand img {
  height: 44px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: block;
  padding: 10px 12px;
  font-family: var(--font-pixel);
  font-size: 13px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cream);
  border: 1px solid transparent;
}

.nav-links a:hover {
  border-color: var(--cream);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 11px 10px;
  border: 1px solid var(--charcoal-3);
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
}

.nav-toggle span {
  display: block;
  height: 3px;
  background: var(--cream);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-header[data-open="true"] .nav-toggle span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.site-header[data-open="true"] .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.site-header[data-open="true"] .nav-toggle span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ---------- Mosaic ---------- */

.section {
  padding: var(--gap) 0;
}

/*
  The mosaic is a grid of equal squares. Each tile is its own size container so
  type is set in cqi and scales with the square it lives in.

  Layout rules (keep rows full):
  - .tile-img / .tile-note: always 1x1
  - .tile-big: always 2x2
  - .tile-text: 1x1 on wide screens, 2x2 below
  - .only-wide: filler image only shown on wide screens
  - .project-img: sized like .tile-text so each project image pairs with its text
  - .only-mid: filler image only shown at 4 columns below wide (720-1179px)
*/
.mosaic {
  --cols: 2;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: var(--gap);
}

.tile {
  position: relative;
  margin: 0;
  aspect-ratio: 1 / 1;
  min-width: 0;
  overflow: hidden;
  container-type: inline-size;
}

.tile-big,
.tile-text,
.project-img {
  grid-column: span 2;
  grid-row: span 2;
}

.only-wide,
.only-mid {
  display: none;
}

@media (min-width: 720px) {
  .mosaic {
    --cols: 4;
  }

  .tile-end {
    grid-column: 3 / span 2;
  }

  .only-mid {
    display: block;
  }
}

@media (min-width: 1180px) {
  :root {
    --gap: 12px;
  }

  .tile-text,
  .project-img {
    grid-column: span 1;
    grid-row: span 1;
  }

  .only-wide {
    display: block;
  }

  .only-mid {
    display: none;
  }

  /* Wide only: put this pair's image on the right */
  .swap-img {
    grid-column: 4;
  }

  .swap-text {
    grid-column: 3;
  }
}

.tile-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 3.2cqi;
  padding: 7cqi;
}

.tile-cream {
  background: var(--cream);
  color: var(--charcoal);
}

.tile-dark {
  background: var(--charcoal-2);
  color: var(--cream);
}

.tile-gold {
  background: var(--gold);
  color: var(--charcoal);
}

.tile-outline {
  background: transparent;
  color: var(--cream);
  box-shadow: inset 0 0 0 2px var(--charcoal-3);
}

/* image tiles */
.tile-img {
  background: var(--charcoal-2);
}

.tile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.3s ease;
}

.tile-img:hover img {
  transform: scale(1.06);
}

/* text in squares */
.tile h2 {
  font-size: 10.5cqi;
}

.tile h3 {
  font-size: 9.5cqi;
}

.tile p {
  font-size: clamp(14px, 4.6cqi, 22px);
  line-height: 1.4;
}

.tile-big p {
  font-size: clamp(15px, 3.6cqi, 22px);
}

.kicker,
.step,
.tile .project-meta {
  font-family: var(--font-pixel);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.tile .kicker {
  font-size: clamp(11px, 2.4cqi, 15px);
  color: var(--gold-dark);
}

.tile-dark .kicker {
  color: var(--gold);
}

.tile-gold .kicker {
  color: var(--charcoal);
  opacity: 0.75;
}

.tile .step {
  font-size: clamp(12px, 5cqi, 18px);
  color: var(--gold);
  margin-bottom: auto;
}

.tile-cream .step {
  color: var(--gold-dark);
}

/* hero */
.tile-hero .tile-inner {
  justify-content: space-between;
}

.hero-logo {
  width: 72%;
  height: auto;
  image-rendering: auto;
}

.tile-hero h1 {
  font-size: 11.5cqi;
  color: var(--cream);
}

.tile-hero h1 span {
  display: block;
  color: var(--gold);
}

.tile-hero .lead {
  max-width: 34em;
  color: var(--cream-2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 2.4cqi;
}

/* notes and stats */
.tile-note {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 9%;
}

.tile .note {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 13cqi;
  line-height: 0.98;
}

.tile .note strong {
  font-weight: 400;
  color: var(--gold);
}

.tile-gold .note strong {
  color: var(--cream);
}

.tile-stat {
  justify-content: space-between;
}

.tile .stat-value {
  font-family: var(--font-display);
  font-size: 34cqi;
  line-height: 0.85;
}

.tile .stat-label {
  font-family: var(--font-pixel);
  font-size: clamp(10px, 6cqi, 15px);
  text-transform: uppercase;
  line-height: 1.3;
}

/* projects */
.project .tile-inner {
  gap: 2.4cqi;
  padding: 6.5cqi;
}

.tile .project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: auto;
  font-size: clamp(10px, 3.6cqi, 13px);
}

.pill {
  padding: 3px 7px;
  background: var(--charcoal);
  color: var(--cream);
}

.pill-gold {
  background: var(--gold);
  color: var(--charcoal);
}

.tags {
  color: var(--stone-dark);
}

.project h3 {
  font-size: 12cqi;
}

.tile .tagline {
  font-style: italic;
  font-weight: 600;
  font-size: clamp(14px, 4.6cqi, 19px);
  line-height: 1.25;
}

.tile .desc {
  font-size: clamp(13px, 3.9cqi, 17px);
  line-height: 1.35;
  color: #4a463f;
}

.tile .links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-family: var(--font-pixel);
  font-size: clamp(11px, 3.7cqi, 14px);
  text-transform: uppercase;
}

.links a {
  text-decoration: none;
  border-bottom: 2px solid var(--gold);
}

.links a:hover {
  color: var(--gold-dark);
}

/* contact */
.tile .email {
  font-family: var(--font-display);
  font-size: 7.4cqi;
  line-height: 1;
  overflow-wrap: anywhere;
}

.email a {
  text-decoration: none;
  border-bottom: 3px solid var(--charcoal);
}

.email a:hover {
  color: var(--cream);
  border-color: var(--cream);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.social-links a {
  display: inline-block;
  padding: 6px 9px;
  font-family: var(--font-pixel);
  font-size: clamp(10px, 2.4cqi, 13px);
  text-transform: uppercase;
  text-decoration: none;
  background: var(--charcoal);
  color: var(--cream);
}

.social-links a:hover {
  background: var(--cream);
  color: var(--charcoal);
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  font-family: var(--font-pixel);
  font-size: 13px;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid var(--cream);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--gold);
}

.button-primary {
  background: var(--cream);
  color: var(--charcoal);
}

.button-ghost {
  background: transparent;
  color: var(--cream);
}

@media (max-width: 1023px) {
  .tile-hero .tile-inner {
    gap: 2.4cqi;
    padding: 6cqi;
  }

  .hero-logo {
    width: 46%;
  }

  .tile-hero h1 {
    font-size: 12.5cqi;
  }

  .tile-hero .lead {
    font-size: clamp(14px, 4.2cqi, 17px);
  }

  .tile-hero .button {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 40px 0 56px;
  border-top: 1px solid var(--charcoal-3);
  margin-top: 30px;
  font-size: 16px;
}

.footer-shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.site-footer .brand span {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.02em;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a,
.footer-link-button {
  font-family: var(--font-pixel);
  font-size: 12px;
  text-transform: uppercase;
  color: var(--stone);
  text-decoration: none;
}

.footer-links a:hover,
.footer-link-button:hover {
  color: var(--cream);
}

.footer-link-button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* ---------- Consent banner ---------- */

.consent-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 60;
  width: min(680px, calc(100% - 24px));
  transform: translateX(-50%);
  background: var(--charcoal-2);
  border: 2px solid var(--cream);
  box-shadow: 6px 6px 0 var(--gold);
}

.consent-banner[hidden] {
  display: none;
}

.consent-banner-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
}

.consent-banner p {
  font-size: 16px;
  line-height: 1.4;
}

.consent-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ---------- Legal pages ---------- */

.legal-main {
  padding: 40px 0 20px;
}

.legal-card {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px);
  background: var(--cream);
  color: var(--charcoal);
}

.legal-card h1 {
  font-size: clamp(44px, 8vw, 72px);
}

.legal-updated {
  margin-top: 8px;
  font-family: var(--font-pixel);
  font-size: 12px;
  text-transform: uppercase;
  color: var(--stone-dark);
}

.legal-card section {
  margin-top: 28px;
}

.legal-card h2 {
  font-size: 32px;
  margin-bottom: 8px;
}

.legal-card ul {
  margin: 8px 0 0;
  padding-left: 1.2em;
}

.legal-card p + p {
  margin-top: 8px;
}

/* ---------- Motion ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.js .reveal.show {
  opacity: 1;
  transform: none;
}

.click-sparkle {
  position: fixed;
  z-index: 70;
  pointer-events: none;
  font-family: var(--font-pixel);
  font-size: 20px;
  color: var(--gold);
  transform: translate(-50%, -50%);
  animation: sparkle 0.7s steps(6) forwards;
}

@keyframes sparkle {
  to {
    opacity: 0;
    transform: translate(-50%, -160%) scale(1.4);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .tile-img img,
  .button {
    transition: none;
  }

  .tile-img:hover img,
  .button:hover {
    transform: none;
  }

  .click-sparkle {
    display: none;
  }
}

/* ---------- Small screens ---------- */

@media (max-width: 819px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    padding: 8px var(--pad) 16px;
    background: var(--charcoal);
    border-bottom: 1px solid var(--charcoal-3);
  }

  .site-header[data-open="true"] .nav-links {
    display: flex;
  }

  .nav-links a {
    padding: 14px 4px;
    font-size: 14px;
  }
}

@media (max-width: 719px) {
  :root {
    --gap: 8px;
  }

  body {
    font-size: 17px;
  }

  .tile-note {
    padding: 8%;
  }

  .tile .note {
    font-size: 14cqi;
  }

  .tile .stat-label {
    font-size: clamp(10px, 7cqi, 13px);
  }

  .consent-banner-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .consent-actions .button {
    flex: 1;
  }
}

@media (max-width: 359px) {
  .tile-hero .lead {
    display: none;
  }
}

/* Bebas Neue maps U+221E to the foundry logo; use a system font for ∞ */
.glyph-inf {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
}
