/* ==========================================================================
   SECTIONS — HERO, ABOUT, CASE STUDIES, CONTACT, FOOTER, & SHELL VIEWS
   ========================================================================== */

/* ==========================================================================
   1. HERO SECTION & TECH TICKER
   ========================================================================== */
.hero {
  position: relative;
  min-height: 92vh;
  min-height: 92dvh;
  display: flex;
  align-items: center;
  padding: 7.5rem 1.5rem 4.5rem;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero-container {
  position: relative;
  z-index: 1;
  max-width: var(--container-max);
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 2rem;
  align-items: center;
}

.hero-copy {
  grid-column: 1 / -1;
  max-width: 960px;
}

.hero-container:has(.hero-photo-slot:not([hidden])) .hero-copy {
  grid-column: 1 / span 8;
}

.hero-photo-slot {
  grid-column: 9 / -1;
  display: flex;
  justify-content: flex-end;
}

.hero-photo-frame {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-strong);
  background-color: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.hero-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Status Chip with Pulsing Dot */
.hero-top-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.5rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--fg);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
}

.status-pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10B981;
  flex-shrink: 0;
}

.status-pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #10B981;
  opacity: 0.6;
  animation: statusPulse 2.2s infinite ease-out;
}

@keyframes statusPulse {
  0% {
    transform: scale(0.75);
    opacity: 0.75;
  }
  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* Huge Hero H1 + Rotating Role Line */
.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(3.25rem, 10vw, 8.5rem);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.035em;
  color: var(--fg);
  margin-bottom: 1rem;
  outline: none;
}

.hero-role {
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 3.2vw, 2.25rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--fg-muted);
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}

.hero-role-prefix {
  font-family: var(--font-mono);
  font-size: 0.95em;
  color: var(--red);
  font-weight: 700;
}

.hero-role-rotator {
  display: inline-block;
  background: linear-gradient(90deg, var(--red) 0%, #FB7185 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.hero-role-rotator.is-switching {
  opacity: 0;
  transform: translateY(6px);
}

.hero-description {
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.65;
  color: var(--fg-muted);
  max-width: 680px;
  margin-bottom: 2.25rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.hero-cv-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 0.65rem 0.85rem;
  min-height: 44px;
  border-radius: var(--radius-sm);
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.hero-cv-link:hover {
  color: var(--red);
  transform: translateX(2px);
}

/* Proof Strip */
.proof-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  list-style: none;
}

.proof-item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-muted);
}

.proof-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--red);
  flex-shrink: 0;
}

.proof-item strong {
  color: var(--fg);
  font-weight: 600;
}

/* Tech Ticker Strip (CSS Marquee under Hero) */
.tech-ticker {
  position: relative;
  width: 100%;
  background-color: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 0;
  overflow: hidden;
  display: flex;
  user-select: none;
}

.tech-ticker::before,
.tech-ticker::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 64px;
  z-index: 2;
  pointer-events: none;
}

.tech-ticker::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-elev), transparent);
}

.tech-ticker::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-elev), transparent);
}

.ticker-track {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  padding-right: 2.25rem;
  flex-shrink: 0;
  min-width: 100%;
  animation: tickerMarquee 32s linear infinite;
}

.tech-ticker:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-muted);
  white-space: nowrap;
}

.ticker-item::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--red);
  opacity: 0.75;
}

@keyframes tickerMarquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-pulse::after {
    animation: none;
    display: none;
  }

  .ticker-track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 1.75rem;
    padding-inline: 1.5rem;
  }

  .ticker-track[aria-hidden="true"] {
    display: none;
  }
}

/* ==========================================================================
   2. ABOUT SECTION (TWO COLUMNS: BIO + TIMELINE LEFT, FACTS + SKILLS RIGHT)
   ========================================================================== */
.about {
  padding: var(--section-pad-y) var(--section-pad-x);
  background-color: var(--bg);
  scroll-margin-top: 5.5rem;
  border-bottom: 1px solid var(--border);
}

