:root {
  --signal: #1F2CFF;
  --signal-deep: #1420C9;
  --paper: #F2F4FF;
  --ink: #0A1340;
  --ink-soft: #46507A;
  --line: #D3D8F2;
  --heat-1: #FFD23F;
  --heat-2: #FF6A2B;
  --heat-3: #E8175D;
  --white: #FFFFFF;

  --font: "Archivo", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1240px;

}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }

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

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

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

.hero {
  background: var(--signal);
  color: var(--white);
  padding: 0 var(--gutter) clamp(48px, 8vw, 96px);
  overflow: hidden;
}

.nav {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0;
}
.nav__mark {
  font-weight: 900;
  font-variation-settings: "wdth" 125;
  text-decoration: none;
  font-size: 1.125rem;
  letter-spacing: 0.02em;
}
.nav__mark { display: inline-flex; align-items: center; gap: 10px; }
.nav__mark img { display: block; transition: transform 0.15s; }
.nav__mark:hover img { transform: rotate(-6deg); }
@media (prefers-reduced-motion: reduce) { .nav__mark img { transition: none; } }
.nav ul { display: flex; gap: clamp(14px, 3vw, 32px); }
.nav ul a {
  text-decoration: none;
  font-size: 0.95rem;
  opacity: 0.85;
}
.nav ul a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

.hero__scan {
  position: relative;
  max-width: var(--max);
  margin: clamp(40px, 9vw, 120px) auto 0;
}

.hero__name {
  font-weight: 900;
  font-variation-settings: "wdth" 125;
  font-size: clamp(2.6rem, 10.4vw, 9.5rem);
  line-height: 0.88;
  letter-spacing: -0.02em;
  text-transform: none;
}
.hero__line { display: block; }

.hero__foot {
  max-width: var(--max);
  margin: clamp(40px, 6vw, 72px) auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 340px);
  gap: clamp(28px, 5vw, 80px);
  align-items: end;
}

.hero__lead {
  font-size: clamp(1.2rem, 2.1vw, 1.55rem);
  line-height: 1.4;
  max-width: 34ch;
  font-weight: 400;
}
.hero__now {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--heat-1);
}
.hero__now::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--heat-1);
  box-shadow: 0 0 0 4px rgba(255, 210, 63, 0.25);
}

.hero__photo {
  aspect-ratio: 4 / 5;
  transform: rotate(2deg);
  border: 6px solid var(--white);
}
.hero__photo img { object-position: 52% 30%; }

/* ---------- Buttons ---------- */

.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

.btn {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.98rem;
  border: 2px solid var(--white);
  transition: background-color 0.15s, color 0.15s;
}
.btn--light { background: var(--white); color: var(--signal); }
.btn--light:hover { background: var(--heat-1); border-color: var(--heat-1); color: var(--ink); }
.btn--ghost { color: var(--white); }
.btn--ghost:hover { background: var(--white); color: var(--signal); }

/* ---------- Photos (graceful when missing) ---------- */

.photo {
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, var(--signal-deep), var(--signal) 60%, var(--heat-2) 140%);
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo.is-missing img { display: none; }

/* ---------- Sections ---------- */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(64px, 10vw, 128px) var(--gutter) 0;
}

