/* ============================================================
   KORNEL ORY — one-screen landing page
   Tokens live at the top. Change them and the page follows.
   ============================================================ */

:root {
  /* colour */
  --blue:      #17457A;   /* primary */
  --blue-deep: #0E2C50;   /* hover, portrait wash */
  --paper:     #F6F7F9;   /* page */
  --ink:       #0D1014;   /* headings */
  --muted:     #6E7885;   /* secondary text */
  --line:      #E1E4E9;   /* hairlines */

  /* type */
  --display: "Familjen Grotesk", system-ui, sans-serif;
  --body:    "Public Sans", system-ui, sans-serif;

  /* rhythm */
  --edge: clamp(1.5rem, 4vw, 3.5rem);   /* page margin */
  --row:  1.75rem;                       /* vertical breathing */

  /* one dial: scales everything so the page always fits the screen */
  font-size: clamp(12px, 0.42vw + 0.62vh + 4px, 18px);
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, p, ul, ol, li { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }

body {
  height: 100dvh;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* ---- shell -------------------------------------------------
   header spans full width · main left · portrait right ·
   footer spans full width. No boxes, only hairlines.
------------------------------------------------------------ */
.page {
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(15rem, 26vw, 23rem);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "header  portrait"
    "main    portrait"
    "footer  portrait";
  column-gap: clamp(2rem, 5vw, 5rem);
}

/* ---- header ------------------------------------------------ */
.header {
  grid-area: header;
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 2rem;
  padding: var(--row) 0 var(--row) var(--edge);
}
.wordmark {
  font-family: var(--display); font-weight: 700;
  font-size: 1.05rem; letter-spacing: -.015em;
  text-decoration: none; color: inherit;
}
.nav { display: flex; gap: clamp(1rem, 2.2vw, 2rem); }
.nav-item {
  font-size: .92rem; color: var(--muted);
  padding-bottom: .2rem; border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
  text-decoration: none;
}
.nav-item:hover { color: var(--ink); }
.nav-item.is-active { color: var(--ink); border-bottom-color: var(--blue); }

/* ---- main column ------------------------------------------ */
.main {
  grid-area: main;
  min-height: 0;
  overflow: hidden;
  padding-left: var(--edge);
  display: flex; flex-direction: column; justify-content: center;
  gap: clamp(1.25rem, 3vh, 2.5rem);
}

/* hero */
.eyebrow {
  font-size: .82rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--blue); font-weight: 500;
}
.headline {
  margin-top: .75rem;
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.85rem, 3.8vw, 3.5rem);
  line-height: 1.05; letter-spacing: -.035em;
  max-width: 16ch; text-wrap: balance;
}
.lede {
  margin-top: .85rem;
  font-size: .98rem; color: var(--muted); max-width: 38ch;
}

/* figures — set inline, quiet, not a dashboard */
.figures { display: flex; gap: clamp(2rem, 5vw, 4.5rem); }
.figure { display: flex; align-items: baseline; gap: .6rem; }
.figure-value {
  font-family: var(--display); font-weight: 700;
  font-size: 1.9rem; letter-spacing: -.03em; color: var(--blue);
  font-variant-numeric: tabular-nums;
}
.figure-label { font-size: .88rem; color: var(--muted); }

/* career — three stints side by side, hairline over each */
.career-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1.5rem; margin-bottom: 1rem;
}
.label {
  font-size: .8rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.link-button {
  font-size: .88rem; color: var(--blue);
  border-bottom: 1px solid currentColor; padding-bottom: 1px;
  transition: color .2s ease;
}
.link-button:hover { color: var(--blue-deep); }
a.link-button { text-decoration: none; }

.track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 2.25rem); }
.stint { padding-top: .8rem; border-top: 1px solid var(--line); }
.years {
  font-size: .82rem; font-weight: 500; color: var(--blue);
  font-variant-numeric: tabular-nums;
}
.post { margin-top: .3rem; font-family: var(--display); font-weight: 600; font-size: .95rem; letter-spacing: -.015em; }
.impact { margin-top: .15rem; font-size: .82rem; color: var(--muted); max-width: 22ch; }

/* ---- portrait column -------------------------------------- */
.portrait { grid-area: portrait; padding: var(--row) var(--edge) var(--row) 0; }
.portrait-frame {
  position: relative; height: 100%; overflow: hidden;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--blue) 0%, var(--blue-deep) 100%);
}
.portrait-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}
.portrait-photo--mobile { display: none; }

