/* ─────────────────────────────────────────────
   Devanssh P Dallal — portfolio
   Palette: warm pastels (pink, peach, butter, sage, coral) on cream, cocoa ink.
   Type: Archivo only. Expanded for headlines, condensed for data, normal for reading.
   ───────────────────────────────────────────── */

:root {
  --cream: #fff7ea;
  --paper: #fffdf8;
  --ink: #3a1b17;
  --ink-soft: #7a5148;
  --line: rgba(58, 27, 23, 0.18);

  --red: #d9412b;
  --red-deep: #b0301e;
  --orange: #ee8322;
  --yellow: #f2c230;
  --pink: #e67a98;
  --green: #4e9a5b;
  --green-deep: #2f6b3a;

  --p-red: #fad3cb;
  --p-orange: #ffe1c4;
  --p-yellow: #fcefc2;
  --p-pink: #fbdce2;
  --p-green: #dcefd8;

  /* label colours: one per kind of thing */
  --tag-lang: #f7a9b8;
  --tag-platform: #fdba74;
  --tag-tool: #f9dc6b;
  --tag-skill: #9fd3a0;

  --wrap: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
  --nav-h: 64px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; }
img, svg, canvas { display: block; }

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

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

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--paper); color: var(--ink);
  padding: 10px 16px; border-radius: 4px; font-weight: 600;
}
.skip:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

