:root {
  color-scheme: light;
  --paper: #fcfcfa;
  --ink: #1c2127;
  --muted: #5c6670;
  --line: #e4e2db;
  --azure: #2b5da8;
  --azure-soft: rgba(43, 93, 168, 0.09);
  --laser: #d8442b;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Lato", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --display: "Lato", ui-sans-serif, system-ui, sans-serif;
  --head: #3d4248;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation: none !important;
    transition: none !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
}

a {
  color: inherit;
}

::selection {
  background: var(--azure-soft);
}

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

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 18px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(252, 252, 250, 0.9);
  backdrop-filter: blur(12px);
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(14px, 2.4vw, 30px);
}

.site-header a {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}

.site-header a:hover,
.site-header a.active {
  color: var(--azure);
}

/* ---------- layout ---------- */

main {
  width: min(1060px, calc(100% - 48px));
  margin: 0 auto;
}

.section {
  padding: clamp(72px, 11vw, 130px) 0;
  border-bottom: 1px solid var(--line);
}

.section:last-child {
  border-bottom: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 16px;
  color: var(--azure);
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.eyebrow::before {
  content: "";
  width: 34px;
  height: 2.5px;
  background: var(--azure);
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 400;
  color: var(--head);
  margin-top: 0;
}

h1 {
  margin-bottom: 34px;
  font-size: clamp(38px, 5.2vw, 56px);
  line-height: 1.1;
}

h2 {
  margin-bottom: 38px;
  font-size: clamp(32px, 4.4vw, 50px);
  line-height: 1.08;
}

h3 {
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 0;
  margin-bottom: 10px;
}

p {
  margin-top: 0;
}

/* ---------- hero ---------- */

.hero-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.hero-copy p {
  max-width: 56ch;
  color: var(--muted);
  font-size: 17.5px;
}

.hero-copy strong {
  color: var(--ink);
  font-weight: 600;
}

.cv-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 20px;
  margin-top: 28px;
}

.cv-link {
  color: var(--ink);
  font-size: 16.5px;
  font-weight: 400;
  text-decoration-color: var(--ink);
  text-underline-offset: 4px;
}

.cv-link:hover {
  color: var(--azure);
  text-decoration-color: var(--azure);
}

/* hero photo */

.hero-photo {
  margin: 0;
  margin-top: -95px; /* raise photo to sit level with the About me heading */
}

.hero-photo img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 344px;
  margin-left: auto;
}

/* ---------- projects ---------- */

.proj-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  margin: 6px 0 30px;
}

.pf {
  appearance: none;
  border: 0;
  background: none;
  padding: 5px 10px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted, #6b7683);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.pf:hover {
  color: var(--ink, #1f2933);
}

.pf.active {
  background: rgba(43, 93, 168, 1);
  color: #fff;
}

.project-grid {
  column-count: 3;
  column-gap: clamp(16px, 2.5vw, 26px);
}

.project-grid .proj {
  break-inside: avoid;
  margin-bottom: clamp(16px, 2.5vw, 26px);
}

.proj.is-hidden {
  display: none;
}

.proj.is-shown {
  animation: projIn 0.35s ease both;
}

@keyframes projIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.proj {
  position: relative;
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
  cursor: default;
}

.proj-art {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, var(--azure-soft) 1px, transparent 1px),
    linear-gradient(0deg, var(--azure-soft) 1px, transparent 1px);
  background-size: 26px 26px;
}

.proj-art svg {
  display: block;
  width: 100%;
  height: auto;
}

.proj-art--photo img,
.proj-art--photo video {
  display: block;
  width: 100%;
  height: auto;
}

.art-ink {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
}

.art-azure {
  fill: var(--azure-soft);
  stroke: var(--azure);
  stroke-width: 1.3;
}

.art-azure-s {
  fill: none;
  stroke: var(--azure);
  stroke-width: 1.6;
}

.art-ray {
  fill: none;
  stroke: var(--azure);
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
}

.art-laser {
  stroke: var(--laser);
  stroke-width: 1.2;
}

.art-laser-o {
  fill: none;
  stroke: var(--laser);
  stroke-width: 1.3;
}

.proj-body {
  padding: 18px 20px 20px;
}

