/* ==========================================================================
   site.css: page components built on top of tide.css
   --------------------------------------------------------------------------
   tide.css is the design system (kept verbatim from PORTFOLIO_STYLE.md).
   This file only adds the pieces the pages need on top of it, and it only
   uses tide.css tokens, so both themes keep working.

   Sections
     1. Home: about, skills, experience, contact
     2. Footer + back-to-top
     3. Case-study pages (project pages)
     4. Small grid layer for the project pages (replaces Bootstrap's grid)
     5. Prev / next project + image zoom
   ========================================================================== */

/* Sections sit above the fixed .page-backdrop */
main > section, main > article, .site-footer { position: relative; z-index: 1; }

/* 1. Home ------------------------------------------------------------------- */
.about-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 96px); }
.about-grid h2 { font-size: clamp(38px, 4.6vw, 64px); letter-spacing: -.05em; line-height: 1; }
.about-copy { display: grid; gap: 22px; color: var(--text-muted); font-size: clamp(17px, 1.45vw, 20px); line-height: 1.6; }
.about-copy p:first-child { color: var(--text); }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }

/* Projects: the animated grid sits behind the cards */
#projects .project-grid, #projects .section-heading { position: relative; z-index: 1; }

/* Experience rows inside the .stack */
.job h3 { font-size: clamp(22px, 2.2vw, 30px); letter-spacing: -.035em; line-height: 1.1; }
.job-meta { margin: 8px 0 14px; display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--text-muted); font-size: 15px; }
.job-meta strong { color: var(--label); font-weight: 600; }
.job ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: var(--text-muted); }
.job li::marker { color: var(--azure); }

.skills-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.skill-card { padding: 26px; border-radius: var(--radius); display: flex; flex-direction: column; gap: 18px; }
.skill-card h3 { font-size: 24px; letter-spacing: -.035em; }
.skill-card .pill-row { margin: 0; }
.skill-card .pill { white-space: normal; }
@media (max-width: 1024px) { .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .skills-grid { grid-template-columns: 1fr; } }

.contact-band {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(36px, 6vw, 80px); border-radius: var(--radius);
  display: grid; gap: 28px; justify-items: start;
}
.contact-band h2 { font-size: clamp(40px, 5.4vw, 76px); letter-spacing: -.055em; line-height: .98; max-width: 14ch; }
.contact-email { font-size: clamp(20px, 3vw, 40px); letter-spacing: -.04em; overflow-wrap: anywhere; border-bottom: 1px solid var(--line); transition: border-color 220ms ease, color 220ms ease; }
.contact-email:hover { border-color: var(--azure); color: var(--label); }
.contact-actions { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 28px; }

