/* Archivo (SIL OFL 1.1, see /fonts/OFL-Archivo.txt). Variable width 62-125%, weight 100-900. */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("/fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations"),
       url("/fonts/archivo-latin-wdth-normal.woff2") format("woff2");
}

:root {
  color-scheme: light dark;

  /* Base palette */
  --paper: #F5F6F8;
  --ink: #14213D;
  --slate: #536074;
  --rule: #D3D9E1;
  --link: #14213D;

  /* Patch cords: blue for my assistant, orange for the Zoom handoff */
  --cord-agent: #2F5BDA;
  --cord-handoff: #C2540A;

  /* Console faceplate */
  --panel: #14213D;
  --panel-raised: #1C2B4D;
  --panel-ink: #E8EDF5;
  --panel-muted: #9BA9C0;
  --panel-rule: #2E3F66;
  --panel-cord-agent: #7C9CFF;
  --panel-cord-handoff: #FF8A3D;

  --focus: #C2540A;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --measure: 68ch;
  --gutter: clamp(16px, 4vw, 48px);
  --page-max: 1200px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F1830;
    --ink: #E6EBF3;
    --slate: #A3AEC0;
    --rule: #26324D;
    --link: #E6EBF3;
    --cord-agent: #7C9CFF;
    --cord-handoff: #FF8A3D;
    --panel: #18233F;
    --panel-raised: #22305A;
    --panel-rule: #34477A;
    --focus: #FF8A3D;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-stretch: 100%;
  font-weight: 400;
  text-rendering: optimizeLegibility;
}

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

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

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
  z-index: 10;
}
.skip-link:focus { top: 12px; }

/* Header */
.site-header {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 20px var(--gutter);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.wordmark {
  font-stretch: 87%;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.site-header ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}
.site-header nav a {
  font-stretch: 87%;
  font-weight: 500;
  text-decoration: none;
}
.site-header nav a:hover { text-decoration: underline; }
@media (max-width: 559px) {
  .site-header { flex-direction: column; gap: 6px; padding-bottom: 8px; }
  .site-header ul { gap: 4px 18px; }
}

/* Hero */
.hero {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 48px) var(--gutter) clamp(48px, 8vw, 96px);
}
.name {
  margin: 0 0 clamp(20px, 3vw, 40px);
  font-size: clamp(3rem, 1.6rem + 7vw, 7.25rem);
  line-height: 0.92;
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: -0.015em;
}
.hero-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
@media (min-width: 960px) {
  .hero-body { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; }
}
.lede {
  margin: 0 0 20px;
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem);
  line-height: 1.42;
  font-weight: 450;
  max-width: 34ch;
}
.hero-meta {
  margin: 0 0 24px;
  color: var(--slate);
  max-width: 44ch;
}
.hero-note {
  margin: 28px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  color: var(--slate);
  font-size: 0.9375rem;
  max-width: 44ch;
}
/* On narrow screens the console's own intro covers this, and it keeps the console closer to the top. */
@media (max-width: 959px) {
  .hero-note { display: none; }
}

/* Buttons */
.link-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 550;
  font-stretch: 95%;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.button-primary { background: var(--ink); color: var(--paper); }
.button-primary:hover { background: color-mix(in srgb, var(--ink) 88%, var(--paper)); }
.button-handoff { border-color: var(--cord-handoff); color: var(--cord-handoff); }
.button-handoff:hover { background: color-mix(in srgb, var(--cord-handoff) 10%, transparent); }

/* Console placement (internals live in the component's shadow DOM) */
agent-console {
  display: block;
  min-width: 0;
}

/* Sections */
.section {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) var(--gutter);
  border-top: 1px solid var(--rule);
}
.section h2 {
  margin: 0 0 32px;
  font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem);
  line-height: 1.15;
  font-stretch: 112%;
  font-weight: 750;
  letter-spacing: -0.01em;
}
.section h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 650;
}
.section p { margin: 0 0 12px; max-width: var(--measure); }