/* signature: a single racing line through the frame */
.apex { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.apex-path {
  fill: none; stroke: rgba(255, 255, 255, .35); stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 900; stroke-dashoffset: 900;
  animation: draw 1.6s cubic-bezier(.4, 0, .1, 1) .3s forwards;
}
.apex-path--mobile { display: none; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---- footer ------------------------------------------------ */
.footer {
  grid-area: footer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: var(--edge);
  padding: 1rem 0 var(--row);
  border-top: 1px solid var(--line);
}

.footer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .55rem .85rem;
  font-size: .82rem;
  color: var(--muted);
}

.footer-bar-row {
  display: contents;
}

.footer-bar-item {
  color: inherit;
  text-decoration: none;
  transition: color .2s ease;
  white-space: nowrap;
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a.footer-bar-item:hover,
.footer-bar-item a:hover {
  color: var(--blue);
}

.footer-bar-item a {
  color: inherit;
  text-decoration: none;
  transition: color .2s ease;
}

.footer-bar-sep {
  color: var(--line);
  user-select: none;
}

.contact { display: flex; flex-wrap: wrap; gap: clamp(.75rem, 1.5vw, 1.5rem); }
.contact-item { font-size: .82rem; color: var(--muted); text-decoration: none; transition: color .2s ease; white-space: nowrap; }
.contact-item:hover { color: var(--blue); }

/* ---- contact page ----------------------------------------- */
.page--contact {
  grid-template-areas:
    "header  portrait"
    "main    portrait"
    "footer  portrait";
}

.main--contact {
  gap: clamp(2rem, 5vh, 3.5rem);
}

.contact-rows { display: grid; gap: 0; max-width: 36ch; }
.contact-row {
  display: grid;
  gap: .35rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}
.contact-row:last-child { border-bottom: 1px solid var(--line); }
.contact-value {
  font-family: var(--body);
  font-weight: 400;
  font-size: .98rem;
  letter-spacing: normal;
  color: var(--ink);
  text-decoration: none;
  transition: color .2s ease;
}
a.contact-value:hover { color: var(--blue); }
.contact-value--muted { color: var(--muted); }

/* ---- career page ------------------------------------------ */
body.page-career {
  height: auto;
  overflow: auto;
}

.page--career {
  height: auto;
  min-height: 100dvh;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "header"
    "main"
    "footer";
  column-gap: 0;
}

.header--scroll {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  box-sizing: border-box;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding-top: calc(var(--row) + env(safe-area-inset-top, 0px));
  padding-right: var(--edge);
  padding-bottom: var(--row);
  padding-left: var(--edge);
}

.career-main {
  grid-area: main;
  position: relative;
  padding: clamp(1.5rem, 4vh, 3rem) var(--edge) clamp(3rem, 8vh, 5rem);
  max-width: 52rem;
}

/* ---- timeline rail (phone left + desktop right) ----------- */
.timeline-rail {
  display: flex;
  position: fixed;
  top: 50%;
  left: max(.45rem, env(safe-area-inset-left, 0px));
  right: auto;
  transform: translateY(-50%);
  z-index: 8;
  width: .85rem;
  height: min(42vh, 16rem);
  align-items: stretch;
  justify-content: center;
  pointer-events: none;
}

.timeline-rail[hidden] { display: none; }

.timeline-rail-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  transform: translateX(-50%);
  background: var(--line);
}

.timeline-rail-progress {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 0%;
  background: var(--blue);
  transition: height .15s linear;
}

.timeline-rail-list {
  position: relative;
  z-index: 1;
  display: block;
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

.timeline-rail-item {
  position: absolute;
  left: 0;
  display: flex;
  justify-content: center;
  width: 100%;
  transform: translateY(-50%);
}

.timeline-rail-link {
  position: relative;
  display: block;
  width: .85rem;
  height: .85rem;
  font-size: 0;
  line-height: 0;
  color: transparent;
  text-decoration: none;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.timeline-rail-link::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: .4rem;
  height: .4rem;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  transform: translate(-50%, -50%);
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.timeline-rail-link.is-active::before {
  background: var(--blue);
  border-color: var(--blue);
  transform: translate(-50%, -50%) scale(1.2);
}

@media (min-width: 1100px) {
  .career-main {
    max-width: none;
    padding-right: calc(var(--edge) + 9rem);
  }

  .timeline {
    max-width: 52rem;
  }

  .timeline-rail {
    left: auto;
    right: clamp(1.25rem, 3vw, 2.75rem);
    width: auto;
    height: auto;
    min-height: 14rem;
    gap: .85rem;
    justify-content: flex-start;
    pointer-events: auto;
  }

  .timeline-rail-line {
    position: relative;
    left: auto;
    top: auto;
    bottom: auto;
    transform: none;
    flex-shrink: 0;
    align-self: stretch;
    margin: .55rem 0;
  }

  .timeline-rail-list {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: auto;
    height: auto;
    min-height: 14rem;
    gap: 1.35rem;
  }

  .timeline-rail-item {
    position: relative;
    left: auto;
    width: auto;
    transform: none;
    display: block;
  }

  .timeline-rail-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: auto;
    height: auto;
    font-size: .72rem;
    line-height: 1.2;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    transition: color .2s ease;
  }

  .timeline-rail-link::before {
    left: calc(-.85rem - .5px);
    top: 50%;
    width: .45rem;
    height: .45rem;
    transform: translate(-50%, -50%);
  }

  .timeline-rail-link:hover { color: var(--ink); }

  .timeline-rail-link.is-active {
    color: var(--blue);
  }

  .timeline-rail-link.is-active::before {
    transform: translate(-50%, -50%) scale(1.15);
  }
}

.timeline {
  display: grid;
  gap: clamp(2.5rem, 5vh, 4rem);
}

.era {
  display: grid;
  gap: 1.25rem;
}

.era-label {
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--line);
}

.era-range {
  letter-spacing: .04em;
  text-transform: none;
  font-weight: 400;
  color: var(--muted);
  opacity: .85;
}

.era-intro {
  font-size: .95rem;
  color: var(--muted);
  max-width: 44ch;
  line-height: 1.55;
  margin-top: -.35rem;
}

.era-cards {
  display: grid;
  gap: 1rem;
  position: relative;
  padding-left: 1.25rem;
}

.era-cards::before {
  content: "";
  position: absolute;
  left: 0;
  top: .35rem;
  bottom: .35rem;
  width: 1px;
  background: var(--line);
}

@media (max-width: 1099px) {
  .era-cards {
    padding-left: 0;
  }

  .era-cards::before {
    display: none;
  }

  .story-card::before {
    display: none;
  }
}

.story-card {
  position: relative;
  display: grid;
  gap: .65rem;
  padding: .35rem 0 1.25rem;
}

.story-card::before {
  content: "";
  position: absolute;
  left: -1.25rem;
  top: 1.15rem;
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: var(--blue);
  transform: translate(-50%, -50%);
}

.story-year {
  font-size: .82rem;
  font-weight: 500;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.story-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  letter-spacing: -.015em;
  margin: 0;
}

.story-text {
  font-size: .95rem;
  color: var(--ink);
  line-height: 1.55;
  max-width: 44ch;
}

.story-meta {
  display: grid;
  gap: 1rem;
  max-width: 44ch;
}

.story-block {
  display: grid;
  gap: .45rem;
}

.story-facts,
.story-skills {
  display: grid;
  gap: .4rem;
}

.story-facts li,
.story-skills li {
  font-size: .9rem;
  color: var(--muted);
  padding-left: .9rem;
  position: relative;
}

.story-facts li::before,
.story-skills li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: .3rem;
  height: .3rem;
  border-radius: 50%;
  background: var(--line);
}

