/* Design tokens live in design-system/tokens.css, linked before this
   file in index.html and resume.html. This file consumes them only —
   see design-system/DESIGN-SYSTEM.md for the full reference. */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Every h1 on the site (hero heading, case-study modal title) gets a
   drop shadow — set here rather than per-selector so it stays in sync
   automatically if more h1s are added later. */
h1 {
  text-shadow: var(--shadow-h1);
}

body {
  margin: 0;
  min-width: 375px; /* floor of the mobile-portrait bucket — narrower viewports scroll horizontally rather than squish the layout */
  background: var(--color-bg-canvas);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

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

/* Editorial face for display/heading-lg/heading-sm/body-lg/body roles.
   Everything else (nav, buttons, tags, mono labels, form fields) stays
   on --font-sans / --font-mono — see design-system/tokens.css. */
.hero h1,
.section-head h2,
.contact-copy h2,
.case-body h3,
.timeline-content h3,
.hero p,
.case-detail .lede,
.section-head p,
.case-body p,
.timeline-content p,
.contact-copy p,
.case-section p,
.case-section li {
  font-family: var(--font-editorial);
}

.wrap {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Nav ---------- */
/* position: fixed (not sticky) so opening the portrait drawer — which
   grows .nav's own height to stay one shared blurred surface with the
   links — overlays on top of the page instead of pushing it down. Fixed
   elements never affect document flow, at any height. #nav-spacer
   (a plain block right after </nav>, height set by script.js) reserves
   the equivalent space so page content still starts in the right place
   underneath the closed header. */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--color-nav-scrim);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border-subtle);
}

.nav-spacer {
  height: 68px; /* fallback until script.js measures the real value */
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
}

.brand-mark {
  display: block;
  height: 32px;
  width: auto;
}

.brand-mark path {
  fill: #fff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* No-op at desktop/landscape — the links render as if this wrapper
   weren't there. Only the portrait drawer (below) turns it into a real
   flex column, since that's what the max-height open/close animation
   needs to clip against. */
.nav-links-inner {
  display: contents;
}

/* Hamburger toggle — hidden by default (landscape/desktop show the
   inline nav-links directly); shown only in the portrait media query
   below, where it controls the collapsed drawer. */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  cursor: pointer;
}

/* Hamburger ⇄ close morph — three bars that rotate/fade into an X via
   transform + opacity, rather than swapping between two separate icons.
   One rule set drives both directions, so opening and closing morph
   with identical timing. */
.nav-toggle-icon {
  position: relative;
  width: 18px;
  height: 14px;
  flex-shrink: 0;
}

.nav-toggle-icon .bar {
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform var(--duration-base) var(--ease-standard),
    opacity var(--duration-base) var(--ease-standard),
    top var(--duration-base) var(--ease-standard);
}

.nav-toggle-icon .bar:nth-child(1) { top: 0; }
.nav-toggle-icon .bar:nth-child(2) { top: 6px; }
.nav-toggle-icon .bar:nth-child(3) { top: 12px; }

.nav-toggle.open .nav-toggle-icon .bar:nth-child(1) {
  top: 6px;
  transform: rotate(45deg);
}

.nav-toggle.open .nav-toggle-icon .bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open .nav-toggle-icon .bar:nth-child(3) {
  top: 6px;
  transform: rotate(-45deg);
}

.nav-links a {
  padding: 8px 14px;
  font-size: 14px;
  color: var(--color-text-secondary);
  transition: color 0.15s ease;
}

/* Underline lives on the label span, not the padded link box, so it
   hugs the word width instead of the full clickable hit area. */
.nav-links a .nav-label {
  display: inline-block;
  padding-bottom: 4px;
  box-shadow: inset 0 -2px 0 0 transparent;
  transition: box-shadow 0.15s ease;
}

/* Active state: current section — desaturated-yellow text, 2px white
   underline. This is what's always visible at rest; hover does not
   control it. Set on page load (Home) and kept in sync with scroll
   position / click by script.js. Resume never receives this class,
   since it isn't an in-page section. */
.nav-links a.active {
  color: var(--color-accent-tertiary);
}

.nav-links a.active .nav-label {
  box-shadow: inset 0 -2px 0 0 var(--color-text-primary);
}

/* Hover on a non-active link only — text-only, no fill/rounded-button
   treatment, no underline. Excludes .active so hovering the current
   section's link has no effect; it stays exactly as above. */