/* 2. Footer + back-to-top ------------------------------------------------------ */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--line-soft); }
.footer-inner {
  width: var(--page); margin: 0 auto; padding: 28px 0;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 28px;
  color: var(--text-muted); font-family: var(--font-mono); font-size: 12px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a:hover { color: var(--text); }

.back-to-top {
  position: fixed; z-index: 900; right: 20px; bottom: 20px;
  width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: 999px; color: var(--text);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity 260ms ease, visibility 260ms ease, transform 260ms var(--ease-out);
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top svg { width: 18px; height: 18px; }

/* 3. Case-study pages ------------------------------------------------------------
   The project pages keep their original markup; these rules restyle it.
   The old inline styles use var(--primary) / --light / --dark, so they are
   mapped onto Tide tokens here. */
.case-study {
  --primary: var(--label);
  --light: var(--glass-bg);
  --dark: var(--text);
  --secondary: var(--text-muted);
  color: var(--text-muted);
  font-size: 17px;
}
.case-study section { padding: 0 0 56px; margin-bottom: 56px; border-bottom: 1px solid var(--line-soft); }
.case-study section:last-of-type { border-bottom: 0; margin-bottom: 0; }
.case-study h2, .case-study h3, .case-study h4, .case-study h5, .case-study h6 { color: var(--text); }
.case-study h2 { margin: 0 0 24px; font-size: clamp(32px, 3.6vw, 48px); letter-spacing: -.045em; }
.case-study h3 { margin: 32px 0 16px; font-size: clamp(22px, 2.2vw, 30px); letter-spacing: -.035em; line-height: 1.15; }
.case-study h4 { margin: 24px 0 12px; font-size: 21px; letter-spacing: -.03em; line-height: 1.2; }
.case-study h5, .case-study h6 { margin: 0 0 12px; font-size: 17px; font-weight: 600; letter-spacing: -.015em; line-height: 1.3; }
.case-study p { margin: 0 0 16px; }
.case-study ul, .case-study ol { margin: 0 0 16px; padding-left: 22px; }
.case-study li { margin-bottom: 6px; }
.case-study li::marker { color: var(--azure); }
.case-study strong { color: var(--text); font-weight: 600; }
.case-study a:not(.text-link):not(.pill):not(.shimmer-button):not(.glass) { color: var(--label); border-bottom: 1px solid currentColor; }
.case-study .lead { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.55; }
.case-study .text-justify { text-align: left; } /* justified text leaves rivers on narrow screens */
.case-study .text-muted, .case-study small { color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; line-height: 1.5; }

/* Section heading: "1. Context & Objective". The number is wrapped in
   .section-num by the page so it can be set in mono. */
.case-study .section-title { margin-top: 0; padding: 0; border: 0; }
.section-num { margin-right: .35em; color: var(--label); font-family: var(--font-mono); font-size: .5em; font-weight: 500; letter-spacing: 0; vertical-align: .35em; }

.metrics-grid { margin: 28px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.metric-card { padding: 24px; border-radius: var(--radius); text-align: left; }
.metric-label {
  margin-bottom: 10px; color: var(--label); font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
}
.metric-value { color: var(--cobalt); font-size: 40px; font-weight: 500; letter-spacing: -.05em; line-height: 1; }
html[data-theme="dark"] .metric-value { color: var(--sky); }
.metric-unit { margin-top: 8px; color: var(--text-muted); font-size: 14px; }

.model-overview, .conclusion-box {
  margin: 24px 0; padding: 24px 26px;
  border: 1px solid var(--glass-border); border-left: 2px solid var(--azure) !important;
  border-radius: var(--radius-sm);
  background: var(--glass-bg); box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(var(--glass-blur, 24px)) saturate(140%);
  backdrop-filter: blur(var(--glass-blur, 24px)) saturate(140%);
}
.conclusion-box { padding: clamp(24px, 3vw, 36px); }
.model-overview > :last-child, .conclusion-box > :last-child { margin-bottom: 0; }
.model-overview h4, .model-overview h5, .model-overview h6, .conclusion-box h3 { margin-top: 0; color: var(--label) !important; }

.badge-tech { margin: 0 6px 8px 0; display: inline-flex; padding: 4px 11px; border: 1px solid var(--pill-border); border-radius: 999px; color: var(--text); font-family: var(--font-mono); font-size: 12px; line-height: 1.4; }

.case-study .comparison-table { width: 100%; margin: 24px 0; border-collapse: collapse; font-size: 15px; }
.table-scroll { margin: 24px 0; overflow-x: auto; }
.table-scroll .comparison-table { margin: 0; min-width: 560px; }
.case-study .comparison-table th {
  padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left;
  color: var(--label); font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
}
.case-study .comparison-table td { padding: 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.case-study .comparison-table tbody tr { background: transparent !important; transition: background-color 200ms ease; }
.case-study .comparison-table tbody tr:hover { background: rgba(63, 169, 245, .08) !important; }

/* Figures */
.row-image { margin: 20px 0; }
.case-study img { border-radius: var(--radius-sm); }
.case-study img.zoomable { cursor: zoom-in; }
.row-image img { margin: 0 auto; }
.row-image p, .row-image + p { margin-top: 10px; }
.architecture-diagram { width: 100%; max-height: 500px; object-fit: contain; margin: 24px 0; }

.image-placeholder {
  min-height: 260px; margin: 20px 0; padding: 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  background: var(--glass-bg); color: var(--text-muted); font-style: italic;
}

.code-block, .case-study pre {
  margin: 16px 0; padding: 18px 20px; overflow-x: auto;
  border: 0; border-radius: var(--radius-sm);
  background: var(--abyss) !important; color: var(--mist) !important;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.6; white-space: pre;
}
.code-block strong { color: #FFFFFF; }
.case-study code { font-family: var(--font-mono); font-size: .88em; }

/* Page-specific pieces kept from the old pages */
.eigenvalue-list { margin: 16px 0; padding: 16px 22px; border-radius: var(--radius-sm); background: var(--bg-alt); color: var(--text); font-family: var(--font-mono); font-size: 13px; }
.figure-caption { margin: 8px 0 24px; text-align: center; color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; }
.case-study .bg-light.border-start { padding: 16px 20px; border-left: 2px solid var(--azure); border-radius: var(--radius-sm); background: var(--glass-bg); }

/* Videos */
.responsive-iframe-wrapper, .ratio { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-sm); background: var(--abyss); }
.responsive-iframe-wrapper iframe, .ratio iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Bootstrap-style cards used on a few pages */
.case-study .card { height: 100%; overflow: hidden; border: 1px solid var(--glass-border); border-radius: var(--radius); background: var(--glass-bg); box-shadow: var(--glass-shadow); }
.case-study .card-img-top { width: 100%; border-radius: 0; }
.case-study .card-body { padding: 20px 22px; }

/* 4. Small grid layer for the project pages -----------------------------------
   Same class names as Bootstrap 5 (row, col-md-*, col-lg-*, mb-*), so the
   original page markup works without loading bootstrap.min.css. */
.case-study .container { width: 100%; margin: 0 auto; }
.case-study .row { display: flex; flex-wrap: wrap; margin: 0 -14px; row-gap: 20px; }
.case-study .row > * { width: 100%; max-width: 100%; padding: 0 14px; }
@media (min-width: 768px) {
  .case-study .col-md-4 { width: 33.333%; }
  .case-study .col-md-6 { width: 50%; }
  .case-study .order-md-1 { order: 1; }
  .case-study .order-md-2 { order: 2; }
}
@media (min-width: 992px) {
  .case-study .col-lg-4 { width: 33.333%; }
  .case-study .col-lg-5 { width: 41.667%; }
  .case-study .col-lg-6 { width: 50%; }
  .case-study .col-lg-7 { width: 58.333%; }
  .case-study .col-lg-8 { width: 66.667%; }
  .case-study .order-lg-1 { order: 1; }
  .case-study .order-lg-2 { order: 2; }
}
.case-study .col-12, .case-study .col-lg-12 { width: 100%; }
.case-study .align-items-center { align-items: center; }
.case-study .text-center { text-align: center; }
.case-study .img-fluid { max-width: 100%; height: auto; margin: 0 auto; }
.case-study .list-unstyled { padding-left: 0; list-style: none; }
.case-study .rounded { border-radius: var(--radius-sm); }
.case-study .mb-0 { margin-bottom: 0; }
.case-study .mb-2 { margin-bottom: 8px; }
.case-study .mb-3 { margin-bottom: 16px; }
.case-study .mb-4 { margin-bottom: 24px; }
.case-study .mb-5 { margin-bottom: 40px; }
.case-study .mt-2 { margin-top: 8px; }
.case-study .mt-3 { margin-top: 16px; }
.case-study .mt-4 { margin-top: 24px; }
.case-study .py-2 { padding-top: 8px; padding-bottom: 8px; }
.case-study .p-3 { padding: 16px; }

/* 5. Prev / next project + image zoom ----------------------------------------- */
.project-nav { margin-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.project-nav a {
  padding: 22px 24px; border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 8px;
  transition: transform 280ms var(--ease-out), box-shadow 280ms ease;
}
.project-nav a:hover { transform: translateY(-4px); box-shadow: var(--glass-shadow), 0 28px 60px rgba(30, 70, 160, .2); }
.project-nav span { color: var(--label); font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.project-nav strong { color: var(--text); font-size: 19px; font-weight: 500; letter-spacing: -.03em; line-height: 1.2; }
.project-nav .next { text-align: right; align-items: flex-end; }
.back-link { margin-top: 32px; }
@media (max-width: 640px) { .project-nav { grid-template-columns: 1fr; } .project-nav .next { text-align: left; align-items: flex-start; } }

.zoom-dialog {
  width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; padding: 24px;
  border: 0; background: rgba(7, 18, 38, .92); display: none; place-items: center; cursor: zoom-out;
}
.zoom-dialog[open] { display: grid; }
.zoom-dialog::backdrop { background: transparent; }
.zoom-dialog img { max-width: 100%; max-height: calc(100vh - 48px); object-fit: contain; border-radius: var(--radius-sm); }
.zoom-dialog button {
  position: absolute; top: 20px; right: 20px; width: 46px; height: 46px;
  border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px;
  background: rgba(255, 255, 255, .07); color: #FFFFFF; font-size: 22px; cursor: pointer;
}

/* Hero meta: stack email + location on phones so the long email never collides */
.hero-meta strong { overflow-wrap: anywhere; }
@media (max-width: 560px) { .hero-meta { grid-template-columns: 1fr; } }

/* Phones: tighter hero gutters, a name size that fits one word per line,
   and no corner index (it collides with the scroll cue). */
@media (max-width: 560px) {
  .hex-hero { padding-right: 16px; padding-left: 16px; }
  .hero-title { font-size: 12.5vw; }
  .hero-index { display: none; }
}

/* Subsidy guides: the A4 document sits on the page as a white sheet in both
   themes. Its own styles are scoped to .guide-doc inside each guide page. */
.guide-wrap { padding-top: 24px; }
.guide-doc { max-width: 794px; margin: 0 auto; overflow: hidden; border-radius: var(--radius); background: #FFFFFF; box-shadow: var(--glass-shadow); }
.guide-doc .section-heading { max-width: none; }

/* Printing a guide gives just the document, as before */
@media print {
  .site-header, .mobile-menu, .page-backdrop, .hex-hero, .site-footer, .back-to-top, .skip-link { display: none !important; }
  body, html { background: #FFFFFF !important; }
  body::after { display: none; }
  .page-shell { animation: none; }
  .guide-wrap { width: auto; padding: 0; }
  .guide-doc { max-width: none; border-radius: 0; box-shadow: none; }
}

/* Hero portrait: never stretched (height follows width), capped at 460px wide
   (the 1024x1536 source is only ever scaled down), soft blurred glow behind. */
.hero-portrait { width: auto; max-width: 460px; isolation: isolate; }
.hero-portrait img { width: auto; max-width: 100%; height: auto; }
.hero-portrait::before {
  position: absolute; z-index: -1; inset: 12% 6% 8%;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--azure), color-mix(in srgb, var(--cobalt) 70%, transparent) 55%, transparent);
  filter: blur(48px); opacity: .55; content: "";
}
html[data-theme="dark"] .hero-portrait::before { opacity: .8; }

/* Calmer motion ---------------------------------------------------------------
   The light ribbons stay but no longer drift: moving them under the frosted
   glass forced the glass blur to be recomputed on every frame. */
.tide-ribbons i { animation: none; }

/* Card grids keep the hover spotlight (tilt, glow, caption, others dim) but
   drop the scroll-scrub (fade / blur / shift tied to scroll position). */
[data-scrub="cards"] > .project-card {
  opacity: var(--focus-opacity, 1);
  filter: brightness(var(--focus-brightness, 1)) saturate(var(--focus-saturation, 1));
  translate: none;
  scale: 1;
  will-change: auto;
}

/* Project bubbles show the whole image (no cropping) in a 4:3 frame. Any
   space around it is filled with a blurred copy of the same image: each card
   sets style="background-image: url('...')" in index.html, the frame hides
   its own copy and the ::before layer inherits it and blurs it. */
.project-media { aspect-ratio: 4 / 3; background-size: 0 0; }
.project-media::before {
  position: absolute; inset: -24px; content: "";
  background-image: inherit; background-position: center; background-size: cover; background-repeat: no-repeat;
  filter: blur(22px) saturate(1.1); opacity: .9;
}
.project-media img { position: relative; z-index: 1; object-fit: contain; }

/* Small icons in front of hero text-links (projects, LinkedIn, Subventions) */
.text-link .link-icon { width: 16px; height: 16px; flex: 0 0 16px; margin-right: -2px; color: var(--label); transition: transform 220ms var(--ease-out); }
.text-link:hover .link-icon { transform: scale(1.12); }
.hero-card .button-row { gap: 18px; }

/* Company logo tile next to each internship title */
.job-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.job-head .job-meta { margin-bottom: 0; }
.job-logo {
  width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; overflow: hidden;
  border-radius: 14px; background: #FFFFFF; box-shadow: 0 0 0 1px var(--line-soft), 0 8px 20px rgba(10, 27, 61, .12);
}
.job-logo img { width: 100%; height: 100%; object-fit: contain; }
.job-logo--wordmark { background: #0B6B72; }                 /* Bain Magique: white wordmark on its teal */
.job-logo--wordmark img { width: 88%; height: auto; }

/* Media-first project layout (racecar_project.html) ---------------------------
   .media-full = one card per row, .media-row = two cards side by side,
   .media-split = text on the left, skills card on the right. */
.media-grid { display: grid; gap: 20px; }
.media-row, .media-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.media-split { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); padding: 28px 0; }
@media (max-width: 860px) { .media-row, .media-split { grid-template-columns: 1fr; } }
.media-card { margin: 0; padding: 14px; border-radius: var(--radius); display: flex; flex-direction: column; gap: 14px; }
.case-study .media-title {
  margin: 4px 6px 0; color: var(--label); font-family: var(--font-mono);
  font-size: 12px; font-weight: 500; letter-spacing: .08em; line-height: 1.3; text-transform: uppercase;
}
.media-card img { width: 100%; height: auto; background: #FFFFFF; }
.about-block p { margin: 14px 0 0; }

/* Skills that pop: glass card, each skill a highlighted chip */
.skills-card { padding: 28px; border-radius: var(--radius); border-left: 2px solid var(--azure) !important; display: flex; flex-direction: column; gap: 18px; }
.case-study .skill-chips { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.case-study .skill-chips li {
  margin: 0; padding: 12px 16px 12px 42px; position: relative;
  border: 1px solid color-mix(in srgb, var(--azure) 45%, transparent); border-radius: 14px;
  background: color-mix(in srgb, var(--cobalt) 9%, transparent);
  color: var(--text); font-size: 15px; font-weight: 500; line-height: 1.35;
  transition: transform 220ms var(--ease-out), background-color 220ms ease;
}
.case-study .skill-chips li::before {
  position: absolute; top: 50%; left: 14px; width: 14px; height: 14px; transform: translateY(-50%);
  border-radius: 999px; background: var(--cobalt); content: "";
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--azure) 25%, transparent);
}
.case-study .skill-chips li:hover { transform: translateX(4px); background: color-mix(in srgb, var(--cobalt) 15%, transparent); }
.case-study .skills-card-sub { margin: 8px 0 0; font-size: 17px; }
.skills-card .shimmer-button { align-self: flex-start; }

/* Click-to-zoom hint on every project-page image (wrapper added by site.js):
   lift, Azure glow, slight zoom, a light sheen and a "View" badge, the same
   hover language as the project cards on the home page. */
.zoom-frame {
  position: relative; display: block; width: fit-content; max-width: 100%; margin-inline: auto;
  overflow: hidden; border-radius: var(--radius-sm); cursor: zoom-in;
  transition: transform 280ms var(--ease-out), box-shadow 350ms ease;
}
.media-card .zoom-frame { width: 100%; }
.zoom-frame img { transition: transform 900ms var(--ease-out), filter 500ms ease; }
.zoom-frame::after {
  position: absolute; z-index: 2; top: 0; bottom: 0; left: -60%; width: 42%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent);
  content: ""; opacity: 0; transform: skewX(-14deg); transition: left 700ms ease, opacity 260ms ease;
}
.zoom-hint {
  position: absolute; z-index: 3; top: 12px; right: 12px; padding: 6px 12px 6px 10px;
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  background: rgba(7, 18, 38, .62); color: #FFFFFF; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transform: translate3d(0, -6px, 0); transition: opacity 260ms ease, transform 420ms var(--ease-out); pointer-events: none;
}
.zoom-hint svg { width: 14px; height: 14px; }
.zoom-frame:hover, .zoom-frame:focus-within { transform: translateY(-4px); box-shadow: 0 0 0 1px color-mix(in srgb, var(--azure) 55%, transparent), 0 24px 50px rgba(30, 91, 255, .22); }
.zoom-frame:hover img, .zoom-frame:focus-within img { transform: scale(1.035); filter: brightness(.92); }
.zoom-frame:hover::after, .zoom-frame:focus-within::after { left: 122%; opacity: .8; }
.zoom-frame:hover .zoom-hint, .zoom-frame:focus-within .zoom-hint { opacity: 1; transform: none; }

/* Diagram + description side by side (racecar Functions row) */
.media-row--text { align-items: start; gap: clamp(20px, 4vw, 48px); }
.media-row--text .media-card { position: sticky; top: 104px; }   /* diagram stays in view while reading */
.functions-text { padding-top: 4px; }
.functions-text p { margin: 10px 0 0; }
.case-study .functions-text h3 { margin: 26px 0 0; font-size: 19px; letter-spacing: -.02em; }
@media (max-width: 860px) { .media-row--text .media-card { position: static; } }

.about-block .lead-in { color: var(--text); font-size: clamp(19px, 1.7vw, 22px); line-height: 1.45; letter-spacing: -.01em; }

/* Internships: date with the location underneath, in the left column */
.job-when { display: flex; flex-direction: column; gap: 6px; }
.job-loc { color: var(--text-muted); font-size: 14px; }

/* Media cards: very tall images (portrait robots) stay a sensible height */
.media-card img { max-height: 640px; object-fit: contain; }
.case-study .challenge-steps { margin: 12px 0 0; padding-left: 22px; display: grid; gap: 6px; }

/* Header: mostly opaque so bright images scrolling underneath don't smear
   into a white blur band (the frosted look stays subtle). */
.site-header .header-shell.glass { background: color-mix(in srgb, var(--bg) 90%, transparent); }

/* Project bubbles: solid surface instead of frosted glass. The glass blur
   sampled the fixed hex backdrop behind it, which showed up as a light band
   sliding down each card while scrolling. */
.project-grid > .project-card.glass {
  -webkit-backdrop-filter: none; backdrop-filter: none;
  background: color-mix(in srgb, var(--bg-alt) 82%, var(--azure) 4%);
}

/* Home sections: tighter rhythm (was up to 160px above and below each) */
.page-shell > section.section-pad { padding-top: clamp(48px, 5.5vw, 88px); padding-bottom: clamp(48px, 5.5vw, 88px); }
.page-shell > section.section-pad .section-heading { margin-bottom: 40px; }

/* Header: no big drop shadow. The 60px shadow of a fixed header slid over the
   page while scrolling and read as a fading band under the bar. */
.site-header .header-shell.glass { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 4px 12px rgba(4, 12, 40, .18); }

/* Header: no backdrop blur. Two overlapping backdrop-filters (header + glass
   card under it) made Chrome paint a header-height light band below the bar.
   The header is near-opaque, so the blur added nothing visible. */
.site-header .header-shell.glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: color-mix(in srgb, var(--bg) 94%, transparent); }
