/* ========================================
   Cisitalia Club of North America — 2026
   Bright Heritage Club Design
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #ffffff;
  --color-surface: #f5f3f0;
  --color-surface-2: #eae7e2;
  --color-text: #2c2825;
  --color-text-muted: #6b6560;
  --color-accent: #9e7c2e;
  --color-accent-dark: #7a5f1e;
  --color-accent-light: #c4a35a;
  --color-heading: #1a1714;
  --color-white: #ffffff;
  --color-border: rgba(0, 0, 0, 0.1);
  --color-border-light: rgba(0, 0, 0, 0.06);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in-out: cubic-bezier(0.455, 0.03, 0.515, 0.955);

  --container-max: 1200px;
  --section-padding: clamp(80px, 10vw, 140px);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.3s var(--ease-out);
}

a:hover {
  color: var(--color-accent-dark);
}

::selection {
  background: var(--color-accent-light);
  color: var(--color-white);
}

/* --- Container --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 60px);
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 24px 0;
  transition: all 0.4s var(--ease-out);
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.06);
}

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 60px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-heading);
}

.nav-logo:hover {
  color: var(--color-accent);
}

/* On hero (before scroll), logo is white for contrast on image */
.nav:not(.scrolled) .nav-logo {
  color: #fff;
}

.nav-logo-mark {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border: 1.5px solid var(--color-accent);
  color: var(--color-accent);
  line-height: 1.2;
}

.nav:not(.scrolled) .nav-logo-mark {
  border-color: #fff;
  color: #fff;
}

.nav-logo-text {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  line-height: 1.3;
  max-width: 140px;
}

.nav:not(.scrolled) .nav-logo-text {
  color: rgba(255, 255, 255, 0.75);
}

.nav-logo:hover .nav-logo-text {
  color: var(--color-accent);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 32px;
}

.nav-links a {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
}

.nav:not(.scrolled) .nav-links a {
  color: rgba(255, 255, 255, 0.8);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.3s var(--ease-out);
}

.nav-links a:hover {
  color: var(--color-heading);
}

.nav:not(.scrolled) .nav-links a:hover {
  color: #fff;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-heading);
  transition: all 0.3s var(--ease-out);
}

.nav:not(.scrolled) .nav-toggle span {
  background: #fff;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -5px);
}

/* --- Hero (stays dark overlay for contrast on image) --- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transform: scale(1.05);
  animation: heroZoom 20s var(--ease-in-out) infinite alternate;
}

@keyframes heroZoom {
  from { transform: scale(1.05); }
  to { transform: scale(1.15); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    135deg,
    rgba(15, 12, 8, 0.65) 0%,
    rgba(15, 12, 8, 0.35) 50%,
    rgba(15, 12, 8, 0.15) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 60px);
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent-light);
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s 0.3s var(--ease-out) forwards;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 700;
  line-height: 1.05;
  color: #ffffff;
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s 0.5s var(--ease-out) forwards;
}

.hero-desc {
  max-width: 540px;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 40px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s 0.7s var(--ease-out) forwards;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s 0.9s var(--ease-out) forwards;
}

.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fadeUp 0.8s 1.2s var(--ease-out) forwards;
}

.hero-scroll span {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.hero-scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), transparent);
  animation: scrollPulse 2s var(--ease-in-out) infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
  50% { opacity: 1; transform: scaleY(1); }
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 14px 36px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-accent-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(158, 124, 46, 0.3);
}

/* Hero buttons stay light-on-dark */
.hero-buttons .btn-primary {
  background: var(--color-accent-light);
  color: #1a1714;
}

.hero-buttons .btn-primary:hover {
  background: #d4b36a;
  color: #1a1714;
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.btn-outline:hover {
  border-color: #fff;
  color: #fff;
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

.btn-inline {
  margin-top: 12px;
}

/* --- Sections --- */
.section {
  padding: var(--section-padding) 0;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-heading);
  margin-bottom: 24px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 560px;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header .section-subtitle {
  margin: 0 auto;
}

.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}

.section-grid--reverse {
  direction: rtl;
}

.section-grid--reverse > * {
  direction: ltr;
}

.section-text h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 16px;
}

.section-text p {
  margin-bottom: 16px;
  color: var(--color-text-muted);
}

.section-text p em {
  color: var(--color-text);
  font-style: italic;
}

.section-image {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.section-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  transition: transform 0.6s var(--ease-out);
}

.section-image:hover img {
  transform: scale(1.03);
}