h2 {
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(2rem, 5.2vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.section-lede {
  margin-top: 14px;
  font-size: 1.125rem;
  color: var(--ink-soft);
  max-width: 60ch;
}

.band { padding-block: clamp(72px, 11vw, 150px); }

/* ───────────── Nav ───────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding-inline: var(--gutter);
  color: var(--ink);
  transition: background-color .25s ease, box-shadow .25s ease;
}
.nav.is-solid {
  background: rgba(255, 247, 234, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}
.nav__name {
  font-stretch: 125%; font-weight: 800; font-size: 1rem;
  letter-spacing: -0.01em; text-decoration: none;
}
.nav nav { display: flex; gap: clamp(14px, 2.4vw, 34px); }
.nav nav a {
  font-size: 0.95rem; font-weight: 600; text-decoration: none;
  padding-block: 6px; border-bottom: 2px solid transparent;
}
.nav nav a:hover { border-bottom-color: var(--red); }

/* ───────────── Hero ───────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--nav-h) + 24px) var(--gutter) clamp(28px, 5vh, 52px);
  color: var(--ink);
  background:
    radial-gradient(90% 60% at 85% 0%, rgba(230, 122, 152, 0.35) 0%, rgba(230, 122, 152, 0) 60%),
    linear-gradient(180deg, #fbd9df 0%, #ffe3ca 46%, #fcefc2 100%);
  overflow: hidden;
  isolation: isolate;
}
/* the landing game: sky above the ground line, name and intro on the ground below it */
.hero__flow {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: -2;
  touch-action: pan-y;
}
.hero.is-flying .hero__flow { touch-action: none; cursor: ns-resize; }

.hero__copy { max-width: 1100px; pointer-events: none; }
.hero h1 {
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(3rem, 6.1vw, 5.9rem);
  line-height: 0.9;
  letter-spacing: -0.035em;
  margin-left: -0.04em;
  color: var(--red-deep);
}
.hero h1 br { display: none; }
.hero__lede {
  margin-top: clamp(14px, 2.2vh, 24px);
  max-width: 30ch;
  font-size: clamp(1.3rem, 2.3vw, 1.9rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.hero__role {
  margin-top: 12px;
  max-width: 52ch;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 1.0625rem;
}

.readout {
  position: absolute;
  top: calc(var(--nav-h) + 18px); right: var(--gutter);
  width: min(292px, 60vw);
  padding: 12px 14px 14px;
  background: rgba(255, 253, 248, 0.82);
  border-radius: 14px;
  font-stretch: 75%;
}
.readout dl { display: grid; gap: 4px; }
.readout dl > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}
.readout dt { color: var(--ink-soft); font-size: 0.9rem; font-weight: 600; letter-spacing: 0.01em; }
.readout dd {
  font-size: 1.3rem; font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--red-deep);
  white-space: nowrap;
}
.readout__curve { width: 100%; height: 44px; margin-top: 8px; overflow: visible; }
.readout__curve line { stroke: var(--line); stroke-width: 1; }
.readout__curve path { fill: none; stroke: var(--green-deep); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.readout p { margin-top: 6px; font-size: 0.92rem; line-height: 1.35; color: var(--ink); }
.readout__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; }
.readout__btn, .readout__link { font: inherit; cursor: pointer; color: var(--ink); }
.readout__btn {
  padding: 9px 16px;
  background: var(--red-deep); color: #fff;
  border: 2px solid var(--red-deep); border-radius: 999px;
  font-stretch: 100%; font-weight: 700; font-size: 0.95rem;
}
.readout__btn:hover { background: var(--ink); border-color: var(--ink); }
.readout__btn[aria-pressed="true"] { background: transparent; color: var(--ink); border-color: var(--ink); }
.readout__link {
  padding: 4px 0; background: none; border: 0;
  font-weight: 700; font-size: 0.9rem;
  text-decoration: underline; text-decoration-thickness: 2px;
  text-decoration-color: var(--orange); text-underline-offset: 4px;
}

.hero__caption {
  position: absolute; right: var(--gutter); bottom: clamp(28px, 5vh, 52px);
  max-width: 44ch; text-align: right;
  font-stretch: 75%; font-size: 0.88rem; font-weight: 500; line-height: 1.35;
  color: var(--ink-soft);
}

/* ───────────── About ───────────── */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(36px, 7vw, 110px);
  align-items: start;
}
.about__text h2 { margin-bottom: clamp(24px, 3.5vw, 44px); }
.about__text p { max-width: 62ch; }
.about__text p + p { margin-top: 1.1em; }
.about__text .big {
  font-size: clamp(1.35rem, 2.3vw, 1.85rem);
  line-height: 1.3; font-weight: 500;
  letter-spacing: -0.01em;
  max-width: 30ch;
  text-wrap: balance;
}

.facts {
  margin-top: 10px;
  background: var(--p-yellow);
  border-radius: 22px;
  padding: 8px 24px;
}
.facts > div { padding-block: 14px; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; }
.facts dt {
  font-stretch: 75%; font-weight: 700; font-size: 0.9rem;
  color: var(--red-deep);
}
.facts dd { font-weight: 500; line-height: 1.4; }

/* ───────────── Journey ───────────── */
.route { padding-top: 0; }

/* Map of the cities worked in */
.atlas {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
  margin-top: clamp(32px, 5vw, 60px);
}
.atlas__map {
  background: var(--p-green);
  border-radius: 28px;
  padding: clamp(12px, 2.4vw, 30px);
}
.atlas__map svg { width: 100%; height: auto; overflow: visible; }
.atlas__land, .atlas__state {
  fill: var(--paper);
  stroke: rgba(58, 27, 23, 0.32);
  stroke-width: 1.2;
  stroke-linejoin: round;
}
.atlas__state { stroke: var(--ink); stroke-width: 1.6; }
.atlas__state--ma { fill: var(--tag-lang); }
.atlas__state--tx { fill: var(--p-yellow); }
.atlas__state--al { fill: var(--p-red); }
.atlas__route {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 2 9;
}
.atlas__pin circle { stroke: var(--ink); stroke-width: 2.6; }
.atlas__pin text {
  font-stretch: 112%;
  font-weight: 800;
  font-size: 30px;
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 7px;
  stroke-linejoin: round;
}
.atlas__pin--boston circle { fill: var(--pink); }
.atlas__pin--austin circle { fill: var(--yellow); }
.atlas__pin--houston circle { fill: var(--orange); }
.atlas__pin--mobile circle { fill: var(--red); }
.atlas__pin .atlas__now { fill: none; stroke: var(--red); stroke-width: 2.6; }

.atlas__list { display: grid; gap: 0; border-top: 2px solid var(--ink); }
.atlas__place {
  position: relative;
  padding: 16px 0 16px 34px;
  border-bottom: 1px solid var(--line);
}
.atlas__place::before {
  content: ""; position: absolute; left: 2px; top: 23px;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--dot);
}
.atlas__place--mobile { --dot: var(--red); }
.atlas__place--houston { --dot: var(--orange); }
.atlas__place--austin { --dot: var(--yellow); }
.atlas__place--boston { --dot: var(--pink); }
.atlas__place h3 {
  font-stretch: 112%; font-weight: 700; font-size: 1.2rem; line-height: 1.2;
  letter-spacing: -0.01em;
}
.atlas__when {
  font-stretch: 75%; font-weight: 700; font-size: 0.95rem;
  color: var(--red-deep);
}
.atlas__place p:not(.atlas__when) { margin-top: 4px; line-height: 1.45; }
.legs {
  position: relative;
  margin-top: clamp(40px, 6vw, 80px);
  --when: clamp(120px, 17vw, 230px);
  --rail-x: calc(var(--when) + clamp(18px, 3vw, 44px));
}