.story-skills-line {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.5;
}

.story-figure {
  margin: .4rem 0 0;
  max-width: min(100%, 36rem);
}

.story-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

.gallery {
  margin-top: .4rem;
  max-width: min(100%, 36rem);
  display: grid;
  gap: .75rem;
}

.gallery-viewport {
  overflow: hidden;
  border-radius: 2px;
  touch-action: pan-y;
  cursor: grab;
  aspect-ratio: 4 / 3;
  background: var(--line);
}

.gallery-viewport:active { cursor: grabbing; }

.gallery-track {
  display: flex;
  height: 100%;
  transition: transform .45s cubic-bezier(.4, 0, .1, 1);
  will-change: transform;
}

.gallery-slide {
  flex: 0 0 100%;
  min-width: 0;
  height: 100%;
}

.gallery-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.gallery-shot--lower {
  object-position: center bottom;
}

.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.gallery-btn {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: color .2s ease, border-color .2s ease;
}

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

.gallery-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  flex: 1;
}

.gallery-dot {
  width: .4rem;
  height: .4rem;
  border-radius: 50%;
  background: var(--line);
  transition: background .2s ease, transform .2s ease;
}

.gallery-dot.is-active {
  background: var(--blue);
  transform: scale(1.15);
}

.story-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: .65rem;
}