.nav-links a:hover:not(.active) {
  color: var(--color-text-primary);
}

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0;
  border-bottom: 1px solid var(--color-border-subtle);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -20% -10% 0 -10%;
  background:
    radial-gradient(circle at 15% 20%, rgba(110, 124, 246, 0.16), transparent 55%),
    radial-gradient(circle at 85% 10%, rgba(79, 209, 197, 0.12), transparent 50%);
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent-secondary);
  background: var(--color-accent-primary-tint);
  border: 1px solid rgba(110, 124, 246, 0.25);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 24px;
}

.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-circle);
  background: var(--color-accent-secondary);
}

.hero h1 {
  font-size: var(--text-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tighter);
  margin: 0 0 22px;
  max-width: 820px;
}

.hero h1 span {
  background: linear-gradient(90deg, var(--color-accent-primary), var(--color-accent-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  font-size: 18px;
  color: var(--color-text-secondary);
  max-width: 560px;
  margin: 0 0 36px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--color-border-default);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--color-text-primary);
  color: var(--color-bg-canvas);
  border-color: var(--color-text-primary);
}

.btn-primary:hover { background: var(--color-accent-secondary); border-color: var(--color-accent-secondary); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-primary);
}

.btn-ghost:hover { border-color: var(--color-text-secondary); }

.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 64px;
  flex-wrap: wrap;
}

.hero-stats div strong {
  display: block;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.hero-stats div span {
  font-size: 13px;
  color: var(--color-text-tertiary);
}

/* ---------- Section shell ---------- */
section { padding: 96px 0; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: var(--text-heading-lg);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 8px;
}

.section-head p {
  color: var(--color-text-secondary);
  margin: 0;
  max-width: 480px;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-tertiary);
}

/* ---------- Approach ---------- */
#approach {
  border-bottom: 1px solid var(--color-border-subtle);
}

#approach .section-head {
  margin-bottom: 0;
}

#selected-work .section-head,
#about .section-head {
  margin-bottom: 0;
}

.approach-lede {
  font-family: var(--font-editorial);
  font-size: var(--text-body-lg);
  color: var(--color-text-primary);
  max-width: 640px;
  margin: 0 0 16px;
}

.section-copy {
  font-family: var(--font-editorial);
  font-size: var(--text-body);
  color: var(--color-text-secondary);
  max-width: 1056px;
  margin: 0;
}

.section-copy + .section-copy {
  margin-top: 16px;
}

#selected-work .section-copy,
#about .section-copy {
  margin-bottom: 24px;
}

#about .btn {
  margin-bottom: 40px;
}

/* Reuses .case-grid for identical responsive column behavior (3-across
   down to tablet landscape, 1-across below that). Connected by a shared
   1px divider-colored border: the grid's own background shows through
   the 1px gap as the border between cells, and the grid's own border
   matches on the outer edge — so lines never double up where two cards
   meet. Compound selector (not just .module-grid) is needed to out-
   specificity the base .case-grid gap rule, which is declared later in
   this file. Height is intentionally not fixed — it hugs each card's
   content, so cards are only "square" incidentally at 3-up widths. */
.case-grid.module-grid {
  margin-top: 24px;
  gap: 1px;
  background: var(--color-border-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.module-card {
  background: var(--color-bg-canvas);
  padding: 24px;
}

/* Three progressively lighter surfaces — reuses the existing two-step
   raised/surface tokens, then derives a third step from --color-bg-surface
   via color-mix rather than hardcoding a new hex value. */
.module-card:nth-child(1) { background: var(--color-bg-raised); }
.module-card:nth-child(2) { background: var(--color-bg-surface); }
.module-card:nth-child(3) { background: color-mix(in srgb, var(--color-bg-surface) 100%, white 4%); }

.module-card p {
  font-family: var(--font-editorial);
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.module-card p + p {
  margin-top: 16px;
}

/* Label line matches .resume-skills-grid h4's treatment. */
.module-card p strong {
  display: block;
  font-family: var(--font-sans);
  color: var(--color-text-primary);
  font-weight: 400;
  font-size: 13px;
  margin-bottom: 8px;
}

/* ---------- Case study cards ---------- */
.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.case-card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  padding: 0;
  color: var(--color-text-primary);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.case-card:hover,
.case-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(110, 124, 246, 0.4);
  box-shadow: var(--shadow-card-hover);
  outline: none;
}

.case-card:focus-visible { outline: 2px solid var(--color-accent-primary); outline-offset: 2px; }

.case-thumb {
  aspect-ratio: 2 / 1;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 16px;
}

.case-thumb .grid-overlay {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  mix-blend-mode: overlay;
}

.case-thumb .index {
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  background: rgba(0,0,0,0.25);
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.case-body {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.case-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-accent-secondary);
}

.case-body h3 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.case-body p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
}

.case-tags span {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border-default);
  color: var(--color-text-tertiary);
}

