/* Sentury Systems — site styles. Dark only, by design. */

/* Self-hosted fonts (SIL Open Font License, see assets/fonts). Latin subset, no third-party requests. */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("../fonts/Barlow-Regular.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap; src: url("../fonts/BarlowSemiCondensed-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 700; font-display: swap; src: url("../fonts/BarlowSemiCondensed-Bold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("../fonts/IBMPlexMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("../fonts/IBMPlexMono-Medium.woff2") format("woff2"); }

:root {
  --ink: #0B0D10;
  --ink-2: #111419;
  --ink-3: #171B21;
  --paper: #F4F3EF;
  --text: rgba(244, 243, 239, 0.78);
  --muted: #8D929B;
  --line: rgba(244, 243, 239, 0.12);
  --line-strong: rgba(244, 243, 239, 0.24);
  --accent: #FF5F1F;
  --amber: #E8B23D;

  --display: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --gutter: 24px;
  --header-h: 68px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Faint engineering grid behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
}

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

h1, h2, h3 {
  font-family: var(--display);
  color: var(--paper);
  margin: 0;
  font-weight: 600;
  line-height: 1.05;
}

p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }

.eyebrow, .code, .status, .tags, .num, .sectors span, .hero-index span, .role, .fine {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow { color: var(--muted); margin: 0 0 18px; }
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  background: var(--accent);
  vertical-align: 1px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--paper);
  color: var(--ink);
  padding: 10px 14px;
}
.skip:focus { top: 12px; }

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 22px;
  background: var(--accent);
  color: var(--ink);
  border: 1px solid var(--accent);
  font: 500 13px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn::after { content: "→"; font-size: 15px; letter-spacing: 0; }
