/* ============================================================
   Garage mécanique automobile — Thiès
   Palette: cafe warmth · Typography: oversized display serif
   Layout: index card stack · Signature: diagonal split
   ============================================================ */

:root {
  --bg: #f4ead8;
  --bg-alt: #efe0c6;
  --ink: #3a2415;
  --ink-soft: #6b543f;
  --accent: #6b1f1a;
  --secondary: #5a5e3a;
  --card: #fbf5e9;
  --rule: rgba(58, 36, 21, 0.22);
  --shadow-hard: 4px 4px 0 rgba(58, 36, 21, 0.85);
  --on-dark: #f4ead8;
  --on-dark-soft: rgba(244, 234, 216, 0.72);
  --maxw: 1180px;
  --pad: clamp(1.1rem, 4vw, 3.5rem);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="dark"] {
  --bg: #1c1410;
  --bg-alt: #241a13;
  --ink: #f0e4d2;
  --ink-soft: #b9a58d;
  --accent: #d98a72;
  --secondary: #a8ad7c;
  --card: #2a1e16;
  --rule: rgba(240, 228, 210, 0.24);
  --shadow-hard: 4px 4px 0 rgba(0, 0, 0, 0.75);
  --on-dark: #f0e4d2;
  --on-dark-soft: rgba(240, 228, 210, 0.72);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  line-height: 1.6;
  font-variation-settings: "opsz" 14;
  transition: background-color 0.35s ease, color 0.35s ease;
  overflow-x: hidden;
}

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

a { color: var(--accent); text-underline-offset: 3px; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- view transitions ---------- */
@view-transition { navigation: auto; }

::view-transition-old(root) {
  animation: vt-out 0.32s cubic-bezier(0.4, 0, 1, 1) both;
}
::view-transition-new(root) {
  animation: vt-in 0.42s cubic-bezier(0, 0, 0.2, 1) both;
}
@keyframes vt-out {
  to { opacity: 0; transform: translateY(-14px) scale(0.99); }
}
@keyframes vt-in {
  from { opacity: 0; transform: translateY(18px) scale(0.99); }
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.7rem var(--pad);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  flex: 0 0 40px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  border-radius: 3px;
  box-shadow: var(--shadow-hard);
}

.brand-text {
  font-size: 0.78rem;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 600;
}
.brand-text em {
  font-style: normal;
  font-weight: 400;
  color: var(--ink-soft);
  letter-spacing: 0.14em;
}

.nav {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
}
.nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  padding: 0.55rem 0.15rem;
  border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--accent); color: var(--accent); }

.topbar-actions { display: flex; align-items: center; gap: 0.6rem; }

.theme-toggle {
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--ink);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.theme-toggle .tt-moon { display: none; }
html[data-theme="dark"] .theme-toggle .tt-sun { display: none; }
html[data-theme="dark"] .theme-toggle .tt-moon { display: inline; }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.call-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 3px;
  box-shadow: var(--shadow-hard);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.call-btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 rgba(58, 36, 21, 0.85); }
html[data-theme="dark"] .call-btn:hover { box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.75); }
.call-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.25; } }

/* ---------- hero: diagonal split ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(3rem, 9vw, 7rem) var(--pad) 0;
  overflow: hidden;
  isolation: isolate;
}

.hero-split {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.split-panel { overflow: hidden; }

.split-a {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 78%);
  transform: translateY(calc(var(--scroll, 0) * -0.06px));
  will-change: transform;
}
.split-b {
  clip-path: polygon(0 0, 100% 0, 100% 78%, 0 100%);
  transform: translateY(calc(var(--scroll, 0) * 0.06px));
  will-change: transform;
}

.split-panel img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.72) contrast(1.06) sepia(0.12);
}

.hero-split::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--bg) 42%, transparent) 0%,
    color-mix(in srgb, var(--bg) 72%, transparent) 46%,
    color-mix(in srgb, var(--bg) 96%, transparent) 100%
  );
}

.hero-inner {
  position: relative;
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
}

.eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.9rem;
}

.display {
  font-family: var(--font-display);
  font-size: clamp(4rem, 18vw, 22rem);
  line-height: 0.85;
  margin: 0 0 -0.4em;
  font-weight: 600;
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 1;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-wrap: balance;
}

.hero-lede {
  position: relative;
  max-width: 46ch;
  margin-left: auto;
  padding-top: 1.4rem;
  border-top: 2px solid var(--ink);
}
.hero-lede p { margin: 0 0 1rem; }
.hero-lede p:first-child { font-size: 1.02rem; }

.hero-cta-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 3px;
  border: 2px solid var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  box-shadow: var(--shadow-hard);
}
.btn-primary:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 rgba(58, 36, 21, 0.85); }
html[data-theme="dark"] .btn-primary:hover { box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.75); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }

.hero-strip {
  position: relative;
  max-width: var(--maxw);
  width: 100%;
  margin: 2.6rem auto 0;
  padding: 1rem 0 1.4rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- generic section ---------- */