.case-open {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-top: 6px;
}

.case-open svg { transition: transform 0.15s ease; }
.case-card:hover .case-open svg { transform: translateX(3px); }

/* ---------- Experience ---------- */
.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 28px;
  padding: 28px 0;
  border-top: 1px solid var(--color-border-subtle);
}

.timeline-item:last-child { border-bottom: 1px solid var(--color-border-subtle); }

.timeline-period {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text-tertiary);
  padding-top: 2px;
}

.timeline-content h3 {
  margin: 0 0 4px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.timeline-content .company {
  color: var(--color-accent-secondary);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 10px;
  display: block;
}

.timeline-content p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 14.5px;
  max-width: 640px;
}

.timeline-content ul {
  margin: 0;
  padding-left: 20px;
  color: var(--color-text-secondary);
  font-size: 14.5px;
  max-width: 640px;
}

.timeline-content ul li { margin-bottom: 4px; }
.timeline-content ul li:last-child { margin-bottom: 0; }

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.timeline-tags span {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border-default);
  color: var(--color-text-tertiary);
}

/* ---------- Contact ---------- */
.contact-panel {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  padding: 56px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  position: relative;
  overflow: hidden;
}

.contact-panel::before {
  content: '';
  position: absolute;
  right: -80px;
  top: -80px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(110,124,246,0.18), transparent 70%);
}

.contact-copy h2 { font-size: var(--text-heading-lg); margin: 0 0 12px; letter-spacing: var(--tracking-tight); }
.contact-copy p { color: var(--color-text-secondary); margin: 0 0 28px; max-width: 420px; }

.contact-methods { display: flex; flex-direction: column; gap: 14px; }

.contact-methods a {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--color-text-primary);
  padding: 10px 0;
}

.contact-methods a svg { color: var(--color-accent-secondary); flex-shrink: 0; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-bottom: 6px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field input,
.field textarea {
  width: 100%;
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-accent-primary);
}

.contact-form .btn { align-self: flex-start; margin-top: 4px; }

/* ---------- Footer ---------- */
footer {
  position: sticky;
  bottom: 0;
  z-index: 40;
  background: var(--color-nav-scrim);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--color-border-subtle);
  padding: 24px 0;
  /* So crossing the tablet/mobile breakpoint (padding drops to 12px 0)
     eases between the two values instead of snapping. Transitions still
     fire on media-query-driven changes as long as the element persists
     across the resize, which it does here. */
  transition: padding var(--duration-slow) var(--ease-emphasized);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--color-text-tertiary);
  /* gap is the one genuinely-interpolable property here, so it eases on
     its own. The actual row↔column repositioning (flex-direction,
     justify-content, text-align are all discrete — CSS can't tween
     them) is handled as a real slide by the FLIP animation in
     script.js, which measures each child's position immediately before
     and after the breakpoint flips and animates the difference via
     transform. Don't add flex-direction/justify-content/text-align to
     this transition list — a CSS "discrete" transition on those would
     flip layout mid-animation and fight the JS transform. */
  transition: gap var(--duration-slow) var(--ease-emphasized);
}

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

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay-scrim);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: stretch;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-standard);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-shell {
  position: fixed;
  inset: 0;
  background: var(--color-bg-canvas);
  display: flex;
  flex-direction: column;
  transform: translateY(16px);
  opacity: 0;
  transition: transform var(--duration-slow) var(--ease-emphasized), opacity var(--duration-slow) var(--ease-standard);
}

.modal-overlay.open .modal-shell {
  transform: translateY(0);
  opacity: 1;
}

.modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--color-border-subtle);
  flex-shrink: 0;
}

.modal-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
}

