/* site.css — the whole stylesheet. Layout: a left "rail" holds keys (dates,
   skill groups, labels) and the body column holds values, so every section
   lines up on the same two edges. */

:root {
  --paper: #f5f7fa;
  --surface: #ffffff;
  --ink: #1a2230;
  --muted: #566070;
  --rule: #d8dee6;
  --rule-strong: #b9c2cf;
  --accent: #22529a;
  --accent-hover: #1a427e;
  --on-accent: #ffffff;
  --track: #e4e9f0;
  --seg-0: #22529a;
  --seg-1: #4a6ea9;
  --seg-2: #8c96a5;
  --led: #2e8540;
  --error: #b42318;

  --rail: 10rem;
  --gap: 2.5rem;
  --measure: 42rem;
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12171f;
    --surface: #19202a;
    --ink: #e7ebf1;
    --muted: #a3adbb;
    --rule: #2a3340;
    --rule-strong: #3d4757;
    --accent: #8fb2ec;
    --accent-hover: #b3cbf3;
    --on-accent: #0f1620;
    --track: #222a35;
    --seg-0: #3a6bb8;
    --seg-1: #2d4f85;
    --seg-2: #4a5464;
    --led: #4cc46a;
    --error: #f59e8b;
  }
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Public Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--accent-hover);
}

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

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius);
  z-index: 10;
}

.skip:focus {
  top: 1rem;
}

.wrap {
  max-width: calc(var(--rail) + var(--gap) + var(--measure) + 5rem);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

/* ── Rail + body rows ─────────────────────────────── */

.row {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, var(--measure));
  column-gap: var(--gap);
}

.row > .body {
  grid-column: 2;
}

.when,
.seg-years,
.career-ticks {
  font-variant-numeric: tabular-nums;
}

.rail {
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5;
  padding-top: 0.1rem;
}

/* ── Masthead ─────────────────────────────────────── */

.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  padding-block: clamp(2rem, 6vw, 3.5rem) 2rem;
}

.masthead-grid {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, var(--measure));
  column-gap: var(--gap);
  align-items: center;
}

.portrait {
  grid-row: 1 / span 2;
  justify-self: end;
  width: 6.5rem;
  height: auto;
  border-radius: 50%;
  border: 1px solid var(--rule);
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.role {
  margin-top: 0.4rem;
  font-size: 1.25rem;
  line-height: 1.35;
}

.meta {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-weight: 600;
}

.led {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--led);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--led) 22%, transparent);
}

.actions {
  grid-column: 2;
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

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

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--on-accent);
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* ── Intro ────────────────────────────────────────── */

.intro {
  padding-block: 2.75rem 0.5rem;
}

.lead {
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.35;
}

.summary {
  margin-top: 0.75rem;
}

.summary-points {
  margin-top: 0.75rem;
  padding-left: 1.1rem;
}

.summary-points li {
  margin-top: 0.3rem;
  padding-left: 0.2rem;
}

.summary-points li::marker {
  color: var(--muted);
}

/* ── Sections ─────────────────────────────────────── */

.block {
  padding-block: 2.75rem 0;
}

.block > h2 {
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
}

.section-intro {
  margin-bottom: 0.5rem;
}

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

.job {
  margin-top: 2rem;
}

.org {
  color: var(--muted);
}

.job ul {
  margin-top: 0.6rem;
  padding-left: 1.1rem;
}

.job li {
  margin-top: 0.3rem;
  padding-left: 0.2rem;
}

.job li::marker {
  color: var(--muted);
}

.pairs .row {
  padding-block: 0.6rem;
}

.pairs .row + .row {
  border-top: 1px solid var(--rule);
}

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

/* Skills: on-prem and cloud side by side, joined by the "seam" row. */

.sides {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  max-width: calc(var(--rail) + var(--gap) + var(--measure));
  margin-top: 1.75rem;
}

.side h3 {
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--ink);
}

.side dl > div {
  display: grid;
  grid-template-columns: 7.25rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 0.6rem;
  border-bottom: 1px solid var(--rule);
}

.side dt {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5;
  padding-top: 0.1rem;
}

.seam {
  max-width: calc(var(--rail) + var(--gap) + var(--measure));
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-top: 0.9rem;
  border-top: 2px solid var(--accent);
}

.seam .rail {
  color: var(--accent);
  font-size: 1rem;
}

