/* ==========================================================================
   Edvanta Labs — brutalist throughout: grey / white / black, one flat
   purple accent. Hard edges (radius 0 everywhere), thick black rules
   instead of soft shadows, monospace for labels and numbers.

   1. Tokens  2. Reset  3. Type  4. Links & buttons  5. Header  6. Hero
   7. Sections  8. Rail  9. Grids  10. Contact  11. Footer  12. Reveal
   13. Responsive
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --bg: #ffffff;
  --bg-soft: #f0f0ee;
  --ink: #111111;
  --body: #2b2b2a;
  --muted: rgba(17, 17, 17, .64);
  --faint: rgba(17, 17, 17, .42);

  --accent: #6940a5;
  --accent-soft: #e8deee;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --hair: .0625rem;
  --rule: .0625rem;
  --rule-lg: .125rem;

  --shell: 66rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section-y: clamp(3.5rem, 8vw, 6rem);
  --head: 4rem;
}

/* 2. Reset ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; border-radius: 0; }

html { font-size: 100%; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Header is fixed and out of flow — push everything below it down by its
   own height so nothing loads underneath it. */
main { padding-top: var(--head); }

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--accent-soft); color: var(--ink); }

:focus-visible {
  outline: .125rem solid var(--accent);
  outline-offset: .25rem;
}

.sr-only {
  position: absolute;
  width: var(--hair); height: var(--hair);
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: .5rem; left: .5rem;
  z-index: 20;
  padding: .5rem .875rem;
  background: var(--ink);
  color: var(--bg);
  font-size: .875rem;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

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

/* 3. Type ------------------------------------------------------------------ */
h1 {
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.03em;
  color: var(--ink);
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.025em;
  color: var(--ink);
  text-wrap: balance;
}

h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -.01em;
  color: var(--ink);
}

.mark { color: var(--accent); }

.eyebrow,
.tag,
.contact-details dt {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 500;
}
.eyebrow { font-size: .75rem; color: var(--muted); }
.tag,
.contact-details dt { font-size: .6875rem; color: var(--faint); }

.lead {
  font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
  line-height: 1.6;
  color: var(--muted);
  max-width: 46ch;
}

.prose {
  color: var(--muted);
  max-width: 62ch;
}

/* 4. Links & buttons ---------------------------------------------------------
   Plain underlined links for in-copy references; a single hard-edged,
   invert-on-hover button for every call to action on the page.
   -------------------------------------------------------------------------- */
a { color: inherit; }

.link {
  color: var(--ink);
  text-decoration-color: var(--faint);
  text-underline-offset: .2em;
  transition: color .15s ease, text-decoration-color .15s ease;
}
.link:hover { color: var(--accent); text-decoration-color: var(--accent); }

.btn-brut {
  display: inline-flex;
  align-items: center;
  padding: .65em 1.25em;
  background: var(--ink);
  color: var(--bg);
  border: var(--rule) solid var(--ink);
  font-size: .8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.btn-brut:hover { background: var(--bg); color: var(--ink); }

.btn-brut--outline { background: var(--bg); color: var(--ink); }
.btn-brut--outline:hover { background: var(--ink); color: var(--bg); }

/* 5. Header ------------------------------------------------------------------ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: var(--bg);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: var(--head);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 1;
  transition: opacity .18s ease;
}
.brand:hover { opacity: .7; }

/* Both logo files carry their own generous white margin; each is scaled up
   inside a clipped, fixed-size container so only the mark (and, in the
   nav, the wordmark) actually shows. */
.nav .brand { height: 2rem; overflow: hidden; }
.brand-logo { height: 5rem; width: auto; max-width: none; }

.site-footer .brand { height: 2rem; width: 2rem; overflow: hidden; }
.footer-logo { height: 3rem; width: 3rem; max-width: none; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-left: auto;
}

.nav-list {
  display: flex;
  gap: 1.75rem;
}
.nav-list a {
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--body);
  text-decoration: none;
  transition: color .18s ease;
}
.nav-list a:hover { color: var(--accent); }

.nav-toggle {
  display: none;
  margin-left: auto;
  padding: .5rem;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 1.125rem;
  height: var(--rule);
  background: var(--ink);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle span + span { margin-top: .3125rem; }
.nav-toggle[aria-expanded='true'] span:first-child { transform: translateY(.1875rem) rotate(45deg); }
.nav-toggle[aria-expanded='true'] span:last-child { transform: translateY(-.1875rem) rotate(-45deg); }

/* 6. Hero --------------------------------------------------------------------
   Small and blunt: left-aligned, hard-edged, grey / white / black / purple.
   -------------------------------------------------------------------------- */
.hero {
  padding-block: clamp(2.5rem, 6vw, 3.75rem);
  text-align: left;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .875rem;
  max-width: 38rem;
}
.hero-inner h1 {
  max-width: 18ch;
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
}
.hero-inner .lead { max-width: 42ch; font-size: 1rem; }

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: .75rem;
  margin-top: .375rem;
}

/* 7. Sections ---------------------------------------------------------------- */
.section { padding-block: var(--section-y); }
.section[id] { scroll-margin-top: var(--head); }

