:root {
  color-scheme: light;
  --blue: #07b0f2;
  --blue-dark: #076b99;
  --ice: #edf7fb;
  --paper: #f8fafb;
  --white: #ffffff;
  --ink: #101923;
  --body: #526372;
  --line: #dbe7ec;
  --content: 72rem;
  --header-h: 3.8125rem; /* 61px: 3.75rem min-height + 1px bottom border */
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

h1,
h2,
h3 {
  margin: 0;
}

a {
  color: var(--blue-dark);
}

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

.section-index {
  margin: 0;
  color: #5f7280;
  font: 700 0.75rem/1 ui-monospace, monospace;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Navigation */

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(119, 149, 164, 0.2);
  background: rgba(247, 251, 252, 0.86);
  backdrop-filter: blur(18px);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 max(1.25rem, var(--safe-r), calc((100% - var(--content)) / 2)) 0
           max(1.25rem, var(--safe-l), calc((100% - var(--content)) / 2));
  min-height: 3.75rem;
}

.brand,
.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: #2b3b47;
  font: 700 0.75rem/1 ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  color: #647480;
}

.nav-links a:hover,
.nav-links a[aria-current='true'] {
  color: var(--blue-dark);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 0.875rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: #2b3b47;
  font: 700 0.75rem/1 ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

/* Hero */

.hero {
  position: relative;
  display: grid;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  background: var(--ice);
  text-align: center;
}

.hero canvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  z-index: 2;
  inset: 0;
  background: radial-gradient(
    circle at 50% 48%,
    rgba(237, 247, 251, 0.08) 0,
    rgba(237, 247, 251, 0.26) 42%,
    rgba(237, 247, 251, 0.82) 82%,
    #edf7fb 100%
  );
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 3;
  width: min(52.5rem, 100%);
  padding: 4rem 0;
  padding-right: max(1.25rem, var(--safe-r));
  padding-left: max(1.25rem, var(--safe-l));
}

.name-lockup {
  margin: 0 0 0.5rem;
  color: #263b48;
  font-size: 1.125rem;
  font-weight: 620;
  letter-spacing: -0.025em;
}

.eyebrow {
  margin: 0;
  color: var(--blue-dark);
  font: 700 0.75rem/1 ui-monospace, monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 1.25rem 0 0;
  font-size: clamp(3.6rem, 8vw, 7.4rem);
  font-weight: 560;
  letter-spacing: -0.035em;
  line-height: 0.9;
}

.hero h1 span {
  display: block;
}