.about-container {
  max-width: var(--container-max);
  margin: 0 auto;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 2rem;
  align-items: start;
}

.about-left {
  grid-column: span 7;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.about-right {
  grid-column: span 5;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.about-card,
.facts-card,
.skills-card,
.timeline-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.panel-heading {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--border);
  margin-left: 0.85rem;
}

.about-text {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--fg);
  margin-bottom: 1.25rem;
}

.about-text:last-of-type {
  margin-bottom: 0;
}

.about-text strong {
  color: var(--fg);
  font-weight: 600;
}

.about-actions {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Facts Panel (Monospace Rows) */
.facts-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.fact-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.825rem;
  line-height: 1.5;
}

.fact-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.fact-label {
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
  padding-top: 0.1rem;
}

.fact-value {
  color: var(--fg);
  font-weight: 500;
}

/* Grouped Skill Tag Clusters */
.skill-clusters {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.skill-group-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--red);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

/* Compact Timeline (4 items) */
.timeline-list {
  list-style: none;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  padding-left: 1.25rem;
  border-left: 1px solid var(--border-strong);
}

.timeline-item {
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(-1.25rem - 4.5px);
  top: 0.35rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--red);
  box-shadow: 0 0 0 3px var(--surface);
}

.timeline-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.timeline-role {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.timeline-org {
  font-size: 0.925rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

@media (max-width: 960px) {
  .hero-container:has(.hero-photo-slot:not([hidden])) .hero-copy,
  .hero-photo-slot,
  .about-left,
  .about-right {
    grid-column: 1 / -1;
  }

  .hero-photo-slot {
    justify-content: flex-start;
  }
}

/* ==========================================================================
   3. CASE STUDIES (WORK) SECTION
   ========================================================================== */
.cases {
  padding: var(--section-pad-y) var(--section-pad-x);
  background-color: var(--bg);
  scroll-margin-top: 5.5rem;
  border-bottom: 1px solid var(--border);
}

.cases-container {
  max-width: var(--container-max);
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 2.5rem;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  background-color: var(--red);
  margin-top: 0.5rem;
  border-radius: 2px;
  transition: background-color 0.3s ease;
}

.cases .section-title::after {
  background-color: var(--track-accent);
}

.cases .eyebrow {
  color: var(--track-accent);
  transition: color 0.3s ease;
}

/* Header Row: Title Left, Segmented Control Right */
.cases-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.75rem;
}

.cases-header .section-title {
  margin-bottom: 0;
}

/* Segmented Control (Software | Data and Automation) with Sliding Thumb */
.track-segmented {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 0.3rem;
  background-color: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
  user-select: none;
}

.track-thumb {
  position: absolute;
  top: 0.3rem;
  bottom: 0.3rem;
  left: 0.3rem;
  width: calc(50% - 0.3rem);
  border-radius: var(--radius-pill);
  background-color: var(--surface);
  border: 1px solid var(--track-accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
  transform: translateX(100%);
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.3s ease,
    background-color 0.3s ease;
  pointer-events: none;
  z-index: 0;
}

.cases[data-track="software"] .track-thumb {
  transform: translateX(0%);
}

.cases[data-track="data"] .track-thumb {
  transform: translateX(100%);
}

.track-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.6rem 1.25rem;
  min-height: 42px;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.25s ease;
}

.track-tab:hover {
  color: var(--fg);
}

.track-tab.is-active {
  color: var(--fg);
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 0.4rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  background-color: var(--bg);
  color: var(--fg-muted);
  border: 1px solid var(--border);
  transition:
    color 0.3s ease,
    border-color 0.3s ease,
    background-color 0.3s ease;
}

.track-tab.is-active .tab-count {
  color: var(--track-accent);
  border-color: var(--track-accent);
}

/* Case Studies Grid: 3 cols desktop, 2 tablet, 1 mobile; featured spans 2 cols */
.cases-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem;
}