.block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.block-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
/* 8. Rail ---------------------------------------------------------------------
   A numbered spine down the left margin, About through Contact. Positioned
   off the shell's own edge so it lines up regardless of viewport width;
   hidden below the breakpoint where that margin runs out (see Responsive).
   -------------------------------------------------------------------------- */
.rail {
  position: relative;
  --rail-x: calc((100% - var(--shell)) / 2 + var(--gutter) - 3.5rem);
  /* JS measures the first/last node and overrides these two with exact
     pixel values; these are just a sane fallback if it can't run. */
  --rail-top: var(--section-y);
  --rail-height: calc(100% - 2 * var(--section-y));
}
.rail::before {
  content: '';
  position: absolute;
  top: var(--rail-top);
  height: var(--rail-height);
  left: var(--rail-x);
  width: var(--rule);
  background: var(--ink);
}
.rail > .section { position: relative; }

.rail-node {
  position: absolute;
  left: var(--rail-x);
  /* Centers the node on the eyebrow's line box (.75rem font, inherited
     1.65 line-height) rather than on the section's padding edge. */
  top: calc(var(--section-y) + (.75rem * 1.65 - 1.75rem) / 2);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--bg);
  border: var(--rule) solid var(--ink);
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 600;
  color: var(--ink);
}

/* 9. Grids --------------------------------------------------------------------
   One ruled-grid pattern (shared border frame, no gaps, no shadows, no
   rounding) reused for every card grid on the page, contact block included.
   -------------------------------------------------------------------------- */
.pillars,
.labs-grid,
.steps,
.contact-details {
  display: grid;
  margin-top: 1.5rem;
  border-top: var(--rule) solid var(--ink);
  border-left: var(--rule) solid var(--ink);
}
.pillars { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.labs-grid { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.steps { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.contact-details { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }

.pillars > *,
.labs-grid > *,
.steps > *,
.contact-details > * {
  padding: 1.75rem;
  border-right: var(--rule) solid var(--ink);
  border-bottom: var(--rule) solid var(--ink);
}
.pillars > *,
.labs-grid > *,
.steps > * {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: background-color .15s ease;
}
.pillars .prose { max-width: 44ch; }

.labs-grid p,
.steps p { font-size: .9375rem; color: var(--muted); }

.labs-grid > *:hover,
.steps > *:hover { background: var(--bg-soft); }

.list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .5rem;
  font-size: .9375rem;
  color: var(--muted);
}
.list li { padding-left: 1.125rem; position: relative; }
.list li::before {
  content: '';
  position: absolute;
  left: 0; top: .55em;
  width: .375rem; height: .375rem;
  background: var(--accent);
}

.num {
  display: block;
  font-family: var(--mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
}

.serve {
  margin-top: 1.5rem;
  border-top: var(--rule) solid var(--ink);
}
.serve > div {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: 1.5rem;
  padding-block: 1.5rem;
  border-bottom: var(--rule) solid var(--ink);
}
.serve dt {
  font-family: var(--mono);
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--ink);
}
.serve dd { color: var(--muted); max-width: 56ch; }

/* 10. Contact ------------------------------------------------------------------
   Grid frame comes from the shared ruled-grid rules above.
   -------------------------------------------------------------------------- */
.contact-details dt { margin-bottom: .5rem; }
.contact-details dd { color: var(--ink); }

/* 11. Footer -------------------------------------------------------------- */
.site-footer {
  padding-block: 2rem;
  background: var(--bg);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.copyright {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--faint);
}

/* 12. Reveal ---------------------------------------------------------------
   One effect for the whole page: a group's direct children fade up together,
   lightly staggered. JS adds .reveal so the page is never hidden without it.
   -------------------------------------------------------------------------- */
.reveal > * {
  opacity: 0;
  transform: translateY(.625rem);
  transition: opacity .5s ease-out, transform .5s ease-out;
}
.reveal.is-in > * { opacity: 1; transform: none; }

.reveal > :nth-child(2) { transition-delay: .05s; }
.reveal > :nth-child(3) { transition-delay: .1s; }
.reveal > :nth-child(4) { transition-delay: .15s; }
.reveal > :nth-child(5) { transition-delay: .2s; }
.reveal > :nth-child(6) { transition-delay: .25s; }
.reveal > :nth-child(n+7) { transition-delay: .3s; }

/* Text-heavy rows fade only — a vertical shift rasterises their descenders. */
.serve.reveal > * { transform: none; }

/* 13. Responsive ------------------------------------------------------------ */
@media (max-width: 74.9375em) {
  .rail-node,
  .rail::before { display: none; }
}

@media (max-width: 52em) {
  .nav-toggle { display: block; }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .5rem var(--gutter) 1.5rem;
    background: var(--bg);
    border-bottom: var(--rule) solid var(--ink);
  }
  .nav-menu.is-open { display: flex; }

  .nav-list {
    flex-direction: column;
    gap: 0;
  }
  .nav-list a {
    display: block;
    padding-block: .75rem;
    border-bottom: var(--hair) solid var(--faint);
  }

  .serve > div { grid-template-columns: 1fr; gap: .375rem; }
}

@media (max-width: 30em) {
  .hero-inner { align-items: stretch; }
  .btn-brut { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  .reveal > * { opacity: 1; transform: none; }
}
