/* =========================================================
   sigterm.co — design system
   reflow & gerbers. unapologetic explorations.
   ========================================================= */

/* ---------- 1. tokens --------------------------------------------------- */
:root {
  /* palette — gunmetal, steel, scope traces */
  --ink:          #0B0D10;   /* near-black gunmetal, page bg */
  --ink-2:        #0F1318;   /* slightly raised */
  --panel:        #14181D;   /* primary surface */
  --panel-2:      #1A1F26;   /* raised surface */
  --etch:         #262C34;   /* hairline border (PCB silkscreen) */
  --etch-bright:  #3A4250;
  --steel:        #6E7783;   /* secondary text */
  --steel-2:      #8A93A0;   /* tertiary text */
  --bone:         #B7BEC8;   /* primary text on dark */
  --bone-bright:  #D8DDE5;
  --sinter:       #C9C2B5;   /* powder metallurgy, warm grey */
  --anodise:      #2B6CB0;   /* anodised blue, structural accent */
  --scope-blue:   #38E5FF;   /* electric/scope trace, primary accent */
  --scope-orange: #FF7A1A;   /* scope trace orange, hot accent */
  --scope-red:    #E63946;   /* scope trace red, used sparingly */

  /* type */
  --font-sans:    'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* rhythm */
  --r-1: 2px;
  --r-2: 4px;
  --r-3: 8px;

  /* hero rhythm — gentle, deliberate spacing for landing/intro blocks */
  --hero-pad-top:     clamp(20px, 3vw, 36px);
  --hero-pad-bot:     clamp(56px, 9vw, 120px);
  --hero-gap-eyebrow: clamp(20px, 2.2vw, 28px);
  --hero-gap-title:   clamp(16px, 1.6vw, 22px);
  --hero-gap-lede:    clamp(28px, 3vw, 40px);
  --cta-gap:          24px;

  /* layout */
  --max:          1240px;
  --gutter:       clamp(20px, 4vw, 56px);
  --col-gap:      clamp(16px, 2.4vw, 28px);
  --row-gap:      clamp(48px, 7vw, 112px);

  /* motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- 2. reset & base -------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0.005em;
  /* faint grid background, like a PCB / scope graticule */
  background-image:
    linear-gradient(to right,  rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.018) 1px, transparent 1px),
    radial-gradient(1200px 600px at 10% -10%, rgba(56,229,255,0.04), transparent 60%),
    radial-gradient(900px  500px at 110% 0%,  rgba(255,122,26,0.03), transparent 60%);
  background-size: 48px 48px, 48px 48px, auto, auto;
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--etch); margin: 0; }

::selection { background: var(--scope-blue); color: var(--ink); }

/* ---------- 3. type system -------------------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--steel);
}

/* status dot — used inside eyebrow lines and similar markers */
.dot           { color: var(--scope-orange); }
.dot--accent   { color: var(--scope-blue); }
.dot--alarm    { color: var(--scope-red); }

/* inline accent text helpers — palette colours applied as text colour */
.accent { color: var(--scope-blue); }
.hot    { color: var(--scope-orange); }
.alarm  { color: var(--scope-red); }
.bright { color: var(--bone-bright); }

/* heading width measures — keep big display type readable */
.h-narrow { max-width: 18ch; }
.h-comfy  { max-width: 22ch; }
.h-wide   { max-width: 26ch; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--bone-bright);
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
}

h1 {
  font-size: clamp(40px, 6vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.08;
}

h3 {
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.15;
}

h4 {
  font-size: 16px;
  line-height: 1.25;
}

p { margin: 0 0 1em; max-width: 62ch; color: var(--bone); }
.lead { font-size: 18px; color: var(--bone-bright); }

.mono { font-family: var(--font-mono); }

/* a small terminal-style label, used for technical callouts */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--steel-2);
  padding: 5px 9px;
  border: 1px solid var(--etch);
  border-radius: var(--r-1);
  background: var(--ink-2);
}
.tag.is-accent { color: var(--scope-blue); border-color: rgba(56,229,255,0.25); }
.tag.is-hot    { color: var(--scope-orange); border-color: rgba(255,122,26,0.3); }

