/* Evander Labs — corporate site
   One typeface for prose (Inter), one for metadata (IBM Plex Mono).
   Two themes, both first-class. Dark is the default. */

@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("assets/fonts/plex-mono-1.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("assets/fonts/plex-mono-2.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --bg: #08090a;
  --bg-raised: #0e1012;
  --bg-sunken: #050506;
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e9e7e4;
  --text-dim: #a2a6ab;
  --text-faint: #71767c;
  --brass: #c8a46a;
  --brass-dim: rgba(200, 164, 106, 0.5);
  --live: #7fb894;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --shell: 74rem;
  --section-y: clamp(4.5rem, 11vw, 9rem);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #fbfaf8;
  --bg-raised: #ffffff;
  --bg-sunken: #f2f0ec;
  --line: rgba(16, 18, 22, 0.11);
  --line-strong: rgba(16, 18, 22, 0.22);
  --text: #14161a;
  --text-dim: #4d5359;
  --text-faint: #6c7278;
  --brass: #8a672a;
  --brass-dim: rgba(138, 103, 42, 0.45);
  --live: #3f7a58;
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #fbfaf8;
    --bg-raised: #ffffff;
    --bg-sunken: #f2f0ec;
    --line: rgba(16, 18, 22, 0.11);
    --line-strong: rgba(16, 18, 22, 0.22);
    --text: #14161a;
    --text-dim: #4d5359;
    --text-faint: #6c7278;
    --brass: #8a672a;
    --brass-dim: rgba(138, 103, 42, 0.45);
    --live: #3f7a58;
    color-scheme: light;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

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

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--bg-raised);
  color: var(--text);
  padding: 0.75rem 1rem;
  z-index: 100;
}
.skip:focus { left: 0; }

/* ---------- type ---------- */

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.12;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 6.2vw, 4.1rem); letter-spacing: -0.032em; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); letter-spacing: -0.028em; }
h3 { font-size: 1.0625rem; letter-spacing: -0.012em; line-height: 1.35; }

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

.lede {
  font-size: clamp(1.0625rem, 1.9vw, 1.25rem);
  line-height: 1.55;
  color: var(--text-dim);
  max-width: var(--measure);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 1.15rem;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 1.5rem;
  height: 1px;
  background: var(--brass-dim);
  vertical-align: 0.28em;
  margin-right: 0.7rem;
}

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

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.masthead[data-scrolled="true"] { border-bottom-color: var(--line); }

.masthead .shell {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 4.25rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.015em;
  text-decoration: none;
  margin-right: auto;
  white-space: nowrap;
}

.wordmark .mark { color: var(--brass); flex: none; }
.wordmark .sub { color: var(--text-faint); font-weight: 400; }

.nav { display: flex; gap: 1.9rem; }

.nav a {
  font-size: 0.875rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s ease;
}
.nav a:hover { color: var(--text); }

@media (max-width: 47.99em) { .nav { display: none; } }

.theme-toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.125rem;
  height: 2.125rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--line-strong); }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="dark"]) .theme-toggle .moon { display: none; }
}

/* ---------- sections ---------- */

section { padding-block: var(--section-y); }
section + section { border-top: 1px solid var(--line); }

.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head p { color: var(--text-dim); max-width: var(--measure); margin-top: 1.15rem; }

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

.hero { padding-top: clamp(3.5rem, 9vw, 7rem); padding-bottom: 0; }

.hero h1 { max-width: 17ch; }

.hero .lede { margin-top: 1.75rem; max-width: 38rem; }

.hero-meta {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2.25rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 0.55rem; }
.hero-meta span::before {
  content: "";
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--brass);
}

.hero-figure {
  margin: clamp(3rem, 7vw, 5.5rem) 0 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
  background: var(--bg-sunken);
}
.hero-figure img { width: 100%; aspect-ratio: 2.4 / 1; object-fit: cover; }

/* ---------- principles ---------- */

.principles {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

.principle {
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line);
  padding: clamp(1.75rem, 3.5vw, 2.5rem) clamp(1.5rem, 3vw, 2.25rem);
}
.principle .num {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--brass);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 1.4rem;
}
.principle h3 { margin-bottom: 0.7rem; }
.principle p { color: var(--text-dim); font-size: 0.9375rem; }

/* ---------- portfolio ---------- */

.group + .group { margin-top: clamp(3rem, 6vw, 5rem); }

.group-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 1.75rem;
}
.group-head h3 {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text);
}
.group-head .count {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--text-faint);
  margin-left: auto;
}

/* Hairlines come from each cell's own ring rather than a background showing
   through the gaps — otherwise a group with an odd product count leaves the
   empty grid cell filled with the line colour. */
.products {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
}