.btn:hover { background: var(--paper); border-color: var(--paper); }
.btn-ghost { background: transparent; color: var(--paper); border-color: var(--line-strong); }
.btn-ghost:hover { background: transparent; border-color: var(--paper); }
.btn-small { padding: 11px 16px; font-size: 12px; }
.btn-small::after { display: none; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(11, 13, 16, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand img { height: 36px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a:not(.btn) {
  font: 500 13px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.site-nav a:not(.btn):hover { color: var(--paper); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  position: relative;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 2px;
  background: var(--paper);
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle-bars { top: 21px; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px 0 40px;
  border-bottom: 1px solid var(--line);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: 48px;
}
.hero h1 {
  font-size: clamp(64px, 10vw, 152px);
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin-bottom: 32px;
}
.lede { font-size: 20px; line-height: 1.55; max-width: 34em; color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* Rotating reticle with the mark at its center (decoration only) */
.reticle {
  position: relative;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1;
  justify-self: center;
}
.reticle svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.reticle circle, .reticle path { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.reticle .ticks { stroke: var(--line); stroke-width: 10; stroke-dasharray: 1 16.1; }
.sweep {
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(255, 95, 31, 0.22) 46deg, transparent 47deg);
  animation: spin 9s linear infinite;
}
.reticle-mark { position: absolute; width: 30%; left: 35%; top: 35%; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Wraps to any number of items: every cell draws its own top and left line, and the list clips
   the left line of whichever cell starts a row. */
.hero-index {
  list-style: none;
  margin: 64px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  overflow: hidden;
}
.hero-index li {
  flex: 1 1 140px;
  margin-left: -1px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.hero-index a {
  display: block;
  padding: 18px 16px 4px;
  font: 600 18px/1.2 var(--display);
  color: var(--paper);
  text-decoration: none;
  transition: color 0.2s;
}
.hero-index a:hover { color: var(--accent); }
.hero-index span { display: block; color: var(--muted); margin-bottom: 6px; font-weight: 400; }

/* ---------- Sections ---------- */

.section { padding: 120px 0; border-bottom: 1px solid var(--line); }
.section-alt { background: rgba(17, 20, 25, 0.72); }
.section-head { margin-bottom: 56px; }
.section-head h2 {
  font-size: clamp(40px, 5.5vw, 72px);
  text-transform: uppercase;
  letter-spacing: 0.005em;
}
.section-head .lede { margin-top: 20px; }

.split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 64px; align-items: start; }
.split .section-head { position: sticky; top: calc(var(--header-h) + 40px); }

.grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Panels get corner brackets on hover, echoing the logo frame */
.panel {
  position: relative;
  background: var(--ink);
  padding: 36px 32px 32px;
}
.panel::before, .panel::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 0 solid var(--accent);
  opacity: 0;
  transition: opacity 0.25s;
}
.panel::before { top: 10px; left: 10px; border-top-width: 2px; border-left-width: 2px; }
.panel::after { bottom: 10px; right: 10px; border-bottom-width: 2px; border-right-width: 2px; }
.panel:hover::before, .panel:hover::after { opacity: 1; }

.panel h3 { font-size: 26px; margin-bottom: 14px; }
.code { color: var(--accent); margin-bottom: 22px; }

/* A card that closes an odd-numbered grid spans the full row; its list runs in two columns. */
.panel-wide { grid-column: 1 / -1; }
.panel-wide .ticks-list { columns: 2; column-gap: 40px; }
.panel-wide .ticks-list li { break-inside: avoid; }

.ticks-list { list-style: none; margin: 22px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); }
.ticks-list li { position: relative; padding-left: 20px; margin-bottom: 9px; font-size: 15px; line-height: 1.5; }
.ticks-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border: 1px solid var(--accent);
}

/* Principles */
.principles { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.principles li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}
.principles .num { color: var(--accent); padding-top: 9px; }
.principles h3 { font-size: clamp(28px, 3.2vw, 40px); margin-bottom: 8px; }
.principles p { margin: 0; font-size: 18px; }

/* Selected work */
.work { display: flex; flex-direction: column; padding: 40px 36px 32px; }
.work h3 { font-size: 30px; }
.work .tags { margin: auto 0 0; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.8; }
.work > p:not(.status):not(.tags) { margin-bottom: 28px; }

.status { display: inline-flex; align-items: center; gap: 10px; color: var(--paper); margin-bottom: 22px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.status-fielded::before, .status-delivered::before { background: var(--paper); }
.status-prototype::before { background: var(--amber); }
.status-rd::before { border: 1.5px solid var(--accent); }

/* Sectors */
.sectors {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
}
.sectors li {
  padding: 28px 22px 32px;
  font: 600 22px/1.2 var(--display);
  color: var(--paper);
}
.sectors li + li { border-left: 1px solid var(--line); }
.sectors span { display: block; color: var(--muted); font-weight: 400; margin-bottom: 26px; }

/* Founder */
.founder {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  border: 1px solid var(--line);
  padding: 48px;
}
.founder-mark { padding: 20px; border: 1px solid var(--line); }
.founder-mark img { width: 100%; height: auto; }
.founder h3 { font-size: 36px; }
.role { color: var(--accent); margin: 10px 0 22px; }
.founder-copy p:last-child { font-size: 19px; max-width: 40em; margin: 0; }

/* Contact form */
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-wide { grid-column: 1 / -1; }
.field label {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 14px 14px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  font: 400 16px/1.4 var(--body);
  transition: border-color 0.2s;
}
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field .invalid { border-color: var(--accent); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.form-status { margin: 0; font-size: 15px; color: var(--muted); }

/* 404 page */
.notfound { font-size: clamp(48px, 8vw, 104px); font-weight: 700; text-transform: uppercase; margin-bottom: 24px; }

/* Footer */
.site-footer { padding: 40px 0 48px; }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-row img { height: 32px; width: auto; }
.footer-row nav { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-row nav a { font: 500 12px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.footer-row nav a:hover { color: var(--paper); }
.fine { color: var(--muted); margin: 0; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a[href^="mailto:"] { text-transform: none; letter-spacing: 0.04em; }
.footer-links a:hover { color: var(--paper); }

/* Reveal on scroll (only when JavaScript is running) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sectors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sectors li + li { border-left: 0; }
  .sectors li { border-bottom: 1px solid var(--line); }
  .sectors li:nth-child(even) { border-left: 1px solid var(--line); }
}

@media (max-width: 900px) {
  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 24px;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a:not(.btn) { padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
  .site-nav .btn { margin-top: 20px; justify-content: center; }
  .nav-toggle { display: block; }

  .hero-grid { grid-template-columns: 1fr; }
  .reticle { max-width: 320px; order: -1; justify-self: start; }
  .split { grid-template-columns: 1fr; gap: 0; }
  .split .section-head { position: static; }
  .grid-2 { grid-template-columns: 1fr; }
  .founder { grid-template-columns: 1fr; padding: 32px; gap: 32px; }
  .founder-mark { max-width: 200px; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; --header-h: 60px; }
  body { font-size: 16px; }
  .brand img { height: 30px; }
  .hero { min-height: 0; padding: 40px 0 32px; }
  .reticle { max-width: 200px; }
  .lede { font-size: 18px; }
  .actions .btn { flex: 1 1 100%; justify-content: center; }
  .hero-index { margin-top: 40px; }
  .hero-index li { flex-basis: 40%; }
  .panel-wide .ticks-list { columns: 1; }
  .section { padding: 80px 0; }
  .section-head { margin-bottom: 36px; }
  .grid-3 { grid-template-columns: 1fr; }
  .panel, .work { padding: 28px 22px; }
  .sectors { grid-template-columns: 1fr; }
  .sectors li:nth-child(even) { border-left: 0; }
  .founder { padding: 22px; }
  .contact-form { grid-template-columns: 1fr; }
  .contact-form .btn { flex: 1 1 100%; justify-content: center; }
}

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