/*
 * Optimist's Garage — Design Tokens & Shared Components
 * Source of truth for colors, type, spacing, and reusable styles.
 */

@import url('https://fonts.googleapis.com/css2?family=Bitter:ital,wght@0,700;0,800;0,900;1,400&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --accent:          #367588;
  --bg:              #0a0a0a;
  --bg-alt:          #0f0f0f;
  --bg-card:         #161616;
  --text:            #f0ece5;
  --text-muted:      #7a7672;
  --text-dim:        #363330;
  --border:          #1c1c1c;
  --border-light:    #272420;
  --display:         'Outfit', sans-serif;
  --body:            'Outfit', sans-serif;
  --serif:           'Bitter', serif;
  --radius:          4px;
  --radius-pill:     9999px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }

/* ─── UTILITIES ─── */
.section-label {
  font-family: var(--display); font-weight: 600; font-size: 11px;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent);
}
.section-rule { height: 1px; background: var(--border-light); margin: 14px 0 44px; }
.section-title {
  font-family: var(--serif); font-weight: 800;
  font-size: clamp(26px, 5vw, 52px); line-height: 1.0;
  text-transform: uppercase; letter-spacing: 0.02em;
}

/* ─── BUTTONS ─── */
.btn-primary {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 10px;
  white-space: nowrap;
  background: rgba(8, 8, 8, 0.88);
  color: var(--text);
  font-family: var(--display); font-weight: 700; font-size: 13px;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 14px 30px;
  border: 1px solid rgba(54, 117, 136, 0.5);
  cursor: pointer;
  border-radius: var(--radius-pill);
  box-shadow:
    0 0 10px 1px rgba(54, 117, 136, 0.18),
    inset 0 1px 0 rgba(130, 210, 240, 0.55),
    inset 0 -1px 0 rgba(54, 117, 136, 0.18);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.btn-primary:hover {
  border-color: rgba(54, 117, 136, 0.82);
  box-shadow:
    0 0 20px 4px rgba(54, 117, 136, 0.38),
    inset 0 1px 0 rgba(140, 215, 248, 0.72),
    inset 0 -1px 0 rgba(54, 117, 136, 0.28);
}
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-secondary {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--text);
  font-family: var(--display); font-weight: 700; font-size: 13px;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 12px 24px; border: 1.5px solid var(--border-light); cursor: pointer;
  border-radius: var(--radius-pill);
  transition: border-color 0.18s, color 0.18s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-link {
  font-family: var(--display); font-weight: 700; font-size: 12px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent);
  transition: opacity 0.18s;
}
.btn-link:hover { opacity: 0.6; }

/* ─── NAV ─── */
#main-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 80px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 52px;
  transition: background 0.35s, border-color 0.35s;
  border-bottom: 1px solid transparent;
}
#main-nav.scrolled,
#main-nav.always-solid {
  background: rgba(10,10,10,0.94);
  border-bottom-color: var(--border-light);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nav-brand { display: flex; align-items: center; gap: 12px; }
.nav-brand img { height: 65px; width: auto; }
.nav-wordmark {
  font-family: var(--serif); font-weight: 700; font-size: 18px;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: rgba(240,236,229,0.85);
  white-space: nowrap;
}
.nav-links { display: flex; gap: 36px; list-style: none; }
.nav-links a {
  font-family: var(--display); font-weight: 600; font-size: 14px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--text);
  transition: color 0.18s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent); }

/* ─── FOOTER ─── */
#footer {
  background: #060606; border-top: 1px solid var(--border);
  padding: 38px 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand span {
  font-family: var(--serif); font-weight: 700; font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase; color: #7a7672;
}
.footer-links { display: flex; gap: 28px; }
.footer-links a {
  font-family: var(--display); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: #7a7672; transition: color 0.18s;
}
.footer-links a:hover { color: var(--accent); }
.footer-copy {
  font-family: var(--display); font-size: 11px;
  color: var(--text-dim); letter-spacing: 0.06em;
}

/* ─── FORM INPUTS ─── */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-family: var(--display); font-size: 11px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted);
}
.field input,
.field select,
.field textarea {
  background: var(--bg-card); border: 1.5px solid var(--border-light);
  color: var(--text); font-family: var(--body); font-size: 15px;
  padding: 13px 16px; border-radius: var(--radius); outline: none;
  transition: border-color 0.18s;
  appearance: none; -webkit-appearance: none;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-dim); }
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 160px; line-height: 1.65; }
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a7672' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.field select option { background: #1a1a1a; }