.card {
  position: relative;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.3s ease,
    background-color 0.25s ease;
}

/* Pointer-Tracking Radial Spotlight Effect (Phase 5) */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 50%),
    var(--cyan-subtle),
    transparent 65%
  );
}

.card[data-track="software"]::before {
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 50%),
    var(--red-subtle),
    transparent 65%
  );
}

.card:hover::before {
  opacity: 1;
}

.card > * {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .card::before {
    display: none;
  }
}

.card.featured {
  grid-column: span 2;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--track-accent);
}

/* Staggered Entrance Animation on Tab Switch */
@keyframes cardFadeRise {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.card.is-entering {
  animation: cardFadeRise 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--stagger-index, 0) * 65ms);
}

/* 1. Card Visual Header (Decorative SVG & CSS Pattern per Track) */
.card-visual {
  position: relative;
  height: 92px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  background-color: var(--bg-elev);
}

.card[data-track="data"] .card-visual {
  background-image:
    radial-gradient(circle at 85% 25%, var(--cyan-subtle), transparent 60%),
    radial-gradient(rgba(34, 211, 238, 0.16) 1px, transparent 1px);
  background-size: 100% 100%, 16px 16px;
}

.card[data-track="software"] .card-visual {
  background-image:
    radial-gradient(circle at 85% 25%, var(--red-subtle), transparent 60%),
    linear-gradient(to right, rgba(239, 68, 68, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(239, 68, 68, 0.07) 1px, transparent 1px);
  background-size: 100% 100%, 20px 20px, 20px 20px;
}

.card-badges {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.track-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-pill);
  background-color: var(--surface);
  color: var(--track-accent);
  border: 1px solid var(--border-strong);
  transition: color 0.3s ease;
}

.track-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--track-accent);
  transition: background-color 0.3s ease;
}

.featured-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-pill);
  background-color: var(--track-accent);
  color: #0A0E17;
  transition: background-color 0.3s ease;
}

:root[data-theme="light"] .cases[data-track="software"] .featured-badge,
:root[data-theme="light"] .cases[data-track="data"] .featured-badge {
  color: #FFFFFF;
}

.card-pattern-svg {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 44px;
  color: var(--track-accent);
  opacity: 0.75;
  flex-shrink: 0;
  transition:
    color 0.3s ease,
    transform 0.3s ease;
}

.card:hover .card-pattern-svg {
  transform: scale(1.06);
  opacity: 0.95;
}

/* 2. Card Body: Title, Summary, Metric Chips, Tech Tags */
.card-body {
  padding: 1.6rem 1.6rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-period {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-bottom: 0.45rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.28;
  color: var(--fg);
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-summary {
  font-size: 0.975rem;
  color: var(--fg-muted);
  line-height: 1.62;
  margin-bottom: 1.25rem;
}

/* 3. Metric Chips (Monospace, real numbers only) */
.card-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.15rem;
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--track-accent);
  background-color: var(--bg-elev);
  border: 1px solid var(--track-accent);
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  transition:
    color 0.3s ease,
    border-color 0.3s ease;
}

/* 4. Tech Tags */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: auto;
}

/* 5. Card Footer: Links + Details Button */
.card-footer {
  padding: 1rem 1.6rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  background-color: rgba(255, 255, 255, 0.01);
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.case-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--track-accent);
  text-decoration: none;
  min-height: 38px;
  padding: 0.25rem 0;
  transition:
    color 0.25s ease,
    transform 0.2s ease;
}

.case-link:hover {
  transform: translateX(3px);
}

.card-details-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg);
  background-color: var(--bg-elev);
  border: 1px solid var(--border-strong);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 36px;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease;
}

.card-details-btn:hover {
  border-color: var(--track-accent);
  color: var(--track-accent);
}