.rail {
  position: absolute; top: 10px; bottom: 0; left: var(--rail-x);
  width: 2px;
  background: repeating-linear-gradient(180deg, var(--line) 0 6px, transparent 6px 12px);
}
.rail__fill {
  position: absolute; inset: 0 0 auto 0;
  height: calc(var(--p, 0) * 100%);
  background: linear-gradient(180deg, var(--pink), var(--orange) 50%, var(--red));
}
.rail__plane {
  position: absolute; left: 50%;
  top: calc(var(--p, 0) * 100%);
  transform: translate(-50%, -60%);
  color: var(--red);
  filter: drop-shadow(0 2px 0 var(--cream)) drop-shadow(0 -2px 0 var(--cream));
}

.leg {
  position: relative;
  display: grid;
  grid-template-columns: var(--when) minmax(0, 1fr);
  column-gap: calc(2 * clamp(18px, 3vw, 44px) + 2px);
  padding-bottom: clamp(36px, 5vw, 64px);
}
.leg:last-child { padding-bottom: 0; }
.leg::before {
  content: ""; position: absolute;
  left: var(--rail-x); top: 0.62em;
  width: 13px; height: 13px; border-radius: 50%;
  transform: translateX(calc(-50% + 1px));
  background: var(--cream);
  border: 2px solid var(--ink-soft);
  transition: background-color .3s ease, border-color .3s ease;
  font-size: clamp(2rem, 4.6vw, 3.7rem);
}
.leg.is-reached::before { background: var(--red); border-color: var(--red); }

.leg__when { text-align: right; }
.leg__year {
  display: block;
  font-stretch: 62%;
  font-weight: 800;
  font-size: clamp(2.6rem, 6.6vw, 5.4rem);
  line-height: 0.9;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  opacity: 0.3;
  transition: opacity .3s ease, color .3s ease;
}
.leg.is-reached .leg__year { opacity: 1; }
.leg--now.is-reached .leg__year { color: var(--red); }
.leg__place {
  display: block; margin-top: 6px;
  font-stretch: 75%; font-weight: 600; font-size: 0.95rem;
  color: var(--ink-soft);
}

.leg__body { max-width: 62ch; padding-top: 0.35em; }
.leg__body h3 {
  font-stretch: 112%;
  font-weight: 700;
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.leg__role { margin-top: 4px; font-weight: 600; color: var(--red-deep); }
.leg__body > p:not(.leg__role) { margin-top: 10px; }
.leg__more {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.leg__more:hover { color: var(--red-deep); }
.leg__body .leg__more { white-space: nowrap; }

/* ───────────── Experience: one section per job ───────────── */
.jobs__intro { padding-block: clamp(40px, 7vw, 90px) clamp(36px, 5vw, 60px); }

.legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; align-items: center; }
.legend__label { font-weight: 600; margin-right: 6px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-block;
  padding: 5px 13px 6px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-stretch: 87%;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--ink);
  background: var(--paper);
}
.tag--lang { background: var(--tag-lang); }
.tag--platform { background: var(--tag-platform); }
.tag--tool { background: var(--tag-tool); }
.tag--skill { background: var(--tag-skill); }

.job { padding-block: clamp(56px, 8vw, 110px); }
.job--pink { background: var(--p-pink); }
.job--yellow { background: var(--p-yellow); }
.job--green { background: var(--p-green); }
.job--orange { background: var(--p-orange); }
.job--red { background: var(--p-red); }

