/* Hegar — portfolio stylesheet.
   Single static page, no build step. Two typographic voices: a sans-serif
   for headlines and body copy, and a monospace for labels, navigation,
   metadata, and actions. Tokens live in :root. */

:root {
  color-scheme: light;
  --bg: #f7f5f0;
  --bg-header: rgba(247, 245, 240, 0.92);
  --bg-tint: #eef1f4;
  --text: #1c1e21;
  --text-muted: #5f646b;
  --text-soft: #8a8f95;
  --border: #dcd7cd;
  --border-strong: #b9b3a7;
  --accent: #47658a;
  --accent-strong: #36506f;

  --sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --container: 1080px;
  --gutter: clamp(20px, 5vw, 40px);
  --focus: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent);
}

/* Dark theme. data-theme is set before first paint by the inline script in
   index.html, from the stored choice or the system preference. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211;
  --bg-header: rgba(18, 18, 17, 0.92);
  --bg-tint: #171b20;
  --text: #ecebe7;
  --text-muted: #a4a39e;
  --text-soft: #72726d;
  --border: #2a2927;
  --border-strong: #4b4a46;
  --accent: #8fb0d4;
  --accent-strong: #aac5e3;
}

/* Reset --------------------------------------------------------------- */

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

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

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

h1, h2, h3, p, ul, ol, dl, dd {
  margin: 0;
}

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

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

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 2px;
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* Layout -------------------------------------------------------------- */

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

.section {
  padding-block: clamp(64px, 10vw, 128px);
  border-top: 1px solid var(--border);
}

/* Anchor targets land below the sticky header. */
[id] {
  scroll-margin-top: 88px;
}

/* Lead column left, body column right. Collapses on small screens. */
.split {
  display: grid;
  gap: 24px 48px;
}

.split-body p {
  color: var(--text-muted);
  max-width: 52ch;
}

.split-body p + p {
  margin-top: 1em;
}

@media (min-width: 800px) {
  .split {
    grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
    align-items: start;
  }
}

/* Typography ---------------------------------------------------------- */

.mono {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  font-weight: 500;
}

h1 {
  font-size: clamp(2.5rem, 7.2vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 500;
  max-width: 14ch;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.75rem, 3.8vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 500;
  max-width: 20ch;
  text-wrap: balance;
}

h3 {
  font-size: 1.0625rem;
  line-height: 1.4;
  font-weight: 600;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.section-index {
  display: flex;
  align-items: center;
  gap: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  margin-bottom: clamp(36px, 5vw, 56px);
}

.section-index span {
  color: var(--accent);
}

.section-index::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: 8px;
}

.lede {
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 48ch;
}

/* Skip link ----------------------------------------------------------- */

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  background: var(--text);
  color: var(--bg);
  border-radius: 4px;
  transform: translateY(-200%);
  z-index: 100;
}

.skip-link:focus {
  transform: none;
}

/* Header -------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(8px, 3vw, 24px);
  min-height: 64px;
}

.header-inner nav {
  margin-left: auto;
}

/* Theme toggle: styled like a nav link, but a real button. */
.theme-toggle {
  padding: 8px 2px;
  border: 0;
  background: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 120ms ease;
}

.theme-toggle::before {
  content: "[\00a0" / "";
  color: var(--border-strong);
  transition: color 120ms ease;
}

.theme-toggle::after {
  content: "\00a0]" / "";
  color: var(--border-strong);
  transition: color 120ms ease;
}

.theme-toggle:hover {
  color: var(--text);
}

.theme-toggle:hover::before,
.theme-toggle:hover::after {
  color: var(--accent);
}

@media (max-width: 479px) {
  .theme-toggle::before,
  .theme-toggle::after {
    content: none;
  }
}

.wordmark {
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  transition: color 120ms ease;
}

.wordmark:hover {
  color: var(--accent);
}

