/* ==========================================================================
   MMS E-Portfolio — Component + Layout Styles

   Design TOKENS (colors, fonts, spacing) live in css/theme.css, not here —
   this file only consumes var(--...) tokens, it never hardcodes a color.
   theme.css must be linked before this file in every page's <head>.

   RESPONSIVE BREAKPOINTS IN THIS FILE (search these markers to jump there):
     - 767px and below   → "RESPONSIVE: MOBILE (<=767px)" section, near the
                            end of this file. Collapses the nav to a
                            hamburger menu and stacks a few layout blocks.
     - 768px–1023px       → "RESPONSIVE: TABLET" section, right after it.
                            Spacing-only tweaks, no nav logic.
     - Nav's DESKTOP DEFAULT (>=768px) is not a media query — it's simply
       the unguarded base rules under "Header / Nav" below. Anything that
       changes how the nav looks/behaves on desktop lives THERE, and
       anything for mobile lives in the MOBILE media query — never both in
       the same place, so a search for one won't land you in the other.

   GUARD RAIL: if your edit is only about color/theme values, you should
   never need to touch anything between the "RESPONSIVE:" markers, and you
   should never need to touch this file at all — theme.css is enough. If a
   change you're making WOULD affect nav layout/breakpoints, flag it before
   editing rather than doing it inline with an unrelated change.
   ========================================================================== */

/* ==========================================================================
   Reset & base
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-foreground);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 var(--space-4);
  color: var(--color-foreground);
}

p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { color: var(--color-primary-hover); }

ul { margin: 0; padding: 0; list-style: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* Visible focus ring everywhere — never remove */
:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary-hover);
  margin: 0 0 var(--space-2);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: var(--color-on-primary);
  padding: var(--space-3) var(--space-6);
  z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
  left: 0;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  border: var(--border-w) solid transparent;
  transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease), border-color var(--duration) var(--ease);
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  color: var(--color-on-primary);
}

.btn-ghost {
  border-color: var(--color-foreground);
  color: var(--color-foreground);
}

.btn-ghost:hover {
  background: var(--color-foreground);
  color: var(--color-background);
}

/* ==========================================================================
   Header / Nav
   ⚠ NAV LAYOUT — this block + its mobile counterpart in the
   "RESPONSIVE: MOBILE (<=767px)" section near the end of this file are the
   ONLY two places nav layout/breakpoint logic lives. Rules below (outside
   any @media block) are the DESKTOP DEFAULT — .nav-toggle is display:none
   here and only flips to display:flex inside the mobile media query.
   Theme/color edits should only need var(--color-*) VALUES in theme.css,
   never these selectors — if you find yourself editing display/position/
   flex properties here for a color-only task, stop and flag it.
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(var(--color-background-rgb), 0.92);
  backdrop-filter: blur(8px);
  border-bottom: var(--border-w) solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-foreground);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.0625rem;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-foreground);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: var(--space-2) 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: border-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

.nav-link:hover {
  border-bottom-color: var(--color-primary);
  color: var(--color-foreground);
}

.nav-link.is-active,
.nav-link[aria-current="page"] {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.nav-dropdown-toggle {
  cursor: pointer;
}

.nav-dropdown-caret {
  flex-shrink: 0;
  transition: transform var(--duration) var(--ease);
}

.nav-dropdown-toggle[aria-expanded="true"] .nav-dropdown-caret {
  transform: rotate(180deg);
}

.nav-item.has-dropdown.is-active-group > .nav-dropdown-toggle {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* Dropdown panel — desktop: floating card anchored under the toggle */
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 60;
  margin-top: var(--space-2);
  min-width: 20rem;
  background: var(--color-card);
  border: var(--border-w) solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 12px 24px -8px rgba(var(--color-foreground-rgb), 0.18);
  padding: var(--space-2);
  animation: nav-dropdown-in var(--duration) var(--ease);
}

/* Invisible bridge over the margin-top gap above: the toggle and the panel
   are both children of .nav-item, which is what nav.js listens to for
   mouseenter/mouseleave, but that gap is dead space with nothing under the
   cursor to keep the pointer "inside" .nav-item while crossing it — this
   fills that dead space so the hover chain never breaks mid-transit. */
.nav-dropdown::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--space-2) * -1);
  height: var(--space-2);
}

.nav-dropdown[hidden] {
  display: none;
}

.nav-dropdown li + li {
  margin-top: 2px;
}

.nav-dropdown a {
  display: block;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border-bottom: none;
  color: var(--color-foreground);
  text-decoration: none;
  font-weight: 400;
  font-size: 0.9375rem;
  line-height: 1.4;
  transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

.nav-dropdown a:hover,
.nav-dropdown a:focus-visible {
  background: var(--color-primary-tint);
  color: var(--color-primary);
}

.nav-dropdown a.is-active,
.nav-dropdown a[aria-current="page"] {
  background: var(--color-primary-tint);
  color: var(--color-primary);
  font-weight: 700;
}

@keyframes nav-dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
}