.modal-close {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-circle);
  border: 1px solid var(--color-border-default);
  background: var(--color-bg-raised);
  color: var(--color-text-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.modal-close:hover { background: var(--color-border-default); transform: rotate(90deg); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

.modal-nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: var(--radius-circle);
  border: 1px solid var(--color-border-default);
  background: rgba(19, 21, 25, 0.9);
  color: var(--color-text-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 101;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.modal-nav-btn:hover { background: var(--color-bg-raised); border-color: var(--color-accent-primary); }
.modal-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.modal-nav-btn.prev { left: 24px; }
.modal-nav-btn.next { right: 24px; }

.case-hero {
  height: 320px;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 40px;
}

.case-hero .grid-overlay {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  mix-blend-mode: overlay;
}

.case-hero-inner {
  position: relative;
  max-width: var(--content-max-width);
  margin: 0 auto;
  width: 100%;
}

.case-hero-inner .case-kicker { color: rgba(255,255,255,0.85); margin-bottom: 10px; }
.case-hero-inner h1 { font-size: 38px; margin: 0; color: #fff; letter-spacing: -0.02em; }

.case-detail {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 48px 32px;
}

.case-meta-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.case-meta-row div span {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-tertiary);
  margin-bottom: 6px;
}

.case-meta-row div strong {
  font-size: 15px;
  font-weight: 500;
}

.case-detail .lede {
  font-size: 19px;
  color: var(--color-text-secondary);
  max-width: 720px;
  margin: 0 0 48px;
}

.case-section { margin-bottom: 44px; }
.case-section h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-family: var(--font-mono);
  color: var(--color-accent-secondary);
  margin: 0 0 16px;
}

.case-section p {
  color: var(--color-text-secondary);
  max-width: 760px;
  margin: 0 0 14px;
  font-size: 15.5px;
}

.case-section ul {
  margin: 0;
  padding-left: 20px;
  color: var(--color-text-secondary);
  font-size: 15.5px;
}

.case-section li { margin-bottom: 8px; }

/* ---------- Resume modal ---------- */
.resume-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.resume-header h1 {
  margin: 0 0 6px;
  font-family: var(--font-editorial);
  font-size: var(--text-heading-lg);
  letter-spacing: var(--tracking-tight);
}

.resume-role {
  color: var(--color-accent-secondary);
  font-weight: 600;
  font-size: 15px;
}

.resume-contact {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text-tertiary);
  line-height: 1.8;
}

/* Same connected-boxes treatment as .module-grid / .module-card in the
   Approach section: 1px divider-colored border shared via the grid's own
   background, rounded outer corners only (overflow: hidden clips the
   individual cells), three progressively lighter surfaces per cell. */
.resume-skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--color-border-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.resume-skills-grid > div {
  padding: 24px;
  background: var(--color-bg-canvas);
}

.resume-skills-grid > div:nth-child(1) { background: var(--color-bg-raised); }
.resume-skills-grid > div:nth-child(2) { background: var(--color-bg-surface); }
.resume-skills-grid > div:nth-child(3) { background: color-mix(in srgb, var(--color-bg-surface) 100%, white 4%); }

.resume-skills-grid h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--color-text-primary);
  font-weight: 400;
}

.resume-skills-grid p {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.resume-edu-row {
  font-size: 15px;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
}

.resume-edu-row:last-child { margin-bottom: 0; }

.case-swatches {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-top: 20px;
  max-width: 640px;
}

.swatch {
  height: 64px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-default);
}

.case-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.case-gallery .plate {
  height: 200px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-default);
}

/* ---------- Responsive ----------
   Four device/orientation buckets, mutually exclusive by width so
   exactly one applies at a time (widest → narrowest below). Desktop
   (>1366px, or any width above the tablet-landscape ceiling) gets no
   override and uses the base styles above as-is.
     Mobile portrait   : <=767px  & orientation: portrait
     Tablet portrait    : 768–1024px & orientation: portrait
     Mobile landscape   : <=1024px & orientation: landscape
     Tablet landscape    : 1025–1366px & orientation: landscape
   See design-system/DESIGN-SYSTEM.md, "Breakpoints". */

/* ----- Tablet landscape: 1025–1366px, landscape (e.g. iPad landscape) -----
   Case grid stays 3-across here, same as desktop — there's enough width
   for it, and only the other three (narrower) buckets drop to 1 card
   per row. */
@media (min-width: 1025px) and (max-width: 1366px) and (orientation: landscape) {
  .wrap, .nav-inner { padding-left: 28px; padding-right: 28px; }
}

/* ----- Tablet portrait: 768–1024px, portrait (e.g. iPad portrait) ----- */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .wrap, .nav-inner { padding-left: 24px; padding-right: 24px; }
  .case-grid { grid-template-columns: 1fr; }
  .case-meta-row { grid-template-columns: repeat(2, 1fr); }
  .case-gallery { grid-template-columns: 1fr; }
  .contact-panel { grid-template-columns: 1fr; padding: 40px; }
  .resume-skills-grid { grid-template-columns: 1fr; }
}

