/* SEVERE — site styles.
   Grid: 6 columns, 20px viewport margins, 16px gutters (column = 220px @1440).
   Red is #FF0000; inactive dropdown columns 30%, inactive bottom nav 20%.
   Overlay text 14px / line-height 16 (desktop), 14px / 15 (mobile). */

@font-face {
  font-family: 'HaasDisp';
  src: url('../assets/fonts/HaasGrotDisp-65Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: block;
}
@font-face {
  font-family: 'HaasDisp';
  src: url('../assets/fonts/HaasGrotDisp-75Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: block;
}

:root {
  --red: #FF0000;
  --m: 20px;                                  /* viewport text margin */
  --cw: calc((100vw - 120px) / 6);            /* 220 @1440 */
  --r3: calc(50vw + 8px);                     /* 728 @1440 */
  --r4: calc(66.66667vw + 4px);               /* 964 @1440 */
  --r5: calc(83.33333vw);                     /* 1200 @1440 */
  --subrel: calc(var(--cw) / 2 + 8px);        /* right sub-column offset inside a column: 118 @1440 */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;                            /* no scrollbar, ever */
  background: #000;
  color: var(--red);
  font-family: 'HaasDisp', Helvetica, Arial, sans-serif;
  font-weight: 500;
}

::selection { background: var(--red); color: #000; }

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

/* ---------- fullscreen image + overlay dim ---------- */

#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #000;
}
#bg-img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter .25s ease, transform .25s ease;
  /* keep the image "in the background": no right-click target, no long-press
     save sheet, no drag-out (context menu is also blocked in JS) */
  pointer-events: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
}
img { -webkit-touch-callout: none; -webkit-user-drag: none; }

/* pool videos: same footprint and protections as the image */
.bg-vid {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter .25s ease, transform .25s ease;
  pointer-events: none;
  -webkit-touch-callout: none;
  user-select: none;
}

/* layer blur 15 = CSS blur radius 7.5px; slight scale hides blurred edge bleed */
body.overlay #bg-img, body.overlay .bg-vid { filter: blur(7.5px); transform: scale(1.03); }

#dim {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
body.overlay #dim { opacity: 1; }

/* ---------- persistent top-left: cities + clocks ---------- */

#cities, #clock {
  position: fixed;
  left: var(--m);
  z-index: 50;
  font-size: 14px;                  /* desktop: same size/rhythm as the overlay text */
  white-space: pre;
  text-box: trim-both cap alphabetic;
  visibility: hidden;               /* until JS has taken over (no first-paint flash) */
}
body.boot #cities, body.boot #clock { visibility: visible; }
#cities { top: var(--m); }
#clock  { top: calc(var(--m) + 16px); color: rgba(255, 0, 0, 0.3); }
#clock-r {
  position: absolute;
  left: var(--clock2, 101px);
  top: 0;
  text-box: trim-both cap alphabetic;   /* cap-align with the London time */
}

/* ---------- header wordmark ---------- */

#wordmark {
  position: fixed;
  left: calc(25vw + 8px);
  top: 20px;
  z-index: 30;
  font-size: 36px;
  font-weight: 700;
  white-space: pre;
  text-box: trim-both cap alphabetic;
  visibility: hidden;
}
body[data-state="main"] #wordmark { visibility: visible; }
#wordmark-tm {
  position: absolute;
  left: 141px;
  top: 0;
  width: 7px;
  height: 3px;
}

/* ---------- navigation ---------- */

#nav { visibility: hidden; }
body[data-state="morph"] #nav, body[data-state="main"] #nav { visibility: visible; }

.navitem {
  position: fixed;
  bottom: 20px;
  z-index: 20;
  font-size: 36px;
  white-space: pre;
  cursor: pointer;
  text-box: trim-both cap alphabetic;
  transition: opacity .15s ease;
}
.navitem:hover { text-decoration: underline; }
#nav-manifesto { left: var(--r3); }
#nav-personnel { left: var(--r4); }
#nav-inquire   { left: var(--r5); }

body.overlay .navitem { opacity: 0.2; }
body[data-tab="manifesto"] #nav-manifesto { opacity: 1; }
body[data-tab="personnel"] #nav-personnel { opacity: 1; }
body[data-tab="inquire"]   #nav-inquire   { opacity: 1; }

/* mobile-only drag hint: icon 11x11 at 16/827, text at 32/829 */
#drag-hint { display: none; }

/* ---------- overlay dropdowns ---------- */

#overlay { display: none; position: fixed; inset: 0; z-index: 10; }
body.overlay #overlay { display: block; }

/* each column is a scroll container: the top rule is its border, content
   scrolls beneath and is masked 20px above the nav line (nav cap top is at
   100vh-46, so the clip edge sits at 100vh-66 -> bottom: 66px) */
