/* Design tokens */

:root {
  --ink: #0b1e25;
  --ink-soft: #354a50;
  --night: #081a21;
  --paper: #f5f3ec;
  --paper-deep: #e9e7df;
  --white: #fffefa;
  --aqua: #4de1c1;
  --acid: #c4ef70;
  --aqua-glow: rgb(77 225 193 / 9%);
  --text-on-dark: #b9c8cb;
  --text-muted: #566669;
  --text-muted-on-dark: #91a4a8;
  --line: #cad1cd;
  --line-dark: #294149;
  --line-on-dark: #466069;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --max-width: 76rem;
  color-scheme: light;
  font-family: var(--sans);
  font-synthesis: none;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

/* Shared foundation */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--night);
}

p,
h1,
h2,
h3,
figure {
  margin-top: 0;
}

.wrap {
  width: min(calc(100% - 3rem), var(--max-width));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  transform: translateY(-180%);
  padding: 0.65rem 0.9rem;
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Header */

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 6rem;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-dark);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  color: var(--white);
  font-size: 1.18rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.wordmark-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 1px solid var(--aqua);
  color: var(--aqua);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.08em;
  transform: rotate(-3deg);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2.2rem);
  color: var(--text-on-dark);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.site-header nav a {
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--white);
}

.site-header .nav-contact {
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line-on-dark);
  color: var(--aqua);
}

/* Shared type and controls */

.eyebrow,
.section-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  gap: 1.3rem;
  align-items: center;
  margin-bottom: 2rem;
  color: var(--aqua);
}

.eyebrow span + span {
  color: var(--text-muted-on-dark);
}

.eyebrow span + span::before {
  margin-right: 1.3rem;
  color: var(--line-on-dark);
  content: "/";
}

h1 {
  margin-bottom: 1.8rem;
  font-size: clamp(3rem, 6.2vw, 5.85rem);
  font-weight: 690;
  letter-spacing: -0.062em;
  line-height: 0.98;
}

h1 em {
  color: var(--aqua);
  font-style: normal;
}

h2 {
  margin-bottom: 1.3rem;
  font-size: clamp(2.25rem, 4.4vw, 4rem);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.section-label {
  margin: 0;
  color: var(--text-muted);
}

.button {
  display: inline-flex;
  min-height: 3.35rem;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.82rem 1.05rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.button-primary {
  min-width: 13.5rem;
  background: var(--aqua);
  color: var(--night);
}

.button-primary:hover {
  background: var(--acid);
}

.text-link {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 700;
}

/* Error page */

.error-surface {
  background: var(--night);
  color: var(--white);
}

.not-found {
  display: grid;
  min-height: calc(100vh - 12rem);
  align-items: center;
  padding-block: clamp(5rem, 10vw, 8rem);
}

.not-found-content {
  max-width: 52rem;
}

.not-found h1 {
  margin-bottom: 1.5rem;
}

.not-found-copy {
  max-width: 40rem;
  margin-bottom: 2rem;
  color: var(--text-on-dark);
  font-size: 1.1rem;
  line-height: 1.7;
}

/* Footer */

.site-footer {
  background: var(--night);
  color: var(--text-muted-on-dark);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  padding-block: 2.8rem;
  border-top: 1px solid var(--line-dark);
}

.footer-grid p {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  line-height: 1.7;
}

/* Shared responsive rules */

@media (max-width: 62rem) {
  .site-header {
    min-height: 5.25rem;
  }

  .site-header nav a:not(.nav-contact) {
    display: none;
  }
}

@media (max-width: 43rem) {
  html {
    scroll-behavior: auto;
  }

  .wrap {
    width: min(calc(100% - 2rem), var(--max-width));
  }

  .site-header {
    min-height: 4.75rem;
  }

  .wordmark-mark {
    width: 2rem;
    height: 2rem;
  }

  .site-header .nav-contact {
    padding: 0.45rem 0.6rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

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