/*
  Two typefaces, three roles, nothing else:
    display - League Gothic (the closest free match to Tungsten): wordmark,
              headings, big numbers, names
    text    - Archivo: paragraphs, notes, addresses
    label   - League Gothic in spaced capitals: navigation, buttons, numbers
*/
:root {
  --black: #000;
  --paper: #f3eee4;

  /* Colours a section paints with. The light theme below swaps these. */
  --bg: var(--black);
  --text: var(--paper);
  --muted: #8f8a82;
  --rule: rgba(243, 238, 228, 0.18);

  /* Content never grows wider than --max; on bigger screens the extra space
     is split evenly left and right, so the page stays centred. Backgrounds
     still run edge to edge. */
  --max: 1440px;
  --side: max(0px, calc((100vw - var(--max)) / 2));
  --edge: calc(clamp(20px, 5vw, 80px) + var(--side));
  --display: 'League Gothic', 'Arial Narrow', Impact, sans-serif;
  --font: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;

  --d-xl: clamp(6rem, min(21vw, 34vh), 21rem); /* also shrinks in short windows */
  --d-l: clamp(3.2rem, 7.4vw, 7rem);
  --d-m: clamp(1.8rem, 3vw, 2.8rem);
  --t-l: clamp(1.25rem, 1.9vw, 1.65rem);
  --t: 17px;
  --t-s: 15px;
}

.theme-light {
  --bg: var(--paper);
  --text: #0a0a0a;
  --muted: #6a645b;
  --rule: rgba(0, 0, 0, 0.16);
}

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

html {
  background: var(--black);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--t);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
em { font-style: normal; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Type roles ---------- */
h1, h2, .hero-name, .hero-tagline, .total strong, .row-name, .row-value, .wall-cta a {
  font-family: var(--display);
  font-weight: 400; /* League Gothic has a single weight */
  letter-spacing: 0;
  line-height: 0.92;
}
h2, .hero-tagline, .row-name, .wall-cta a { text-transform: uppercase; }
.nav a, .lang, .btn, .num, .tree-label, .tree-end a {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.07em;
  line-height: 1;
  text-transform: uppercase;
}

.arr { flex: none; transition: transform .25s cubic-bezier(.2, .7, .2, 1); }

/* ---------- Top bar (sits over the hero) ---------- */
.top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 28px var(--edge);
}
.brand img { border-radius: 50%; }
.nav { display: flex; gap: 32px; margin-left: auto; }
.nav a, .lang button { color: var(--muted); padding: 13px 6px; margin: -13px -6px; transition: color .15s; }
.nav a:hover, .lang button:hover { color: var(--text); }
.lang { display: flex; gap: 8px; }
.lang span { color: var(--muted); }
.lang button[aria-pressed="true"] { color: var(--text); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(100vh, 1200px);
  min-height: min(100svh, 1200px); /* a full screen, but not a giant one on 4K */
  display: flex;
  align-items: center;
  padding: 104px var(--edge) clamp(40px, 9vh, 110px);
  overflow: hidden;
}

/* The portrait is shot on black, so it sits straight on the page with no frame. */
.hero-photo {
  position: absolute;
  top: 0;
  right: var(--side);
  height: 100%;
  width: auto;
  max-width: min(62%, 720px); /* on tall, wide screens the portrait must not grow into the wordmark */
  object-fit: cover;
  object-position: 50% 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22%), linear-gradient(0deg, transparent 0, #000 26%);
  mask-image: linear-gradient(90deg, transparent 0, #000 22%), linear-gradient(0deg, transparent 0, #000 26%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

.hero-text { position: relative; width: 100%; }

.hero-name { font-size: var(--d-m); margin-bottom: 0.1em; }
.hero-name span { color: var(--muted); }

h1 {
  font-size: var(--d-xl);
  line-height: 0.82;
  margin-left: -0.02em;
}
/* The only contrast in the wordmark: "pedia" steps back to grey. */
h1 .hot { color: var(--muted); }

.hero-intro { max-width: 48rem; margin-top: clamp(24px, 4vh, 44px); }
.hero-tagline { font-size: var(--d-m); }
.hero-tagline em { color: var(--muted); }
.hero-desc { margin-top: 16px; color: var(--muted); font-size: clamp(17px, 1.35vw, 20px); max-width: min(38rem, 54vw); }
.hero-desc strong { color: var(--text); font-weight: 700; }

.hero-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 36px; }

/* Split button: label on the left, arrow in its own compartment. On hover a
   second colour wipes across from the left. */
.btn {
  --fill: var(--text);
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--text);
  background: linear-gradient(var(--fill), var(--fill)) no-repeat 0 0 / 0% 100%;
  transition: background-size .35s cubic-bezier(.2, .7, .2, 1), color .2s, border-color .2s;
}
.btn { font-size: 25px; }
.btn-label { display: flex; align-items: center; padding: 21px 34px 20px; }
.btn-arrow { display: grid; place-items: center; width: 72px; border-left: 1px solid currentColor; }
.btn .arr { width: 22px; height: 22px; }
.btn-arrow.down .arr { transform: rotate(90deg); }
.btn:hover { background-size: 100% 100%; }
.btn:hover .arr { transform: translateX(4px); }
.btn:hover .btn-arrow.down .arr { transform: rotate(90deg) translateX(4px); }
.btn-fill { --fill: var(--bg); background-color: var(--text); color: var(--bg); }
.btn-fill:hover { color: var(--text); }
.btn-line:hover { color: var(--bg); }