.job__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.35fr);
  gap: clamp(28px, 6vw, 96px);
  align-items: start;
}
.job__head { position: sticky; top: calc(var(--nav-h) + 28px); }
.job__logo {
  display: grid; place-items: center;
  width: min(100%, 270px); height: 118px;
  padding: 24px 30px;
  background: var(--paper);
  border-radius: 22px;
  box-shadow: 0 1px 0 rgba(58, 27, 23, 0.12), 0 14px 30px -18px rgba(58, 27, 23, 0.45);
}
.job__logo img { max-width: 100%; max-height: 68px; width: auto; height: auto; object-fit: contain; }
.job__logo--dark { background: #17355e; }
.job__logo--word {
  font-stretch: 125%; font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em;
  color: var(--red-deep);
}
.job__dates {
  margin-top: 26px;
  font-stretch: 75%; font-weight: 700; font-size: 1.05rem;
  color: var(--red-deep);
}
.job__head h3 {
  margin-top: 6px;
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.job__co { margin-top: 10px; font-weight: 600; font-size: 1.1rem; }

.job__body h4 {
  font-stretch: 112%; font-weight: 700; font-size: 1.15rem;
  letter-spacing: -0.005em;
}
.job__body h4:not(:first-child) { margin-top: 30px; }
.job__body > p { margin-top: 10px; max-width: 64ch; }
.job__list { margin-top: 12px; display: grid; gap: 10px; max-width: 66ch; }
.job__list li { position: relative; padding-left: 24px; }
.job__list li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--red);
}
.job__body .tags { margin-top: 14px; }

/* MTTR comparison */
.mttr {
  margin-top: 20px;
  padding: 20px 22px 22px;
  background: var(--paper);
  border-radius: 18px;
  max-width: 66ch;
}
.mttr figcaption { font-size: 0.95rem; line-height: 1.4; color: var(--ink-soft); max-width: 52ch; }
.mttr__row {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center; gap: 12px;
  margin-top: 14px;
}
.mttr__label { font-stretch: 75%; font-weight: 600; font-size: 0.95rem; }
.mttr__bar { height: 16px; width: var(--w); border-radius: 999px; background: var(--tag-lang); }
.mttr__row--after .mttr__bar { background: var(--green); }
.mttr__val {
  font-stretch: 62%; font-weight: 800; font-size: 1.6rem; line-height: 1;
  font-variant-numeric: tabular-nums; min-width: 4.6ch; text-align: right;
}
.mttr__row--after .mttr__val { color: var(--green-deep); }

/* ───────────── Projects ───────────── */
.projects { padding-block: clamp(72px, 11vw, 150px); }
.plist { margin-top: clamp(36px, 5vw, 70px); border-top: 2px solid var(--ink); }

