/* ==========================================================================
   Design tokens — "Deep Ocean + Light"
   Dark ink bands (hero, page headers, footer) with teal/cyan accents over
   light, cool content surfaces.
   ========================================================================== */
:root {
  color-scheme: light;

  /* Ink (dark bands) */
  --ink: #0b1f33;
  --ink-2: #0f2e4a;
  --ink-3: #16405f;
  --on-ink: #e6eef6;
  --on-ink-muted: #9fb3c8;
  --ink-line: rgba(159, 179, 200, 0.18);

  /* Accents */
  --teal: #14b8a6;
  --teal-dark: #0d9488;
  --teal-ink: #0f766e;      /* teal dark enough for text on light surfaces */
  --cyan: #38bdf8;
  --accent-gradient: linear-gradient(120deg, #2dd4bf 0%, #38bdf8 100%);

  /* Light surfaces */
  --bg: #f6f8fb;
  --bg-alt: #eaf0f6;
  --card-bg: #ffffff;
  --line: #dbe3ec;
  --text: #1e293b;
  --text-muted: #5b6b7d;

  /* Legacy token names, re-pointed at the new palette so every older
     rule further down picks up the theme automatically. */
  --navy: #0f2e4a;
  --sage: var(--teal-ink);
  --sage-dark: var(--ink-2);
  --olive: var(--teal-ink);
  --olive-dark: #115e59;
  --terracotta: #0e7490;

  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-serif-display: "Space Grotesk", "Inter", system-ui, sans-serif;

  --container: 1180px;
  --radius: 14px;
  --shadow-soft: 0 14px 34px -20px rgba(11, 31, 51, 0.35);
  --shadow-lift: 0 22px 44px -22px rgba(11, 31, 51, 0.45);
  --header-h: 76px;

}

/* The design is a fixed light theme with dark accent bands — no dark-mode
   override — so the site looks identical regardless of OS theme. */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Long unbroken strings (DOI links, URLs) drop to the next line
   instead of overflowing their card once they no longer fit —
   never mid-word if a clean break point (space, /, -) is available. */
a, p, li {
  overflow-wrap: break-word;
  word-break: normal;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif-display);
  color: var(--ink-2);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }

.eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal-ink);
}

.section-rule {
  display: inline-block;
  width: 36px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent-gradient);
  margin-bottom: 16px;
}

/* ==========================================================================
   Site header / nav — sticky; transparent over the dark band, solid
   glass once scrolled (.is-scrolled is toggled in baseof.html).
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 18px 0;
  background: var(--ink);
  color: var(--on-ink);
  transition: background 0.25s ease, box-shadow 0.25s ease, padding 0.25s ease;
}

.site-header.is-scrolled {
  padding: 12px 0;
  background: rgba(11, 31, 51, 0.86);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.6);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-family: var(--font-serif-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
}

.brand-tag {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--on-ink-muted);
  text-transform: uppercase;
  margin-top: 3px;
}

.nav-links {
  display: none;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-links a {
  position: relative;
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--on-ink-muted);
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-links a:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

.nav-links a[aria-current="page"] {
  color: #fff;
  font-weight: 600;
  background: rgba(45, 212, 191, 0.14);
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.35);
}

.nav-social {
  display: none;
  align-items: center;
  gap: 16px;
}

.nav-social a {
  color: var(--on-ink-muted);
  display: inline-flex;
  transition: color 0.15s ease;
}
.nav-social a:hover { color: var(--teal); }

.nav-social svg { width: 19px; height: 19px; }

.nav-toggle {
  display: inline-flex;
  background: none;
  border: 1px solid var(--ink-line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--on-ink);
}

@media (min-width: 960px) {
  .nav-links, .nav-social { display: flex; }
  .nav-toggle { display: none; }
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 14px;
  padding: 16px 0 6px;
  border-top: 1px solid var(--ink-line);
  margin-top: 14px;
}

.mobile-menu.is-open { display: flex; }

.mobile-menu a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--on-ink);
}

.mobile-menu .nav-social { display: flex; padding-top: 6px; }

@media (min-width: 960px) {
  .mobile-menu { display: none !important; }
}

/* ==========================================================================
   Dark bands: home hero + inner-page headers share one treatment
   ========================================================================== */
