/* ==========================================================================
   Gritron — design system
   Language: engineered / datasheet. Hairline lattices, mono microtype,
   45° chamfers echoing the mark. No rounded corners anywhere.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Surface */
  --bg: #07080a;
  --bg-sunk: #050506;
  --surface: #0d0f12;
  --surface-2: #14171b;
  --surface-3: #1b1f24;

  /* Ink */
  /* Contrast on --bg: ink 18.2, ink-2 8.7, ink-3 4.9 (AA for text).
     ink-4 is 3.3 — ordinals and decorative marks only, never body copy. */
  --ink: #f2f4f5;
  --ink-2: #a4acb3;
  --ink-3: #767f87;
  --ink-4: #5b636a;

  /* Lines */
  --line: rgba(242, 244, 245, 0.09);
  --line-2: rgba(242, 244, 245, 0.16);
  --line-3: rgba(242, 244, 245, 0.3);

  /* Signal — used sparingly: focus, ticks, active states */
  --signal: #55b9f0;
  --signal-soft: rgba(85, 185, 240, 0.14);

  /* Type */
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Metrics */
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --shell-w: 1240px;
  --header-h: 4.5rem;
  --section-y: clamp(4.5rem, 9vw, 8rem);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Geometry — the chamfer repeats the mark's cut corners */
  --cut: 10px;
  --chamfer: polygon(
    0 0,
    calc(100% - var(--cut)) 0,
    100% var(--cut),
    100% 100%,
    var(--cut) 100%,
    0 calc(100% - var(--cut))
  );

  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1;
}

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

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.06;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

/* Anchor targets must clear the fixed header */
[id] {
  scroll-margin-top: calc(var(--header-h) + 2rem);
}

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

/* Keep the scrollbar in the same material as the site */
* {
  scrollbar-color: var(--surface-3) var(--bg);
  scrollbar-width: thin;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -6rem;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: top 0.2s var(--ease);
}

.skip-link:focus-visible {
  top: 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */

.shell {
  width: min(var(--shell-w), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

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

.section--sunk {
  background: var(--bg-sunk);
}

/* First section after a masthead: the masthead already drew the rule */
.section--flush {
  border-top: 0;
}

.section--tight {
  padding-top: clamp(2.5rem, 5vw, 4rem);
}

.split {
  display: grid;
  gap: 2rem;
}

.split-title {
  margin-top: 1.5rem;
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  max-width: 16ch;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 24rem) minmax(0, 1fr);
    gap: 4.5rem;
  }
}

.stack-top {
  margin-top: 2.5rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
}

/* The lattice is the site's structural signature: cells sit on a 1px grid
   made of the gap itself, so every panel shares one continuous hairline. */
.lattice {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.lattice > * {
  background: var(--bg);
}

.lattice--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lattice--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.section--sunk .lattice > * {
  background: var(--bg-sunk);
}

/* --------------------------------------------------------------------------
   4. Typography
   -------------------------------------------------------------------------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.tag::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--signal);
  flex: none;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.idx {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

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

.prose p {
  color: var(--ink-2);
  font-size: 1.0625rem;
  line-height: 1.75;
  max-width: 62ch;
}

.prose p + p {
  margin-top: 1.15rem;
}

.prose strong {
  color: var(--ink);
  font-weight: 500;
}

/* Section head ------------------------------------------------------------ */

.sec-head {
  display: grid;
  gap: 1.15rem;
  margin-bottom: clamp(2.5rem, 5vw, 3.75rem);
}

.sec-head h2 {
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  max-width: 18ch;
}

.sec-head .lead {
  max-width: 52ch;
}

@media (min-width: 900px) {
  .sec-head--split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
    align-items: end;
    column-gap: 4rem;
  }

  .sec-head--split .tag,
  .sec-head--split h2 {
    grid-column: 1;
  }

  .sec-head--split .lead {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: end;
    padding-bottom: 0.35rem;
  }
}

/* --------------------------------------------------------------------------
   5. Buttons & inline links
   -------------------------------------------------------------------------- */

.btn {
  --cut: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.125rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 0;
  cursor: pointer;
  transition:
    background 0.28s var(--ease),
    color 0.28s var(--ease),
    box-shadow 0.28s var(--ease);
}

.btn .ico {
  transition: transform 0.35s var(--ease);
}

.btn:hover .ico {
  transform: translateX(3px);
}

.btn--solid {
  clip-path: var(--chamfer);
  background: var(--ink);
  color: var(--bg);
}

.btn--solid:hover {
  background: #fff;
}

.btn--line {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-2);
}