.section {
  padding: clamp(3.5rem, 9vw, 7rem) var(--pad);
  transition: background-color 0.4s ease;
}

.section > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }

.section-head { margin-bottom: clamp(2rem, 5vw, 3.4rem); }

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 5.2rem);
  line-height: 0.94;
  margin: 0 0 0.6rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 96;
  text-wrap: balance;
}

.section-note {
  max-width: 58ch;
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0;
}

.section-dark {
  background: var(--ink);
  color: var(--on-dark);
}
.section-dark .section-note,
.section-dark .eyebrow { color: var(--on-dark-soft); }
.section-dark .eyebrow { color: var(--secondary); }
html[data-theme="dark"] .section-dark { background: #120d09; }
html[data-theme="dark"] .section-dark .eyebrow { color: var(--secondary); }
.section-dark a { color: var(--on-dark); }

/* ---------- index card stack ---------- */
.card-stack {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.6rem;
}

.card {
  position: relative;
  background: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  padding: 1.9rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-hard);
  transform: rotate(-1deg);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.card:nth-child(even) { transform: rotate(1deg); }
.card:hover {
  transform: rotate(0deg) translate(-3px, -3px);
  box-shadow: 8px 8px 0 rgba(58, 36, 21, 0.85);
}
html[data-theme="dark"] .card { border-color: var(--rule); }
html[data-theme="dark"] .card:hover { box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.75); }

.punch {
  position: absolute;
  top: 0.85rem;
  left: 50%;
  transform: translateX(-50%);
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1.5px solid var(--ink);
  box-shadow: inset 0 1px 2px rgba(58, 36, 21, 0.45);
}
html[data-theme="dark"] .punch { border-color: var(--rule); }

.card-body h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.1;
  margin: 0 0 0.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-body p {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.card-body .price {
  margin: 0;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--rule);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.01em;
}

/* ---------- atelier ---------- */
.atelier-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(1.6rem, 4vw, 3.4rem);
  align-items: start;
}

.atelier-copy p { margin: 0 0 1.1rem; color: var(--on-dark-soft); }
.atelier-copy p:first-child { color: var(--on-dark); font-size: 1.06rem; }

.atelier-figure { margin: 0; }
.atelier-figure img {
  border: 1.5px solid var(--on-dark);
  border-radius: 3px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: saturate(0.8) contrast(1.05);
}
.atelier-figure figcaption,
.zone-figure figcaption,
.gallery figcaption {
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--on-dark-soft);
  margin-top: 0.6rem;
  line-height: 1.45;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.2rem;
  margin-top: clamp(2.4rem, 5vw, 3.6rem);
  padding-top: 1.8rem;
  border-top: 1px solid rgba(244, 234, 216, 0.28);
}
.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1;
  font-weight: 600;
  color: var(--secondary);
}
.stat span {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-dark-soft);
}

/* ---------- steps ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1.6rem;
  counter-reset: step;
}
.steps li {
  border-top: 2px solid var(--ink);
  padding-top: 1.1rem;
}
.step-num {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.steps h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
  font-weight: 600;
}
.steps p { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }

/* ---------- zone ---------- */
.zone-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr;
  gap: clamp(1.6rem, 4vw, 3rem);
  align-items: start;
}
.zone-col h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(244, 234, 216, 0.3);
  font-weight: 600;
}
.zone-col ul { list-style: none; margin: 0; padding: 0; }
.zone-col li {
  padding: 0.42rem 0;
  font-size: 0.92rem;
  color: var(--on-dark-soft);
  border-bottom: 1px dotted rgba(244, 234, 216, 0.18);
}
.zone-figure { margin: 0; }
.zone-figure img {
  border: 1.5px solid var(--on-dark);
  border-radius: 3px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: saturate(0.8) contrast(1.05);
}