/* ---------- 4. layout primitives -------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--row-gap);
  position: relative;
}

.section + .section {
  border-top: 1px solid var(--etch);
}

.grid {
  display: grid;
  gap: var(--col-gap);
}

/* a fiducial marker — like PCB alignment crosshair, used as decoration */
.fiducial {
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--etch-bright);
  border-radius: 50%;
}
.fiducial::before,
.fiducial::after {
  content: ''; position: absolute; background: var(--etch-bright);
}
.fiducial::before { left: 50%; top: -6px;  width: 1px; height: 26px; transform: translateX(-50%); }
.fiducial::after  { top: 50%;  left: -6px; width: 26px; height: 1px; transform: translateY(-50%); }

/* ---------- 5. site frame: header + footer ---------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11,13,16,0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--etch);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--bone-bright);
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.02em;
}
.brand__mark {
  width: 18px; height: 18px;
  position: relative;
}
.brand__mark::before {
  content: ''; position: absolute; inset: 0;
  background: var(--bone-bright);
  /* notched corner — feels like silkscreen pin-1 marker */
  clip-path: polygon(0 0, 100% 0, 100% 65%, 65% 100%, 0 100%);
}
.brand__mark::after {
  content: ''; position: absolute; right: -4px; bottom: -4px;
  width: 6px; height: 6px; background: var(--scope-orange);
  border-radius: 50%;
}
.brand__suffix {
  color: var(--steel);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
}

.nav {
  display: flex;
  gap: clamp(14px, 2vw, 28px);
  align-items: center;
}
.nav a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--steel-2);
  padding: 6px 0;
  position: relative;
  transition: color .25s var(--ease);
}
.nav a:hover { color: var(--bone-bright); }
.nav a[aria-current="page"] { color: var(--bone-bright); }
.nav a[aria-current="page"]::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 1px; background: var(--scope-orange);
}

.site-footer {
  border-top: 1px solid var(--etch);
  padding-block: 48px 28px;
  color: var(--steel);
  font-size: 13px;
}
.site-footer__row {
  display: flex; flex-wrap: wrap; gap: 24px; align-items: baseline; justify-content: space-between;
}
.site-footer .lab-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--steel);
  border-bottom: 1px dashed var(--etch-bright);
  padding-bottom: 1px;
}
.site-footer .lab-link:hover { color: var(--scope-blue); border-color: var(--scope-blue); }
.site-footer__legal { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; }

/* ---------- 6. buttons / CTAs ----------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border: 1px solid var(--etch-bright);
  background: var(--panel);
  color: var(--bone-bright);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-radius: var(--r-1);
  transition: border-color .25s var(--ease), color .25s var(--ease), background .25s var(--ease), transform .25s var(--ease);
}
.btn:hover {
  border-color: var(--scope-orange);
  color: var(--scope-orange);
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  border-color: var(--scope-blue);
  color: var(--scope-blue);
  background: linear-gradient(180deg, rgba(56,229,255,0.06), rgba(56,229,255,0.02));
}
.btn--primary:hover {
  background: rgba(56,229,255,0.12);
  color: var(--bone-bright);
  border-color: var(--scope-blue);
}
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--steel-2);
  padding-inline: 0;
}
.btn--ghost:hover { color: var(--bone-bright); border-color: transparent; }

/* ---------- 7. hero & home -------------------------------------------- */
/* the `.hero` block is the universal page-intro — used on every top-level
   page. its job is to set a calm, deliberate rhythm between the eyebrow,
   the headline, the lede, and any CTA row beneath. spacing tokens live
   in :root so the rhythm can be tuned in one place.

   structure (typical):
     <section class="hero">
       <div class="container">
         <p class="eyebrow">…</p>
         <h1 class="h-narrow">…</h1>
         <p class="lead">…</p>
         <div class="cta-row">…</div>
       </div>
     </section>
*/
.hero {
  padding-block: var(--hero-pad-top) var(--hero-pad-bot);
  position: relative;
  overflow: hidden;
}