.nav-toggle-bar {
  width: 22px;
  height: 2px;
  background: var(--color-foreground);
  transition: transform var(--duration) var(--ease), opacity var(--duration) var(--ease);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding-block: var(--space-24) var(--space-16);
  border-bottom: var(--border-w) solid var(--color-border);
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
}

.hero-text {
  flex: 1;
  min-width: 0;
  max-width: 34rem;
}

.hero h1 {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  margin-bottom: var(--space-4);
}

.hero-photo-frame {
  position: relative;
  flex-shrink: 0;
  width: min(340px, 40%);
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--color-primary);
  background: var(--color-background-alt);
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.hero-divider {
  display: block;
  width: 56px;
  height: 3px;
  background: var(--color-primary);
  margin-block: var(--space-3);
}

.hero-sub {
  font-size: clamp(1.25rem, 2.4vw, 1.625rem);
  font-weight: 400;
  font-style: italic;
  color: var(--color-muted-foreground);
}

.hero-tagline {
  font-size: 1.125rem;
  color: var(--color-muted-foreground);
  max-width: 38rem;
  margin-bottom: var(--space-8);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  padding-block: var(--space-24);
}

.section-muted {
  background: var(--color-background-alt);
  border-top: var(--border-w) solid var(--color-border);
  border-bottom: var(--border-w) solid var(--color-border);
}

.section h2:not(.stub-heading) {
  font-size: clamp(1.875rem, 3.5vw, 2.5rem);
  margin-bottom: var(--space-12);
}

/* Stub / placeholder pages */

.stub-heading {
  font-size: clamp(1.875rem, 3.5vw, 2.5rem);
  margin-bottom: var(--space-4);
}

.stub-note {
  color: var(--color-muted-foreground);
  max-width: 42rem;
}

/* Course page top section — text column + placeholder photo column */

.course-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  margin-bottom: calc(var(--space-16) + var(--space-4)); /* 80px */
}

.course-hero-text {
  flex: 1;
  min-width: 0;
}

.course-hero-desc {
  color: var(--color-muted-foreground);
  max-width: 42rem;
  margin-bottom: var(--space-4);
}

.course-hero-photo {
  flex-shrink: 0;
  width: min(420px, 100%);
  aspect-ratio: 3 / 2;
  object-fit: contain;
  border-radius: var(--radius);
  border: var(--border-w) solid var(--color-border);
  background: var(--color-background-alt);
}

/* Capstone alternating image + text rows — image is first in the markup for
   every row; the --image-right modifier reverses it on desktop, and the
   mobile override below always stacks the image above the text. */

.capstone-row {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  margin-bottom: var(--space-16);
}

.capstone-row--image-right {
  flex-direction: row-reverse;
}

.capstone-row-text {
  flex: 1;
  min-width: 0;
}

.capstone-row-text p {
  color: var(--color-muted-foreground);
}

.capstone-row-photo {
  flex-shrink: 0;
  width: min(360px, 40%);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: var(--border-w) solid var(--color-border);
  background: var(--color-background-alt);
}

/* For images whose aspect ratio doesn't match the square frame — shows the
   full image centered instead of cropping it off-center. */
.capstone-row-photo--contain {
  object-fit: contain;
}

/* Program Mission / Goals */

.program-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.program-card {
  position: relative;
  background: var(--color-card);
  color: var(--color-card-foreground);
  border: var(--border-w) solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-8);
}

.program-card-index {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary-hover);
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
}

.program-card h3 {
  font-size: 1.375rem;
  margin-bottom: var(--space-3);
}

.program-card p {
  color: var(--color-muted-foreground);
}

/* About intro */

.about-intro {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  margin-bottom: var(--space-12);
  flex-wrap: wrap;
}

.about-photo {
  flex-shrink: 0;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--color-card);
  box-shadow: 0 0 0 1px var(--color-border);
}

.about-photo-initials {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 600;
}

.about-copy { flex: 1; min-width: 16rem; }

.about-copy h2 { margin-bottom: var(--space-3); }

.about-blurb {
  color: var(--color-muted-foreground);
  max-width: 42rem;
  margin-bottom: 0;
}

/* About Me (personal) */

.about-me-text {
  color: var(--color-muted-foreground);
  max-width: 42rem;
  margin-bottom: var(--space-12);
}

.about-me-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.about-me-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--color-primary);
  background: var(--color-primary-tint);
}