/* Empty State */
.cases-empty {
  background-color: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-card);
  padding: 3rem 2rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--fg-muted);
}

/* Native <dialog> for Case Study Details (Phase 5) */
.case-dialog {
  margin: auto;
  padding: 0;
  width: min(680px, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  max-height: calc(100dvh - 3rem);
  background-color: var(--surface);
  color: var(--fg);
  border: 1px solid var(--track-accent);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card-hover);
  overflow-y: auto;
}

.case-dialog::backdrop {
  background-color: var(--backdrop-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.case-dialog-inner {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.case-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.case-dialog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.case-dialog-meta .card-period {
  margin-bottom: 0;
}

.case-dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--bg-elev);
  color: var(--fg-muted);
  cursor: pointer;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.case-dialog-close:hover {
  color: var(--fg);
  border-color: var(--track-accent);
}

.case-dialog-title {
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--fg);
}

.case-dialog .card-metrics {
  margin-bottom: 0;
}

.case-dialog-body {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.25rem;
  background-color: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.detail-block h4 {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--track-accent);
  margin-bottom: 0.35rem;
}

.detail-block p {
  font-size: 0.975rem;
  line-height: 1.65;
  color: var(--fg);
}

.case-dialog-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 960px) {
  .cases-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card.featured {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .cases-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .track-segmented {
    width: 100%;
  }

  .track-tab {
    padding: 0.55rem 0.75rem;
    font-size: 0.825rem;
  }

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

  .card.featured {
    grid-column: span 1;
  }
}

/* ==========================================================================
   4. CONTACT SECTION ("LET'S WORK TOGETHER" + INLINE FORM + CALENDAR)
   ========================================================================== */
body.modal-open {
  overflow: hidden;
}

.contact {
  padding: var(--section-pad-y) var(--section-pad-x);
  background-color: var(--bg);
  scroll-margin-top: 5.5rem;
}

.contact-container {
  max-width: var(--container-max);
  margin: 0 auto;
}

.contact-intro {
  max-width: 720px;
  margin-bottom: 3rem;
}

.contact-description {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--fg-muted);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 2.25rem;
  align-items: start;
}

.contact-left {
  grid-column: span 5;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.contact-right {
  grid-column: span 7;
}

/* Three "How I can help" Cards */
.help-cards {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.help-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  box-shadow: var(--shadow-card);
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.help-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.help-card-title {
  font-family: var(--font-heading);
  font-size: 1.025rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.help-card-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--red);
  flex-shrink: 0;
}

.help-card-text {
  font-size: 0.925rem;
  color: var(--fg-muted);
  line-height: 1.55;
}

/* Direct Email + Buttons + Social Row */
.contact-direct {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-email-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.contact-email-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}

.contact-email-link {
  font-family: var(--font-mono);
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--red);
  text-decoration: none;
  word-break: break-all;
  transition: opacity 0.2s ease;
}

.contact-email-link:hover {
  opacity: 0.85;
  text-decoration: underline;
}

.contact-cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Inline Netlify Contact Form Card */
.contact-form-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 2.25rem;
  box-shadow: var(--shadow-card);
}

.contact-form-heading {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.35rem;
}

.contact-form-sub {
  font-size: 0.95rem;
  color: var(--fg-muted);
  margin-bottom: 1.5rem;
}

.contact-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
}

.form-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  min-height: 44px;
  color: var(--fg);
  background-color: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  outline: none;
  box-sizing: border-box;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.form-input::placeholder {
  color: var(--fg-muted);
  opacity: 0.7;
}

.form-input:hover {
  border-color: var(--fg-muted);
}

.form-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-subtle);
}

.form-textarea {
  resize: vertical;
  min-height: 135px;
  line-height: 1.6;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 0.25rem;
}

.form-submit-btn {
  border: none;
  cursor: pointer;
  min-height: 46px;
}

.form-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.form-status {
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.925rem;
  font-weight: 500;
  line-height: 1.5;
}

