/* =====================================================================
   PROJECT HUMANITY — printed tees
   A stylized catalogue: framed white sheet on a desk, ink line work,
   NASA blueprint × 90s McGraw-Hill. Masthead · grid · footer. Nothing else.
   ===================================================================== */

:root{
  --sheet:   #FFFFFF;                 /* white — brand */
  --desk:    #0B3FD6;                 /* cobalt blue — brand (the striking field) */
  --ink:     #0E1A33;                 /* deep navy-ink: text + line work */
  --ink-2:   #45506B;
  --faint:   #D6DCEA;                 /* cool hairlines on white */
  --grid:    rgba(255,255,255,0.08);  /* faint grid on the cobalt field */
  --cobalt:  #0B3FD6;                 /* brand accent (same as the field) */
  --blue:    #0B3FD6;
  --red:     #C0392B;                 /* reserved: form error state only */

  --bg-strength: 0.26;                /* line intensity (master opacity of the field) */

  --page-w: 1040px;
  --pad: clamp(24px,5vw,68px);

  --f-disp: "Archivo", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, monospace;
  --f-body: "Newsreader", Georgia, serif;
}

*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }

body{
  margin:0;
  background:var(--desk);
  color:var(--ink);
  font-family:var(--f-body);
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
  padding:clamp(16px,4vw,52px) clamp(12px,3vw,40px);
}
img,svg{ display:block; max-width:100%; }
a{ color:inherit; }
h1{ font-family:var(--f-disp); font-weight:900; margin:0; }

/* ===================== BACKGROUND FIELD (fixed, switchable) ===================== */
#bgfield,#bgcanvas{
  position:fixed; inset:0; z-index:-1; pointer-events:none;
  opacity:var(--bg-strength); transition:opacity .35s ease;
}
#bgfield{ background-repeat:repeat; background-position:center; overflow:hidden; }
#bgcanvas{ display:none; width:100%; height:100%; }
body[data-bg="flow"] #bgcanvas,
body[data-bg="constellation"] #bgcanvas{ display:block; }

body[data-bg="survey"]   #bgfield{ background-image:url("../assets/survey.svg");   background-size:560px 560px; }
body[data-bg="voronoi"]  #bgfield{ background-image:url("../assets/voronoi.svg");  background-size:640px 640px; }
body[data-bg="halftone"] #bgfield{ background-image:url("../assets/halftone.svg"); background-size:360px 360px; }

body[data-bg="radar"] #bgfield{
  background:repeating-radial-gradient(circle at 50% 50%, transparent 0 47px, rgba(255,255,255,.55) 47px 48px);
}
body[data-bg="radar"] #bgfield::after{
  content:""; position:absolute; top:50%; left:50%;
  width:300vmax; height:300vmax; margin:-150vmax 0 0 -150vmax;
  background:conic-gradient(rgba(255,255,255,.32), transparent 26%, transparent 100%);
  transform-origin:center; animation:radar-sweep 4.5s linear infinite;
}
@keyframes radar-sweep{ to{ transform:rotate(360deg); } }
body[data-motion="off"] #bgfield::after{ animation-play-state:paused; }