.about-me-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-me-photo-badge {
  position: absolute;
  right: var(--space-2);
  bottom: var(--space-2);
  padding: 0.25rem var(--space-2);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-card);
  color: var(--color-muted-foreground);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Shared hover-grow effect for framed photos (hero + About Me gallery) — the
   whole frame scales up on hover, calibrated to grow the hero frame's 340px
   resting width by ~20px per side (340 -> 380); reused as-is for the About
   Me photos so all framed photos on the page grow with the same feel. */
.hero-photo-frame,
.about-me-photo {
  transform: scale(1);
  transform-origin: center;
  transition: transform calc(var(--duration) * 1.5) var(--ease);
}

.hero-photo-frame:hover,
.about-me-photo:hover {
  transform: scale(calc(380 / 340));
}

@media (prefers-reduced-motion: reduce) {
  .hero-photo-frame,
  .about-me-photo {
    transition: none;
  }

  .hero-photo-frame:hover,
  .about-me-photo:hover {
    transform: scale(1);
  }
}

/* ==========================================================================
   Accordion — Skills Spotlight
   ========================================================================== */

.accordion {
  border-top: var(--border-w) solid var(--color-border);
}

.accordion-item {
  border-bottom: var(--border-w) solid var(--color-border);
}

.accordion-heading { margin: 0; }

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-block: var(--space-6);
  text-align: left;
  min-height: 44px;
}

.accordion-number {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-primary-hover);
  font-size: 0.9375rem;
  flex-shrink: 0;
  width: 1.75rem;
}

.accordion-title {
  flex: 1;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-foreground);
}

.accordion-icon {
  flex-shrink: 0;
  color: var(--color-primary);
  transition: transform var(--duration) var(--ease);
}

.accordion-trigger[aria-expanded="true"] .accordion-icon {
  transform: rotate(180deg);
}

.accordion-trigger:hover .accordion-title {
  color: var(--color-primary);
}

.accordion-panel {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows var(--duration) var(--ease);
}

.accordion-panel[hidden] {
  display: grid;
  grid-template-rows: 0fr;
}

/* Keep [hidden] panels in normal flow so the row-collapse transition can run;
   overriding the browser's default `display:none` for [hidden] is required
   for the CSS grid collapse technique to animate instead of snapping shut. */

.accordion-panel-inner {
  overflow: hidden;
  min-height: 0;
}

.accordion-panel-inner p {
  padding-bottom: var(--space-6);
  padding-right: var(--space-8);
  max-width: 46rem;
  color: var(--color-muted-foreground);
}

/* ==========================================================================
   Work Items — course/artifact blocks (e.g. courses-communicating-science.html)
   Reusable layout: title, optional media (photo or audio), then a row of
   labeled subsections (Task / middle / Takeaway).
   ========================================================================== */

.work-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  margin-top: var(--space-12);
}

.work-item {
  background: var(--color-card);
  color: var(--color-card-foreground);
  border: var(--border-w) solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-8);
}

.work-item-title {
  font-size: 1.5rem;
  margin-bottom: var(--space-6);
}

.work-item-photo {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: var(--border-w) solid var(--color-border);
  background: var(--color-background-alt);
  margin-bottom: var(--space-8);
}

/* Two photos shown together — same size, centered as a pair, evenly
   spaced; wraps to a centered vertical stack on narrow screens. */
.work-item-photo-pair {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-12);
  margin-bottom: var(--space-8);
}

.work-item-photo-pair .work-item-photo {
  width: auto;
  flex: 1 1 260px;
  max-width: 320px;
  margin-bottom: 0;
}

.work-item-audio {
  margin-bottom: var(--space-8);
}

.work-item-audio audio {
  width: 100%;
  max-width: 480px;
}

.work-item-audio-caption {
  margin-top: var(--space-2);
  color: var(--color-muted-foreground);
  font-size: 0.875rem;
  font-style: italic;
}

.work-item-sections {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.work-item-section p {
  color: var(--color-muted-foreground);
}

/* Inline PDF viewer — relies on the browser's built-in PDF renderer inside
   the iframe for scroll/zoom, with a download link as a fallback for
   mobile browsers that don't render embedded PDFs. */
.pdf-embed {
  margin-top: var(--space-8);
}

.pdf-embed-frame {
  display: block;
  width: 100%;
  height: 700px;
  max-width: 100%;
  border: var(--border-w) solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-card);
}

.pdf-embed-link {
  display: inline-flex;
  align-items: center;
  margin-top: var(--space-4);
  font-weight: 700;
}

/* ==========================================================================
   Utility
   ========================================================================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Self-Reflection Carousel — swipeable, one card visible at a time
   (e.g. courses-communicating-science.html). Slides are toggled with the
   `hidden` attribute, same convention as the accordion panels; dots use
   aria-expanded/aria-controls to match the accordion trigger pattern.
   ========================================================================== */

.self-reflection {
  margin-top: var(--space-16);
}

.self-reflection h2 {
  margin-bottom: var(--space-4);
}