.story-photos img {
  width: 100%;
  height: auto;
  border-radius: 2px;
}

.story-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
}

.story-links-break {
  flex-basis: 100%;
  height: 0;
}

.story-link {
  font-size: .88rem;
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: color .2s ease;
}

.story-link:hover { color: var(--blue-deep); }

.footer--career {
  margin-right: var(--edge);
}

/* ---- partnerships page ------------------------------------ */
body.page-partners {
  height: auto;
  overflow: auto;
}

.page--partners {
  height: auto;
  min-height: 100dvh;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "header"
    "main"
    "footer";
  column-gap: 0;
}

.partners-main {
  grid-area: main;
  max-width: 52rem;
  padding: clamp(1.5rem, 4vh, 3rem) var(--edge) clamp(3rem, 8vh, 5rem);
  display: grid;
  gap: clamp(2rem, 5vh, 3.5rem);
}

.partners-intro,
.skills-intro {
  display: grid;
  gap: 0;
  max-width: 38rem;
}

.headline--partners,
.headline--skills {
  max-width: 16ch;
}

.partner-tier {
  display: grid;
  gap: 1.35rem;
}

.partner-tier-head {
  display: grid;
  gap: .65rem;
  max-width: 42rem;
}

.logo-wall {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.logo-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  background: var(--paper);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.logo-tile img {
  display: block;
  width: 72%;
  max-width: 7.5rem;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.partner-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.75rem, 4vh, 2.5rem) 1.5rem;
  align-items: start;
}

.partner-group {
  display: grid;
  gap: .85rem;
  min-width: 0;
}

.name-wall {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}

.name-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.5rem;
  height: 100%;
  padding: .85rem 1rem;
  text-align: center;
  font-family: var(--display);
  font-weight: 600;
  font-size: .92rem;
  letter-spacing: -.01em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: color .2s ease, border-color .2s ease;
}

.name-tile:hover {
  color: var(--ink);
  border-color: var(--blue);
}

.consult-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.consult-item {
  display: grid;
  gap: .55rem;
  align-content: start;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.consult-item .story-text {
  max-width: none;
}

/* ---- skills page ------------------------------------------ */
body.page-skills {
  height: auto;
  overflow: auto;
}

.page--skills {
  height: auto;
  min-height: 100dvh;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "header"
    "main"
    "footer";
  column-gap: 0;
}

.skills-main {
  grid-area: main;
  max-width: 52rem;
  padding: clamp(1.5rem, 4vh, 3rem) var(--edge) clamp(3rem, 8vh, 5rem);
  display: grid;
  gap: clamp(2rem, 5vh, 3.25rem);
}

.skill-group {
  display: grid;
  gap: 1rem;
}

.skill-list {
  display: grid;
  gap: .45rem;
  max-width: 42rem;
}

.skill-list li {
  position: relative;
  padding-left: .95rem;
  font-size: .95rem;
  color: var(--ink);
  line-height: 1.45;
}

.skill-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: .3rem;
  height: .3rem;
  border-radius: 50%;
  background: var(--blue);
}

.education {
  display: grid;
  gap: 1rem;
}

.edu-table {
  display: grid;
  border-top: 1px solid var(--line);
}

.edu-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
  padding: .95rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .9rem;
}

.edu-row--head {
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.edu-row span:nth-child(3) {
  font-variant-numeric: tabular-nums;
  color: var(--blue);
  font-weight: 500;
}

.edu-row--head span:nth-child(3) {
  color: var(--muted);
  font-weight: 500;
}

.edu-row span:nth-child(4) {
  color: var(--muted);
}

.edu-row--head span:nth-child(4) {
  color: var(--muted);
}

/* ---- awards page ------------------------------------------ */
body.page-awards {
  height: auto;
  overflow: auto;
}

.page--awards {
  height: auto;
  min-height: 100dvh;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "header"
    "main"
    "footer";
  column-gap: 0;
}

.awards-main {
  grid-area: main;
  max-width: 52rem;
  padding: clamp(1.5rem, 4vh, 3rem) var(--edge) clamp(3rem, 8vh, 5rem);
  display: grid;
  gap: clamp(2rem, 5vh, 3.25rem);
}

.awards-intro {
  display: grid;
  gap: 0;
  max-width: 38rem;
}

.headline--awards {
  max-width: 14ch;
}

.award-group {
  display: grid;
  gap: 1rem;
}

.award-list {
  display: grid;
  gap: .85rem;
  max-width: 42rem;
}

.award-list li {
  position: relative;
  padding-left: .95rem;
  display: grid;
  gap: .25rem;
  font-size: .95rem;
  color: var(--ink);
  line-height: 1.45;
}

.award-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: .3rem;
  height: .3rem;
  border-radius: 50%;
  background: var(--blue);
}