.hero,
.page-hero {
  position: relative;
  color: var(--on-ink);
  /* Site-wide watermark: one connected EO -> data -> AI -> insight
     illustration, fixed at 1920px and centred so it lines up with the
     1180px container on every page (on Home the globe sits behind the
     photo collage). */
  background:
    url("/assets/images/watermark-eo.svg") center top / 1920px auto no-repeat,
    radial-gradient(1000px 500px at 85% -10%, rgba(56, 189, 248, 0.14), transparent 60%),
    radial-gradient(800px 400px at -10% 110%, rgba(45, 212, 191, 0.10), transparent 60%),
    linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
}

.hero h1, .hero h2, .page-hero h1 { color: #fff; }


.hero .eyebrow, .page-hero .eyebrow { color: #5eead4; }

/* ==========================================================================
   Hero (home page)
   ========================================================================== */
.hero {
  position: relative;
  padding: 40px 0 0;
  overflow: hidden;
}

.hero > .container { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
  padding-bottom: 72px;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 40px;
  }
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #5eead4;
}
.hero-kicker .section-rule { margin: 0; }

.hero-copy h1 {
  font-size: clamp(2.3rem, 5.4vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 18px 0 24px;
}

.hero-copy h1 .line-sage {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-copy p {
  max-width: 50ch;
  color: var(--on-ink-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

/* Primary button */
.hero-cta, .cv-download { white-space: nowrap; }

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  background: var(--accent-gradient);
  color: var(--ink);
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 12px 28px -14px rgba(45, 212, 191, 0.7);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.hero-cta:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 16px 32px -14px rgba(45, 212, 191, 0.85); }
.hero-cta svg { width: 18px; height: 18px; transition: transform 0.15s ease; }
.hero-cta:hover svg { transform: translateX(3px); }

/* Outline button on dark bands */
.hero .cv-download {
  margin-top: 0;
  border-color: rgba(230, 238, 246, 0.35);
  color: var(--on-ink);
}
.hero .cv-download:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--teal); color: #fff; }

.hero-open-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
}

.hero-open-label .eyebrow { color: var(--on-ink-muted); }

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.6);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(45, 212, 191, 0); }
  100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0); }
}

/* Photo collage — CSS grid for pixel-exact alignment. Each photo gets an
   opaque ink frame so overlapping edges stay crisp on the dark band. */
.hero-collage {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  column-gap: 24px;
  align-items: start;
  padding-top: 40px;
}

.collage-photo {
  position: relative;
  z-index: 1;
  padding: 6px;
  background: var(--ink-3);
  border-radius: 16px;
  box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(94, 234, 212, 0.18);
}

.collage-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 11px;
  display: block;
}

/* Top photo spans both columns and is centered above the two below it. */
.collage-main {
  grid-column: 1 / 3;
  grid-row: 1;
  justify-self: center;
  width: 58%;
  aspect-ratio: 3 / 4;
  z-index: 1;
}

.collage-speaking {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
  width: 88%;
  aspect-ratio: 4 / 5;
  margin-top: -48px;
  z-index: 2;
}

.collage-laptop {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  width: 88%;
  aspect-ratio: 4 / 5;
  margin-top: -64px;
  z-index: 2;
}

/* ==========================================================================
   Generic inner-page header (Education / Experience / Projects)
   ========================================================================== */
.page-hero {
  padding: 64px 0 56px;
  /* Same watermark, dimmed and scaled for the shorter header */
  background:
    linear-gradient(180deg, rgba(11, 31, 51, 0.5), rgba(15, 46, 74, 0.5)),
    url("/assets/images/watermark-eo.svg") center top / 1920px auto no-repeat,
    radial-gradient(1000px 500px at 85% -10%, rgba(56, 189, 248, 0.14), transparent 60%),
    linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
}

.page-hero h1 { font-size: clamp(2.1rem, 4.8vw, 3rem); letter-spacing: -0.02em; }
.page-hero .lede { max-width: 62ch; color: var(--on-ink-muted); font-size: 1.05rem; margin-bottom: 0; }

main { padding-bottom: 0; }

/* Footer always sits at the bottom; on Home the blue hero stretches to
   fill the window so there is no strip of page background below it. */
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
main:has(> .hero) { display: flex; flex-direction: column; }
main > .hero { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; }