/* ===================== CONTROL PANEL (fixed) ===================== */
#controls{
  position:fixed; right:14px; top:50%; transform:translateY(-50%); z-index:60;
  display:flex; flex-direction:column; align-items:center; gap:9px;
  padding:9px 7px; background:var(--sheet);
  border:1.5px solid var(--ink); box-shadow:4px 4px 0 rgba(4,16,54,.25);
}
.ctrl-head{ font-family:var(--f-mono); font-size:8px; letter-spacing:.16em; color:var(--ink-2); }
.ctrl-modes{ display:flex; flex-direction:column; gap:6px; }
.ctrl-mode{
  width:30px; height:30px; padding:0; cursor:pointer;
  display:grid; place-items:center;
  background:#fff; color:var(--ink); border:1px solid var(--faint);
  transition:background .2s, color .2s, border-color .2s;
}
.ctrl-mode svg{ width:16px; height:16px; }
.ctrl-mode:hover{ border-color:var(--ink); }
.ctrl-mode.active{ background:var(--cobalt); border-color:var(--cobalt); color:#fff; }
.ctrl-toggle{
  width:30px; height:30px; padding:0; cursor:pointer; display:grid; place-items:center;
  background:#fff; color:var(--ink-2); border:1px solid var(--faint);
  border-top:1px solid var(--ink); margin-top:2px;
  transition:background .2s, color .2s, border-color .2s;
}
.ctrl-toggle svg{ width:16px; height:16px; }
.ctrl-toggle:hover{ color:var(--ink); }
.ctrl-toggle[aria-pressed="true"]{ background:var(--cobalt); border-color:var(--cobalt); color:#fff; }
.ctrl-knob{
  display:flex; flex-direction:column; align-items:center; gap:4px;
  background:none; border:0; padding:4px 0 0; cursor:pointer;
  border-top:1px solid var(--faint); width:100%;
}
.knob-dial{
  width:30px; height:30px; border-radius:50%; position:relative; display:block;
  border:1.5px solid var(--ink); background:#fff;
  transform:rotate(var(--knob-angle,0deg)); transition:transform .28s cubic-bezier(.5,.05,.2,1);
}
.knob-ind{ position:absolute; left:50%; top:3px; width:2px; height:9px; background:var(--cobalt); transform:translateX(-50%); border-radius:1px; }
.knob-label{ font-family:var(--f-mono); font-size:8px; letter-spacing:.1em; color:var(--ink-2); }

@media (max-width:1100px){
  #controls{ right:50%; top:auto; bottom:12px; transform:translateX(50%);
    flex-direction:row; flex-wrap:wrap; justify-content:center; gap:8px; padding:7px 10px;
    max-width:calc(100vw - 20px); }
  .ctrl-head{ width:100%; text-align:center; }
  .ctrl-modes{ flex-direction:row; flex-wrap:wrap; justify-content:center; }
  .ctrl-toggle{ border-top:1px solid var(--faint); margin-top:0; }
  .ctrl-knob{ border-top:0; border-left:1px solid var(--faint); width:auto; padding:0 0 0 8px; flex-direction:row; }
}

/* ===================== DOSSIER (framed sheet) ===================== */
.dossier{
  position:relative; max-width:var(--page-w); margin:0 auto;
  background-color:var(--sheet);
  border:1.5px solid var(--ink);
  box-shadow:14px 16px 0 rgba(4,16,54,.30);
  background-image:radial-gradient(circle at 50% 50%, rgba(0,0,0,.012) 1px, transparent 1px);
  background-size:3px 3px;
  transition:background-color .4s ease, border-color .4s ease, box-shadow .4s ease;
}
.reg{ position:absolute; width:24px; height:24px; pointer-events:none; transition:opacity .4s ease; }
.reg::before,.reg::after{ content:""; position:absolute; background:#fff; }
.reg::before{ left:50%; top:0; width:1px; height:100%; transform:translateX(-50%); }
.reg::after{ top:50%; left:0; height:1px; width:100%; transform:translateY(-50%); }
.reg-tl{ top:-12px; left:-12px; } .reg-tr{ top:-12px; right:-12px; }
.reg-bl{ bottom:-12px; left:-12px; } .reg-br{ bottom:-12px; right:-12px; }

.page{ position:relative; padding:clamp(26px,4vw,50px) var(--pad); }
.page + .page{ border-top:1.5px solid var(--ink); }

/* running header strip */
.rhead{
  display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:12px;
  font-family:var(--f-mono); font-size:10.5px; letter-spacing:.14em; text-transform:uppercase;
  color:var(--ink-2); padding-bottom:9px; border-bottom:1px solid var(--faint);
}
.rhead > span:first-child{ color:var(--ink); font-weight:600; text-align:left; min-width:0; }
.rhead > span:last-child{ text-align:right; white-space:nowrap; min-width:0; }
.rhead-link{
  justify-self:center; text-align:center;
  font-family:var(--f-mono); font-size:inherit; letter-spacing:inherit; text-transform:uppercase;
  color:var(--ink-2); background:none; border:0; padding:2px 4px 2px calc(4px + .14em); cursor:pointer;
  position:relative; transition:color .2s;
}
.rhead-link::after{ content:""; position:absolute; left:50%; bottom:-1px; width:0; height:1px; background:var(--cobalt); transform:translateX(-50%); transition:width .25s; }
.rhead-link:hover,.rhead-link:focus-visible{ color:var(--cobalt); outline:none; }
.rhead-link:hover::after,.rhead-link:focus-visible::after{ width:64%; }
@media (max-width:560px){ .rhead{ font-size:9px; letter-spacing:.08em; } }

/* ===================== ORIGIN VIEW (video) ===================== */
.origin-stage{ display:none; }
.reel{ width:100%; max-width:760px; margin:0 auto; border:1.5px solid var(--ink); background:#000; box-shadow:8px 8px 0 rgba(11,63,214,.12); line-height:0; }
.reel-video{ display:block; width:100%; height:auto; }
.origin-back{
  margin-top:20px; cursor:pointer;
  font-family:var(--f-mono); font-size:11px; letter-spacing:.18em; text-transform:uppercase;
  color:var(--ink-2); background:none; border:0; padding:6px 10px; transition:color .2s, letter-spacing .2s;
}
.origin-back:hover,.origin-back:focus-visible{ color:var(--cobalt); letter-spacing:.24em; outline:none; }
body.origin-view .site-content{ display:none; }
body.origin-view .origin-stage{ display:flex; flex-direction:column; align-items:center; padding:clamp(14px,3vw,30px); }
body.origin-view .dossier{ max-width:800px; }
body.origin-view #controls{ display:none; }
/* once collapsed, dissolve the white sheet — just the video on the cobalt field */
.dossier.bare{ background-color:transparent; background-image:none; border-color:transparent; box-shadow:none; }
.dossier.bare .reg{ opacity:0; }
.dossier.bare .origin-back{ color:#fff; }

/* ===================== MASTHEAD ===================== */
.masthead{ text-align:center; }
.mast-wordmark{
  font-family:var(--f-mono); font-weight:600; font-size:13px; letter-spacing:.34em;
  text-transform:uppercase; color:var(--ink); margin:clamp(18px,3vw,28px) 0 0; padding-left:.34em;
}
.mast-emblem{ position:relative; max-width:clamp(80px,15vw,132px); margin:clamp(14px,2.5vw,22px) auto 2px; }
.globe{ width:100%; height:auto; display:block; }
/* real photo (assets/globe.png) hides until it actually loads; then it replaces the SVG */
.globe-photo{ display:none; }
.mast-emblem.has-photo .globe-photo{ display:block; position:absolute; inset:0; width:100%; height:100%; object-fit:cover; border-radius:50%; }
.mast-emblem.has-photo .globe-fallback{ visibility:hidden; }

/* ===================== CATALOGUE / CONTACT SHEET ===================== */
.catalogue{ padding-top:clamp(22px,3.5vw,40px); }
.contact{ width:100%; border:1.5px solid var(--ink); background:var(--sheet); box-shadow:8px 8px 0 rgba(11,63,214,.10); }
.contact-head{
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  padding:10px 14px; border-bottom:1.5px solid var(--ink);
  font-family:var(--f-mono); font-size:11px; letter-spacing:.14em; text-transform:uppercase; color:var(--ink-2);
}
.contact-head span:first-child{ color:var(--ink); }
.contact-stat{ display:flex; align-items:center; gap:8px; white-space:nowrap; }
.dot-r{ width:7px; height:7px; border-radius:50%; background:var(--cobalt); box-shadow:0 0 0 3px rgba(11,63,214,.18); animation:pulse 2.4s ease-in-out infinite; flex:none; }
@keyframes pulse{ 0%,100%{ box-shadow:0 0 0 3px rgba(11,63,214,.18);} 50%{ box-shadow:0 0 0 5px rgba(11,63,214,.04);} }

.contact-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:1px; background:var(--faint); }
.pcell{ position:relative; margin:0; aspect-ratio:4/5; background:var(--sheet); overflow:hidden; }
.pcell-photo{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:1; transition:transform .45s ease; }
.pcell:hover .pcell-photo{ transform:scale(1.04); }
.pcell-tab{
  position:absolute; top:0; left:0; z-index:2;
  background:var(--ink); color:var(--sheet);
  font-family:var(--f-mono); font-size:10px; letter-spacing:.04em; padding:3px 8px;
}
@media (max-width:680px){ .contact-grid{ grid-template-columns:repeat(2,1fr); } }

/* ===================== FOOTER ===================== */
.foot{ text-align:center; }
.notify{ display:flex; max-width:460px; margin:0 auto 8px; border:1.5px solid var(--ink); background:var(--sheet); }
.notify input{
  flex:1; min-width:0; border:0; background:transparent; outline:none;
  font-family:var(--f-mono); font-size:12px; color:var(--ink); padding:13px 14px;
}
.notify input::placeholder{ color:var(--faint); }
.notify button{
  border:0; border-left:1.5px solid var(--ink); cursor:pointer;
  background:var(--ink); color:var(--sheet);
  font-family:var(--f-mono); font-size:11px; letter-spacing:.12em; padding:0 20px;
  transition:background .25s;
}
.notify button:hover{ background:var(--cobalt); }
.notify button:disabled{ opacity:.5; cursor:wait; }

.form-status{ font-family:var(--f-mono); font-size:10px; letter-spacing:.05em; min-height:1.2em; margin:0 0 18px; }
.form-status.ok{ color:#2E6E6A; } .form-status.err{ color:var(--red); }

.foot-meta{
  display:flex; gap:14px; justify-content:center; flex-wrap:wrap;
  font-family:var(--f-mono); font-size:10px; letter-spacing:.12em; text-transform:uppercase; color:var(--ink-2);
}
.foot-meta a{ text-decoration:none; border-bottom:1px solid var(--cobalt); }

/* ===================== REVEAL ===================== */
.reveal{ opacity:0; transform:translateY(14px); transition:opacity .7s ease, transform .7s ease; transition-delay:calc(var(--i,0) * 90ms); }
.in-view .reveal,.reveal.in-view{ opacity:1; transform:none; }

@media (prefers-reduced-motion:reduce){
  html{ scroll-behavior:auto; }
  .reveal{ opacity:1; transform:none; transition:none; }
  .dot-r{ animation:none; }
}