.hero-statement {
  width: min(38rem, 100%);
  margin: 1.5rem auto 0;
  color: #536776;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

.action-primary,
.action-secondary {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1.375rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

.action-primary {
  color: var(--white);
  background: var(--blue-dark);
  box-shadow: 0 9px 25px rgba(7, 176, 242, 0.2);
}

.action-secondary {
  border: 1px solid #bdd2dc;
  color: #34495a;
  background: rgba(255, 255, 255, 0.6);
}

/* Sections */

.section {
  min-height: 78svh;
  padding: clamp(5rem, 10vw, 9rem) max(1.5rem, var(--safe-r), calc((100% - var(--content)) / 2))
    clamp(5rem, 10vw, 9rem) max(1.5rem, var(--safe-l), calc((100% - var(--content)) / 2));
}

.section h2 {
  max-width: 54rem;
  margin: 1.125rem 0 0;
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  font-weight: 540;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.about {
  display: grid;
  align-content: center;
  background: var(--white);
}

.about-copy {
  max-width: 46rem;
  margin: 1.75rem 0 0;
  color: var(--body);
  font-size: 1.0625rem;
  line-height: 1.75;
}

.about-block {
  margin-top: 3rem;
}

.about-label {
  margin: 0;
  color: #5f7280;
  font: 700 0.75rem/1 ui-monospace, monospace;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* The sub-block owns the top margin now, so the inner blocks lose theirs. */
.about-block .approach,
.about-block .expertise,
.about-block .stack {
  margin-top: 1.25rem;
}

.about-block .expertise {
  padding-top: 0;
  border-top: 0;
}

.approach {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  margin-top: 3rem;
}

.approach > div {
  padding-top: 1.25rem;
  border-top: 2px solid var(--blue);
}

.approach > div::before {
  content: attr(data-step);
  color: var(--blue-dark);
  font: 700 0.6875rem/1 ui-monospace, monospace;
  letter-spacing: 0.16em;
}

.approach h4 {
  margin: 0.875rem 0 0.625rem;
  color: #1d2a34;
  font-size: 1.25rem;
  font-weight: 580;
  letter-spacing: -0.02em;
}

.approach p {
  margin: 0;
  color: var(--body);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.expertise {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-content: flex-start;
  margin: 3rem 0 0;
  padding: 2rem 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.expertise li,
.job-chip {
  display: inline-flex;
  align-items: center;
  min-height: auto;
  padding: 0.375rem 0.625rem;
  border: 0;
  border-radius: 6px;
  color: #135a78;
  background: #eaf6fb;
  font-size: 0.8125rem;
  font-weight: 650;
  cursor: default;
}

.job-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 0.625rem 0 0;
  padding: 0;
  list-style: none;
}

.job-chip {
  font-size: 0.75rem;
}

.stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.25rem clamp(1.5rem, 4vw, 3rem);
  margin: 2rem 0 0;
}

.stack dt {
  color: #5f7280;
  font: 700 0.6875rem/1 ui-monospace, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stack dd {
  margin: 0.5rem 0 0;
  color: #34495a;
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* Experience timeline */

.experience {
  background: var(--paper);
}

.timeline {
  position: relative;
  width: min(58rem, 100%);
  margin: 3.5rem auto 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 0.5px);
  width: 1px;
  background: linear-gradient(to bottom, var(--blue), #dce8ed);
}

.job {
  position: relative;
  width: calc(50% - 3rem);
  margin-bottom: 2rem;
  padding: 1.25rem 1.3125rem;
  border: 1px solid #e0e9ed;
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 12px 32px rgba(41, 61, 71, 0.06);
}

.job:nth-child(even) {
  margin-left: calc(50% + 3rem);
}

.job::after {
  content: '';
  position: absolute;
  top: 1.625rem;
  width: 17px;
  height: 17px;
  border: 4px solid var(--paper);
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 1px rgba(7, 176, 242, 0.18), 0 6px 16px rgba(7, 176, 242, 0.2);
}

.job:nth-child(odd)::after {
  right: calc(-3rem - 8.5px);
}

.job:nth-child(even)::after {
  left: calc(-3rem - 8.5px);
}

.job h3 {
  color: #1d2a34;
  font-size: 1.125rem;
}

.job-role {
  margin: 0.5rem 0 0;
  color: #4c6070;
  font-size: 0.9375rem;
}

.job-when {
  margin: 0.125rem 0 0;
  color: #5f7280;
  font-size: 0.875rem;
  font-weight: 500;
}

.job-stack {
  margin: 0.625rem 0 0;
  color: #5f7280;
  font-size: 0.8125rem;
  line-height: 1.55;
}

.job-disclosure {
  margin-top: 0.625rem;
}

.job-disclosure summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  color: #5f7280;
  font: 700 0.6875rem/1 ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  list-style: none;
  cursor: pointer;
}

.job-disclosure summary::-webkit-details-marker {
  display: none;
}

.job-disclosure summary::after {
  content: '›';
  color: var(--blue-dark);
  font-size: 1rem;
  transition: transform 0.15s ease;
}

.job-disclosure[open] summary::after {
  transform: rotate(90deg);
}

/* Contact */

.contact {
  display: grid;
  align-content: center;
  background: var(--ice);
}

.contact-intro {
  text-align: center;
}

.contact-intro h2 {
  max-width: 52rem;
  margin-inline: auto;
}

.contact-intro p:last-child {
  max-width: 36rem;
  margin: 1.375rem auto 0;
  color: #526773;
  font-size: 1.0625rem;
}

.contact-layout {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 1.75rem;
  width: min(56rem, 100%);
  margin: 3rem auto 0;
}

.contact-links {
  display: grid;
  gap: 0.5rem;
  align-content: start;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 3.25rem;
  border-bottom: 1px solid #d3e2e8;
  color: #33495a;
  font-size: 1.0625rem;
  text-decoration: none;
  word-break: break-word;
}

.contact-links a::after {
  content: '↗';
  color: var(--blue-dark);
  transform: translateY(-1px);
}

.contact-email a {
  display: grid;
  gap: 0.125rem;
  min-height: 3.5rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid #cfe6f0;
  border-left: 4px solid var(--blue);
  border-radius: 14px;
  background: var(--white);
  justify-content: start;
  align-content: center;
}

.contact-email a::after {
  content: none;
}

.contact-email-label {
  color: #5f7280;
  font: 700 0.6875rem/1 ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.contact-email-value {
  font-size: 1.0625rem;
}

.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.125rem 1rem;
  align-content: start;
}

.field {
  display: grid;
  gap: 0.375rem;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: #5f7280;
  font: 700 0.6875rem/1 ui-monospace, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6875rem 0.875rem;
  border: 1px solid #cddfe7;
  border-radius: 10px;
  background: var(--white);
  color: #22313b;
  font: inherit;
  font-size: 1rem;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--blue);
}

.field textarea {
  resize: vertical;
}

/* Status and button share one row, and an empty status is removed from the flow
   so it cannot reserve a gap above the button. */
.form-status {
  grid-column: 1;
  align-self: center;
  margin: 0;
  color: var(--body);
  font-size: 0.875rem;
  line-height: 1.45;
}

.form-status:empty {
  display: none;
}

.form.is-sending .form-status {
  color: var(--blue-dark);
}

.form.is-success .form-status {
  color: #14714b;
}

.form.is-error .form-status {
  color: #b02a1f;
}

.form.is-sending .send {
  opacity: 0.65;
}

.send {
  grid-column: 2;
  justify-self: end;
  min-height: 2.75rem;
  padding: 0 1.375rem;
  border: 0;
  border-radius: 999px;
  color: var(--white);
  background: var(--blue-dark);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}

.send:disabled {
  cursor: progress;
}

/* Footer */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.5rem max(1.5rem, var(--safe-r), calc((100% - var(--content)) / 2))
           max(1.5rem, var(--safe-b)) max(1.5rem, var(--safe-l), calc((100% - var(--content)) / 2));
  border-top: 1px solid var(--line);
  background: var(--white);
  color: #5f7280;
  font: 700 0.6875rem/1.4 ui-monospace, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Responsive */

@media (max-width: 47.999rem) {
  /* Hero: one screen minus the header, capped so a tall phone shows the next
     section at the fold instead of spending a whole screen on the hero. */
  .hero {
    min-height: min(calc(100svh - var(--header-h)), 42rem);
  }

  .hero-copy {
    padding-top: clamp(1.5rem, 6svh, 4rem);
    padding-bottom: max(clamp(1.5rem, 6svh, 4rem), var(--safe-b));
  }

  /* The name is already in the header brand 16px above; the element stays in the
     DOM for desktop. */
  .name-lockup {
    display: none;
  }

  .hero h1 {
    font-size: clamp(1.75rem, 9vw, 3.6rem);
  }

  .hero h1 span {
    text-wrap: balance;
  }

  .hero-statement {
    text-wrap: pretty;
  }

  /* 12.5rem is the widest CTA label on one line (196.5px measured), so the row splits
     in two only when both buttons clear it and stacks full-width otherwise. */
  .hero-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
    gap: 0.75rem;
  }

  .action-primary,
  .action-secondary {
    justify-content: center;
  }

  /* The mesh is densest under the text, so the centre becomes the calmest region
     and the sphere reads at the bleeding edges instead. */
  .hero::after {
    background: radial-gradient(
      circle at 50% 46%,
      rgba(237, 247, 251, 0.74) 0,
      rgba(237, 247, 251, 0.58) 42%,
      rgba(237, 247, 251, 0.18) 78%,
      rgba(237, 247, 251, 0.06) 100%
    );
  }

  /* Translucent glass ghosted body copy behind the header on every scrolled
     section. Opaque at all times on mobile: no scroll listener, no new state. */
  .site-header {
    background: #f7fbfc;
    backdrop-filter: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: calc(var(--header-h) - 1px);
    gap: 0 1rem;
  }

  /* Content-sized, or the grid's default stretch makes the whole empty 1fr track a
     live link. Set on .brand rather than justify-items, which would also stop
     .nav-links filling the row. */
  .brand {
    justify-self: start;
  }

  .nav-links {
    display: none;
    grid-column: 1 / -1;
    flex-direction: column;
    gap: 0;
    padding-bottom: 0.75rem;
  }

  /* Raised as one full-width surface: lifting only .nav-links left the nav's side
     padding below the scrim, which showed through as dark gutters beside the panel. */
  .site-header[data-nav-open] .site-nav {
    position: relative;
    z-index: 2;
    background: #f7fbfc;
  }

  .site-header[data-nav-open] .nav-links {
    display: flex;
  }

  .nav-links li + li {
    border-top: 1px solid var(--line);
  }

  .nav-links a {
    min-height: 3rem;
    font-size: 0.8125rem;
  }

  .nav-scrim {
    position: fixed;
    z-index: 1;
    inset: var(--header-h) 0 0 0;
    border: 0;
    padding: 0;
    background: rgba(16, 25, 35, 0.38);
  }

  .section {
    min-height: auto;
    padding: clamp(3.5rem, 9vw, 5rem) max(1.25rem, var(--safe-r)) clamp(3.5rem, 9vw, 5rem) max(1.25rem, var(--safe-l));
  }

  .about-block {
    margin-top: 2.5rem;
  }

  .approach,
  .contact-layout,
  .form {
    grid-template-columns: 1fr;
  }

  /* One column, so the status and the button must not claim a second track. */
  .form-status,
  .send {
    grid-column: 1;
  }

  .send {
    justify-self: stretch;
  }

  .field label {
    font-size: 0.75rem;
    letter-spacing: 0.06em;
  }

  .timeline {
    margin-top: 2.5rem;
  }

  .timeline::before,
  .job::after {
    display: none;
  }

  .job,
  .job:nth-child(even) {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-left: 0;
    margin-bottom: 1rem;
    padding: 1rem 1.125rem;
  }

  /* Date first on mobile; DOM order stays company → role → date. */
  .job-when {
    order: -1;
    margin: 0 0 0.375rem;
    font: 700 0.75rem/1.4 ui-monospace, monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5f7280;
  }

  .job-role {
    margin: 0.25rem 0 0;
  }

  .site-footer {
    justify-content: flex-start;
    flex-direction: column;
    gap: 0.5rem;
    letter-spacing: 0.08em;
    padding-bottom: max(1.5rem, var(--safe-b));
  }
}

html[data-nav-lock] {
  overflow: hidden;
  overscroll-behavior: none;
}

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

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