/* C2SR website. Brand: C2SR Brand Guidelines v2.1 (Command Black, Paper, Marron #9B6131, IBM Plex Sans + Mono). */

@font-face { font-family: 'Plex Sans'; src: url('../fonts/plex-sans-var.woff2') format('woff2'); font-weight: 100 700; font-stretch: 85% 100%; font-display: swap; }
@font-face { font-family: 'Plex Sans'; src: url('../fonts/plex-sans-italic-var.woff2') format('woff2'); font-weight: 100 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url('../fonts/plex-mono-regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url('../fonts/plex-mono-medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --k: #0A0B0D;          /* Command Black */
  --k2: #111316;
  --graphite: #1C1F22;
  --paper: #F5F5F3;
  --tint: #EAE9E5;
  --marron: #9B6131;     /* the only accent */
  --marron-hi: #C58A55;  /* marron lifted for small text on black (contrast 6.4:1) */
  --steel: #5E636A;
  --mist: #9BA0A6;
  --steel-t: #82878E;   /* steel for text: 4.9:1 on --k */
  --line: #2A2E33;       /* hairline on black */
  --line-2: #3A3F45;
  --line-l: #C9C8C3;     /* hairline on paper */
  --crit: #B4232A;

  --fg: var(--paper);
  --fg-2: var(--mist);
  --bg: var(--k);

  --sans: 'Plex Sans', 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Plex Mono', 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --m: clamp(20px, 4.2vw, 72px);       /* page margin */
  --gut: clamp(16px, 1.8vw, 28px);
  --maxw: 1680px;

  --t-display: clamp(52px, 10.2vw, 184px);
  --t-h1: clamp(40px, 6.4vw, 112px);
  --t-h2: clamp(30px, 4.1vw, 70px);
  --t-h3: clamp(22px, 2.1vw, 34px);
  --t-lead: clamp(18px, 1.55vw, 25px);
  --t-body: clamp(16px, 1.08vw, 18px);
  --t-label: 11.5px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --hdr: 68px;
}

* { box-sizing: border-box; }
html { background: var(--k); color-scheme: dark; -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--sans); font-size: var(--t-body); line-height: 1.55; font-weight: 400;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--marron); color: var(--paper); }
:focus-visible { outline: 2px solid var(--marron-hi); outline-offset: 3px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- type */
.label { font-family: var(--mono); font-size: var(--t-label); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-2); font-weight: 400; line-height: 1.5; }
.label b, .label strong { color: var(--fg); font-weight: 500; }
.display { font-size: var(--t-display); font-weight: 300; letter-spacing: -.045em; line-height: .9; margin: 0; font-stretch: 100%; }
.h1 { font-size: var(--t-h1); font-weight: 300; letter-spacing: -.035em; line-height: .96; margin: 0; }
.h2 { font-size: var(--t-h2); font-weight: 300; letter-spacing: -.028em; line-height: 1.02; margin: 0; }
.h3 { font-size: var(--t-h3); font-weight: 400; letter-spacing: -.015em; line-height: 1.15; margin: 0; }
.lead { font-size: var(--t-lead); font-weight: 350; line-height: 1.42; letter-spacing: -.008em; color: var(--fg); margin: 0; max-width: 34em; }
.dim { color: var(--fg-2); }
.quiet { color: var(--steel-t); }
.tab { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }

/* ---------- layout */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-left: var(--m); padding-right: var(--m); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gut); }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
section { position: relative; }
.pad { padding-top: clamp(96px, 14vh, 200px); padding-bottom: clamp(96px, 14vh, 200px); }