.page-section { padding: 56px 0; }
.page-section:last-child { padding-bottom: 88px; }
.page-section + .page-section { border-top: 1px solid var(--line); }


/* ==========================================================================
   Cards / timeline (Education, Experience, Projects)
   ========================================================================== */
.timeline { display: flex; flex-direction: column; gap: 36px; }

.timeline-item {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 28px 26px;
}

.timeline-item .role { font-size: 1.25rem; margin-bottom: 2px; }
.timeline-item .org {
  color: var(--olive);
  font-weight: 600;
  font-size: 0.98rem;
  margin-bottom: 4px;
}
.timeline-item .org a { border-bottom: 1px solid var(--olive); }
.timeline-item .org a:hover { color: var(--olive-dark); }
.timeline-item .meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.timeline-item ul { margin: 0 0 0.6em; padding-left: 1.2em; }
.timeline-item li { margin-bottom: 6px; }

.sub-block {
  margin-top: 18px;
  padding: 16px 18px;
  background: var(--bg-alt);
  border-radius: 8px;
  border-left: 3px solid var(--olive);
}

.sub-block h4 { font-size: 1rem; margin-bottom: 6px; color: var(--sage-dark); }
.sub-block p:last-child { margin-bottom: 0; }

.pub-list {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.pub-list h4 {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pub-list li { margin-bottom: 10px; font-size: 0.94rem; }
.pub-list li:last-child { margin-bottom: 0; }
.pub-list a { color: var(--olive); font-weight: 600; border-bottom: 1px solid var(--olive); }

/* Skills grid */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 8px;
}

@media (min-width: 700px) {
  .skills-grid { grid-template-columns: repeat(3, 1fr); }
}

.skills-group h4 {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 10px;
}

.pill-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  background: var(--card-bg);
}

/* Gallery */
.gallery-strip {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 640px) { .gallery-strip { grid-template-columns: repeat(4, 1fr); } }

.gallery-strip a {
  display: block;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 4/3;
}

.gallery-strip img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s ease; }
.gallery-strip a:hover img { transform: scale(1.05); }

/* Project cards */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
}

@media (min-width: 720px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-card .tag {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--olive);
  background: var(--bg-alt);
  padding: 4px 10px;
  border-radius: 999px;
}

.project-card h3 { font-size: 1.15rem; margin-bottom: 2px; }
.project-card p { color: var(--text-muted); font-size: 0.94rem; margin-bottom: 6px; }

.project-links { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: auto; padding-top: 10px; font-size: 0.88rem; font-weight: 600; }
.project-links a { color: var(--navy); border-bottom: 1px solid var(--olive); }

.cv-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 11px 20px;
  border: 1.5px solid var(--navy);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--navy);
}

.cv-download:hover { background: var(--navy); color: var(--bg); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  background: var(--bg-alt);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .footer-inner { flex-direction: row; justify-content: space-between; align-items: center; }
}

.footer-social { display: flex; gap: 16px; }
.footer-social a { color: var(--navy); display: inline-flex; }
.footer-social svg { width: 18px; height: 18px; }

/* ==========================================================================
   Project detail / case-study pages
   ========================================================================== */
.back-link {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.back-link:hover { color: var(--olive); }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

/* Project detail header: the back-link stays left as a utility nav
   element; everything else (tags, title/logo, intro, meta, CTAs) is
   one centered block. */
.project-detail-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 28px;
}

.project-detail-centered .tag-row { justify-content: center; }
.project-detail-centered .project-links { justify-content: center; }

.project-title-row { margin-bottom: 0.6em; }
.project-title-row h1 { margin: 0; }

/* When a project has a logo, it stands in for the text title
   entirely (h1 wraps the <img>, so it still reads as the page
   heading to screen readers/SEO) - sized to read clearly as a title,
   not a small icon. */
.project-logo-title {
  display: inline-block;
  height: clamp(72px, 13vw, 140px);
  width: auto;
}

/* Project detail title: bigger than the standard .page-hero h1 used
   on other pages (Education, Experience, Projects list, Workshops),
   since this one stands alone, centered, as the page's main visual
   anchor. */
.project-detail-hero h1 { font-size: clamp(2.75rem, 7vw, 4.5rem); }

.project-detail-hero .lede { max-width: 62ch; }

.project-meta span {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
}

.project-detail-links { margin-top: 18px; }