.btn--line:hover {
  box-shadow: inset 0 0 0 1px var(--line-3);
  background: rgba(242, 244, 245, 0.035);
}

.btn--sm {
  --cut: 7px;
  min-height: 2.5rem;
  padding: 0.5rem 1.05rem;
  font-size: 0.71875rem;
}

/* Text link with an animated rule */
.tlink {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: 0.4rem;
  position: relative;
}

.tlink::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: var(--line-2);
}

.tlink::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
  z-index: 1;
}

.tlink:hover::before {
  transform: scaleX(1);
}

.tlink .ico {
  transition: transform 0.35s var(--ease);
}

.tlink:hover .ico {
  transform: translateX(3px);
}

.tlink--out:hover .ico {
  transform: translate(2px, -2px);
}

.ico {
  width: 1rem;
  height: 1rem;
  flex: none;
  stroke: currentColor;
  stroke-width: 1.25;
  fill: none;
}

/* --------------------------------------------------------------------------
   6. Header
   -------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition:
    background 0.4s var(--ease),
    border-color 0.4s var(--ease),
    height 0.4s var(--ease);
}

.site-header.is-stuck {
  height: 4rem;
  background: rgba(7, 8, 10, 0.72);
  border-bottom-color: var(--line);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-right: auto;
  color: var(--ink);
}

.brand svg {
  width: 1.75rem;
  height: auto;
  fill: currentColor;
  transition: color 0.3s var(--ease);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.0625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand:hover {
  color: #fff;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2.25rem;
}

.site-nav a {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding-block: 0.4rem;
  transition: color 0.25s var(--ease);
}

.site-nav a::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav-index {
  display: none;
}

.nav-toggle {
  display: none;
  position: relative;
  z-index: 120;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 1.375rem;
  height: 1.5px;
  margin: 0.3125rem auto;
  background: currentColor;
  transition:
    transform 0.35s var(--ease),
    opacity 0.2s linear;
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: min(100svh, 60rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: calc(var(--header-h) + 3rem);
  overflow: hidden;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 42%;
  opacity: 0.9;
  animation: hero-drift 24s var(--ease) forwards;
}

@keyframes hero-drift {
  from {
    transform: scale(1.005);
  }
  to {
    transform: scale(1.06);
  }
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(
      100deg,
      var(--bg) 0%,
      rgba(7, 8, 10, 0.93) 26%,
      rgba(7, 8, 10, 0.55) 52%,
      rgba(7, 8, 10, 0.25) 74%
    ),
    linear-gradient(
      180deg,
      rgba(7, 8, 10, 0.85) 0%,
      transparent 22%,
      transparent 55%,
      rgba(7, 8, 10, 0.82) 88%,
      var(--bg) 100%
    );
}

.hero-veil::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--noise);
  opacity: 0.045;
  mix-blend-mode: overlay;
}

.hero-content {
  position: relative;
  padding-bottom: clamp(3rem, 7vw, 5.5rem);
}

.hero-content .tag {
  margin-bottom: 1.75rem;
}

.hero h1 {
  font-size: clamp(2.75rem, 7.4vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.042em;
  line-height: 0.96;
  max-width: 15ch;
}

.hero h1 span {
  color: var(--ink-2);
}

.hero .lead {
  margin-top: 1.75rem;
  max-width: 40ch;
}

.hero .actions {
  margin-top: 2.5rem;
}

/* Index rail — the spec strip pinned to the base of the hero */
.hero-rail {
  position: relative;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(7, 8, 10, 0.6), var(--bg));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.hero-rail ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hero-rail li {
  padding: 1.25rem 0 1.35rem;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}