/* --- Mission Cards --- */
.mission-section {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.mission-card {
  text-align: center;
  padding: 40px 24px;
}

.mission-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 24px;
  color: var(--color-accent);
}

.mission-icon svg {
  width: 100%;
  height: 100%;
}

.mission-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 12px;
}

.mission-card p {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* --- Quote --- */
.quote-section {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
}

.quote {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.quote p {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  font-style: italic;
  line-height: 1.4;
  color: var(--color-heading);
  margin-bottom: 20px;
}

.quote cite {
  font-style: normal;
  font-size: 0.85rem;
  color: var(--color-accent);
  letter-spacing: 0.05em;
}

/* --- History Narrative --- */
.history-narrative {
  margin-bottom: 80px;
}

.history-narrative .section-grid {
  margin-bottom: 60px;
}

.history-narrative .section-grid:last-child {
  margin-bottom: 0;
}

/* --- Timeline --- */
.timeline {
  position: relative;
  max-width: 700px;
  margin: 60px auto 0;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  padding-bottom: 48px;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -44px;
  top: 6px;
  width: 10px;
  height: 10px;
  background: var(--color-accent);
  border-radius: 50%;
  border: 2px solid var(--color-bg);
  box-shadow: 0 0 0 2px var(--color-accent);
}

.timeline-year {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-accent);
}

.timeline-content h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 6px;
}

.timeline-content p {
  font-size: 0.92rem;
  color: var(--color-text-muted);
}

/* --- Gallery --- */
.gallery-section {
  background: var(--color-surface);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.gallery-item--wide {
  grid-column: span 2;
  aspect-ratio: 16 / 9;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.gallery-item:hover img {
  transform: scale(1.06);
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 12, 8, 0.75) 0%, transparent 50%);
  display: flex;
  align-items: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-overlay span {
  font-size: 0.85rem;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.03em;
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s var(--ease-out);
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  margin: 0 auto;
}

.lightbox-caption {
  margin-top: 16px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 2rem;
  padding: 16px;
  transition: color 0.3s var(--ease-out);
  z-index: 10;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  color: var(--color-accent-light);
}

.lightbox-close {
  top: 20px;
  right: 20px;
  font-size: 2.5rem;
}

.lightbox-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
}

.lightbox-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
}

/* --- Models --- */
.models-section {
  background: var(--color-bg);
}

.models-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.model-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.model-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
}

.model-card-img {
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.model-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.model-card:hover .model-card-img img {
  transform: scale(1.05);
}

.model-card-body {
  padding: 28px;
}

.model-card-body h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 4px;
}

.model-year {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 14px;
}

.model-card-body p {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* --- Restoration Section --- */
.restoration-section {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border-light);
}

/* --- Footer --- */
.footer {
  background: #1a1714;
  color: rgba(255, 255, 255, 0.75);
  padding: 0 0 40px;
}

.footer-cta {
  text-align: center;
  padding: 80px 0 60px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 60px;
}

.footer-cta .section-title {
  color: #fff;
}

.footer-cta p {
  max-width: 520px;
  margin: 0 auto 28px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 1.02rem;
}

.footer-cta .btn-primary {
  background: var(--color-accent-light);
  color: #1a1714;
}

.footer-cta .btn-primary:hover {
  background: #d4b36a;
  color: #1a1714;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 60px;
}

.footer-brand h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.55);
  margin-top: 12px;
  font-size: 0.92rem;
}

.footer-links h4 {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 20px;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--color-accent-light);
}

.footer-bottom {
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
}

/* --- Scroll Animations --- */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .models-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }

  .mission-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .nav-logo-text {
    display: none;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 100px 40px;
    gap: 24px;
    transition: right 0.4s var(--ease-out);
    border-left: 1px solid var(--color-border);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  }

  .nav-links.open {
    right: 0;
  }

  /* When menu is open, links should always be dark (on white bg) */
  .nav-links.open a {
    color: var(--color-text-muted) !important;
  }

  .nav-links.open a:hover {
    color: var(--color-heading) !important;
  }

  .nav-toggle {
    display: flex;
    z-index: 1001;
  }

  .section-grid,
  .section-grid--reverse {
    grid-template-columns: 1fr;
    direction: ltr;
  }

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

  .gallery-item--wide {
    grid-column: span 2;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-title {
    font-size: clamp(2.4rem, 10vw, 4rem);
  }

  .hero-buttons {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-item--wide {
    grid-column: span 1;
  }

  .timeline {
    padding-left: 30px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .timeline-item::before {
    left: -34px;
  }
}
