/* ============================================================
   MR2 Roadster Restoration - Styles
   Modern, clean, light aesthetic
   ============================================================ */

:root {
  --color-bg: #fafafa;
  --color-bg-alt: #f0f0f0;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #6b6b6b;
  --color-accent: #c0392b;
  --color-accent-dark: #a93226;
  --color-border: #e5e5e5;
  --color-overlay: rgba(0, 0, 0, 0.5);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.15);
  --radius: 12px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden; /* fallback for browsers without overflow-x: clip */
  overflow-x: clip;   /* never let stray content widen the mobile layout viewport */
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition);
}

.nav.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.nav-logo span {
  color: var(--color-accent);
}

.nav-logo-img {
  height: 34px;
  width: auto;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
  position: relative;
  padding: 4px 0;
  transition: var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--color-accent);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition: var(--transition);
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.05);
  animation: heroZoom 8s ease forwards;
}

@keyframes heroZoom {
  from { transform: scale(1.1); }
  to { transform: scale(1); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.2) 50%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  padding: 0 24px;
  max-width: 800px;
}

.hero-logo {
  width: clamp(280px, 55vw, 640px);
  height: auto;
  margin: 0 auto 28px;
  filter: brightness(0) invert(1) drop-shadow(0 8px 28px rgba(0, 0, 0, 0.35));
}

.hero-eyebrow {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 20px;
  opacity: 0.9;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 20px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

\\\.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 300;
  opacity: 0.95;
  margin-bottom: 120px;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.btn {
  display: inline-block;
  padding: 14px 36px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

.btn-light {
  background: #fff;
  color: var(--color-text);
}

.btn-light:hover {
  background: var(--color-accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  text-align: center;
  color: #fff;
}

.hero-scroll span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.8;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.5);
  margin: 10px auto 0;
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  animation: scrollLine 2s ease infinite;
}

@keyframes scrollLine {
  0% { top: -100%; }
  100% { top: 100%; }
}

/* ============================================================
   Sections
   ============================================================ */
.section {
  padding: 100px 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-head {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 60px;
}

.section-eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 600;
  margin-bottom: 16px;
  line-height: 1.2;
}

.section-desc {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  font-weight: 300;
}

/* ============================================================
   Specs
   ============================================================ */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 60px;
}

.spec-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  transition: var(--transition);
}

.spec-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.spec-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.spec-value {
  font-size: 1.1rem;
  font-weight: 600;
}

.intro-text {
  max-width: 1200px;
  margin: 50px auto 0;
  text-align: center;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-text-muted);
  font-weight: 300;
}

.intro-text p {
  margin-bottom: 16px;
}

.intro-text strong {
  color: var(--color-accent);
}

/* ============================================================
   Result Photo
   ============================================================ */
.result-photo {
  max-width: 1200px;
  margin: 0 auto;
}

.result-photo img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: block;
}

/* ============================================================
   Car Slideshow
   ============================================================ */
.car-slideshow-container {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.car-status-text {
  text-align: center;
  color: var(--color-text-muted);
  font-style: italic;
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.car-slideshow {
  position: relative;
  width: 100%;
  height: 500px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--color-bg-alt);
}

.car-slideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
  cursor: pointer;
}

.car-slideshow img.active {
  opacity: 1;
}

.car-slideshow-nav {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  gap: 8px;
  padding: 0 8px;
}

.car-slideshow-btn {
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.car-slideshow-btn:hover {
  background: var(--color-accent);
  color: #fff;
  transform: scale(1.1);
}

.car-slideshow-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  display: flex;
  flex-wrap: wrap;               /* wrap instead of overflowing on narrow screens */
  justify-content: center;
  gap: 8px;
  max-width: calc(100% - 32px);  /* never wider than the slideshow frame */
  transform: translateX(-50%);
}

.car-slideshow-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--transition);
}

.car-slideshow-dot.active,
.car-slideshow-dot:hover {
  background: var(--color-accent);
  transform: scale(1.2);
}

/* Result slideshow - wider than the car slideshow */
.result-slideshow-container {
  max-width: 1200px;
}