.section__title {
  font-weight: 900;
  font-variation-settings: "wdth" 125;
  font-size: clamp(2rem, 5.5vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.015em;
  margin-bottom: clamp(28px, 4vw, 48px);
}
.section__intro {
  color: var(--ink-soft);
  margin: calc(clamp(28px, 4vw, 48px) * -0.6) 0 clamp(28px, 4vw, 48px);
}

h3 {
  font-weight: 800;
  font-variation-settings: "wdth" 110;
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  line-height: 1.2;
}

/* ---------- Timeline ---------- */




/* ---------- Track record: journey ---------- */

.journey { position: relative; }

/* the track: every stop visible on one rail, oldest left, next stop right */
.journey__track {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  position: relative;
  margin-top: 8px;
}
.journey__track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 15px;
  border-top: 3px solid var(--ink);
}
.stop {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 2px;
  padding: 0 8px 14px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.stop__dot {
  width: 18px;
  height: 18px;
  margin: 7px 0 10px;
  background: var(--paper);
  border: 3px solid var(--ink);
  transform: rotate(45deg);
  transition: transform 0.15s, background-color 0.15s;
}
.stop__date { font-size: 0.85rem; color: var(--ink-soft); }
.stop__name { font-weight: 700; line-height: 1.2; }
.stop:hover .stop__dot { transform: rotate(45deg) scale(1.2); }
.stop[aria-selected="true"] .stop__dot { background: var(--signal); transform: rotate(45deg) scale(1.35); }
.stop[aria-selected="true"] .stop__name { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.stop--next .stop__dot { border-style: dashed; }

.journey__controls {
  position: absolute;
  right: 0;
  top: -64px;
  display: flex;
  gap: 8px;
}
.journey__step {
  width: 44px;
  height: 44px;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 800;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.event {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(20px, 4vw, 48px);
  margin-top: 20px;
  align-items: start;
}
.event[hidden] { display: none; }
.event__photo { aspect-ratio: 4 / 3; }
.event__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 65%; }
.event__thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.thumb {
  width: 64px;
  height: 48px;
  padding: 0;
  border: 2px solid transparent;
  background: none;
  cursor: pointer;
  opacity: 0.7;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb[aria-pressed="true"], .thumb:hover { opacity: 1; border-color: var(--ink); }
.event__poster {
  aspect-ratio: 4 / 3;
  display: grid;
  place-content: center;
  text-align: center;
  background: var(--signal);
  color: var(--paper);
}
.event__poster span { font-weight: 900; font-variation-settings: "wdth" 125; font-size: clamp(2rem, 6vw, 4rem); line-height: 1; }
.event__poster small { margin: 8px 0; font-size: 1.15rem; font-weight: 700; }
.event__awards {
  aspect-ratio: 4 / 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr auto;
  gap: 16px;
}
.award {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: clamp(16px, 2.5vw, 28px);
  background: var(--signal);
  color: var(--paper);
  font-weight: 600;
}
.award__big { font-weight: 900; font-variation-settings: "wdth" 125; font-size: clamp(1.6rem, 4vw, 3.2rem); line-height: 1; }
.award--b .award__big { font-size: clamp(1.2rem, 2.6vw, 2rem); }
.award__where { grid-column: 1 / -1; font-weight: 700; }
.event__date { font-weight: 700; color: var(--signal); }
.event h3 { margin-top: 6px; font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.1; }
.event__body p:not(.event__date) { margin-top: 12px; color: var(--ink-soft); font-size: 1.05rem; line-height: 1.6; }
.event__link { display: inline-block; margin-top: 18px; font-weight: 700; }

@media (prefers-reduced-motion: reduce) { .stop__dot { transition: none; } }

@media (max-width: 860px) {
  .event { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .stop__name, .stop__date { display: none; }
  .stop { justify-items: center; padding: 0 0 6px; }
  .journey__controls { position: static; justify-content: flex-end; margin-top: 4px; }
}

/* ---------- About ---------- */

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.about__text p { font-size: clamp(1.1rem, 1.6vw, 1.28rem); line-height: 1.6; max-width: 60ch; }
.about__text p + p { margin-top: 1em; }
.about__facts {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  border-top: 2px solid var(--ink);
}
.about__facts dt, .about__facts dd { padding: 14px 0; border-bottom: 1px solid var(--line); }
.about__facts dt { font-weight: 700; }
.about__facts dd { color: var(--ink-soft); }

/* ---------- Project rows ---------- */

.plist { display: grid; gap: clamp(24px, 3vw, 40px); }
.prow {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  padding-bottom: clamp(24px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.prow:nth-child(even) .prow__img { order: 2; }
.prow__img { aspect-ratio: 16 / 10; }
.prow__img img { transition: transform 0.4s ease; }
.prow:hover .prow__img img { transform: scale(1.03); }
.prow__meta { color: var(--signal); font-weight: 600; font-size: 0.95rem; }
.prow h3 {
  margin-top: 6px;
  font-weight: 900;
  font-variation-settings: "wdth" 125;
  font-size: clamp(1.7rem, 3.6vw, 2.8rem);
  line-height: 1;
}
.prow__body p:not(.prow__meta) { color: var(--ink-soft); margin-top: 12px; max-width: 46ch; }
.prow__more { display: inline-block; margin-top: 18px; font-weight: 700; border-bottom: 2px solid currentColor; }
.prow:hover .prow__more { color: var(--signal); }
@media (prefers-reduced-motion: reduce) { .prow__img img { transition: none; } }

/* ---------- Project pages ---------- */

.page-head {
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px var(--gutter) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.page-head a { font-weight: 600; }
.story { max-width: 820px; margin: 0 auto; padding: clamp(40px, 7vw, 88px) var(--gutter) 0; }
.story__meta { color: var(--signal); font-weight: 600; }
.story__title {
  margin-top: 10px;
  font-weight: 900;
  font-variation-settings: "wdth" 125;
  font-size: clamp(2.6rem, 8vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.story__lead { margin-top: 20px; font-size: clamp(1.15rem, 2vw, 1.45rem); line-height: 1.45; }
.story__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0 24px;
  margin-top: 32px;
  border-top: 2px solid var(--ink);
}
.story__facts div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.story__facts dt { font-size: 0.88rem; color: var(--ink-soft); }
.story__facts dd { font-weight: 700; margin-top: 2px; }
.story__facts a { text-underline-offset: 3px; }
.story h2 {
  margin-top: clamp(48px, 7vw, 80px);
  font-weight: 900;
  font-variation-settings: "wdth" 125;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.05;
}
.story p { margin-top: 1em; font-size: 1.1rem; line-height: 1.65; }
.story ul.points { margin-top: 1em; display: grid; gap: 10px; }
.story ul.points li { padding-left: 22px; position: relative; font-size: 1.05rem; line-height: 1.55; }
.story ul.points li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 9px; height: 9px; background: var(--signal); }
.story figure { margin: 32px 0 0; }
.story figure img { width: 100%; }
.story figcaption { font-size: 0.92rem; color: var(--ink-soft); padding-top: 8px; }
.story .wide { margin-left: calc(-1 * clamp(0px, 8vw, 160px)); margin-right: calc(-1 * clamp(0px, 8vw, 160px)); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.story__next { margin-top: clamp(56px, 8vw, 96px); padding-top: 24px; border-top: 2px solid var(--ink); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-weight: 700; }

/* ---------- Projects ---------- */

.projects {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
}

.project {
  grid-column: span 3;
  background: var(--white);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.project__photo { aspect-ratio: 4 / 3; }
.project__body { padding: clamp(20px, 2.4vw, 32px); }
.project__body p { color: var(--ink-soft); margin-top: 10px; max-width: 62ch; }
.side { margin-top: 28px; color: var(--ink-soft); }
.side a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.project h3 a { text-decoration: none; }
.project h3 a::after { content: " ↗"; color: var(--signal); }
.project h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }

.project--wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}
.project__media { display: flex; flex-direction: column; }
.project--wide .project__photo { aspect-ratio: auto; flex: 1; min-height: 360px; }
.project--wide .project__photo img { object-position: 0% 50%; }
.project--wide .project__body { align-self: center; padding: clamp(24px, 3.5vw, 48px); }
.project--wide h3 { font-size: clamp(1.5rem, 2.8vw, 2.2rem); font-variation-settings: "wdth" 125; font-weight: 900; }
.project--wide .project__body p { color: #C9CFF0; }
.project--wide .tags li { background: rgba(255, 255, 255, 0.1); color: var(--white); }

.project:not(.project--wide):not(.project--compact) { grid-column: span 2; }
.project--compact { background: transparent; border-style: dashed; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.tags li {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--signal);
}

/* Sentinel-2 bands, visible to SWIR: the ones that make fire stand out */
.bands {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
}
.bands span {
  display: flex;
  align-items: flex-end;
  padding: 14px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
}
.bands span:nth-child(1) { background: #2F5BFF; }
.bands span:nth-child(2) { background: #2E9E7A; }
.bands span:nth-child(3) { background: #B33A4E; }
.bands span:nth-child(4) { background: #6A2E7A; }
.bands span:nth-child(5) { background: var(--heat-2); }
.bands span:nth-child(6) { background: var(--heat-1); color: var(--ink); }


/* ---------- Rows (experience / education) ---------- */

.rows { border-top: 2px solid var(--ink); }
.row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.row__when { color: var(--ink-soft); font-size: 0.95rem; }
.row__org { color: var(--signal); font-weight: 600; margin-top: 4px; }
.row p:not(.row__when):not(.row__org) { margin-top: 10px; color: var(--ink-soft); max-width: 62ch; }

.section--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
}
.section--split .row { grid-template-columns: 130px minmax(0, 1fr); }

.skills {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  border-top: 2px solid var(--ink);
}
.skills dt, .skills dd { padding: 18px 0; border-bottom: 1px solid var(--line); }
.skills dt { font-weight: 700; }
.skills dd { color: var(--ink-soft); }

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

.contact {
  margin-top: clamp(80px, 12vw, 160px);
  background: var(--signal);
  color: var(--white);
  padding: clamp(64px, 10vw, 120px) var(--gutter) 32px;
}
.contact__inner { max-width: var(--max); margin: 0 auto; }
.contact__title {
  font-weight: 900;
  font-variation-settings: "wdth" 125;
  font-size: clamp(3rem, 11vw, 9rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
}
.contact__lead { margin-top: 24px; font-size: clamp(1.1rem, 1.8vw, 1.35rem); max-width: 40ch; }
.contact .links { margin-top: 32px; }
.contact__small { margin-top: clamp(64px, 8vw, 112px); opacity: 0.7; font-size: 0.88rem; }

/* ---------- Theme switcher (dev only) ---------- */

.theme-switch {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #fff;
  border: 1px solid #ccd;
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  font-family: system-ui, sans-serif;
}
.theme-switch button {
  font: inherit;
  font-size: 0.85rem;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #223;
  cursor: pointer;
}
.theme-switch button[aria-pressed="true"] { background: #223; color: #fff; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .hero__foot { grid-template-columns: 1fr; }
  .hero__photo { max-width: 260px; order: -1; }
  .projects .project,
  .projects .project:not(.project--wide):not(.project--compact) { grid-column: 1 / -1; }
  .project--wide { grid-template-columns: 1fr; }
  .project--wide .project__photo { aspect-ratio: 4 / 3; min-height: 0; }
  .section--split, .about__grid { grid-template-columns: 1fr; }
  .prow { grid-template-columns: 1fr; }
  .prow:nth-child(even) .prow__img { order: 0; }
  .story .wide { margin-left: 0; margin-right: 0; }
}

@media (max-width: 600px) {
  .nav ul { display: none; }
  .row, .section--split .row { grid-template-columns: 1fr; gap: 6px; }
  .row__when br { display: none; }
  .skills, .about__facts { grid-template-columns: 1fr; }
  .about__facts dt { padding-bottom: 0; border-bottom: 0; }
  .pair { grid-template-columns: 1fr; }
  .skills dt { padding-bottom: 0; border-bottom: 0; }
  .skills dd { padding-top: 4px; }
}