/* ---------- gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.6rem;
}
.gallery figure { margin: 0; }
.gallery img {
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  box-shadow: var(--shadow-hard);
  filter: saturate(0.82) contrast(1.04);
  transition: transform 0.25s ease;
}
.gallery figure:hover img { transform: translate(-3px, -3px); }
.gallery figcaption { color: var(--ink-soft); }

/* ---------- hours ---------- */
.hours-wrap {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(1.8rem, 4vw, 3.4rem);
  align-items: start;
}
.hours {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
}
.hours th, .hours td {
  text-align: left;
  padding: 0.85rem 0.4rem;
  border-bottom: 1px solid rgba(244, 234, 216, 0.22);
}
.hours th {
  font-weight: 500;
  color: var(--on-dark);
  width: 40%;
}
.hours td { color: var(--on-dark-soft); font-variant-numeric: tabular-nums; }
.hours tr.closed td { color: var(--secondary); font-style: italic; }

.hours-note {
  background: rgba(244, 234, 216, 0.07);
  border: 1px solid rgba(244, 234, 216, 0.24);
  border-radius: 3px;
  padding: 1.4rem;
}
.hours-note h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 0.6rem;
  font-weight: 600;
}
.hours-note p { margin: 0 0 0.8rem; font-size: 0.9rem; color: var(--on-dark-soft); }
.hours-note-small { font-size: 0.82rem !important; opacity: 0.85; margin-bottom: 0 !important; }

/* ---------- contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: 1.6rem;
}
.contact-block {
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  padding: 1.7rem 1.5rem;
  box-shadow: var(--shadow-hard);
}
html[data-theme="dark"] .contact-block { border-color: var(--rule); }
.contact-block h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0 0 0.8rem;
  font-weight: 600;
}
.contact-block address {
  font-style: normal;
  font-size: 0.98rem;
  line-height: 1.55;
  margin-bottom: 0.9rem;
}
.contact-hint { font-size: 0.87rem; color: var(--ink-soft); margin: 0 0 1.1rem; }

.phone-big {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 2.9rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 0.7rem;
}
.phone-big:hover { text-decoration: underline; }

.pay-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.pay-list li {
  padding: 0.4rem 0;
  border-bottom: 1px dotted var(--rule);
  font-size: 0.94rem;
}

/* ---------- footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--on-dark);
  padding: clamp(2.4rem, 5vw, 3.6rem) var(--pad) 1.6rem;
}
html[data-theme="dark"] .site-footer { background: #120d09; }

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem 2.4rem;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid rgba(244, 234, 216, 0.22);
}
.footer-brand { display: flex; align-items: center; gap: 0.7rem; }
.footer-brand p { margin: 0; font-size: 0.84rem; line-height: 1.35; }
.footer-brand em { font-style: normal; color: var(--on-dark-soft); letter-spacing: 0.08em; }

.footer-nav { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.footer-nav a {
  color: var(--on-dark-soft);
  text-decoration: none;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
}
.footer-nav a:hover { color: var(--on-dark); text-decoration: underline; }

.footer-legal {
  font-size: 0.8rem;
  color: var(--on-dark-soft);
  margin: 0;
  width: 100%;
}
.footer-legal a { color: var(--on-dark); }

.claim-row {
  max-width: var(--maxw);
  margin: 1.2rem auto 0.6rem;
  text-align: center;
}
.claim-banner {
  display: inline-block;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--on-dark-soft);
  background: rgba(244, 234, 216, 0.08);
  border: 1px solid rgba(244, 234, 216, 0.2);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  text-decoration: none;
}
.claim-banner:hover { color: var(--on-dark); border-color: var(--on-dark-soft); }

.attribution {
  max-width: var(--maxw);
  margin: 0.4rem auto 0;
  text-align: center;
  font-size: 0.74rem;
}
.attribution a { color: var(--on-dark-soft); text-decoration: none; }
.attribution a:hover { text-decoration: underline; }
.muted { color: var(--on-dark-soft); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .atelier-grid,
  .zone-grid,
  .hours-wrap { grid-template-columns: 1fr; }
  .hero-lede { margin-left: 0; }
  .display { margin-bottom: -0.28em; }
}

@media (max-width: 720px) {
  .nav { display: none; }
  .hero { min-height: auto; padding-top: 3rem; }
  .hero-split { grid-template-columns: 1fr; }
  .split-a { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 62%); }
  .split-b { display: none; }
  .hero-strip { gap: 0.5rem 1.2rem; font-size: 0.7rem; }
  .card { transform: none; }
  .card:nth-child(even) { transform: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .brand-text { display: none; }
  .call-btn { padding: 0.6rem 0.85rem; font-size: 0.78rem; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .split-a, .split-b { transform: none !important; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none !important; }
}
