/* Midwest Performance
   Theme: dark only (garage at night, matches DAT2V content). One accent: Grabber-style Ford blue.
   Shape rule: every box, button and input uses --r (6px). Nothing is pill-shaped. */

:root {
  color-scheme: dark;
  --bg: #0c0e11;
  --bg-2: #13161b;
  --bg-3: #1b1f26;
  --line: #2a2f38;
  --text: #eef0f3;
  --muted: #a3aab5;
  --accent: #2f80ed;
  --accent-strong: #1c66d4;
  --accent-ink: #ffffff;
  --ok: #3fb67a;
  --bad: #ef5b5b;
  --r: 6px;
  --wrap: 1280px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* z-index scale */
  --z-header: 20;
  --z-modal: 40;
  --z-toast: 50;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
code { background: var(--bg-3); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.9em; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.02; letter-spacing: -0.01em; margin: 0 0 0.4em; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 6.2vw, 5.2rem); text-transform: uppercase; }
h2 { font-size: clamp(2rem, 4vw, 3.3rem); text-transform: uppercase; }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; text-wrap: pretty; }
.muted { color: var(--muted); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.section { padding: clamp(64px, 9vw, 120px) 0; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 52ch; }
.accent { color: var(--accent); }
.eyebrow { font: 600 0.8rem/1 var(--body); text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent); margin-bottom: 1rem; display: block; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 14px; z-index: 100; border-radius: var(--r); }
.skip:focus { left: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 48px; padding: 0 1.4em;
  font: 600 1rem/1 var(--body); letter-spacing: 0.02em; white-space: nowrap;
  border: 1px solid transparent; border-radius: var(--r);
  background: var(--accent-strong); color: var(--accent-ink); text-decoration: none; cursor: pointer;
  transition: background-color 160ms var(--ease), transform 120ms var(--ease), border-color 160ms var(--ease);
  user-select: none; touch-action: manipulation;
}
.btn:hover { color: var(--accent-ink); }
@media (hover: hover) { .btn:hover { background: var(--accent); } }
.btn:active { transform: scale(0.97); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
@media (hover: hover) { .btn-ghost:hover { background: var(--bg-3); color: var(--text); border-color: #3a414d; } }
.btn-sm { min-height: 40px; padding: 0 0.9em; font-size: 0.92rem; }
.btn-danger { background: transparent; border-color: #5a2a2a; color: #ff9b9b; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: rgb(12 14 17 / 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r);
  background: var(--accent-strong); color: #fff; font: 800 italic 1.15rem/1 var(--display); letter-spacing: -0.02em;
}
.brand-text { font: 600 1.25rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.brand-text b { font-weight: 800; font-style: italic; color: var(--accent); margin-left: 4px; }
.nav { display: flex; gap: 6px; margin-left: 12px; }
.nav a, .mobile-nav a { text-decoration: none; padding: 8px 12px; border-radius: var(--r); color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--text); background: var(--bg-3); }
.nav a[aria-current="page"] { color: var(--text); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-link { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r); color: var(--muted); text-decoration: none; font-size: 1.3rem; }
.icon-link:hover { color: var(--text); background: var(--bg-3); }
.menu-btn { display: none; width: 44px; height: 44px; border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: var(--r); font-size: 1.3rem; cursor: pointer; }
.mobile-nav { display: flex; flex-direction: column; padding: 8px 16px 16px; border-top: 1px solid var(--line); }
.mobile-nav[hidden] { display: none; }
.mobile-nav a { padding: 14px 8px; font-size: 1.1rem; color: var(--text); }
@media (max-width: 860px) {
  .nav, .header-actions .icon-link { display: none; }
  .menu-btn { display: grid; place-items: center; }
  #account-link span { display: none; }
  #account-link { width: 44px; padding: 0; }
}

/* ---------- hero ---------- */
.hero { position: relative; min-height: calc(100dvh - 68px); display: grid; align-items: center; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(24px, 4vw, 64px); align-items: center; padding-top: 48px; padding-bottom: 48px; }
.hero h1 { font-style: italic; }
.hero h1 .accent { display: block; }
.hero .lede { margin-bottom: 2rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-media { position: relative; aspect-ratio: 4 / 5; border-radius: var(--r); overflow: hidden; background: var(--bg-2); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; transform: scale(1.04); animation: settle 1.4s var(--ease) both; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgb(12 14 17 / 0.65)); pointer-events: none; }
.hero-tag { position: absolute; left: 16px; bottom: 16px; right: 16px; z-index: 1; display: flex; justify-content: space-between; align-items: end; gap: 12px; font-weight: 600; }
.hero-tag small { display: block; color: var(--muted); font-weight: 500; }
.hero-copy > * { animation: rise 700ms var(--ease) both; }
.hero-copy > *:nth-child(2) { animation-delay: 60ms; }
.hero-copy > *:nth-child(3) { animation-delay: 120ms; }
.hero-copy > *:nth-child(4) { animation-delay: 180ms; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes settle { from { transform: scale(1.12); opacity: 0.4; } }
@media (max-width: 860px) {
  .hero { min-height: auto; }
  .hero-grid { grid-template-columns: 1fr; padding-top: 32px; }
  .hero-media { aspect-ratio: 4 / 3; order: -1; }
}

/* ---------- social strip ---------- */
.social-strip { border-block: 1px solid var(--line); background: var(--bg-2); }
.social-row { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); }
.social-row > * { padding: 28px 24px; border-left: 1px solid var(--line); text-decoration: none; }
.social-row > *:first-child { border-left: 0; padding-left: 0; }
.social-stat strong { display: block; font: 700 italic 2.6rem/1 var(--display); }
.social-stat span { color: var(--muted); font-size: 0.95rem; }
.social-stat i { color: var(--accent); margin-right: 6px; }
a.social-stat { transition: background-color 160ms var(--ease); }
@media (hover: hover) { a.social-stat:hover { background: var(--bg-3); color: var(--text); } }
.social-intro p { margin: 0; }
.social-intro h2 { font-size: 1.6rem; margin-bottom: 6px; }
@media (max-width: 860px) {
  .social-row { grid-template-columns: 1fr 1fr 1fr; }
  .social-intro { grid-column: 1 / -1; border-bottom: 1px solid var(--line); padding: 24px 0 !important; }
  .social-row > *:nth-child(2) { border-left: 0; padding-left: 0; }
  .social-row > * { padding: 20px 12px; }
  .social-stat strong { font-size: 2rem; }
}

/* ---------- services bento ---------- */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(200px, auto); gap: 12px; margin-top: 40px; }
.tile { position: relative; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.tile h3 { margin-bottom: 6px; }
.tile p { color: var(--muted); margin: 0; }
.tile .ph { font-size: 1.8rem; color: var(--accent); margin-bottom: auto; }
.tile.photo { color: #fff; border: 0; min-height: 300px; }
.tile.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
.tile.photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(0 0 0 / 0) 30%, rgb(8 10 12 / 0.92)); }
.tile.photo > :not(img) { position: relative; z-index: 1; }
.tile.photo p { color: #d7dbe1; }
@media (hover: hover) { .tile.photo:hover img { transform: scale(1.04); } }
.tile.blue { background: var(--accent-strong); border-color: var(--accent-strong); }
.tile.blue p, .tile.blue .ph { color: #e3edff; }
.span-2 { grid-column: span 2; }
.row-2 { grid-row: span 2; }
@media (max-width: 960px) { .bento { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .bento { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } .row-2 { grid-row: auto; } }

/* ---------- feature build (truck) ---------- */
.build { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(24px, 5vw, 72px); align-items: center; }
.build-media { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.build-media img { border-radius: var(--r); aspect-ratio: 9 / 14; object-fit: cover; width: 100%; }
.build-media img:nth-child(2) { margin-top: 48px; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 32px; margin: 28px 0 32px; }
.specs dt { color: var(--muted); font-size: 0.9rem; }
.specs dd { margin: 2px 0 0; font: 600 1.3rem/1.2 var(--display); text-transform: uppercase; }
@media (max-width: 860px) { .build { grid-template-columns: 1fr; } .build-media { order: -1; } }

/* ---------- recent work strip ---------- */
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; overscroll-behavior-x: contain; margin-top: 32px; }
.strip a { scroll-snap-align: start; position: relative; border-radius: var(--r); overflow: hidden; aspect-ratio: 9 / 13; background: var(--bg-2); }
.strip img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease); }
@media (hover: hover) { .strip a:hover img { transform: scale(1.04); } }
.head-row { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.head-row h2 { margin: 0; }

/* ---------- reviews ---------- */
.quotes { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; margin-top: 32px; }
.quote { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; }
.quote:first-child { grid-row: span 2; display: flex; flex-direction: column; justify-content: space-between; }
.quote:first-child blockquote { font: 600 italic clamp(1.5rem, 2.6vw, 2.2rem)/1.15 var(--display); }
.quote blockquote { margin: 12px 0 16px; font-size: 1.05rem; }
.quote cite { font-style: normal; color: var(--muted); font-size: 0.95rem; }
.stars { color: #f5b942; letter-spacing: 2px; }
@media (max-width: 760px) { .quotes { grid-template-columns: 1fr; } .quote:first-child { grid-row: auto; } }

/* ---------- forms ---------- */
.quote-wrap { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(24px, 5vw, 72px); }
.form { display: grid; gap: 18px; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field .hint { color: var(--muted); font-size: 0.88rem; }
.field .err { color: #ff8a8a; font-size: 0.88rem; min-height: 0; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  font: 400 16px/1.4 var(--body); color: var(--text);
  background: var(--bg-2); border: 1px solid #3a414d; border-radius: var(--r);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
textarea { min-height: 130px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #8a929e; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(47 128 237 / 0.3); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); }
input[type="checkbox"] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--accent); }
@media (max-width: 760px) { .quote-wrap, .form-2 { grid-template-columns: 1fr; } }
.contact-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.contact-list li { display: flex; gap: 12px; align-items: center; }
.contact-list i { font-size: 1.4rem; color: var(--accent); }

/* ---------- page head ---------- */
.page-head { padding: clamp(48px, 7vw, 88px) 0 24px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-style: italic; font-size: clamp(2.4rem, 5vw, 4rem); }

/* ---------- shop ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 24px 0; }
.chip { min-height: 40px; padding: 0 16px; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: var(--r); font: 500 0.95rem var(--body); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.product { display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.product-img { aspect-ratio: 4 / 3; background: var(--bg-3); }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-body p { color: var(--muted); margin: 0; flex: 1; }
.product-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.price { font: 700 1.4rem/1 var(--display); }
.badge { display: inline-block; align-self: flex-start; font-size: 0.78rem; font-weight: 600; padding: 3px 8px; border-radius: 4px; background: var(--bg-3); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.badge.paid { background: rgb(63 182 122 / 0.16); color: #7fe0ae; }
.badge.sent { background: rgb(47 128 237 / 0.18); color: #9cc4ff; }
.badge.void { background: rgb(239 91 91 / 0.15); color: #ff9b9b; }

/* ---------- gallery ---------- */
.masonry { columns: 3 280px; column-gap: 12px; margin-top: 32px; }
.masonry figure { break-inside: avoid; margin: 0 0 12px; border-radius: var(--r); overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.masonry button { all: unset; display: block; cursor: zoom-in; width: 100%; }
.masonry button:focus-visible { outline: 2px solid var(--accent); }
.masonry figcaption { padding: 14px 16px; }
.masonry figcaption strong { display: block; }
.masonry figcaption span { color: var(--muted); font-size: 0.92rem; }

dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: min(92vw, 900px); max-height: 92dvh; color: var(--text); }
dialog.lightbox::backdrop { background: rgb(5 6 8 / 0.88); }
dialog.lightbox img { max-height: 80dvh; width: auto; margin: 0 auto; border-radius: var(--r); }
dialog.lightbox p { text-align: center; margin-top: 12px; }
dialog[open] { animation: pop 220ms var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(0.96); } }
.close-x { position: fixed; top: 16px; right: 16px; width: 48px; height: 48px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-size: 1.4rem; cursor: pointer; }

/* ---------- panels / account / admin ---------- */
.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(20px, 3vw, 32px); }
.auth-box { max-width: 460px; margin: 48px auto; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs button { all: unset; cursor: pointer; padding: 12px 16px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); border-color: var(--accent); }
.tabs button:focus-visible { outline: 2px solid var(--accent); }
.list { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; padding: 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); }
.row img { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; }
.row .meta { color: var(--muted); font-size: 0.9rem; }
.row .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row.noimg { grid-template-columns: 1fr auto; }
@media (max-width: 600px) { .row { grid-template-columns: 48px 1fr; } .row img { width: 48px; height: 48px; } .row .actions { grid-column: 1 / -1; justify-content: flex-start; } .row.noimg { grid-template-columns: 1fr; } }
.admin-grid { display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }
@media (max-width: 960px) { .admin-grid { grid-template-columns: 1fr; } }
.items-table { width: 100%; border-collapse: collapse; }
.items-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 0.85rem; padding: 8px 6px; }
.items-table td { padding: 4px 6px; vertical-align: top; }
.items-table input { min-height: 40px; padding: 8px 10px; }
.totals { margin-left: auto; display: grid; grid-template-columns: auto auto; gap: 6px 24px; text-align: right; width: max-content; }
.totals .grand { font: 700 1.4rem var(--display); }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); }
.empty i { font-size: 2.2rem; display: block; margin: 0 auto 8px; }
.skeleton { background: linear-gradient(90deg, var(--bg-2) 0%, var(--bg-3) 50%, var(--bg-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--r); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- invoice print ---------- */
.invoice { background: #fff; color: #111; max-width: 820px; margin: 32px auto; padding: 48px; border-radius: var(--r); }
.invoice h1 { font-size: 2.4rem; color: #111; }
.invoice table { width: 100%; border-collapse: collapse; margin: 24px 0; }
.invoice th, .invoice td { padding: 10px 8px; text-align: left; }
.invoice thead th { border-bottom: 2px solid #111; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.invoice tbody td { border-bottom: 1px solid #ddd; }
.invoice .num { text-align: right; font-variant-numeric: tabular-nums; }
.inv-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
@media print {
  .site-header, .site-footer, .no-print, .skip { display: none !important; }
  body { background: #fff; }
  .invoice { margin: 0; padding: 0; max-width: none; }
}

/* ---------- toast ---------- */
.toast-box { position: fixed; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: var(--z-toast); display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--bg-3); border: 1px solid var(--line); border-left: 3px solid var(--ok); padding: 14px 16px; border-radius: var(--r); animation: rise 260ms var(--ease) both; transition: opacity 300ms, transform 300ms; }
.toast-bad { border-left-color: var(--bad); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 56px 0 24px; background: var(--bg-2); padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-grid p { margin: 0 0 6px; }
.footer-grid a { text-decoration: none; color: var(--muted); }
.footer-grid a:hover { color: var(--text); }
.foot-h { font-size: 1.1rem; margin-bottom: 12px; }
.foot-base { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 20px; font-size: 0.9rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