.proj {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr) minmax(0, 0.55fr);
  gap: clamp(18px, 3.4vw, 54px);
  align-items: start;
  padding: clamp(26px, 3.6vw, 46px) clamp(0px, 1.4vw, 20px);
  border-bottom: 1px solid var(--line);
  transition: background-color .2s ease;
}
.proj:nth-child(5n + 1):hover { background: var(--p-pink); }
.proj:nth-child(5n + 2):hover { background: var(--p-yellow); }
.proj:nth-child(5n + 3):hover { background: var(--p-green); }
.proj:nth-child(5n + 4):hover { background: var(--p-orange); }
.proj:nth-child(5n + 5):hover { background: var(--p-red); }
.proj__head h3 {
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(1.45rem, 2.7vw, 2.3rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.proj__body p { max-width: 58ch; }
.proj__body .tags { margin-top: 14px; }
.proj__body p + p { margin-top: 0.8em; }
.planform { width: 132px; height: auto; margin: 0 0 12px auto; overflow: visible; }
.planform__wing { fill: var(--p-yellow); stroke: var(--ink); stroke-width: 26; stroke-linejoin: round; }
.planform__pod { fill: var(--tag-platform); stroke: var(--ink); stroke-width: 22; stroke-dasharray: 60 44; }
.proj__link {
  justify-self: end; text-align: right;
  font-stretch: 75%; font-weight: 600; font-size: 0.95rem;
}
.proj__link span { color: var(--ink-soft); }
.proj__link a {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
.proj__link a:hover { color: var(--red-deep); }

.loshu {
  border-collapse: collapse;
  margin: 0 0 14px auto;
  font-stretch: 62%; font-weight: 700; font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}
.loshu td {
  width: 34px; height: 34px; text-align: center;
  border: 1.5px solid var(--ink);
  background: var(--p-yellow);
}
.loshu tr:nth-child(2) td:nth-child(2) { background: var(--tag-platform); }

/* ───────────── Toolkit ───────────── */
.toolkit { background: var(--p-orange); }
.degree {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 60px);
  align-items: center;
  margin-top: clamp(36px, 5vw, 70px);
  padding-block: clamp(24px, 3vw, 36px);
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
}
.degree .job__logo { height: 104px; }
.degree__years {
  font-stretch: 75%; font-weight: 700; font-size: 1.05rem;
  color: var(--red-deep);
}
.degree h3 {
  font-stretch: 112%; font-weight: 700;
  font-size: clamp(1.3rem, 2.2vw, 1.7rem); line-height: 1.15;
  letter-spacing: -0.01em;
}
.degree p:not(.degree__years) { margin-top: 8px; max-width: 60ch; }

.spec > div {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 60px);
  padding-block: clamp(18px, 2.4vw, 28px);
  border-bottom: 1px solid var(--line);
}
.spec dt { font-stretch: 112%; font-weight: 700; font-size: 1.05rem; }
.spec dd { max-width: 64ch; }
.spec dd.plain { padding-top: 2px; }

/* ───────────── Contact ───────────── */
.contact {
  position: relative;
  background:
    radial-gradient(90% 80% at 100% 0%, rgba(242, 194, 48, 0.5) 0%, rgba(242, 194, 48, 0) 60%),
    radial-gradient(90% 90% at 0% 100%, rgba(217, 65, 43, 0.3) 0%, rgba(217, 65, 43, 0) 62%),
    linear-gradient(180deg, #fbd9df 0%, #ffd9bd 100%);
  padding-top: clamp(84px, 13vw, 180px);
}
.contact h2 {
  font-size: clamp(2.2rem, 6.6vw, 5.6rem);
  max-width: 17ch;
  color: var(--red-deep);
}
.contact__links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: clamp(30px, 4vw, 52px); }
.btn {
  display: inline-block;
  padding: 16px 26px;
  background: var(--red-deep); color: #fff;
  font-stretch: 112%; font-weight: 700; font-size: 1.05rem;
  text-decoration: none;
  border: 2px solid var(--red-deep);
  border-radius: 999px;
  transition: transform .15s ease, background-color .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-2px); background: var(--ink); border-color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--cream); }

.foot {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-top: clamp(84px, 12vw, 160px);
  padding: 22px var(--gutter);
  border-top: 1px solid var(--line);
  font-stretch: 75%; font-size: 0.95rem; font-weight: 500; color: var(--ink-soft);
}
.foot a { text-underline-offset: 4px; }

/* ───────────── Internship detail pages (work/*.html) ───────────── */
.btn--small { padding: 11px 20px; font-size: 0.98rem; }
.job__more { margin-top: 26px; }

.case__top { padding: calc(var(--nav-h) + clamp(28px, 5vw, 60px)) 0 clamp(40px, 6vw, 76px); }
.case__back {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
.case__back:hover { color: var(--red-deep); }
.case__head {
  display: grid;
  grid-template-columns: minmax(0, 270px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 60px);
  align-items: center;
  margin-top: clamp(24px, 3vw, 40px);
}
.case__head h1 {
  margin-top: 6px;
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(2rem, 5.2vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--red-deep);
  text-wrap: balance;
}
.case__sum {
  margin-top: 16px;
  max-width: 44ch;
  font-size: clamp(1.15rem, 1.9vw, 1.45rem);
  font-weight: 500;
  line-height: 1.35;
}
.case__facts {
  display: flex; flex-wrap: wrap; gap: 12px clamp(28px, 5vw, 72px);
  margin-top: clamp(28px, 4vw, 48px);
  padding-top: 18px;
  border-top: 2px solid var(--ink);
}
.case__facts dt { font-stretch: 75%; font-weight: 700; font-size: 0.9rem; color: var(--red-deep); }
.case__facts dd { font-weight: 600; }

.case { padding-bottom: clamp(56px, 8vw, 110px); }
.case__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
  gap: clamp(14px, 4vw, 60px);
  padding-block: clamp(32px, 4.6vw, 60px);
  border-bottom: 1px solid var(--line);
}
.case__grid h2 { font-size: clamp(1.5rem, 2.8vw, 2.2rem); line-height: 1.05; }
.case__grid p { max-width: 64ch; }
.case__grid p + p { margin-top: 1em; }
.case__grid .job__list { margin-top: 0; }
.case__grid p + .job__list { margin-top: 14px; }
.case__wide { grid-column: 1 / -1; }