/* Result slideshow - taller frame so the full photo is always visible */
.result-slideshow-container .car-slideshow {
  height: 675px;
  border-radius: var(--radius);
  overflow: hidden;
}

/* Keep a true 16:9 ratio at every screen width so the photo always fills
   the frame edge-to-edge (no gray bars) and rounded corners stay visible. */
@supports (aspect-ratio: 16 / 9) {
  .result-slideshow-container .car-slideshow {
    height: auto;
    aspect-ratio: 16 / 9;
  }
}

.result-slideshow-container .car-slideshow img {
  object-fit: contain;
  border-radius: var(--radius);
}

/* ============================================================
   Timeline
   ============================================================ */
.timeline {
  max-width: 1000px;
  margin: 0 auto;
}

.timeline-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  counter-reset: work;
}

.timeline-entry {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 15px 18px;
  transition: var(--transition);
}

.timeline-entry:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.timeline-entry-check {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.timeline-entry-content {
  flex: 1;
  min-width: 0;
}

.timeline-entry-title {
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 4px;
}

.timeline-entry-details {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.timeline-entry-details.placeholder {
  font-style: italic;
  opacity: 0.6;
}

/* ============================================================
   Work List Frame — scrollable restoration work + search
   Sized like the car slideshows (900px wide, ~500px tall).
   ============================================================ */
.work-frame {
  max-width: 900px;          /* same width as .car-slideshow-container */
  height: 500px;             /* approx .car-slideshow height */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.work-frame-search {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}

.work-frame-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  flex-shrink: 0;
}

.work-frame-search-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-text);
  background: var(--color-surface);
  outline: none;
  transition: var(--transition);
}

.work-frame-search-input::placeholder {
  color: var(--color-text-muted);
}

.work-frame-search-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.14);
}

.work-frame-search-clear {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;   /* only shown once the search box has text */
}

.work-frame-search-clear.visible {
  visibility: visible;
}

.work-frame-search-clear:hover {
  background: var(--color-accent);
  color: #fff;
}

.work-frame-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  scrollbar-width: thin;                       /* Firefox */
  scrollbar-color: #c9c4c4 transparent;
}

.work-frame-scroll::-webkit-scrollbar {
  width: 10px;
}

.work-frame-scroll::-webkit-scrollbar-track {
  background: var(--color-bg-alt);
  border-radius: 8px;
}

.work-frame-scroll::-webkit-scrollbar-thumb {
  background: #c9c4c4;
  border-radius: 8px;
}

.work-frame-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

.work-frame-count {
  flex-shrink: 0;
  padding: 8px 16px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 0.78rem;
  letter-spacing: 0.3px;
  color: var(--color-text-muted);
  text-align: center;
}

/* Search matches highlighted in titles and details */
.work-frame mark {
  background: rgba(192, 57, 43, 0.16);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

.work-frame-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-muted);
  font-style: italic;
  font-size: 0.95rem;
}

/* ============================================================
   Remaining To-Do
   ============================================================ */
.todo-remaining {
  max-width: 900px;   /* same width as the work list frame / slideshows */
  margin: 48px auto 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}

.todo-remaining h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.todo-remaining ul {
  list-style: none;
}

.todo-remaining li {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.95rem;
}

.todo-remaining li:last-child {
  border-bottom: none;
}

.todo-remaining li::before {
  content: '○';
  color: var(--color-accent);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ============================================================
   After Gallery
   ============================================================ */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
}

.filter-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 50px;
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  color: var(--color-text);
}

.filter-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.filter-btn.active {
  background: var(--color-text);
  color: #fff;
  border-color: var(--color-text);
}

.filter-btn.active:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.after-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* History gallery — documents at equal height, natural width, centered */
#historyGallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-bottom: 80px;
}

#historyGallery img {
  height: 420px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: var(--transition);
}

#historyGallery img:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

@media (max-width: 600px) {
  #historyGallery img {
    height: 280px;
  }
}

/* Resources section — compact section heads (eyebrow / History / Downloads) */
.section-head-compact {
  margin-bottom: 40px;
}

.after-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: var(--transition);
}

