/* ============================================================
   HISTÓRIA DO AUTOMÓVEL — Sistema de Design
   Tipografia: Playfair Display + DM Sans
   Paleta: Preto profundo, Vermelho Ferrari, Dourado champagne
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400;1,700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,300&family=DM+Mono:wght@400;500&display=swap');

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
img { display: block; max-width: 100%; }
a { text-decoration: none; }

/* ===== TOKENS ===== */
:root {
  /* Cores */
  --c-bg:       #0a0a0b;
  --c-surface:  #111114;
  --c-card:     #17171c;
  --c-border:   rgba(255,255,255,0.08);
  --c-red:      #D0021B;
  --c-red-soft: #a80015;
  --c-gold:     #C9A84C;
  --c-gold-lt:  #e8c96b;
  --c-text:     #f0eee8;
  --c-muted:    #8a8880;
  --c-subtle:   rgba(255,255,255,0.06);

  /* Tipografia */
  --ff-serif: 'Playfair Display', Georgia, serif;
  --ff-sans:  'DM Sans', system-ui, sans-serif;
  --ff-mono:  'DM Mono', monospace;

  /* Espaços */
  --r: 4px;
  --r-lg: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 16px 64px rgba(0,0,0,0.6);
  --tr: all 0.35s cubic-bezier(0.4,0,0.2,1);

  /* Layout */
  --max-w: 1280px;
  --nav-h: 68px;
}

/* ===== BASE ===== */
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--ff-sans);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.65;
  min-height: 100vh;
}

/* Grain overlay for luxury texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

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

/* ===== NAV ===== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(10,10,11,0.92);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-logo {
  font-family: var(--ff-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.nav-logo span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-red);
}

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

.nav-links a {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--c-muted);
  padding: 6px 12px;
  border-radius: var(--r);
  transition: var(--tr);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--c-text);
  background: var(--c-subtle);
}

.nav-links a.active { color: var(--c-gold); }

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding-bottom: 80px;
}

.hero-img {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10,10,11,0.2) 0%,
    rgba(10,10,11,0.4) 40%,
    rgba(10,10,11,0.9) 80%,
    var(--c-bg) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
}

.hero-eyebrow {
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--c-gold);
}

.hero h1 {
  font-family: var(--ff-serif);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.hero h1 em {
  font-style: italic;
  color: var(--c-gold);
}

.hero-desc {
  font-size: 1.125rem;
  color: rgba(240,238,232,0.75);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 40px;
  font-weight: 300;
}

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

.hero-stat { text-align: left; }

.hero-stat .num {
  font-family: var(--ff-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--c-gold);
  line-height: 1;
  display: block;
}

.hero-stat .lbl {
  font-size: 0.75rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

/* ===== PAGE HEADER (sub-pages) ===== */
.page-hero {
  position: relative;
  padding: 120px 0 80px;
  overflow: hidden;
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
  opacity: 0.3;
}

.page-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--c-bg) 0%, rgba(10,10,11,0.7) 100%);
}

.page-hero-content {
  position: relative;
  z-index: 2;
}

.page-eyebrow {
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-eyebrow::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--c-gold);
}

.page-hero h1 {
  font-family: var(--ff-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.page-hero p {
  font-size: 1.1rem;
  color: rgba(240,238,232,0.7);
  max-width: 600px;
  font-weight: 300;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 8px 0;
  transition: var(--tr);
  margin-bottom: 32px;
}

.back-link:hover { color: var(--c-gold); }
.back-link::before { content: '←'; }

/* ===== SECTION LAYOUT ===== */
.section { padding: 80px 0; }
.section + .section { border-top: 1px solid var(--c-border); }
.section-sm { padding: 48px 0; }

.section-label {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--c-gold);
}

.section-title {
  font-family: var(--ff-serif);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-desc {
  color: var(--c-muted);
  font-size: 1rem;
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 48px;
}

/* ===== TIMELINE ===== */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--c-gold), var(--c-red), transparent);
}

.timeline-item {
  position: relative;
  padding: 0 0 48px 32px;
}

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

.timeline-item::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c-gold);
  border: 2px solid var(--c-bg);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.2);
}

.timeline-year {
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  color: var(--c-red);
  font-weight: 500;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.timeline-title {
  font-family: var(--ff-serif);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--c-text);
}