/* ---------- header */
.hdr {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--hdr);
  display: flex; align-items: center; gap: 28px; padding: 0 var(--m);
  color: var(--paper); transition: background .5s var(--ease), border-color .5s var(--ease), transform .5s var(--ease);
  border-bottom: 1px solid transparent;
}
.hdr.solid { background: rgba(10, 11, 13, .94); border-bottom-color: var(--line); }
.hdr.hide { transform: translateY(-100%); }
.hdr .brand { display: flex; align-items: center; gap: 14px; flex: none; }
.hdr .brand svg { width: 92px; height: auto; color: var(--paper); }
.hdr nav { display: flex; gap: 26px; margin-left: 18px; }
.hdr nav a { font-size: 14px; color: var(--mist); letter-spacing: .005em; transition: color .25s; position: relative; padding: 6px 0; }
.hdr nav a:hover, .hdr nav a[aria-current="page"] { color: var(--paper); }
.hdr nav a[aria-current="page"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--marron); }
.hdr .clock { margin-left: auto; display: flex; gap: 18px; align-items: center; white-space: nowrap; }
.hdr .clock .label { font-size: 11px; }
.hdr .clock .sep { width: 1px; height: 14px; background: var(--line-2); }
.btn {
  display: inline-flex; align-items: center; gap: 12px; height: 44px; padding: 0 18px;
  font-size: 14px; font-weight: 450; letter-spacing: .005em; white-space: nowrap;
  border: 1px solid var(--line-2); color: var(--paper); background: transparent;
  transition: background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.btn:hover { background: var(--paper); color: var(--k); border-color: var(--paper); }
.btn.solid { background: var(--paper); color: var(--k); border-color: var(--paper); }
.btn.solid:hover { background: var(--marron); border-color: var(--marron); color: var(--paper); }
.btn .arr { width: 14px; height: 10px; flex: none; }
.hdr .btn { height: 38px; font-size: 13.5px; }
.menu-btn { display: none; width: 44px; height: 44px; margin-left: auto; position: relative; }
.menu-btn span { position: absolute; left: 11px; right: 11px; height: 1px; background: var(--paper); transition: transform .4s var(--ease), top .4s var(--ease); }
.menu-btn span:nth-child(1) { top: 18px; } .menu-btn span:nth-child(2) { top: 26px; }
body.menu-open .menu-btn span:nth-child(1) { top: 22px; transform: rotate(45deg); }
body.menu-open .menu-btn span:nth-child(2) { top: 22px; transform: rotate(-45deg); }
.drawer {
  position: fixed; inset: 0; z-index: 45; background: var(--k); padding: calc(var(--hdr) + 32px) var(--m) 32px;
  display: flex; flex-direction: column; gap: 6px; visibility: hidden; opacity: 0; transition: opacity .35s var(--ease), visibility .35s;
}
body.menu-open .drawer { visibility: visible; opacity: 1; }
.drawer a.big { font-size: 40px; font-weight: 300; letter-spacing: -.02em; padding: 8px 0; border-bottom: 1px solid var(--line); }
.drawer .label { margin-top: auto; }

@media (max-width: 1100px) { .hdr .clock .next { display: none; } }
@media (max-width: 900px) {
  :root { --hdr: 60px; }
  .hdr nav, .hdr .clock, .hdr > .btn { display: none; }
  .menu-btn { display: block; }
  .hdr .brand svg { width: 80px; }
}

/* ---------- media */
.media { position: relative; overflow: hidden; background: #000; }
.media video, .media img, .media canvas { width: 100%; height: 100%; object-fit: cover; }
.shade-b::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(10,11,13,0) 45%, rgba(10,11,13,.78) 100%); }
.shade-l::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(10,11,13,.82) 0%, rgba(10,11,13,.35) 45%, rgba(10,11,13,0) 70%); }
.grain::before { content: ''; position: absolute; inset: -50%; z-index: 2; pointer-events: none; opacity: .06; background-image: url('../img/grain.png'); animation: grain 1s steps(6) infinite; mix-blend-mode: overlay; }
@keyframes grain { 0% { transform: translate(0,0) } 20% { transform: translate(-3%,2%) } 40% { transform: translate(2%,-3%) } 60% { transform: translate(-2%,-1%) } 80% { transform: translate(3%,3%) } 100% { transform: translate(0,0) } }

/* a real screen: flat recording inside a thin bezel */
.screen { position: relative; background: #050607; border: 1px solid var(--line-2); padding: 0; }
.screen::before { content: ''; position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.04); pointer-events: none; z-index: 2; }
.screen video { width: 100%; height: auto; aspect-ratio: var(--ar, 1600/908); object-fit: cover; background: #050607; }
.screen .cap { position: absolute; left: 0; right: 0; bottom: -34px; display: flex; justify-content: space-between; }

/* ---------- reveal on view */
.rv { opacity: 0; transform: translateY(28px); transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: var(--d, 0s); }
.rv.in { opacity: 1; transform: none; }
.lines .ln { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.lines .ln > span { display: inline-block; transform: translateY(105%); transition: transform 1.15s var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms + var(--d, 0s)); }
.lines.in .ln > span { transform: none; }

/* ---------- footer */
.ftr { border-top: 1px solid var(--line); padding: 64px 0 0; overflow: hidden; background: var(--k); }
.ftr .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--gut); }
.ftr .ftr-h { margin: 0 0 18px; }
[data-clock], [data-brief] { display: inline-block; min-width: 8ch; }
.ftr ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ftr ul a { color: var(--mist); font-size: 15px; transition: color .25s; }
.ftr ul a:hover { color: var(--paper); }
.ftr .giant { margin-top: 72px; width: 100%; color: #15181b; transform: translateY(18%); }
.ftr .giant svg { width: 100%; height: auto; }
.ftr .base { display: flex; justify-content: space-between; gap: 20px; padding: 28px 0; border-top: 1px solid var(--line); margin-top: 56px; flex-wrap: wrap; }
@media (max-width: 800px) { .ftr .cols { grid-template-columns: 1fr 1fr; row-gap: 40px; } .ftr .cols > :first-child { grid-column: 1 / -1; } }

/* ---------- page transition veil */

/* ---------- link tiles and the closing pair, shared by inner pages */
.tile { position: relative; display: grid; gap: 12px; padding: clamp(24px, 3vw, 44px); min-height: 220px; align-content: end; background: var(--k2); border: 1px solid var(--line-2); transition: background .35s var(--ease), color .35s; }
.tile .arr { position: absolute; top: clamp(24px, 3vw, 44px); right: clamp(24px, 3vw, 44px); width: 22px; height: 16px; transition: transform .4s var(--ease); }
.tile:hover .arr { transform: translateX(6px); }
.tile:hover { background: var(--graphite); }
.tile.solid { background: var(--paper); color: var(--k); border-color: var(--paper); }
.tile.solid .label { color: #4b5056; }
.tile.solid:hover { background: var(--marron); color: var(--paper); border-color: var(--marron); }
.tile.solid:hover .label { color: var(--tint); }

.next-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; }
@media (max-width: 900px) { .next-grid { grid-template-columns: 1fr; } }

.veil { position: fixed; inset: 0; z-index: 100; background: var(--k); pointer-events: none; opacity: 1; transition: opacity .7s var(--ease); }
body.ready .veil { opacity: 0; }
body.leaving .veil { opacity: 1; transition-duration: .35s; }

@media (prefers-reduced-motion: reduce) {
  .rv, .lines .ln > span { transition: none !important; opacity: 1 !important; transform: none !important; }
  .grain::before { animation: none; }
}