.product {
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line);
  padding: 1.6rem 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  transition: background 0.18s ease;
}
.product:hover { background: var(--bg-raised); }

.product-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}
.product h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.product p {
  color: var(--text-dim);
  font-size: 0.9375rem;
  line-height: 1.55;
}
.product .note {
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

.status {
  margin-left: auto;
  flex: none;
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--text-faint);
  white-space: nowrap;
}
.status[data-state="live"] { color: var(--live); border-color: color-mix(in srgb, var(--live) 45%, transparent); }
.status[data-state="dev"] { color: var(--brass); border-color: var(--brass-dim); }

.figure-strip {
  margin-top: clamp(2rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-sunken);
}
.figure-strip img { width: 100%; aspect-ratio: 3 / 1; object-fit: cover; }
.figure-strip figcaption {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--text-faint);
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
  letter-spacing: 0.03em;
}

/* ---------- pipeline ---------- */

.pipeline { display: grid; gap: 1px; background: var(--line); border-block: 1px solid var(--line); }

.stage {
  background: var(--bg);
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: clamp(1rem, 4vw, 3rem);
  padding: clamp(1.6rem, 3vw, 2.2rem) 0;
}
@media (max-width: 47.99em) {
  .stage { grid-template-columns: 1fr; gap: 0.9rem; }
}

.stage .when {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass);
  padding-top: 0.2rem;
}
.stage h3 { margin-bottom: 0.55rem; }
.stage p { color: var(--text-dim); font-size: 0.9375rem; max-width: var(--measure); }

/* ---------- practices ---------- */

.practices {
  display: grid;
  gap: clamp(1.75rem, 4vw, 2.75rem) clamp(2rem, 5vw, 4rem);
  grid-template-columns: 1fr;
}
@media (min-width: 34rem) {
  .practices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.practice { border-top: 1px solid var(--line-strong); padding-top: 1.35rem; }
.practice h3 { margin-bottom: 0.6rem; }
.practice p { color: var(--text-dim); font-size: 0.9375rem; }
.practice code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--text);
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.05em 0.35em;
}

.split {
  display: grid;
  gap: clamp(2.5rem, 6vw, 5rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: start;
}
@media (max-width: 61.99em) { .split { grid-template-columns: 1fr; } }

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

.clarity {
  max-width: 46rem;
  margin: clamp(1.5rem, 4vw, 2.5rem) 0 0;
  padding: 1.1rem 1.35rem;
  border: 1px solid var(--line);
  border-left: 2px solid var(--brass);
  border-radius: 4px;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-dim);
  background: var(--bg-sunken);
}
.clarity strong { color: var(--text); font-weight: 600; }

.contact-layout {
  display: grid;
  gap: clamp(2.25rem, 5vw, 4.5rem);
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 55.99em) { .contact-layout { grid-template-columns: 1fr; } }

.field { margin-bottom: 1.35rem; }

.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.55rem;
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.7rem 0.8rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.field textarea { resize: vertical; min-height: 8rem; line-height: 1.55; }

.field input:hover,
.field textarea:hover { border-color: var(--line-strong); }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brass);
  background: var(--bg-raised);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: #c96a6a; }

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.25rem;
  margin-top: 1.6rem;
}

.submit {
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--bg);
  background: var(--text);
  border: 1px solid var(--text);
  border-radius: 4px;
  padding: 0.62rem 1.4rem;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.submit:hover { opacity: 0.86; }
.submit[disabled] { opacity: 0.45; cursor: default; }

.form-status { font-size: 0.875rem; color: var(--text-dim); margin: 0; }
.form-status[data-state="ok"] { color: var(--live); }
.form-status[data-state="error"] { color: #d08585; }

.contact-aside { display: grid; gap: 2rem; }
.contact-item h3 {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.75rem;
}
.contact-item a {
  font-size: 1.0625rem;
  text-decoration: none;
  border-bottom: 1px solid var(--brass-dim);
  padding-bottom: 1px;
  transition: border-color 0.15s ease;
}
.contact-item a:hover { border-bottom-color: var(--brass); }
.contact-item p { color: var(--text-dim); font-size: 0.9375rem; }

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

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
  background: var(--bg-sunken);
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  align-items: baseline;
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}
.footer-top .wordmark { margin-right: auto; }
.footer-top nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.footer-top nav a { font-size: 0.875rem; color: var(--text-dim); text-decoration: none; }
.footer-top nav a:hover { color: var(--text); }

.disclaimer {
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--text-faint);
  max-width: 52rem;
}
.disclaimer strong { color: var(--text-dim); font-weight: 500; }

.colophon {
  margin-top: 1.75rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--text-faint);
  letter-spacing: 0.03em;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

html { scroll-behavior: smooth; }
:where(section[id]) { scroll-margin-top: 5.5rem; }