.hero-rail li + li {
  padding-left: 1.5rem;
  border-left: 1px solid var(--line);
}

.hero-rail .rail-label {
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   8. Product cards (home grid)
   -------------------------------------------------------------------------- */

.pcard {
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 0;
  transition: background 0.4s var(--ease);
}

.pcard:hover {
  background: var(--surface);
}

.pcard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem clamp(1.25rem, 2.5vw, 2rem);
  border-bottom: 1px solid var(--line);
}

.pcard-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: clamp(1.75rem, 3vw, 2.5rem) clamp(1.25rem, 2.5vw, 2rem)
    clamp(1.5rem, 2.5vw, 2rem);
}

.pcard h3 {
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  font-weight: 700;
}

.pcard p {
  color: var(--ink-2);
  font-size: 0.9875rem;
  line-height: 1.65;
  max-width: 40ch;
}

.pcard-foot {
  margin-top: auto;
  padding-top: 0.5rem;
}

/* The whole card is the link, so the rule reacts to the card's hover */
.pcard .tlink::after {
  background: transparent;
}

.pcard:hover .tlink::before {
  transform: scaleX(1);
}

.pcard:hover .ico {
  transform: translate(2px, -2px);
}

.pcard .tlink:not(.tlink--out) .ico {
  transition: transform 0.35s var(--ease);
}

.pcard:hover .tlink:not(.tlink--out) .ico {
  transform: translateX(3px);
}

/* Product icon tile */
.thumb {
  --cut: 8px;
  position: relative;
  width: 4.75rem;
  height: 4.75rem;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  clip-path: var(--chamfer);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

/* Transparent logotype marks need breathing room; opaque app icons bleed */
.thumb--mark img {
  width: 86%;
  height: 86%;
  object-fit: contain;
}

.pcard:hover .thumb img,
.prow:hover .thumb img {
  transform: scale(1.05);
}

.thumb--lg {
  --cut: 10px;
  width: 5.5rem;
  height: 5.5rem;
}

/* Corner registration ticks */
.ticks::before,
.ticks::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border: 1px solid var(--line-3);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}

.ticks::before {
  top: 0;
  left: 0;
  border-right: 0;
  border-bottom: 0;
}

.ticks::after {
  bottom: 0;
  right: 0;
  border-left: 0;
  border-top: 0;
}

.ticks:hover::before,
.ticks:hover::after {
  opacity: 1;
}

/* Status pip */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.status::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  background: var(--ink-4);
}

.status--live::before {
  background: var(--signal);
  box-shadow: 0 0 0 3px var(--signal-soft);
}

/* --------------------------------------------------------------------------
   9. Product rows (products page)
   -------------------------------------------------------------------------- */

/* No top rule here — the masthead already closes with one. */
.prow-list {
  border-top: 0;
}

.prow {
  position: relative;
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) minmax(0, 15rem);
  gap: 2rem clamp(1.5rem, 3.5vw, 3rem);
  align-items: start;
  padding: clamp(2rem, 4vw, 3rem) clamp(0.75rem, 2vw, 1.5rem);
  margin-inline: clamp(-1.5rem, -2vw, -0.75rem);
  border-bottom: 1px solid var(--line);
  transition: background 0.4s var(--ease);
}

.prow:hover {
  background: var(--surface);
}

.prow-main {
  display: grid;
  gap: 0.9rem;
}

.prow-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
}

.prow h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
}

.prow p {
  color: var(--ink-2);
  max-width: 52ch;
}

.prow-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  margin-top: 0.35rem;
}