/* ---------- Sections ---------- */
.section {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  padding: clamp(72px, 10vw, 152px) var(--edge);
  background: var(--bg);
  color: var(--text);
}
.section-head { grid-column: 1 / span 4; }
.section-body { grid-column: 6 / -1; }

.num { display: block; margin-bottom: 22px; color: var(--muted); }
h2 { font-size: var(--d-l); }
.section-head > p { margin-top: 20px; color: var(--muted); max-width: 26rem; }

.section-head > .total { display: flex; flex-direction: column; margin-top: clamp(32px, 5vw, 72px); color: var(--text); }
.total strong { font-size: clamp(5rem, 10.5vw, 10rem); white-space: nowrap; line-height: 0.8; }
.total > span { margin-top: 14px; color: var(--muted); }

/* ---------- Rows (platforms, contact) ---------- */
.rows { align-self: start; border-bottom: 1px solid var(--text); }
.row {
  display: grid;
  grid-template-columns: 42% minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 24px;
  padding: clamp(20px, 2.6vw, 34px) 0;
  border-top: 1px solid var(--text);
  transition: background-color .2s, color .2s, padding .3s cubic-bezier(.2, .7, .2, 1);
}
.row:hover { background: var(--text); color: var(--bg); padding-inline: 18px; }
.row:hover .row-meta { color: inherit; }
.row-name { font-size: var(--d-m); line-height: 1; }
.row-meta { color: var(--muted); font-size: var(--t-s); transition: color .2s; }
.row-value {
  font-size: clamp(2.4rem, 4.6vw, 4.4rem);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.row-mail {
  font-size: var(--t-l);
  font-weight: 500;
  letter-spacing: -0.01em;
  text-align: right;
  overflow-wrap: anywhere;
}

/* Contact rows: label and note stacked on the left, address on the right. */
.row-contact { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.row-contact .row-meta { grid-column: 1; grid-row: 2; margin-top: 6px; }
.row-contact .row-meta:empty { display: none; }
.row-contact .row-mail { grid-column: 2; grid-row: 1 / span 2; }

/* ---------- About ---------- */
.prose { max-width: 40rem; }
.prose p + p { margin-top: 1.4em; }
.prose p { color: var(--muted); }
.prose p:first-child {
  font-size: var(--t-l);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.012em;
  color: var(--text);
}
.prose em { font-weight: 700; }

/* ---------- Brands ---------- */
/* A full-width ruled wall of logo cells; the last cell is the invitation. */
.section-wide .section-head {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-items: end;
}
.section-wide .num { grid-column: 1 / -1; }
.section-wide h2 { grid-column: 1 / span 5; }
.section-wide .section-head > p { grid-column: 6 / -1; margin: 0; padding-bottom: 0.35em; }

.wall {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: clamp(130px, 13vw, 200px);
  margin-top: clamp(40px, 5vw, 72px);
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.wall li {
  display: grid;
  place-items: center;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  transition: background-color .25s;
}
.wall li:hover { background: rgba(243, 238, 228, 0.07); }
.wall img {
  max-width: 56%;
  max-height: 38%;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0.75;
  transition: opacity .25s, transform .35s cubic-bezier(.2, .7, .2, 1);
}
.wall li:hover img { opacity: 1; transform: scale(1.05); }

.wall .wall-cta { display: block; background: var(--text); color: var(--bg); }
.wall .wall-cta:hover { background: #fff; }
.wall-cta a {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: clamp(14px, 1.8vw, 26px);
  font-size: clamp(1.35rem, 2.2vw, 2.2rem);
  line-height: 1;
}
.wall-cta .arr { width: 22px; height: 22px; align-self: flex-end; }
.wall-cta:hover .arr { transform: translateX(6px); }

/* ---------- Link page (/tree/) ---------- */
/* A plain, narrow column of links. Nothing oversized. */
.tree {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 88px 20px 40px;
}
.tree-col { width: 100%; max-width: 400px; }
.tree-id { text-align: center; margin-bottom: 28px; }
.tree-id img { width: 88px; height: 88px; margin: 0 auto 14px; border-radius: 50%; }
.tree-name { font-family: var(--display); font-size: 30px; line-height: 1; margin: 0; }
.tree-sub { margin-top: 6px; color: var(--muted); font-size: var(--t-s); }
.tree-links { display: grid; gap: 10px; }
.tree-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  transition: background-color .2s, color .2s, border-color .2s;
}
.tree-link:hover { background: var(--text); border-color: var(--text); color: var(--bg); }
.tree-link strong {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}
.tree-link span { margin-left: auto; color: var(--muted); font-size: var(--t-s); transition: color .2s; }
.tree-link:hover span { color: inherit; }
.tree-link .arr { transform: rotate(-45deg); }
.tree-link span + .arr { margin-left: 0; }
.tree-link .arr:nth-child(2) { margin-left: auto; }
.tree-label { margin: 26px 0 10px; color: var(--muted); }
.tree-end { margin-top: 30px; text-align: center; color: var(--muted); font-size: 13px; }
.tree-end a { display: inline-block; margin-top: 2px; padding: 12px 8px; color: var(--muted); transition: color .15s; }
.tree-end a:hover { color: var(--text); }
.tree-lang { margin-left: auto; }

/* ---------- Footer ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 28px var(--edge) 32px;
  border-top: 1px solid var(--rule);
  font-size: var(--t-s);
  color: var(--muted);
}

/* On screens wider than the content, the portrait no longer touches the
   window edge, so its right side fades out as well. */
@media (min-width: 1441px) {
  .hero-photo {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22%, #000 86%, transparent 100%), linear-gradient(0deg, transparent 0, #000 26%);
    mask-image: linear-gradient(90deg, transparent 0, #000 22%, #000 86%, transparent 100%), linear-gradient(0deg, transparent 0, #000 26%);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Tablet and down ---------- */
@media (max-width: 900px) {
  /* Below this width the text would run over the portrait, so the photo
     goes on top and the text follows it. */
  .hero { min-height: 0; display: block; padding: 0 0 56px; }
  .hero-photo {
    position: static;
    width: 100%;
    max-width: none;
    height: min(78vw, 62vh);
    object-position: 50% 10%;
    -webkit-mask-image: linear-gradient(0deg, transparent 0, #000 30%);
    mask-image: linear-gradient(0deg, transparent 0, #000 30%);
    -webkit-mask-composite: source-over;
    mask-composite: add;
  }
  .hero-text { padding: 0 var(--edge); margin-top: -64px; }
  .hero-desc { max-width: 38rem; }

  .section-head, .section-body { grid-column: 1 / -1; }
  .section-body { margin-top: clamp(36px, 7vw, 56px); }
  .section-wide h2, .section-wide .section-head > p { grid-column: 1 / -1; }
  .section-wide .section-head > p { margin-top: 18px; }
  .wall { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: clamp(36px, 7vw, 56px); }
  .wall .wall-cta { grid-column: span 2; }
}

/* ---------- Phone ---------- */
@media (max-width: 640px) {
  :root { --t: 16px; --d-xl: 27vw; }
  .top { padding-block: 18px; gap: 20px; }
  .nav { display: none; }
  .lang { margin-left: auto; }

  .hero-photo { height: auto; aspect-ratio: 1 / 1.05; }
  .btn { flex: 1 1 100%; font-size: 23px; }
  .btn-label { flex: 1; }

  .row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .row-meta { grid-column: 1; grid-row: 2; margin-top: 4px; }
  .row-value { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .row-contact { grid-template-columns: minmax(0, 1fr); }
  .row-contact .row-mail { grid-column: 1; grid-row: 3; text-align: left; margin-top: 12px; }

  .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 132px; }
  .wall img { max-width: 66%; }
  .wall .wall-cta { grid-column: auto; }
  .foot { flex-direction: column; gap: 4px; }
}