.timeline-body {
  font-size: 0.9rem;
  color: var(--c-muted);
  line-height: 1.7;
}

/* ===== CARDS ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: var(--tr);
}

.card:hover {
  border-color: rgba(201,168,76,0.3);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.card-body {
  padding: 24px;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--c-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.card-title {
  font-family: var(--ff-serif);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.card-text {
  font-size: 0.875rem;
  color: var(--c-muted);
  line-height: 1.7;
}

.card-list {
  list-style: none;
  margin-top: 14px;
}

.card-list li {
  font-size: 0.82rem;
  color: var(--c-muted);
  padding: 4px 0;
  padding-left: 14px;
  position: relative;
}

.card-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--c-red);
  font-size: 0.7rem;
}

/* ===== FEATURE BLOCK ===== */
.feature-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.feature-block.reverse { direction: rtl; }
.feature-block.reverse > * { direction: ltr; }

.feature-img-wrap {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
}

.feature-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.feature-img-wrap:hover img { transform: scale(1.04); }

.feature-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  pointer-events: none;
}

.feature-tag {
  display: inline-block;
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-red);
  border: 1px solid rgba(208,2,27,0.3);
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.feature-h {
  font-family: var(--ff-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.feature-p {
  font-size: 0.95rem;
  color: var(--c-muted);
  line-height: 1.75;
}

/* ===== STATS ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1px;
  background: var(--c-border);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.stat-item {
  background: var(--c-card);
  padding: 32px 24px;
  text-align: center;
}

.stat-num {
  font-family: var(--ff-serif);
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--c-gold);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-lbl {
  font-size: 0.75rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.4;
}

/* ===== HIGHLIGHT BOX ===== */
.highlight-box {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-gold);
  border-radius: var(--r-lg);
  padding: 32px 36px;
  margin: 32px 0;
}

.highlight-box h4 {
  font-family: var(--ff-serif);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--c-gold);
}

.highlight-box p {
  font-size: 0.9rem;
  color: var(--c-muted);
  line-height: 1.7;
}

/* ===== TABLE ===== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: var(--c-card);
}

th {
  padding: 14px 20px;
  text-align: left;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--c-border);
}

td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
  font-size: 0.875rem;
}

tr:last-child td { border-bottom: none; }

tbody tr {
  transition: background 0.2s;
  background: var(--c-surface);
}

tbody tr:nth-child(odd) { background: var(--c-card); }
tbody tr:hover { background: rgba(201,168,76,0.04); }

/* ===== FOOTER NAV ===== */
.page-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  padding: 64px 0;
  margin-top: 100px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.footer-brand .logo {
  font-family: var(--ff-serif);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--c-muted);
  max-width: 320px;
  line-height: 1.65;
}

.footer-nav h5 {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: 16px;
}

.footer-nav-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-nav-links a {
  font-size: 0.875rem;
  color: var(--c-muted);
  transition: var(--tr);
  padding: 2px 0;
}

.footer-nav-links a:hover { color: var(--c-gold); }

.footer-copy {
  border-top: 1px solid var(--c-border);
  margin-top: 48px;
  padding-top: 24px;
  font-size: 0.75rem;
  color: var(--c-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy a { color: var(--c-muted); }
.footer-copy a:hover { color: var(--c-gold); }

/* ===== IMAGE CAPTION ===== */
.img-with-caption {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
}

.img-with-caption img {
  width: 100%;
  display: block;
}

.img-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
  font-style: italic;
  letter-spacing: 0.05em;
}

/* ===== ERA BAND ===== */
.era-band {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 100px 1fr;
}

.era-band-year {
  background: var(--c-red);
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  rotate: 180deg;
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
}

.era-band-content {
  padding: 28px 32px;
}

.era-band-content h3 {
  font-family: var(--ff-serif);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.era-band-content p {
  font-size: 0.875rem;
  color: var(--c-muted);
  line-height: 1.7;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .container { padding: 0 20px; }
  .hero { min-height: 80vh; }
  .feature-block { grid-template-columns: 1fr; gap: 32px; }
  .feature-block.reverse { direction: ltr; }
  .footer-inner { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .era-band { grid-template-columns: 1fr; }
  .era-band-year { writing-mode: horizontal-tb; rotate: 0deg; padding: 8px 20px; }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 2.5rem; }
  .hero-stats { gap: 24px; }
  .section { padding: 48px 0; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