.project-detail-image {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px 8px;
}

.project-detail-image img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.project-detail-image figcaption {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Inline figure, placed mid-article via the {{< project-figure >}} shortcode */
.project-inline-image {
  margin: 1.8em 0;
}

.project-inline-image img {
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.project-inline-image--small img {
  max-width: 420px;
  width: 100%;
}

.project-inline-image--full img {
  width: 100%;
}

.project-inline-image figcaption {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Sliding report-figure gallery, via {{< project-carousel >}} +
   {{< carousel-item >}} - one slide fills the viewport at a time (not
   a scrollable list), stepped with prev/next buttons (see baseof.html
   for the scroll-by-one script). A case-section holding a carousel
   spans the full card-grid row - see .case-section:has() below - so
   a large figure set gets real room instead of a 1/3-width card. */
.image-carousel {
  margin: 1.4em 0 0.4em;
}

.carousel-viewport {
  display: flex;
  align-items: center;
  gap: 12px;
}

.carousel-track {
  display: flex;
  overflow-x: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  flex: 1 1 auto;
  min-width: 0;
}

.carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: start;
  margin: 0;
}

.carousel-slide img {
  width: 100%;
  height: 360px;
  object-fit: contain;
  background: var(--bg-alt);
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  display: block;
}

.carousel-slide-name {
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  text-align: center;
  font-style: normal;
}

.carousel-counter {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.carousel-btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--navy);
  background: var(--bg);
  color: var(--navy);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-btn:hover { background: var(--navy); color: var(--bg); }

/* Full-size embedded HTML map, via {{< embed-map >}} */
.embedded-map {
  margin: 1.8em 0;
}

.embedded-map iframe {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: block;
}

.embedded-map-caption {
  margin-top: 8px;
  font-size: 0.85rem;
}

/* A section holding an embedded map also gets the full row width,
   same as the figure carousel above. */
.case-section:has(.embedded-map) {
  grid-column: 1 / -1 !important;
}

/* Prose: typographic rules for rendered Markdown content (case studies,
   workshop write-ups) — headings/paragraphs/lists/code get the site's
   design tokens instead of browser defaults. */
.prose { max-width: 72ch; }
.prose h2 {
  font-size: 1.4rem;
  margin-top: 2.2em;
  padding-top: 0.6em;
  border-top: 1px solid var(--line);
}
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.prose h3 { font-size: 1.1rem; margin-top: 1.6em; color: var(--sage-dark); }

/* Project case studies: the render hook (layouts/_default/_markup/
   render-heading.html) turns every ## heading into its own boxed
   .case-section, wrapped in the .case-sections grid below - so the
   page uses the full width instead of one narrow continuous column. */
.prose-grid { max-width: none; }

.case-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: stretch;
}

@media (min-width: 640px) {
  .case-sections { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  /* 6 sub-columns so each card (span 2) is still a third of the row
     width, but a leftover row of exactly 2 cards can be centered
     with mathematically equal space on both sides (see below). */
  .case-sections { grid-template-columns: repeat(6, 1fr); }
  .case-section { grid-column: span 2; }

  /* When exactly 2 cards are left over in what would be a row of 3
     (e.g. 5 total cards), center that pair instead of left-packing
     it - the first of the pair starts one card-width in, the second
     follows immediately after, leaving an equal empty gutter at both
     ends of the row. Generalizes to any project's card count. */
  .case-section:nth-child(3n+1):nth-last-child(2) {
    grid-column: 2 / span 2;
  }
  .case-section:nth-child(3n+1):nth-last-child(2) ~ .case-section:last-child {
    grid-column: 4 / span 2;
  }
}

/* A section holding a carousel passed full="true" (a large figure
   set) gets the full row width instead of a 1/3-width card -
   overrides the span-2 / pair-centering rules above regardless of
   breakpoint or position in the grid. A plain carousel (no full="true")
   stays at normal card width and sits alongside other cards. */
.case-section:has(.image-carousel--full) {
  grid-column: 1 / -1 !important;
}

.case-section {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
}

.prose .case-section h2 {
  font-size: 1.2rem;
  margin: 0 0 0.7em;
  padding-top: 0;
  border-top: none;
}

/* Clamp every card's body to a uniform 12 lines so cards in the same
   row match in height regardless of how much a section has to say;
   .case-read-more (shown only when content actually overflows, via
   the small script in baseof.html) expands it in place. */
.case-section-body {
  display: -webkit-box;
  -webkit-line-clamp: 12;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.case-section.is-expanded .case-section-body {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.case-read-more {
  display: none;
  align-self: flex-start;
  margin-top: 14px;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--olive);
  cursor: pointer;
}

.case-read-more.is-visible { display: inline-flex; }
.case-read-more:hover { color: var(--olive-dark); }
.prose p { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; margin-bottom: 1em; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--olive); font-weight: 600; border-bottom: 1px solid var(--olive); }
.prose strong { color: var(--navy); }
.prose code {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-size: 0.88em;
}
/* Chroma (Hugo's syntax highlighter, "github" style) sets its own
   background/colors inline; we only lay out the block. */
.prose pre {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.2em 0;
}
.prose pre code { padding: 0; border: none; background: none; }

/* ==========================================================================
   Workshops
   ========================================================================== */
.workshop-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
}

@media (min-width: 640px) {
  .workshop-grid { grid-template-columns: repeat(2, 1fr); }
}

.workshop-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.workshop-card-media { display: block; aspect-ratio: 16/10; }
.workshop-card-media img { width: 100%; height: 100%; object-fit: cover; }

.workshop-card-body { padding: 20px 22px 22px; }
.workshop-card-body .meta {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.workshop-card-body h3 { font-size: 1.15rem; margin-bottom: 8px; }
.workshop-card-body h3 a { color: var(--navy); }
.workshop-card-body p:last-child { color: var(--text-muted); font-size: 0.94rem; margin-bottom: 0; }

/* ==========================================================================
   Deep Ocean theme — component refinements
   (placed last so they layer over the base component rules above)
   ========================================================================== */

/* Tags / pills (shared) */
.tag,
.project-card .tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-ink);
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.22);
  padding: 4px 10px;
  border-radius: 999px;
}