.seam ul {
  padding-left: 1.1rem;
}

.seam li + li {
  margin-top: 0.35rem;
}

.chains {
  list-style: none;
  padding: 0;
  margin-top: 0.35rem;
  display: grid;
  gap: 0.35rem;
}

.chains li,
.seam .chains li + li {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0.4rem;
  font-weight: 600;
}

.arrow {
  width: 1rem;
  height: 0.625rem;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

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

#contact > .row:last-child {
  margin-top: 1.5rem;
}

/* ── Career bar ───────────────────────────────────── */

.career {
  max-width: calc(var(--rail) + var(--gap) + var(--measure));
  margin-bottom: 0.5rem;
}

.career-track {
  position: relative;
  height: 3.25rem;
  margin-top: 2rem;
  background: var(--track);
  border-radius: var(--radius);
}

.seg {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 0.75rem;
  border-right: 3px solid var(--paper);
  border-radius: var(--radius);
  color: #fff;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
}

.seg:last-child {
  border-right: 0;
}

.seg.tone-0 { background: var(--seg-0); }
.seg.tone-1 { background: var(--seg-1); }
.seg.tone-2 { background: var(--seg-2); }

.seg:hover {
  color: #fff;
  filter: brightness(1.12);
}

.seg-name {
  font-size: 0.9375rem;
  font-weight: 600;
}

.seg-years {
  font-size: 0.8125rem;
}

/* Segments too narrow for a label carry it above the bar instead. */
.seg.narrow {
  padding: 0;
}

.seg.narrow .seg-name,
.seg.narrow .seg-years {
  position: absolute;
  bottom: calc(100% + 0.35rem);
  left: 0;
  color: var(--ink);
}

.seg.narrow .seg-years {
  display: none;
}

.career-ticks {
  position: relative;
  height: 1.5rem;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.career-ticks span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}

.career-ticks span:first-child {
  transform: none;
}

@media (prefers-reduced-motion: no-preference) {
  /* One load moment: the career fills in left to right. A clip reveal keeps
     labels undistorted; fill-mode backwards drops the clip afterwards so the
     narrow segment's outside label shows. */
  .seg {
    animation: seg-grow 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  }
  .seg.tone-1 { animation-delay: 0.15s; }
  .seg.tone-0 { animation-delay: 0.3s; }

  @keyframes seg-grow {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0 0 0 0); }
  }
}

/* ── Contact form ─────────────────────────────────── */

.contact-form {
  display: grid;
  gap: 1rem;
}

.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}

.field textarea {
  resize: vertical;
}

.field input:focus-visible,
.field textarea:focus-visible {
  border-color: var(--accent);
  outline-offset: 1px;
}

.gotcha {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.form-status {
  font-size: 0.9375rem;
}

.form-status.ok { color: var(--led); font-weight: 600; }
.form-status.error { color: var(--error); }
.form-status.pending { color: var(--muted); }

/* ── Footer ───────────────────────────────────────── */

.footer {
  margin-top: 4rem;
  padding-block: 1.5rem 2.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.footer p {
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
}

/* ── Narrow screens: rail stacks above its value ──── */

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

  .row > .body,
  .actions {
    grid-column: 1;
  }

  .rail {
    padding-top: 0;
  }

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

  .portrait {
    grid-row: 1;
    justify-self: start;
    width: 4.5rem;
  }

  .actions {
    grid-column: 1 / -1;
  }

  .actions .btn-primary {
    flex-basis: 100%;
  }

  .actions .btn:not(.btn-primary) {
    flex: 1;
  }

  .field-pair,
  .sides {
    grid-template-columns: minmax(0, 1fr);
  }

  .seam ul {
    margin-top: 0.4rem;
  }
}

@media (max-width: 420px) {
  .side dl > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
  }
}

/* ── Print: the page itself prints as a resume ───── */

@media print {
  :root {
    --paper: #fff;
    --surface: #fff;
  }

  body {
    font-size: 10.5pt;
  }

  .masthead {
    border: 0;
    padding-block: 0 1rem;
  }

  .actions,
  .skip,
  .footer,
  #contact > .row:last-child {
    display: none;
  }

  .career,
  .seg {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
    animation: none;
  }

  .job,
  .pairs .row {
    break-inside: avoid;
  }

  .block > h2 {
    break-after: avoid;
  }
}