.col {
  position: absolute;
  top: 48px;
  bottom: 66px;
  width: var(--cw);
  border-top: 1px solid var(--red);
  overflow-y: auto;
  scrollbar-width: none;
  font-size: 14px;
  line-height: 16px;
  opacity: 0.3;
  transition: opacity .15s ease;
}
.col::-webkit-scrollbar { display: none; }
.col-manifesto { left: var(--r3); }
.col-personnel { left: var(--r4); }
.col-inquire   { left: var(--r5); }
body[data-tab="manifesto"] .col-manifesto { opacity: 1; }
body[data-tab="personnel"] .col-personnel { opacity: 1; }
body[data-tab="inquire"]   .col-inquire   { opacity: 1; }

/* labels sit above the scroll region (fixed on the rails, dim with the column) */
.col-label {
  position: fixed;
  top: 20px;
  white-space: pre;
  cursor: pointer;
  text-box: trim-both cap alphabetic;
}
.col-manifesto .col-label { left: var(--r3); }
.col-personnel .col-label { left: var(--r4); }
.col-inquire   .col-label { left: var(--r5); }
.col-label:hover { text-decoration: underline; }

/* "+" when closed, ↓ arrow when open/active */
.arr {
  display: none;
  width: 6px;
  height: 10px;
  margin-left: 2px;
  vertical-align: baseline;
  background: url('../assets/svg/arrow-down-m.svg') no-repeat center / contain;
}
body[data-tab="manifesto"] .col-manifesto .col-label .plus,
body[data-tab="personnel"] .col-personnel .col-label .plus,
body[data-tab="inquire"]   .col-inquire   .col-label .plus { display: none; }
body[data-tab="manifesto"] .col-manifesto .col-label .arr,
body[data-tab="personnel"] .col-personnel .col-label .arr,
body[data-tab="inquire"]   .col-inquire   .col-label .arr { display: inline-block; }

.col-rule { display: none; }   /* the column border is the rule */

.col-body {
  padding: 5px 0 20px;
  white-space: pre-wrap;
  text-box: trim-both cap alphabetic;
}

/* external links: text + ↗ arrow riding the cap line */
.ext-arr {
  position: absolute;
  top: 0;
  width: 8px;
  height: 8px;
  background: url('../assets/svg/arrow-up-m.svg') no-repeat center / contain;
}

#email {
  position: relative;
  display: block;
  width: -moz-max-content;
  width: max-content;
  margin-top: 5px;
  white-space: pre;
  text-box: trim-both cap alphabetic;
}
#email:hover { text-decoration: underline; }
#email .ext-arr { left: 121.5px; }

/* ---------- personnel rows ---------- */

#p-rows { padding-bottom: 20px; }

.p-row { border-top: 1px solid var(--red); }
.p-row:first-child { border-top: none; }   /* the column border is the first line */

.p-head { position: relative; cursor: pointer; }

.p-name {
  position: absolute;
  left: 0;
  top: 5px;
  white-space: pre;
  text-box: trim-both cap alphabetic;
}
.p-name:hover { text-decoration: underline; }
.p-name .arr { vertical-align: baseline; }
.p-row.open .p-name .plus { display: none; }
.p-row.open .p-name .arr { display: inline-block; }

/* cap box at 14px is 10.01px (effectively integer), so the gaps are clean */
.p-sub { margin-left: var(--subrel); padding: 5px 0 19px; }

/* titles wrap within the sub-column — at 14px the long titles no longer fit
   one line without running into the inquire column */
.p-title {
  text-box: trim-both cap alphabetic;
}

.p-link {
  position: relative;
  display: block;
  width: -moz-max-content;
  width: max-content;
  margin-top: 5px;
  white-space: pre;
  text-box: trim-both cap alphabetic;
}
.p-link:hover { text-decoration: underline; }
.p-link .ext-arr { left: 55px; }

.p-bio {
  display: none;
  white-space: pre-wrap;
  text-box: trim-both cap alphabetic;
}
.p-row.open .p-bio {
  display: block;
  margin-top: 1px;
  margin-bottom: 19px;
}

#p-assoc {
  position: relative;
  border-top: 1px solid var(--red);
  height: 140px;
}
.assoc-label, .assoc-name {
  position: absolute;
  left: 0;
  white-space: pre;
  text-box: trim-both cap alphabetic;
}
.assoc-label { top: 5px; }
.assoc-title {
  position: absolute;
  left: var(--subrel);
  white-space: pre;
  text-box: trim-both cap alphabetic;
}
#p-assoc .p-link { position: absolute; left: var(--subrel); margin: 0; }
.a-n1, .a-t1 { top: 35px; }
.a-l1 { top: 66px; }
.a-n2, .a-t2 { top: 96px; }
.a-l2 { top: 127px; }

/* ---------- close X ---------- */

#close-overlay {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  background: url('../assets/svg/x.svg') no-repeat center / contain;
}

/* ---------- intro / loading screen ---------- */

#intro {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #000;
}
body[data-state="morph"] #intro { background: transparent; }
body[data-state="main"] #intro { display: none; }