.pillars {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px 48px;
}
@media (min-width: 820px) {
  .pillars { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.section-footnote {
  margin-top: 32px;
  color: var(--slate);
}

/* Experience timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.role {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px 40px;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
}
.role:first-child { border-top: 0; padding-top: 0; }
@media (min-width: 820px) {
  .role { grid-template-columns: 200px minmax(0, 1fr); }
}
.section .role-dates {
  margin: 0;
  color: var(--slate);
  font-stretch: 87%;
  font-weight: 500;
  padding-top: 2px;
}
.section .role-org {
  margin: 0 0 12px;
  color: var(--slate);
}
.role-body ul {
  margin: 0;
  padding-left: 1.1em;
  max-width: var(--measure);
}
.role-body li { margin: 0 0 8px; }
.role-body li::marker { color: var(--slate); }

/* Projects */
.projects {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 36px 56px;
  margin-bottom: 48px;
}
@media (min-width: 820px) {
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.section .stack {
  color: var(--slate);
  font-stretch: 87%;
  font-size: 0.9375rem;
}
.section .subhead {
  margin: 0 0 16px;
  font-size: 1.125rem;
  font-stretch: 100%;
  font-weight: 650;
}
.earlier {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 80ch;
}
.earlier li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px 24px;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
}
@media (min-width: 640px) {
  .earlier li { grid-template-columns: 140px minmax(0, 1fr); }
}
.earlier a { font-weight: 600; }
.earlier span { color: var(--slate); }

/* Skills */
.skills {
  margin: 0 0 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px 48px;
}
@media (min-width: 820px) {
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.skills dt { font-weight: 650; margin-bottom: 2px; }
.skills dd { margin: 0; color: var(--slate); max-width: 60ch; }

.education {
  list-style: none;
  margin: 0;
  padding: 0;
}
.education li { padding: 6px 0; }
.education .degree { font-weight: 600; margin-right: 8px; }
.education .school { color: var(--slate); }

/* Contact */
.contact .contact-email {
  margin: 8px 0 28px;
  font-size: clamp(1.5rem, 1rem + 2.6vw, 2.75rem);
  line-height: 1.1;
  font-stretch: 118%;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.contact .contact-email a { text-decoration-thickness: 2px; }
.section .zoom-status {
  margin-top: 16px;
  min-height: 1.6em;
  color: var(--slate);
  font-size: 0.9375rem;
}

/* Footer */
.site-footer {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 32px var(--gutter) 48px;
  border-top: 1px solid var(--rule);
  color: var(--slate);
  font-size: 0.9375rem;
}
.site-footer p { margin: 0; }

/* Highlight when the assistant points at part of the page */
.section, .role, .project, #project-earlier, #education { scroll-margin-top: 24px; }
.is-spotlit {
  outline: 2px solid var(--cord-agent);
  outline-offset: 10px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--cord-agent) 7%, transparent);
  /* Extends the tint into the outline offset so it reads as one block */
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--cord-agent) 7%, transparent);
  transition: outline-color 600ms ease, background-color 600ms ease, box-shadow 600ms ease;
}
@media (prefers-reduced-motion: reduce) {
  .is-spotlit { transition: none; }
}

/* Zoom Scheduler dialog */
.scheduler-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(20, 33, 61, 0.35);
}
.scheduler-dialog::backdrop { background: rgba(15, 24, 48, 0.55); }
.scheduler-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
}
.scheduler-head h2 { margin: 0; font-size: 1.125rem; font-weight: 650; }
.scheduler-dialog iframe {
  display: block;
  width: 100%;
  height: min(640px, calc(100dvh - 120px));
  border: 0;
  background: #fff;
}

/* Floating shortcut back to the console */
.ask-float {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 5;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--panel);
  color: var(--panel-ink);
  font: inherit;
  font-weight: 600;
  font-stretch: 95%;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(20, 33, 61, 0.28);
}
.ask-float::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--panel-cord-agent);
}
.ask-float[hidden] { display: none; }