/* how the data moved, step by step */
.flow { display: flex; gap: 26px; }
.flow li {
  position: relative;
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center;
  padding: 14px 16px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  font-stretch: 87%; font-weight: 600; font-size: 0.98rem; line-height: 1.25;
}
.flow li:last-child { background: var(--tag-skill); }
.flow li + li::before {
  content: ""; position: absolute; left: -19px; top: 50%;
  transform: translateY(-50%);
  border-left: 11px solid var(--ink);
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}
.flow__cap { margin-bottom: 12px; font-stretch: 75%; font-weight: 700; font-size: 0.95rem; color: var(--red-deep); }
.flow + .flow__cap { margin-top: 26px; }

.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.results li { padding: 18px 20px 20px; border-radius: 18px; background: var(--p-yellow); }
.results li:nth-child(4n + 2) { background: var(--p-pink); }
.results li:nth-child(4n + 3) { background: var(--p-green); }
.results li:nth-child(4n + 4) { background: var(--p-orange); }
.results__n {
  display: block;
  font-stretch: 62%; font-weight: 800;
  font-size: clamp(2.6rem, 5vw, 3.7rem); line-height: 0.95;
  font-variant-numeric: tabular-nums;
  color: var(--red-deep);
}
.results p { margin-top: 8px; line-height: 1.4; }
.case__note { margin-top: 18px; }

.case__nav {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding-top: clamp(32px, 4.6vw, 56px);
}
.foot--plain { margin-top: 0; }

/* ───────────── Small screens ───────────── */
@media (max-width: 860px) {
  .nav nav a:nth-child(5) { display: none; }
  .about__grid { grid-template-columns: 1fr; }
  .atlas { grid-template-columns: 1fr; }
  .atlas__pin text { font-size: 38px; }
  .flow { flex-direction: column; align-items: stretch; }
  .flow li + li::before { left: 50%; top: -19px; transform: translateX(-50%) rotate(90deg); }
  .case__grid { grid-template-columns: 1fr; }
  .case__nav { flex-direction: column; }
  .job__grid { grid-template-columns: 1fr; }
  .job__head { position: static; }
  .proj { grid-template-columns: 1fr; gap: 14px; }
  .proj__link { justify-self: start; text-align: left; }
  .loshu, .planform { margin-left: 0; }
  .degree, .spec > div { grid-template-columns: 1fr; gap: 10px; }
  .hero__caption { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .nav__name { font-stretch: 87%; font-size: 0.98rem; white-space: nowrap; }
  .nav nav { gap: 11px; }
  .nav nav a { font-stretch: 87%; font-size: 0.88rem; }
  .nav nav a:nth-child(1), .nav nav a:nth-child(2) { display: none; }
  .hero h1 { font-size: clamp(2.3rem, 11.6vw, 3.5rem); line-height: 0.88; }
  .hero h1 br { display: inline; }
  .readout { left: var(--gutter); right: var(--gutter); width: auto; top: calc(var(--nav-h) + 8px); padding: 8px 12px 10px; background: rgba(255, 253, 248, 0.74); }
  .readout dl { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
  .readout dl > div { display: block; border-bottom: 0; padding-bottom: 0; }
  .readout dt { font-size: 0.78rem; line-height: 1.2; }
  .readout dd { font-size: 1.15rem; }
  .readout__curve { display: none; }
  .readout p { font-size: 0.86rem; min-height: 4.05em; }
  .readout__actions { margin-top: 8px; }
  .readout__btn { padding: 7px 14px; font-size: 0.9rem; }

  .legs { --rail-x: 6px; }
  .leg { grid-template-columns: 1fr; padding-left: 30px; row-gap: 6px; }
  .leg::before { top: 0.5em; font-size: 2.6rem; }
  .leg__when { text-align: left; display: flex; align-items: baseline; gap: 12px; }
  .leg__year { font-size: 2.6rem; }
  .leg__place { margin-top: 0; }
  .job__logo { height: 100px; width: min(100%, 230px); }
  .case__head { grid-template-columns: 1fr; }
  .nav--case nav a:nth-child(n) { display: inline-block; }
  .mttr { padding: 16px; }
}

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