/* Covalent Systems
   Design tokens live here. Change a value once and it changes everywhere. */

@font-face {
  font-family: 'Cabinet Grotesk';
  src: url('fonts/CabinetGrotesk-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/JetBrainsMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --charcoal:   #16181D;
  --accent:     #E8453C;
  --accent-btn: #D63A30;
  --light:      #ECEEF1;
  --muted:      #9AA1AC;
  --dim:        #6C7079;
  --hairline:   #2A2F38;
  --border:     #23272F;
  --field:      #3A3F49;

  --display: 'Cabinet Grotesk', system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;

  --header:  109px;
  --marquee: 81px;
  --shell:   1280px;
  --gutter:  40px;
  --section: 140px;

  /* display type scales with the viewport, body type does not */
  --h1:    clamp(44px, 7.2vw, 104px);
  --h2:    clamp(34px, 4.2vw, 60px);
  --h3:    clamp(30px, 3.8vw, 54px);
  --num:   clamp(84px, 10.4vw, 150px);
  --card:  clamp(20px, 1.6vw, 22px);
  --body:  19px;
  --label: 16px;
}

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

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

body {
  margin: 0;
  background-color: var(--charcoal);
  background-image:
    url('img/grain.png'),
    linear-gradient(rgba(255,255,255,0.020) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.020) 1px, transparent 1px);
  background-size: 128px 128px, 120px 120px, 120px 120px;
  color: var(--light);
  font-family: var(--display);
  font-size: var(--body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--light); text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

section[id], #top { scroll-margin-top: 110px; }

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.label {
  font-family: var(--mono);
  font-size: var(--label);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}
.label--accent { color: var(--accent); }
.label--muted  { color: var(--muted); }

.skip {
  position: absolute; left: -9999px;
  background: var(--accent-btn); color: #fff;
  padding: 12px 20px; font-family: var(--mono); font-size: 14px;
}
.skip:focus { left: 16px; top: 16px; z-index: 100; color: #fff; }

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

.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  background-color: var(--charcoal);
  background-image: url('img/grain.png');
  background-size: 128px 128px;
}
.site-header .shell {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding-top: 26px; padding-bottom: 26px;
}
.site-header img { height: 48px; width: auto; }

.nav { display: flex; align-items: center; gap: 36px; }
.nav a {
  font-family: var(--mono); font-size: var(--label); font-weight: 500;
  letter-spacing: 0.14em; color: var(--muted);
}
.nav a:hover { color: var(--accent); }

.btn {
  display: inline-block;
  font-family: var(--mono); font-size: var(--label); font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 14px 22px; border: 1px solid var(--field); color: var(--light);
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn--solid {
  background: var(--accent-btn); border-color: var(--accent-btn);
  color: #fff; padding: 19px 32px;
}
.btn--solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.nav-toggle { display: none; }

/* ---------- hero ---------- */

.hero {
  min-height: calc(100vh - var(--header) - var(--marquee));
  min-height: calc(100svh - var(--header) - var(--marquee));
  display: flex; flex-direction: column; justify-content: center;
}
.hero .shell {
  display: flex; flex-direction: column; gap: 40px;
  padding-top: 52px; padding-bottom: 66px;
}
.eyebrow { display: flex; align-items: center; gap: 14px; }
.eyebrow span.sq { width: 9px; height: 9px; background: var(--accent); flex-shrink: 0; }

h1 {
  margin: 0; max-width: 16ch;
  font-size: var(--h1); font-weight: 800; line-height: 0.90;
  letter-spacing: -0.025em; text-transform: uppercase;
}
h1 .struck {
  text-decoration: line-through;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.085em;
  text-decoration-skip-ink: none;
}
h1 .accent { color: var(--accent); }

.hero-foot {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 60px; margin-top: 40px; flex-wrap: wrap;
}
.hero-foot p { margin: 0; max-width: 44ch; color: var(--muted); }
.hero-cta { display: flex; align-items: center; gap: 32px; flex-shrink: 0; }
.scroll {
  font-family: var(--mono); font-size: var(--label); font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}

/* ---------- marquee ---------- */

.marquee {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  overflow: hidden; padding: 26px 0;
}
.marquee-track {
  display: flex; width: max-content;
  animation: marquee 42s linear infinite;
  font-family: var(--mono); font-size: var(--label); font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim);
}
.marquee-track > div { display: flex; align-items: center; white-space: nowrap; flex-shrink: 0; }
.marquee .sep { color: var(--accent); padding: 0 40px; }
@keyframes marquee { from { transform: translate3d(0,0,0); } to { transform: translate3d(-50%,0,0); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ---------- manifesto ---------- */

section { border-bottom: 1px solid var(--border); }
.section-pad { padding-top: var(--section); padding-bottom: var(--section); }

.manifesto .shell { display: flex; flex-direction: column; gap: 150px; }

.block { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.numeral {
  font-size: var(--num); font-weight: 800; line-height: 1; letter-spacing: -0.02em;
  color: transparent; -webkit-text-stroke: 2px var(--accent);
}
.block h2 {
  margin: 0; max-width: 20ch;
  font-size: var(--h3); font-weight: 500; line-height: 1.08; letter-spacing: -0.015em;
}
.block p { margin: 0; max-width: 52ch; color: var(--muted); line-height: 1.7; }

.split { display: flex; align-items: center; gap: 80px; }
.split img { width: 520px; height: 330px; object-fit: cover; flex-shrink: 0; }
.split .block { flex-grow: 1; }
.split--right .block { align-items: flex-end; text-align: right; }

/* ---------- capabilities ---------- */

.cap-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 80px; margin-bottom: 70px; flex-wrap: wrap;
}
.cap-head h2 {
  margin: 0; font-size: var(--h2); font-weight: 800; line-height: 0.95;
  letter-spacing: -0.025em; text-transform: uppercase;
}
.cap-head h2 .accent { color: var(--accent); }
.cap-head > div { display: flex; flex-direction: column; gap: 20px; }
.cap-head p { margin: 0; max-width: 40ch; color: var(--muted); text-align: right; }

.grid {
  border: 1px solid var(--hairline);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cell {
  padding: 44px 40px; display: flex; flex-direction: column; gap: 16px;
  border-bottom: 1px solid var(--hairline);
}
.cell:nth-child(odd) { border-right: 1px solid var(--hairline); }
.cell:nth-last-child(-n+2) { border-bottom: 0; }
.cell { transition: outline-color 120ms ease; outline: 1px solid transparent; outline-offset: -1px; }
.cell:hover { outline-color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .cell { transition: none; } }

.cell-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.cell h3 { margin: 0; font-size: var(--card); font-weight: 500; letter-spacing: -0.01em; }
.cell .arrow { color: var(--dim); font-size: var(--label); }
.cell p { margin: 0; color: var(--muted); font-size: var(--label); line-height: 1.65; max-width: 44ch; }

/* ---------- contact ---------- */

.contact .shell { display: flex; align-items: flex-start; gap: 100px; }
.contact-left { display: flex; flex-direction: column; gap: 24px; width: 480px; flex-shrink: 0; }
.contact-left h2 {
  margin: 0; font-size: var(--h2); font-weight: 800; line-height: 0.95;
  letter-spacing: -0.025em; text-transform: uppercase;
}
.contact-left h2 .accent { color: var(--accent); }
.contact-left p { margin: 0; color: var(--muted); }

.ticks { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.tick { display: flex; align-items: center; gap: 14px; }
.tick .sq { width: 7px; height: 7px; background: var(--accent); flex-shrink: 0; }
.tick span:last-child {
  font-family: var(--mono); font-size: var(--label); font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}

form { display: flex; flex-direction: column; gap: 34px; flex-grow: 1; padding-top: 8px; }
.row { display: flex; gap: 40px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 220px; }
label {
  font-family: var(--mono); font-size: var(--label); font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim);
}
input, textarea {
  width: 100%; background: transparent; border: 0;
  border-bottom: 1px solid var(--field); border-radius: 0;
  color: var(--light); font-family: var(--display); font-size: var(--body);
  font-weight: 400; padding: 12px 0; outline: none;
}
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
input:focus, textarea:focus { border-bottom-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
form button {
  border: 0; border-radius: 0; cursor: pointer; width: 100%;
  background: var(--accent-btn); color: #fff; padding: 21px 32px;
  font-family: var(--mono); font-size: var(--label); font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; margin-top: 8px;
}
form button:hover { background: var(--accent); }
.form-note { margin: 0; font-size: var(--label); color: var(--dim); }

/* ---------- footer ---------- */

footer { border-bottom: 0; }
.foot-cols {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 80px; padding-top: 90px; flex-wrap: wrap;
}
.foot-cols > div { display: flex; flex-direction: column; gap: 18px; }
.foot-cols a, .foot-cols p { color: var(--muted); margin: 0; }
.foot-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding-top: 44px; padding-bottom: 30px; flex-wrap: wrap;
  font-family: var(--mono); font-size: var(--label); font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: #4A5058;
}
.wordmark {
  overflow: hidden; display: flex; justify-content: center;
  height: clamp(58px, 12.4vw, 182px);
}
.wordmark-svg {
  width: 100%; height: auto; display: block;
  fill: none; stroke: #59626F; stroke-width: 4; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* short windows, so the hero still fits above the marquee */
@media (max-height: 920px) {
  .hero .shell { padding-top: 38px; padding-bottom: 52px; gap: 32px; }
  .hero-foot { margin-top: 28px; }
}
@media (max-height: 780px) {
  :root { --h1: clamp(40px, 5.4vw, 78px); }
  .hero .shell { padding-top: 26px; padding-bottom: 40px; gap: 26px; }
  .hero-foot { margin-top: 20px; }
}
@media (max-height: 660px) {
  :root { --h1: clamp(34px, 4.6vw, 62px); }
  .hero .shell { padding-top: 12px; padding-bottom: 26px; gap: 18px; }
  .hero-foot { margin-top: 12px; }
}

/* ---------- tablet ---------- */

@media (max-width: 1024px) {
  :root { --section: 100px; --gutter: 32px; }
  .manifesto .shell { gap: 100px; }
  .split { gap: 48px; }
  .split img { width: 42vw; height: 27vw; }
  .contact .shell { gap: 60px; }
  .contact-left { width: 44%; }
  .cap-head p { text-align: left; }
}

/* ---------- phone ---------- */

@media (max-width: 760px) {
  :root { --section: 72px; --gutter: 24px; --body: 18px; --label: 15px; }

  .nav { gap: 20px; }
  .nav a:not(.btn) { display: none; }
  .site-header img { height: 36px; }
  :root { --header: 100px; --marquee: 63px; }
  section[id], #top { scroll-margin-top: 78px; }
  .nav .btn { white-space: nowrap; padding: 11px 14px; letter-spacing: 0.10em; font-size: 14px; }

  .hero .shell { padding-top: 72px; padding-bottom: 60px; gap: 28px; }
  h1 { max-width: none; }
  .hero-foot { flex-direction: column; align-items: flex-start; gap: 32px; margin-top: 24px; }
  .hero-foot p { max-width: none; }
  .hero-cta { width: 100%; }
  .btn--solid { width: 100%; text-align: center; }
  .scroll { display: none; }

  .marquee { padding: 18px 0; }
  .marquee .sep { padding: 0 24px; }

  .manifesto .shell { gap: 72px; }
  .split { flex-direction: column; align-items: stretch; gap: 28px; }
  .split img { width: 100%; height: 56vw; }
  .split--right .block { align-items: flex-start; text-align: left; }
  .split--right { flex-direction: column-reverse; }
  .block h2, .block p { max-width: none; }
  .numeral { -webkit-text-stroke-width: 1.5px; }

  .cap-head { flex-direction: column; gap: 24px; margin-bottom: 40px; }
  .cap-head p { max-width: none; }
  .grid { grid-template-columns: 1fr; }
  .cell { padding: 32px 24px; }
  .cell:nth-child(odd) { border-right: 0; }
  .cell:nth-last-child(-n+2) { border-bottom: 1px solid var(--hairline); }
  .cell:last-child { border-bottom: 0; }

  .contact .shell { flex-direction: column; gap: 48px; }
  .contact-left { width: 100%; }
  .row { flex-direction: column; gap: 34px; }

  .foot-cols { flex-direction: column; gap: 40px; padding-top: 56px; }
  .foot-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
}