.after-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.after-item img,
.after-item video {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.after-item-cat {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 4px;
  z-index: 2;
}

.video-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: var(--transition);
}

.video-badge::after {
  content: '▶';
  color: #fff;
  font-size: 1.2rem;
  margin-left: 4px;
}

.after-item:hover .video-badge {
  background: var(--color-accent);
}

/* Lightbox video support */
.lightbox-video {
  max-width: 90%;
  max-height: 80vh;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  background: #000;
}



/* ============================================================
   Downloads
   ============================================================ */
.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.download-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  transition: var(--transition);
  display: block;
}

.download-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.download-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.download-title {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.download-desc {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.download-btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 50px;
  background: var(--color-text);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}

.download-btn:hover {
  background: var(--color-accent);
}

/* ============================================================
   Costs
   ============================================================ */
.cost-summary {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 40px;
  color: var(--color-text-muted);
  font-size: 1.05rem;
  font-weight: 300;
}

.cost-table {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  border-collapse: collapse;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cost-table th,
.cost-table td {
  padding: 12px 20px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
}

.cost-table thead th {
  background: var(--color-bg-alt);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 1px;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-border);
}

.cost-col-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cost-category td {
  background: var(--color-bg-alt);
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.cost-category td[colspan="2"] {
  border-right: 1px solid var(--color-border);
}

.cost-total td {
  font-weight: 700;
  background: var(--color-bg-alt);
  border-top: 2px solid var(--color-border);
}

.cost-total .cost-col-amount {
  color: var(--color-accent);
  font-weight: 700;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  background: var(--color-text);
  color: #fff;
  padding: 60px 0 40px;
  text-align: center;
}

.footer-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.footer-text {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  font-weight: 300;
  margin-bottom: 30px;
}

.reflection-text {
  max-width: 1200px;
  margin: 48px auto 0;
  text-align: center;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-text-muted);
  font-weight: 300;
}

.footer-copy {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 30px;
}

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 40px;
}

.lightbox.active {
  display: flex;
}

.lightbox-img {
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}

.lightbox-caption {
  color: #fff;
  margin-top: 20px;
  font-size: 0.9rem;
  opacity: 0.8;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.lightbox-close {
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  font-size: 1.2rem;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--color-accent);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-surface);
    flex-direction: column;
    padding: 20px 24px;
    gap: 16px;
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-100%);
    transition: var(--transition);
    opacity: 0;
    pointer-events: none;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .timeline-list {
    grid-template-columns: 1fr;
  }

  .work-frame {
    height: 440px;
  }

  .work-frame-scroll {
    padding: 12px;
  }

  .section {
    padding: 70px 0;
  }

  .hero-title {
    font-size: 2.8rem;
  }

  .hero-logo {
    width: min(78vw, 340px);
    margin-bottom: 18px;
  }

  .nav-logo {
    font-size: 1.2rem;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }

  /* Gallery category pills: one swipeable row instead of a tall wrapped list.
     Same buttons as on desktop — just a horizontal scroll strip with a right-edge
     fade hinting there is more to swipe. */
  .gallery-filters {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    gap: 8px;
    margin-bottom: 30px;
    padding: 2px 2px 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 28px), transparent 100%);
  }

  .gallery-filters::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 7px 14px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .specs-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  /* Cost table: keep it inside the screen — swipeable if ever wider */
  .cost-table {
    display: block;
    overflow-x: auto;
  }

  .cost-table th,
  .cost-table td {
    padding: 10px;
  }

  /* Extra-narrow phones: tighter cells so the table fits without swiping */
  @media (max-width: 360px) {
    .cost-table th,
    .cost-table td {
      padding: 8px 6px;
    }
  }

  .car-slideshow {
    height: 400px;
  }

  .work-frame {
    height: 400px;
  }

  /* Result slideshow keeps its 16:9 frame on mobile too,
     so the photos never show gray bars + square corners. */
  @supports (aspect-ratio: 16 / 9) {
    .result-slideshow-container .car-slideshow {
      height: auto;
      aspect-ratio: 16 / 9;
    }
  }

}