.form-status.status-success {
  background-color: var(--status-success-bg);
  color: var(--status-success-fg);
  border: 1px solid var(--status-success-border);
}

.form-status.status-error {
  background-color: var(--status-error-bg);
  color: var(--status-error-fg);
  border: 1px solid var(--status-error-border);
}

.form-status.status-error a {
  color: var(--red);
  font-weight: 600;
  text-decoration: underline;
}

/* Lazy Google Calendar Booking Accordion */
.calendar-embed-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 2.25rem;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.calendar-card-header {
  width: 100%;
  border: none;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  min-height: 54px;
  cursor: pointer;
  user-select: none;
  background-color: var(--surface);
  color: var(--fg);
  transition: background-color 0.2s ease;
}

.calendar-card-header:hover {
  background-color: var(--bg-elev);
}

.calendar-embed-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--fg);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.calendar-toggle-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fg);
  background-color: var(--red-subtle);
  border: 1px solid var(--border);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  min-height: 36px;
  transition: all 0.2s ease;
}

.calendar-card-header:hover .calendar-toggle-badge {
  background-color: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.chevron-icon {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.calendar-embed-card.open .chevron-icon {
  transform: rotate(180deg);
}

.calendar-embed-wrapper {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.35s ease,
    padding 0.3s ease;
  padding: 0 1.5rem;
}

.calendar-embed-card.open .calendar-embed-wrapper {
  max-height: 700px;
  opacity: 1;
  padding: 0 1.5rem 1.5rem 1.5rem;
}

.calendar-embed-wrapper iframe {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 600px;
  border: 0;
  display: block;
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  background-color: #ffffff;
}

@media (max-width: 960px) {
  .contact-left,
  .contact-right {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .contact-form-card {
    padding: 1.5rem;
  }

  .form-submit-btn {
    width: 100%;
  }

  .calendar-card-header {
    padding: 1rem 1.25rem;
  }

  .calendar-embed-card.open .calendar-embed-wrapper {
    padding: 0 0.75rem 1rem 0.75rem;
    max-height: 600px;
  }

  .calendar-embed-wrapper iframe {
    height: 500px;
  }
}

/* ==========================================================================
   6. SHELL ROUTE VIEWS (`/blog` STUB & 404 VIEW)
   ========================================================================== */
.route-view {
  min-height: calc(100vh - 180px);
  min-height: calc(100dvh - 180px);
  padding: 8.5rem 0 5rem;
  display: flex;
  align-items: center;
}

.shell-stub {
  max-width: 720px;
}

.stub-title {
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--fg);
  margin-bottom: 1rem;
  outline: none;
}

.stub-description {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--fg-muted);
  margin-bottom: 2rem;
}

.stub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==========================================================================
   7. SITE FOOTER
   ========================================================================== */
.site-footer {
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--border);
  background-color: var(--bg);
}

.footer-container {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.footer-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.footer-copy {
  color: var(--fg);
  font-weight: 500;
}

.footer-craft {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fg-muted);
  background-color: var(--surface);
  border: 1px solid var(--border);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  cursor: pointer;
  min-height: 38px;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.back-to-top:hover {
  color: var(--red);
  border-color: var(--red);
  transform: translateY(-2px);
}

/* ==========================================================================
   8. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 640px) {
  .hero {
    padding: 6.5rem 1.25rem 4rem;
  }

  .cases,
  .about,
  .contact {
    padding: 4.5rem 1.25rem;
  }

  .case-card,
  .about-card {
    padding: 1.5rem;
  }

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

  .modal-form-actions {
    flex-direction: column-reverse;
    width: 100%;
  }

  .modal-form-actions .form-submit-btn,
  .modal-form-actions .modal-cancel-btn {
    width: 100%;
    justify-content: center;
  }

  .footer-container {
    flex-direction: column;
    align-items: flex-start;
  }
}