/* Inline feature keys */
.feat {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.feat li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.feat li::before {
  content: "";
  width: 4px;
  height: 4px;
  flex: none;
  background: var(--ink-4);
}

/* Spec table in the right column */
.spec {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  align-self: start;
}

.spec div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.9rem;
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.prow:hover .spec div {
  background: var(--surface);
}

.spec dt {
  color: var(--ink-3);
}

.spec dd {
  margin: 0;
  color: var(--ink-2);
  text-align: right;
}

/* --------------------------------------------------------------------------
   10. Capability / principle cells
   -------------------------------------------------------------------------- */

.cell {
  display: grid;
  align-content: start;
  gap: 0.85rem;
  padding: clamp(1.75rem, 3vw, 2.5rem) clamp(1.25rem, 2.4vw, 1.875rem);
  position: relative;
  transition: background 0.4s var(--ease);
}

.cell:hover {
  background: var(--surface);
}

.section--sunk .cell:hover {
  background: var(--surface);
}

.cell h3 {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.cell p {
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.cell .idx {
  margin-bottom: 0.35rem;
}

/* --------------------------------------------------------------------------
   11. Masthead (inner pages)
   -------------------------------------------------------------------------- */

.masthead {
  padding-top: calc(var(--header-h) + clamp(3.5rem, 7vw, 6.5rem));
  padding-bottom: clamp(2.75rem, 5vw, 4.5rem);
  position: relative;
}

.masthead::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: var(--line);
}

.masthead .tag {
  margin-bottom: 1.5rem;
}

.masthead h1 {
  font-size: clamp(2.5rem, 6.6vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  max-width: 14ch;
}

.masthead .lead {
  margin-top: 1.5rem;
  max-width: 48ch;
}

/* --------------------------------------------------------------------------
   12. Contact
   -------------------------------------------------------------------------- */

.contact-grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
}

@media (min-width: 900px) {
  .contact-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 4.5rem;
  }
}

.mailblock {
  display: grid;
  gap: 1.5rem;
  justify-items: start;
}

.mail {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 4.6vw, 2.75rem);
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--ink);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line-2);
  transition: border-color 0.3s var(--ease);
  overflow-wrap: anywhere;
}

.mail:hover {
  border-bottom-color: var(--ink);
}

.copy-btn {
  position: relative;
}

.copy-btn[data-copied="true"] {
  color: var(--signal);
}

.channel-list {
  border-top: 1px solid var(--line);
}

.channel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.15rem 0.25rem;
  border-bottom: 1px solid var(--line);
  transition: padding-inline 0.35s var(--ease);
}

.channel:hover {
  padding-left: 0.75rem;
}

.channel-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

.channel-sub {
  display: block;
  margin-top: 0.2rem;
}

.block-label {
  margin-bottom: 1.25rem;
}

.channel .ico {
  color: var(--ink-4);
  transition:
    transform 0.35s var(--ease),
    color 0.25s var(--ease);
}

.channel:hover .ico {
  color: var(--ink);
  transform: translate(2px, -2px);
}

/* --------------------------------------------------------------------------
   13. CTA band
   -------------------------------------------------------------------------- */

.cta {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  background: var(--bg-sunk);
  padding-block: clamp(4rem, 8vw, 7rem);
  isolation: isolate;
}

/* z-index 0, not -1: a negative index would drop it behind the band's
   own background and make it invisible. */
.cta-media {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(52%, 40rem);
  z-index: 0;
  pointer-events: none;
  opacity: 0.16;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 65%);
  mask-image: linear-gradient(90deg, transparent, #000 65%);
}

.cta-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.cta-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2rem;
  align-items: end;
}

.cta-inner .tag {
  margin-bottom: 1.5rem;
}

@media (min-width: 860px) {
  .cta-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3rem;
  }
}

.cta h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  max-width: 16ch;
}

.cta .lead {
  margin-top: 1.25rem;
}

/* --------------------------------------------------------------------------
   14. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-sunk);
  padding-block: clamp(3rem, 5vw, 4.5rem) 2rem;
}

.footer-top {
  display: grid;
  gap: 2.75rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 760px) {
  .footer-top {
    grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
    gap: 3rem;
  }
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
}

.footer-brand svg {
  width: 1.5rem;
  fill: currentColor;
}

.footer-brand span {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9375rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-tagline {
  margin-top: 1.15rem;
  max-width: 30ch;
  color: var(--ink-3);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.footer-col h2 {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 1.15rem;
}

.footer-col li + li {
  margin-top: 0.7rem;
}

.footer-col a {
  font-size: 0.9375rem;
  color: var(--ink-2);
  transition: color 0.25s var(--ease);
}

.footer-col a:hover {
  color: var(--ink);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-top: 1.75rem;
}

.footer-bottom--only {
  padding-top: 0;
}

.footer-bottom p {
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   15. Error page
   -------------------------------------------------------------------------- */