/* ----- Mobile landscape: <=1024px, landscape (phones on their side) -----
   Width can be generous but height is tight, so this trims vertical
   rhythm (hero padding, section padding, nav height) rather than
   collapsing columns as aggressively as portrait mobile. */
@media (max-width: 1024px) and (orientation: landscape) {
  .wrap, .nav-inner { padding-left: 20px; padding-right: 20px; }
  .nav-inner { padding-top: 12px; padding-bottom: 12px; }
  .hero { padding: 48px 0 32px; }
  .hero-stats { margin-top: 28px; gap: 28px; }
  section { padding: 48px 0; }
  .case-grid { grid-template-columns: 1fr; }
  .contact-panel { grid-template-columns: 1fr; padding: 32px; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
  .case-meta-row { grid-template-columns: repeat(2, 1fr); }
  .case-gallery { grid-template-columns: 1fr; }
  .modal-nav-btn { width: 42px; height: 42px; }
  .modal-nav-btn.prev { left: 10px; }
  .modal-nav-btn.next { right: 10px; }
  .case-swatches { grid-template-columns: repeat(3, 1fr); }
  .resume-skills-grid { grid-template-columns: 1fr; }
}

/* ----- Mobile portrait: <=767px, portrait (phones upright) -----
   Narrowest bucket: everything collapses to one column. Nav is handled
   by the shared hamburger block below, alongside tablet portrait. */
@media (max-width: 767px) and (orientation: portrait) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .nav-inner { padding: 12px 20px; }
  .hero { padding: 48px 0 32px; }
  .hero-stats { margin-top: 32px; gap: 24px; }
  section { padding: 56px 0; }
  .case-grid { grid-template-columns: 1fr; }
  .contact-panel { grid-template-columns: 1fr; padding: 28px; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
  .case-meta-row { grid-template-columns: repeat(2, 1fr); }
  .case-gallery { grid-template-columns: 1fr; }
  .modal-nav-btn { width: 42px; height: 42px; }
  .modal-nav-btn.prev { left: 10px; }
  .modal-nav-btn.next { right: 10px; }
  .case-swatches { grid-template-columns: repeat(3, 1fr); }
  .resume-skills-grid { grid-template-columns: 1fr; }
}

/* ----- Hamburger nav: shared by both portrait buckets -----
   Mobile portrait and tablet portrait both collapse .nav-links into a
   toggled drawer instead of shrinking link text to fit — landscape
   buckets (mobile or tablet) never see this; they keep the full inline
   nav since width isn't the constraint there.

   The drawer is NOT a separately-blurred overlay panel — backdrop-filter
   on a floating absolutely-positioned layer was unreliable in practice
   (WebKit in particular). Instead .nav-links wraps onto its own full-width
   row inside .nav-inner via flex-wrap, so it's painted as part of the
   same .nav box that already has a working background + blur. Opening
   the drawer genuinely grows the (sticky) header rather than overlaying
   a separate surface on top of it.

   Height animation uses max-height, not grid-template-rows fr-unit
   interpolation — the fr trick has inconsistent real-browser support for
   this exact "flex item that's also a grid container" combination, which
   was the root cause of the drawer misbehaving in Chrome/Firefox/Safari.
   max-height is the boring, universally-supported option. */
@media (max-width: 1024px) and (orientation: portrait) {
  .nav-toggle { display: inline-flex; }

  .nav-inner { flex-wrap: wrap; }

  .nav-links {
    order: 3;
    flex-basis: 100%;
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--duration-slow) var(--ease-emphasized);
  }

  .nav-links.open { max-height: 320px; }

  .nav-links-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 0 4px;
  }

  .nav-links a { padding: 4px 4px; }
  .nav-links a .nav-label { display: inline-block; }
}

/* ----- Footer: reduced vertical padding across every tablet/mobile
   bucket (both orientations) — anything at or below the tablet-landscape
   ceiling, so desktop is the only size that keeps the roomier default. ----- */
@media (max-width: 1366px) {
  footer { padding: 12px 0; }
}

/* ----- Footer: mobile only (not tablet) — copyright and "Back to top"
   no longer fit on one line at these widths, so stack and center them
   instead of the space-between left/right split. "Back to top" leads
   (order swapped from source order), with a tighter 8px gap than the
   12px used everywhere else. */
@media (max-width: 1024px) and (orientation: landscape), (max-width: 767px) and (orientation: portrait) {
  .footer-inner {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 8px;
  }

  .footer-inner span:first-child { order: 2; }
  .footer-inner span:last-child { order: 1; }
}