.award-list strong {
  font-weight: 600;
}

.award-note {
  color: var(--muted);
  font-size: .9rem;
}

/* ============================================================
   NARROW SCREENS — stack, and allow scrolling here only
   ============================================================ */
@media (max-width: 900px) {
  :root { font-size: 15px; }
  body { height: auto; overflow: auto; }
  .page {
    height: auto;
    min-height: 100dvh;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas: "header" "portrait" "main" "footer";
    row-gap: .85rem;
  }
  .header,
  .header--scroll {
    position: sticky;
    top: 0;
    z-index: 20;
    flex-direction: column;
    align-items: flex-start;
    gap: .85rem;
    width: 100%;
    box-sizing: border-box;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding-top: calc(var(--row) + env(safe-area-inset-top, 0px));
    padding-right: var(--edge);
    padding-bottom: .85rem;
    padding-left: var(--edge);
    transition: padding .38s cubic-bezier(.4, 0, .2, 1), gap .38s cubic-bezier(.4, 0, .2, 1);
  }

  .header.is-scrolled {
    gap: 0;
    padding-top: calc(.55rem + env(safe-area-inset-top, 0px));
    padding-bottom: .55rem;
  }

  .header .wordmark {
    display: block;
    max-height: 1.5rem;
    opacity: 1;
    overflow: hidden;
    transform: translate3d(0, 0, 0);
    transition:
      max-height .38s cubic-bezier(.4, 0, .2, 1),
      opacity .28s ease,
      transform .38s cubic-bezier(.4, 0, .2, 1);
  }

  .header.is-scrolled .wordmark {
    max-height: 0;
    opacity: 0;
    transform: translate3d(0, -.35rem, 0);
    pointer-events: none;
  }

  .header.is-navigating,
  .header.is-navigating .wordmark {
    transition: none;
  }

  @media (prefers-reduced-motion: reduce) {
    .header,
    .header--scroll,
    .header .wordmark {
      transition: none;
    }
  }

  .nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: space-between;
    width: 100%;
    gap: .35rem;
  }

  .nav-item {
    font-size: .72rem;
    padding-bottom: .15rem;
    flex: 0 1 auto;
    white-space: nowrap;
  }
  .portrait { height: 46vh; padding: 0 var(--edge); }
  .portrait-photo--desktop { display: none; }
  .portrait-photo--mobile {
    display: block;
    object-position: center center;
  }
  .apex-path--desktop { display: none; }
  .apex-path--mobile { display: block; }
  .main { padding-right: var(--edge); }
  .main--contact { gap: 2rem; }
  .track { grid-template-columns: minmax(0, 1fr); }
  .footer {
    margin-right: var(--edge);
    text-align: center;
  }

  .footer-bar {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: .7rem;
  }

  .footer-bar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .45rem .7rem;
  }

  .footer-bar-sep--break {
    display: none;
  }

  .contact {
    justify-content: center;
    gap: .85rem 1.25rem;
  }

  /* phone: portrait only on the about/home hero, not on contact */
  .page--contact {
    grid-template-areas: "header" "main" "footer";
    grid-template-rows: auto 1fr auto;
  }
  .page--contact .portrait { display: none; }
  .page--contact .footer {
    margin-top: auto;
  }

  .career-main,
  .partners-main,
  .skills-main,
  .awards-main {
    max-width: none;
    padding-top: 1rem;
  }
  .story-figure { max-width: 100%; }
  .footer--career {
    margin-top: auto;
  }

  .page--contact .main--contact {
    padding-top: .25rem;
  }

  .logo-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .partner-groups,
  .consult-list {
    grid-template-columns: 1fr;
  }

  .edu-row {
    grid-template-columns: 1fr;
    gap: .25rem;
    padding: 1rem 0;
  }

  .edu-row--head {
    display: none;
  }

  .edu-row span:first-child {
    font-family: var(--display);
    font-weight: 600;
    color: var(--ink);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .apex-path { stroke-dashoffset: 0; }
}