.nav-list {
  display: flex;
  gap: clamp(8px, 3vw, 24px);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Bracketed labels, in the spirit of an editorial index. The brackets are
   decorative and hidden from assistive tech via the alt-text syntax. */
.nav-list a {
  display: inline-block;
  padding: 8px 2px;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 120ms ease;
}

.nav-list a::before {
  content: "[\00a0" / "";
  color: var(--border-strong);
  transition: color 120ms ease;
}

.nav-list a::after {
  content: "\00a0]" / "";
  color: var(--border-strong);
  transition: color 120ms ease;
}

/* Below 480px the brackets no longer fit beside the wordmark. */
@media (max-width: 479px) {
  .nav-list a::before,
  .nav-list a::after {
    content: none;
  }
}

.nav-list a:hover {
  color: var(--text);
}

.nav-list a:hover::before,
.nav-list a:hover::after {
  color: var(--accent);
}

/* Actions ------------------------------------------------------------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.action {
  display: inline-block;
  padding: 10px 0 8px;
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  transition: color 120ms ease, border-color 120ms ease;
}

.action:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.action-primary {
  border-bottom: 2px solid var(--accent);
}

.action-primary:hover {
  color: var(--accent-strong);
  border-bottom-color: var(--accent-strong);
}

/* Hero ---------------------------------------------------------------- */

.hero {
  padding-block: clamp(72px, 12vw, 152px) clamp(56px, 9vw, 112px);
}

.hero-foot {
  display: grid;
  gap: 32px;
  margin-top: clamp(36px, 5vw, 56px);
}

.hero-foot .actions {
  align-self: end;
}

@media (min-width: 800px) {
  .hero-foot {
    grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
    align-items: end;
  }

  .hero-foot .actions {
    justify-content: flex-end;
  }
}

/* Definition rows ----------------------------------------------------- */

.rows {
  margin-top: clamp(48px, 7vw, 80px);
  border-top: 1px solid var(--border);
}

.row {
  display: grid;
  gap: 6px 48px;
  padding-block: 22px;
  border-bottom: 1px solid var(--border);
}

.row dt {
  font-weight: 500;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.row dd {
  color: var(--text-muted);
  max-width: 52ch;
}

@media (min-width: 800px) {
  .row {
    grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  }
}

/* Featured project ---------------------------------------------------- */

.project-title {
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  letter-spacing: -0.035em;
  line-height: 1;
  margin-bottom: 16px;
}

.project-subtitle {
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--accent-strong);
  max-width: 30ch;
}

.meta {
  color: var(--text-soft);
  margin-top: 24px !important;
}

.project-blocks {
  display: grid;
  margin-top: clamp(48px, 7vw, 80px);
  border: 1px solid var(--border);
}

.block {
  min-width: 0;
  padding: clamp(24px, 3.5vw, 36px);
}

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

.block-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 24px;
}

.block-head h3 {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
}

.status {
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-planned {
  color: var(--accent-strong);
  padding: 2px 8px;
  border: 1px solid var(--accent);
}

.block p {
  color: var(--text-muted);
}

.block p + p {
  margin-top: 1em;
}

/* Planned work sits on a tinted surface with an accent rule so it reads
   unmistakably as not-yet-shipped. */
.block-planned {
  background: var(--bg-tint);
  border-left: 3px solid var(--accent);
}

.note {
  font-weight: 600;
  color: var(--text) !important;
}

.checklist li {
  position: relative;
  padding-left: 24px;
  color: var(--text-muted);
}

.checklist li + li {
  margin-top: 10px;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.8em;
  width: 12px;
  height: 1px;
  background: var(--accent);
}

@media (min-width: 800px) {
  .project-blocks {
    grid-template-columns: 1fr 1fr;
  }

  .block + .block {
    border-top: none;
    border-left: 1px solid var(--border);
  }

  .block-planned {
    border-left: 3px solid var(--accent);
  }
}

.confidential {
  margin-top: 20px;
  color: var(--text-soft);
  max-width: 72ch;
}

/* Approach ------------------------------------------------------------ */

.steps {
  display: grid;
  gap: 0;
  margin-top: clamp(40px, 6vw, 64px);
  counter-reset: step;
  border-top: 1px solid var(--border);
}

.steps li {
  counter-increment: step;
  display: grid;
  gap: 8px 48px;
  padding-block: 28px;
  border-bottom: 1px solid var(--border);
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  line-height: 1.6;
}

.steps h3 {
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.steps p {
  color: var(--text-muted);
  max-width: 52ch;
}

@media (min-width: 800px) {
  .steps li {
    grid-template-columns: 64px minmax(0, 5fr) minmax(0, 6fr);
    align-items: start;
  }
}

/* Contact ------------------------------------------------------------- */

.email {
  margin-top: 28px;
  margin-bottom: 20px;
  font-size: clamp(1.375rem, 3vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
  color: var(--text) !important;
  max-width: none !important;
}

.email a {
  border-bottom: 1px solid var(--border-strong);
  transition: color 120ms ease, border-color 120ms ease;
}

.email a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Footer -------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 32px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}