/* tighter bottom padding — for pages where the next section is a dense
   content block (e.g. a card grid) and the usual breath feels too wide. */
.hero--tight { padding-bottom: var(--hero-pad-top); }

/* spacing rhythm inside the hero — gentle gaps between the four lines */
.hero .eyebrow  { display: block; margin: 0 0 var(--hero-gap-eyebrow); }
.hero h1        { margin: 0 0 var(--hero-gap-title); }
.hero .lead,
.hero__sub      {
  max-width: 64ch;
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--bone);
  margin: 0 0 var(--hero-gap-lede);
}

.hero h1 .strike {
  position: relative;
  white-space: nowrap;
}
.hero h1 .strike::after {
  content: ''; position: absolute; left: -2%; right: -2%; top: 53%;
  height: 2px; background: var(--scope-orange); opacity: 0.85;
}

.hero__meta {
  margin-top: clamp(40px, 5vw, 72px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  border-top: 1px solid var(--etch);
  padding-top: 20px;
}
.hero__meta dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--steel); margin-bottom: 6px; }
.hero__meta dd { margin: 0; color: var(--bone-bright); font-family: var(--font-display); font-size: 17px; }

/* a `.section` directly after a `.hero` should sit flush — the hero's
   bottom padding already carries the breath. */
.hero + .section { padding-top: 0; }

/* a scope-trace decorative SVG that floats behind the hero */
.scope-trace {
  position: absolute;
  inset: auto -10% 8% -10%;
  height: 220px;
  pointer-events: none;
  opacity: 0.55;
  z-index: 0;
}
.scope-trace path { stroke: var(--scope-blue); fill: none; stroke-width: 1.4; }
.scope-trace path.warm { stroke: var(--scope-orange); opacity: 0.5; }

.hero > .container { position: relative; z-index: 1; }

/* a row of CTA buttons — used wherever buttons sit beneath running text.
   default sits with a comfortable break from the preceding paragraph; in
   a hero, the lede's margin-bottom already carries that gap, so the
   top margin is suppressed there. */
.cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: var(--cta-gap);
}
.cta-row.is-centered { justify-content: center; }
.hero .cta-row       { margin-top: 0; }

/* a centred CTA block — heading + buttons, both centred. used for
   end-of-page calls to action like the about page footer. */
.cta-block { text-align: center; }
.cta-block > h2     { max-width: 26ch; margin-inline: auto; }
.cta-block .cta-row { justify-content: center; }

/* feature row on home */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.feature--media-first { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
@media (max-width: 860px) {
  .feature,
  .feature--media-first { grid-template-columns: 1fr; }
}

/* a tiles grid — used for the disciplines block on /about and similar
   evenly-distributed cards. each tile uses the .tile pattern below. */
.grid--tiles { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.tile {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}
.tile > h3,
.tile > p { margin: 0; }

.feature__visual {
  border: 1px solid var(--etch);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border-radius: var(--r-2);
  padding: clamp(20px, 3vw, 40px);
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid; place-items: center;
}
.feature__visual::before,
.feature__visual::after {
  content: ''; position: absolute; width: 8px; height: 8px;
  border: 1px solid var(--etch-bright);
}
.feature__visual::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.feature__visual::after  { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }

/* ---------- 8. family grid ------------------------------------------- */
.family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--col-gap);
}
.family-grid__error {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--steel);
  padding: 24px 0;
}

.phone-card {
  position: relative;
  border: 1px solid var(--etch);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border-radius: var(--r-2);
  padding: 18px 18px 22px;
  display: flex; flex-direction: column;
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.phone-card:hover { border-color: var(--etch-bright); transform: translateY(-2px); }
.phone-card.is-empty { opacity: 0.65; }
.phone-card.is-empty:hover { transform: none; }

.phone-card__index {
  position: absolute; top: 12px; right: 14px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em; color: var(--steel);
}

.phone-card__photo {
  aspect-ratio: 4 / 3;
  background: var(--ink-2);
  border: 1px solid var(--etch);
  border-radius: var(--r-1);
  margin-bottom: 16px;
  display: grid; place-items: center;
  overflow: hidden;
  position: relative;
}
.phone-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.phone-card__photo svg { width: 56%; height: 56%; opacity: 0.7; }

.phone-card__name {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--bone-bright);
  margin: 0 0 4px;
}
.phone-card__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--scope-blue);
  margin-bottom: 12px;
}
.phone-card.is-empty .phone-card__meta { color: var(--steel); }
.phone-card__bio {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--bone);
  margin: 0;
}
.phone-card__joined {
  margin-top: auto;
  padding-top: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--steel);
  border-top: 1px dashed var(--etch);
  margin-top: 18px;
}