.page-hero .tag {
  color: #99f6e4;
  background: rgba(45, 212, 191, 0.1);
  border-color: rgba(45, 212, 191, 0.3);
}

.pill {
  background: var(--card-bg);
  border-color: var(--line);
  color: var(--text);
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.pill:hover { border-color: var(--teal); color: var(--teal-ink); transform: translateY(-1px); }

.skills-group {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px 22px;
}

/* Cards: lift + accent top edge on hover */
.timeline-item,
.project-card,
.case-section,
.workshop-card {
  position: relative;
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(11, 31, 51, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.project-card::before,
.timeline-item::before,
.case-section::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.project-card:hover,
.workshop-card:hover,
.timeline > .timeline-item:hover,
.case-section:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: transparent;
}

.project-card:hover::before,
.timeline-item:hover::before,
.case-section:hover::before { opacity: 1; }

.project-card h3 { font-size: 1.2rem; }
.project-links a { color: var(--ink-2); border-bottom-color: var(--teal); transition: color 0.15s ease; }
.project-links a:hover { color: var(--teal-ink); }

.sub-block { background: var(--bg); border-left-color: var(--teal); }
.sub-block h4 { color: var(--ink-2); }

/* Outline button (light surfaces) */
.cv-download {
  border-radius: 10px;
  border-color: var(--ink-2);
  color: var(--ink-2);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.cv-download:hover { background: var(--ink-2); color: #fff; transform: translateY(-1px); }

/* Project detail header on the dark band */
.page-hero .back-link { color: var(--on-ink-muted); }
.page-hero .back-link:hover { color: #5eead4; }
.page-hero .project-meta { color: var(--on-ink-muted); display: flex; gap: 6px 16px; flex-wrap: wrap; justify-content: center; }
.page-hero .project-links a { color: #fff; border-bottom-color: var(--teal); }
.page-hero .project-links a:hover { color: #5eead4; }

/* Prose */
.prose a { color: var(--teal-ink); border-bottom-color: rgba(15, 118, 110, 0.4); }
.prose a:hover { border-bottom-color: var(--teal-ink); }
.prose strong { color: var(--ink-2); }
.prose h3 { color: var(--ink-3); }

/* Existing figure carousel buttons */
.carousel-btn {
  border-color: var(--line);
  background: var(--card-bg);
  color: var(--ink-2);
  box-shadow: var(--shadow-soft);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.carousel-btn:hover { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }

/* Footer */
.site-footer {
  background: var(--ink);
  border-top: 1px solid var(--ink-line);
  color: var(--on-ink-muted);
}
.footer-inner { color: var(--on-ink-muted); }
.footer-inner p { margin: 0; }
.footer-social a { color: var(--on-ink-muted); transition: color 0.15s ease; }
.footer-social a:hover { color: var(--teal); }

/* ==========================================================================
   Auto-sliding panels  ([data-slider], script in baseof.html)
   Without JS (.is-ready missing) panels stack and controls hide.
   ========================================================================== */
.slider { position: relative; }

.slider-window {
  overflow: hidden;
  border-radius: var(--radius);
  transition: height 0.45s ease;
}

.slider-track { display: flex; flex-direction: column; gap: 24px; }

.slider.is-ready .slider-track {
  flex-direction: row;
  gap: 0;
  align-items: flex-start;
  transition: transform 0.65s cubic-bezier(0.65, 0, 0.35, 1);
  will-change: transform;
}

.slider.is-ready .slider-panel {
  flex: 0 0 100%;
  min-width: 0;
  opacity: 0.35;
  transition: opacity 0.6s ease;
}
.slider.is-ready .slider-panel.is-active { opacity: 1; }

.slider-controls,
.slider-progress,
.slider-tabs { display: none; }

.slider.is-ready .slider-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 22px;
}
.slider.is-ready.is-single .slider-controls,
.slider.is-ready.is-single .slider-progress { display: none; }

.slider-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--ink-2);
  font-size: 1.05rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.slider-btn:hover { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }

.slider-counter {
  min-width: 56px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.slider.is-ready .slider-progress {
  display: block;
  width: 160px;
  height: 3px;
  margin: 14px auto 0;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.slider-progress span {
  display: block;
  height: 100%;
  background: var(--accent-gradient);
  transform-origin: left center;
  transform: scaleX(0);
}
.slider.no-autoplay .slider-progress { display: none; }

/* Experience: timeline tabs above the slider */
.slider.is-ready .slider-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  gap: 0;
  margin-bottom: 26px;
  overflow-x: auto;
  scrollbar-width: none;
}
.slider-tabs::-webkit-scrollbar { display: none; }

.slider-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 22px 16px 12px 0;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--text-muted);
}

/* the timeline rail + node */
.slider-tab::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--line);
}
.slider-tab::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 2px solid #b6c4d3;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.slider-tab.is-active::before { background: var(--accent-gradient); }
.slider-tab.is-active::after {
  background: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 0 0 5px rgba(20, 184, 166, 0.18);
}

.slider-tab-dates { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.slider-tab-org { font-family: var(--font-serif-display); font-size: 0.98rem; font-weight: 600; color: var(--ink-2); line-height: 1.3; }
.slider-tab:hover .slider-tab-org,
.slider-tab.is-active .slider-tab-org { color: var(--teal-ink); }
.slider-tab.is-active .slider-tab-dates { color: var(--teal-ink); }

.slider--experience .timeline-item { padding: 32px 32px 28px; }

@media (max-width: 639px) {
  .slider.is-ready .slider-tabs { grid-auto-columns: 1fr; margin-bottom: 18px; }
  .slider-tab { padding-right: 8px; }
  .slider-tab-org { display: none; }
  .slider-tab-dates { font-size: 0.68rem; letter-spacing: 0.03em; }
  .slider--experience .timeline-item { padding: 24px 20px 22px; }
}
.slider--experience + .cv-download { margin-top: 32px; }

.job-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px 20px;
  margin-bottom: 14px;
}
.job-head .role { font-size: 1.45rem; }
.job-head .org, .job-head .meta { margin-bottom: 0; }

.date-chip {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .slider.is-ready .slider-track,
  .slider.is-ready .slider-panel,
  .slider-window { transition: none; }
  .pulse-dot { animation: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 720px) {
  .hero {
    background:
      linear-gradient(180deg, rgba(11, 31, 51, 0.5), rgba(15, 46, 74, 0.35)),
      url("/assets/images/watermark-eo.svg") 68% top / 1300px auto no-repeat,
      linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
  }
  .page-hero { background-size: auto, 1300px auto, auto, auto; background-position: 0 0, 68% top, 0 0, 0 0; }
}