/* ─── CHIPS ─── */
.chip {
  font-family: var(--display); font-weight: 600; font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 8px 18px; border: 1.5px solid var(--border-light);
  color: var(--text-muted); cursor: pointer; background: transparent;
  border-radius: var(--radius-pill);
  transition: background 0.16s, border-color 0.16s, color 0.16s;
}
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip:hover:not(.active) { border-color: rgba(240,236,229,0.25); color: var(--text); }

/* Square chips (for contact form) */
.type-chip {
  font-family: var(--display); font-weight: 600; font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 8px 18px; border: 1.5px solid var(--border-light);
  color: var(--text-muted); cursor: pointer; background: transparent;
  border-radius: var(--radius);
  transition: background 0.16s, border-color 0.16s, color 0.16s;
}
.type-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.type-chip:hover:not(.active) { border-color: rgba(240,236,229,0.25); color: var(--text); }

/* ─── CARDS ─── */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(54, 117, 136, 0.45);
  border-radius: var(--radius); overflow: hidden;
  box-shadow:
    0 0 10px 1px rgba(54, 117, 136, 0.16),
    inset 0 1px 0 rgba(130, 210, 240, 0.45),
    inset 0 -1px 0 rgba(54, 117, 136, 0.16);
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.15s ease;
}
.card:hover {
  border-color: rgba(54, 117, 136, 0.8);
  transform: translateY(-3px);
  box-shadow:
    0 0 20px 4px rgba(54, 117, 136, 0.36),
    inset 0 1px 0 rgba(140, 215, 248, 0.65),
    inset 0 -1px 0 rgba(54, 117, 136, 0.26);
}

/* Car listing cards */
.car-card {
  background: var(--bg-card);
  border: 1px solid rgba(54, 117, 136, 0.45);
  display: flex; flex-direction: column;
  border-radius: var(--radius); overflow: hidden;
  cursor: pointer;
  box-shadow:
    0 0 10px 1px rgba(54, 117, 136, 0.16),
    inset 0 1px 0 rgba(130, 210, 240, 0.45),
    inset 0 -1px 0 rgba(54, 117, 136, 0.16);
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.15s ease;
}
.car-card:hover {
  border-color: rgba(54, 117, 136, 0.8);
  transform: translateY(-3px);
  box-shadow:
    0 0 20px 4px rgba(54, 117, 136, 0.36),
    inset 0 1px 0 rgba(140, 215, 248, 0.65),
    inset 0 -1px 0 rgba(54, 117, 136, 0.26);
}
.car-card-img {
  width: 100%; aspect-ratio: 16/10; overflow: hidden;
  background: var(--bg); border-bottom: 1px solid var(--border);
  position: relative; display: flex; align-items: center; justify-content: center;
}
.car-card-img-placeholder {
  font-family: var(--display); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-dim);
}
.car-card-body { padding: 18px 20px 22px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.car-card-year {
  font-family: var(--display); font-size: 10px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent);
}
.car-card-name {
  font-family: var(--serif); font-weight: 800; font-size: 22px;
  text-transform: uppercase; line-height: 1.0; letter-spacing: 0.01em;
}
.car-card-desc {
  font-size: 13px; color: var(--text-muted); line-height: 1.5; flex: 1;
  margin-top: 4px;
}
.car-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.car-card-price {
  font-family: var(--display); font-weight: 900; font-size: 22px; color: var(--text);
}
.car-card-tags { display: flex; gap: 5px; }
.car-tag {
  font-family: var(--display); font-size: 9px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 2px 7px; border: 1px solid var(--border-light); color: var(--text-dim);
  border-radius: var(--radius);
}
.car-tag.live { border-color: #3a7a3a; color: #52b252; }

/* ─── HAMBURGER ─── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 201;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  #main-nav { padding: 0 28px; }
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(10, 10, 10, 0.97);
    border-top: 1px solid var(--border-light);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links li a {
    display: block;
    padding: 14px 28px;
    font-size: 15px;
    text-align: right;
  }
  #footer { padding: 36px 32px; flex-wrap: wrap; gap: 24px; }
}

@media (max-width: 480px) {
  #main-nav { padding: 0 20px; height: 56px; }
  .nav-brand img { height: 48px; }
  .nav-wordmark {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }
  .nav-links { top: 56px; }
  #footer { flex-direction: column; align-items: flex-start; gap: 24px; padding: 36px 20px; }
}