.err {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 1.5rem;
  min-height: 72svh;
  padding-top: var(--header-h);
}

.err-code {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(5rem, 20vw, 14rem);
  line-height: 0.82;
  letter-spacing: -0.05em;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-3);
}

/* --------------------------------------------------------------------------
   16. Reveal
   -------------------------------------------------------------------------- */

.js .reveal {
  opacity: 0;
  transform: translateY(1.5rem);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   17. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .prow {
    grid-template-columns: 5rem minmax(0, 1fr);
  }

  .spec {
    grid-column: 2;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 34rem;
  }
}

@media (max-width: 900px) {
  .lattice--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lattice--3 > *:last-child {
    grid-column: 1 / -1;
  }

  .hero-rail ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-rail li:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .hero-rail li:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 860px) {
  :root {
    --header-h: 4rem;
  }

  .nav-toggle {
    display: block;
  }

  /* backdrop-filter would make the header a containing block for the
     position:fixed nav overlay, trapping it inside the bar. */
  .site-header.is-stuck {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(7, 8, 10, 0.94);
  }

  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: grid;
    align-content: center;
    gap: 0;
    padding: 5rem var(--gutter) 3rem;
    background: rgba(5, 5, 6, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    visibility: hidden;
    opacity: 0;
    /* visibility flips instantly on open (so focus() can land on the first
       link) and only after the fade on close. */
    transition:
      opacity 0.35s var(--ease),
      visibility 0s linear 0.35s;
  }

  .site-nav.is-open {
    visibility: visible;
    opacity: 1;
    transition:
      opacity 0.35s var(--ease),
      visibility 0s linear 0s;
  }

  /* Keep the mark pinned above the overlay while the menu is open */
  .brand {
    position: relative;
    z-index: 120;
  }

  .site-nav a {
    display: flex;
    align-items: baseline;
    gap: 1.25rem;
    padding-block: 1.15rem;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 8vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    text-transform: none;
    color: var(--ink);
  }

  .site-nav a::after {
    display: none;
  }

  .nav-index {
    display: inline;
    font-family: var(--font-mono);
    font-size: 0.71875rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    color: var(--ink-4);
  }

  .site-nav a[aria-current="page"] .nav-index {
    color: var(--signal);
  }

  .hero {
    min-height: min(92svh, 46rem);
  }

  /* Portrait crops sit the mark right behind the headline, so the plate
     is dimmed hard and the veil carries the contrast. */
  .hero-media img {
    object-position: 58% 42%;
    opacity: 0.5;
  }

  .hero-veil {
    background:
      linear-gradient(
        180deg,
        rgba(7, 8, 10, 0.94) 0%,
        rgba(7, 8, 10, 0.66) 22%,
        rgba(7, 8, 10, 0.74) 48%,
        rgba(7, 8, 10, 0.93) 78%,
        var(--bg) 100%
      );
  }
}

@media (max-width: 720px) {
  .lattice--2,
  .lattice--3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .lattice--3 > *:last-child {
    grid-column: auto;
  }

  .prow {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    padding-inline: 0;
    margin-inline: 0;
  }

  .prow:hover {
    background: transparent;
  }

  .spec {
    grid-column: auto;
    grid-template-columns: minmax(0, 1fr);
  }

  .prow-links {
    gap: 1.25rem 1.75rem;
  }

  .hero-rail li {
    padding-block: 1rem;
  }

  .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 360px) {
  .hero-rail ol {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-rail li:nth-child(n + 2) {
    border-top: 1px solid var(--line);
    padding-left: 0;
    border-left: 0;
  }
}

/* --------------------------------------------------------------------------
   18. Print
   -------------------------------------------------------------------------- */

@media print {
  .site-header,
  .hero-media,
  .hero-veil,
  .cta-media,
  .nav-toggle,
  .skip-link {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