.self-reflection .stub-note {
  margin-bottom: var(--space-8);
}

.carousel-slide {
  background: var(--color-card);
  color: var(--color-card-foreground);
  border: var(--border-w) solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-8);
}

.carousel-slide-title {
  font-size: 1.375rem;
  color: var(--color-primary);
}

.carousel-slide p {
  color: var(--color-muted-foreground);
  margin-bottom: 0;
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  margin-top: var(--space-6);
}

.carousel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: var(--border-w) solid var(--color-border);
  background: var(--color-card);
  color: var(--color-foreground);
  transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease), border-color var(--duration) var(--ease);
}

.carousel-btn:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-on-primary);
}

.carousel-dots {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  padding: 0;
  background: var(--color-border);
  transition: background-color var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.carousel-dot:hover {
  background: var(--color-primary-hover);
}

.carousel-dot[aria-expanded="true"] {
  background: var(--color-primary);
  transform: scale(1.3);
}

/* Slide-deck carousel — same carousel component reused with an image per
   slide (e.g. courses-interdisciplinary-skills.html PowerPoint artifacts). */
.carousel-slide img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--color-background-alt);
}

.work-item-sections--two {
  grid-template-columns: repeat(2, 1fr);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  padding-block: var(--space-8);
  border-top: var(--border-w) solid var(--color-border);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.site-footer p {
  color: var(--color-muted-foreground);
  font-size: 0.875rem;
  margin: 0;
}

.footer-inner nav ul {
  display: flex;
  gap: var(--space-6);
}

.footer-inner nav a {
  color: var(--color-muted-foreground);
  font-size: 0.875rem;
  text-decoration: none;
}

.footer-inner nav a:hover {
  color: var(--color-primary);
}

/* ==========================================================================
   RESPONSIVE: MOBILE (<=767px)
   ⚠ NAV BREAKPOINT — .primary-nav / .nav-list / .nav-item / .nav-link /
   .nav-dropdown / .nav-toggle below are what collapse the nav into the
   hamburger menu. This is the ONLY place that happens — the desktop default
   (>=768px) is the unguarded base rules in the "Header / Nav" section above.
   A theme/color-only change has no reason to touch anything in this media
   query; if a change you're making needs to, flag it before proceeding.
   ========================================================================== */

@media (max-width: 767px) {
  .wrap { padding-inline: var(--space-4); }

  .primary-nav {
    display: grid;
    grid-template-rows: 0fr;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-background);
    border-bottom: var(--border-w) solid var(--color-border);
    transition: grid-template-rows var(--duration) var(--ease);
  }

  .primary-nav.is-open {
    grid-template-rows: 1fr;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-2) var(--space-4) var(--space-4);
    overflow: hidden;
    min-height: 0;
  }

  .nav-item { width: 100%; }

  .nav-link {
    display: flex;
    width: 100%;
    justify-content: space-between;
    padding: var(--space-3) 0;
  }

  .nav-dropdown {
    position: static;
    z-index: auto;
    margin-top: 0;
    min-width: 0;
    padding: 0 0 var(--space-2) var(--space-4);
    background: transparent;
    border: none;
    box-shadow: none;
  }

  /* Panel is laid out inline in the accordion here — no gap to bridge. */
  .nav-dropdown::before {
    display: none;
  }

  .nav-dropdown a {
    padding: var(--space-3) var(--space-3);
  }

  .nav-toggle { display: flex; }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .hero { padding-block: var(--space-16) var(--space-12); }

  .section { padding-block: var(--space-16); }

  .program-grid {
    grid-template-columns: 1fr;
  }

  .about-me-gallery {
    grid-template-columns: 1fr;
  }

  .about-intro {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-8);
  }

  .hero-text {
    max-width: 100%;
  }

  .hero-photo-frame {
    width: 100%;
    max-width: 320px;
  }

  .work-item {
    padding: var(--space-6);
  }

  .course-hero {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-8);
  }

  .course-hero-photo {
    width: 100%;
    height: auto;
  }

  .capstone-row {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-6);
  }

  .capstone-row-photo {
    width: 100%;
  }

  .work-item-sections {
    grid-template-columns: 1fr;
  }

  .work-item-photo-pair {
    flex-direction: column;
    align-items: center;
  }

  .work-item-photo-pair .work-item-photo {
    width: 100%;
    max-width: 320px;
  }

  .carousel-slide {
    padding: var(--space-6);
  }

  .pdf-embed-frame {
    height: 420px;
  }
}

/* ==========================================================================
   RESPONSIVE: TABLET (768px–1023px)
   Spacing-only — no nav logic here. Nav is already in its desktop/expanded
   state at this width (breakpoint is 768px, see "Header / Nav" above).
   ========================================================================== */

@media (min-width: 768px) and (max-width: 1023px) {
  .section { padding-block: var(--space-16); }
}