/* lockup in design units: S ink at (0,0), cap height 260, full width 1416 (incl ™).
   JS drives the transform (intro position, morph into the header wordmark). */
#hero-lockup {
  position: absolute;
  left: 0;
  top: 0;
  width: 1416px;
  height: 260px;
  transform-origin: 0 0;
  visibility: hidden;               /* raw (untransformed) lockup must never paint */
}
body.boot #hero-lockup { visibility: visible; }
#hero-word {
  margin: 0;
  position: absolute;
  left: -6px;                    /* S side bearing at 363px */
  top: 0;
  font-size: 363px;
  font-weight: 700;
  letter-spacing: -3.63px;
  white-space: pre;
  text-box: trim-both cap alphabetic;
}
#hero-word .e1 { letter-spacing: 0.16px; }     /* kerning fix on the first E */
#hero-tm {
  position: absolute;
  left: 1389.04px;
  top: 0.55px;
  width: 26.96px;
  height: auto;
}

#intro-arrow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  width: 12px;
  height: 20px;
  transition: opacity .15s ease;
}
body[data-state="morph"] #intro-arrow { opacity: 0; }

/* ================= mobile (393 base) ================= */

@media (max-width: 700px) {
  :root { --m: 16px; }

  #cities, #clock { font-size: 10px; }
  #clock { top: calc(var(--m) + 12px); color: var(--red); }   /* hours full opacity on mobile */
  #clock-r { left: var(--clock2-m, 72px); }

  #wordmark { left: 16px; top: 67px; }

  /* main state: big stacked nav */
  .navitem {
    left: 16px;
    right: auto;
    bottom: auto;
    font-size: 66px;
  }
  #nav-manifesto { left: 16px; top: 137px; }
  #nav-personnel { left: 16px; top: 204px; }
  #nav-inquire   { left: 16px; top: 271px; }

  /* open section: only the active title, at the top slot */
  body.overlay .navitem { display: none; }
  body[data-tab="manifesto"] #nav-manifesto,
  body[data-tab="personnel"] #nav-personnel,
  body[data-tab="inquire"]   #nav-inquire { display: block; top: 137px; opacity: 1; }

  /* single full-width column, scrollable content under a fixed rule */
  .col { display: none; }
  body[data-tab="manifesto"] .col-manifesto,
  body[data-tab="personnel"] .col-personnel,
  body[data-tab="inquire"]   .col-inquire { display: block; opacity: 1; }
  .col {
    position: fixed;
    left: 16px;
    right: 16px;
    top: 227px;
    bottom: 0;
    width: auto;
    font-size: 14px;
    line-height: 15px;
  }

  .col-label { display: none; }
  .col-rule { display: none; }

  .col-body { padding: 15px 0 16px; }

  #email { margin-top: 10px; }
  #email .ext-arr { left: 121.5px; }

  #p-rows { padding-bottom: 16px; }

  .p-name { top: 10px; }
  .p-sub { margin-left: 193.63px; padding: 10px 0 19px; }
  .p-link { margin-top: 5px; }
  .p-row.open .p-bio { margin-top: 1px; margin-bottom: 19px; }

  .arr { width: 6px; height: 10px; background-image: url('../assets/svg/arrow-down-m.svg'); }
  .ext-arr { width: 8px; height: 8px; background-image: url('../assets/svg/arrow-up-m.svg'); }
  .p-link .ext-arr { left: 55px; }

  #p-assoc { height: 140px; }
  .assoc-label { top: 10px; }
  .assoc-title, #p-assoc .p-link { left: 193.63px; }
  .a-n1, .a-t1 { top: 40px; }
  .a-l1 { top: 70px; }
  .a-n2, .a-t2 { top: 100px; }
  .a-l2 { top: 130px; }

  #close-overlay {
    right: 16px;
    bottom: auto;
    top: 137px;
    width: 47px;
    height: 47px;
    background-image: url('../assets/svg/x-m.svg');
  }

  #drag-hint {
    display: block;
    position: fixed;
    left: 16px;
    bottom: 14px;
    z-index: 20;
    visibility: hidden;
  }
  body[data-state="main"] #drag-hint { visibility: visible; }
  body.overlay #drag-hint { visibility: hidden; }
  #drag-hint img { display: block; width: 11px; height: 11px; }
  #drag-hint span {
    position: absolute;
    left: 16px;
    top: 2px;
    font-size: 10px;
    white-space: pre;
    text-box: trim-both cap alphabetic;
  }

  /* no ™ on the intro lockup — it arrives with the header wordmark */
  #hero-tm { display: none; }

  #intro-arrow { bottom: 6px; }
}

/* touch devices: taps must not leave links stuck underlined */
@media (hover: none) {
  .navitem:hover, .col-label:hover, .p-name:hover, .p-link:hover, #email:hover {
    text-decoration: none;
  }
}