/* ---------- 9. module page ------------------------------------------- */
.module-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
@media (max-width: 920px) { .module-hero { grid-template-columns: 1fr; } }

.module-spec-list {
  list-style: none; padding: 0; margin: 24px 0 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--etch);
}
.module-spec-list li {
  border-bottom: 1px solid var(--etch);
  padding: 12px 0;
  display: flex; align-items: baseline; gap: 12px;
}
.module-spec-list li:nth-child(odd) { padding-right: 16px; border-right: 1px solid var(--etch); }
.module-spec-list li:nth-child(even){ padding-left: 16px; }
.module-spec-list dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--steel);
  min-width: 96px;
}
.module-spec-list dd { margin: 0; color: var(--bone-bright); font-family: var(--font-display); font-size: 16px; }

/* video grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--col-gap);
  margin-top: 32px;
}
.video-card {
  border: 1px solid var(--etch);
  background: var(--panel);
  border-radius: var(--r-2);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.video-card__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ink-2);
}
.video-card__frame iframe,
.video-card__frame .placeholder {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.video-card__frame .placeholder {
  display: grid; place-items: center;
  color: var(--steel);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  background:
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(255,255,255,0.02) 12px 13px),
    var(--ink-2);
}
.video-card__caption { padding: 14px 16px 16px; }
.video-card__caption h4 { color: var(--bone-bright); margin-bottom: 4px; }
.video-card__caption p { margin: 0; color: var(--steel-2); font-size: 13.5px; }

/* ---------- 10. about / studio / contact ----------------------------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.statement {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.3;
  color: var(--bone-bright);
  letter-spacing: -0.005em;
  max-width: 26ch;
}

.studio-card {
  border: 1px solid var(--etch);
  background: var(--panel);
  border-radius: var(--r-2);
  padding: 28px;
  position: relative;
}
.studio-card__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--scope-orange);
  margin-bottom: 12px;
}
.studio-card h3      { margin-bottom: 8px; }
.studio-card .split  { margin-top: 12px; }

/* contact / transmit */
.transmit {
  border: 1px solid var(--etch);
  border-radius: var(--r-2);
  background:
    radial-gradient(600px 280px at 90% -20%, rgba(56,229,255,0.06), transparent 70%),
    var(--panel);
  padding: clamp(28px, 4vw, 56px);
}
.transmit h2     { max-width: 22ch; }
.transmit__cmd {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--steel-2);
  margin-bottom: 18px;
}
.transmit__cmd .prompt { color: var(--scope-orange); margin-right: 8px; }
.transmit__cmd .caret {
  display: inline-block; width: 8px; height: 14px;
  background: var(--scope-blue); vertical-align: -2px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- 11. lab / hidden ----------------------------------------- */
.lab-shell {
  font-family: var(--font-mono);
  color: var(--bone);
  background: var(--ink-2);
  border: 1px solid var(--etch);
  border-radius: var(--r-2);
  padding: clamp(20px, 3vw, 36px);
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.lab-shell .ok    { color: var(--scope-blue); }
.lab-shell .warn  { color: var(--scope-orange); }
.lab-shell .err   { color: var(--scope-red); }
.lab-shell .muted { color: var(--steel); }

/* ---------- 12. utilities -------------------------------------------- */
.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 24px; }
.center { text-align: center; }
.muted  { color: var(--steel-2); }
.hide-on-narrow { display: initial; }
@media (max-width: 640px) { .hide-on-narrow { display: none; } }

/* reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
}