.proj-body h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.proj-body p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.proj-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 7px;
  padding: 18px 20px;
  background: rgba(43, 93, 168, 0.96);
  color: #fff;
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.proj:hover .proj-overlay,
.proj:focus-visible .proj-overlay,
.proj.is-open .proj-overlay {
  opacity: 1;
}

.proj:hover .proj-overlay h3,
.proj:focus-visible .proj-overlay h3,
.proj.is-open .proj-overlay h3,
.proj:hover .proj-overlay .ov-meta,
.proj:focus-visible .proj-overlay .ov-meta,
.proj.is-open .proj-overlay .ov-meta {
  transform: translateY(0);
  opacity: 1;
}

.proj-overlay h3 {
  color: #fff;
  font-size: 17.5px;
  line-height: 1.3;
  margin: 0;
  transform: translateY(-150px);
  opacity: 0;
  transition: transform 520ms cubic-bezier(0.22, 0.7, 0.3, 1), opacity 420ms ease;
}

.ov-meta {
  transform: translateY(150px);
  opacity: 0;
  transition: transform 520ms cubic-bezier(0.22, 0.7, 0.3, 1), opacity 420ms ease;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.ov-when {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ov-where {
  font-family: var(--sans);
  font-size: 19px;
  font-weight: 700;
}

.ov-role {
  font-family: var(--mono);
  font-size: 12.5px;
  opacity: 0.85;
}

/* ---------- experience ---------- */

.timeline {
  position: relative;
  display: grid;
  gap: clamp(44px, 6vw, 72px);
  padding-left: clamp(34px, 5vw, 56px);
}

.timeline::before {
  content: "";
  position: absolute;
  top: -14px;
  bottom: 0;
  left: 5px;
  width: 2px;
  background: var(--ink);
}

.timeline article {
  position: relative;
}

/* paper mask that breaks the line around the marker */
.timeline article::after {
  content: "";
  position: absolute;
  top: 3px;
  left: calc(-1 * clamp(34px, 5vw, 56px) - 4px);
  width: 20px;
  height: 20px;
  background: var(--paper);
  transform: rotate(45deg);
}

/* the diamond itself */
.timeline article::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 9px;
  left: calc(-1 * clamp(34px, 5vw, 56px) + 2px);
  width: 8px;
  height: 8px;
  background: var(--ink);
  transform: rotate(45deg);
  transition: transform 300ms ease, background 200ms ease;
}

.timeline article:hover::before {
  background: var(--azure);
  transform: rotate(135deg);
}

.badge {
  display: inline-block;
  margin: 0 0 16px;
  padding: 4px 14px;
  background: var(--ink);
  color: #fff;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

.badge {
  transition: background 140ms ease;
}

.timeline article:hover .badge {
  background: var(--azure);
}

.timeline h3 {
  font-size: clamp(23px, 2.8vw, 28px);
  margin-bottom: 8px;
}

.org {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  color: var(--azure);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.org::before {
  content: "";
  width: 38px;
  height: 2px;
  flex-shrink: 0;
  background: var(--azure);
}

.timeline ul {
  margin: 0;
  padding-left: 20px;
  list-style: circle;
}

.timeline li {
  margin: 9px 0;
  color: var(--muted);
  font-size: 15.5px;
}

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

/* ---------- contact ---------- */

.contact-list h3 {
  font-family: var(--display);
  font-size: 23px;
  font-weight: 400;
  color: var(--head);
  margin: 34px 0 8px;
}

.contact-list h3:first-child {
  margin-top: 0;
}

.contact-mail {
  color: var(--muted);
  font-size: 15.5px;
  text-decoration: none;
}

.contact-mail:hover {
  color: var(--azure);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.social-icons {
  display: flex;
  gap: 16px;
  margin: 4px 0 0;
}

.social-icons a {
  color: #4a5158;
}

.social-icons a:hover {
  color: var(--azure);
}

.social-icons svg {
  display: block;
}

.footer-note {
  margin: 48px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero-columns {
    grid-template-columns: 1fr;
  }

  .hero-photo {
    margin-top: 0;
  }

  .hero-photo img {
    margin-left: 0;
    max-width: 310px;
  }

  .project-grid {
    column-count: 2;
  }

}

@media (max-width: 560px) {
  .site-header {
    justify-content: flex-start;
  }

  .project-grid {
    column-count: 1;
  }

}
