/* ============================================================
   DNA Mobile Mechanic — Brampton, ON
   Composition: cafe warmth palette, oversized display serif,
   museum-wall labels, hover-swap H1, section bg hard-swap.
   ============================================================ */

:root {
  --bg: #f4ead8;
  --ink: #3a2415;
  --accent: #6b1f1a;
  --secondary: #5a5e3a;

  --ink-soft: rgba(58, 36, 21, 0.72);
  --ink-faint: rgba(58, 36, 21, 0.5);
  --rule: rgba(58, 36, 21, 0.18);
  --paper: #fbf5e9;
  --paper-edge: rgba(58, 36, 21, 0.12);

  --pad-x: clamp(1.15rem, 5vw, 5rem);
  --maxw: 1240px;

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- dark theme ---------- */
html[data-theme="dark"] {
  --bg: #1c1410;
  --ink: #f0e3cf;
  --accent: #e08a6f;
  --secondary: #b6bb84;

  --ink-soft: rgba(240, 227, 207, 0.74);
  --ink-faint: rgba(240, 227, 207, 0.5);
  --rule: rgba(240, 227, 207, 0.2);
  --paper: #261c16;
  --paper-edge: rgba(240, 227, 207, 0.14);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #1c1410;
    --ink: #f0e3cf;
    --accent: #e08a6f;
    --secondary: #b6bb84;
    --ink-soft: rgba(240, 227, 207, 0.74);
    --ink-faint: rgba(240, 227, 207, 0.5);
    --rule: rgba(240, 227, 207, 0.2);
    --paper: #261c16;
    --paper-edge: rgba(240, 227, 207, 0.14);
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.45s var(--ease), color 0.45s var(--ease);
}

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

a { color: inherit; }

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

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

/* ---------- shared type ---------- */
.eyebrow {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1.1rem;
}

.label {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}

.wall-title {
  font-family: var(--serif);
  font-weight: 500;
  font-variation-settings: "opsz" 100, "SOFT" 20;
  font-size: clamp(2.4rem, 7vw, 5.2rem);
  line-height: 0.94;
  letter-spacing: -0.02em;
  margin: 0 0 1.4rem;
  text-wrap: balance;
}

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

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  margin-right: auto;
}

.mark {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.wordmark-text {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.05;
  display: flex;
  flex-direction: column;
}

.wordmark-text em {
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.topnav {
  display: none;
  gap: 1.4rem;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

.topnav a {
  text-decoration: none;
  color: var(--ink-soft);
  padding: 0.5rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.topnav a:hover { color: var(--accent); border-bottom-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: 50%;
  cursor: pointer;
  color: var(--ink);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.theme-toggle:hover { border-color: var(--accent); }

.theme-icon {
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: inset -4px -3px 0 0 var(--bg);
  transition: box-shadow 0.25s var(--ease), background-color 0.25s var(--ease);
}

html[data-theme="dark"] .theme-icon {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--accent);
}

.call-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 0.95rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), filter 0.2s var(--ease);
}

.call-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.call-btn-label { display: none; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: clamp(2.5rem, 7vw, 5rem) var(--pad-x) clamp(3rem, 8vw, 6rem);
  max-width: var(--maxw);
  margin: 0 auto;
}

.hero-inner { position: relative; }

.hero-title {
  position: relative;
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 1;
  font-size: clamp(3.6rem, 17vw, 15rem);
  line-height: 0.85;
  letter-spacing: -0.035em;
  margin: 0 0 -0.28em;
  cursor: default;
  text-wrap: balance;
}

.hero-title span {
  display: block;
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
}

.hero-title .alt {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(0.12em);
  color: var(--accent);
  font-style: italic;
  pointer-events: none;
}

.hero-title:hover .default,
.hero-title:focus-visible .default { opacity: 0; transform: translateY(-0.12em); }

.hero-title:hover .alt,
.hero-title:focus-visible .alt { opacity: 1; transform: translateY(0); }

.hero-cols {
  position: relative;
  display: grid;
  gap: 1.8rem;
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
  border-top: 1px solid var(--rule);
}

.hero-lede {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(1rem, 0.95rem + 0.35vw, 1.2rem);
  color: var(--ink-soft);
}

.hero-facts {
  display: grid;
  gap: 0.7rem;
  align-content: start;
}

.hero-facts p {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  align-items: baseline;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--rule);
}

.fact-k {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  min-width: 6.5rem;
}

.fact-v {
  font-family: var(--serif);
  font-size: 1.05rem;
  text-decoration: none;
}

a.fact-v { border-bottom: 1px solid var(--accent); color: var(--accent); }

.hero-figure {
  margin: clamp(2.5rem, 6vw, 4.5rem) 0 0;
  display: grid;
  gap: 0.7rem;
}

.hero-figure img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--paper-edge);
  filter: saturate(0.92) contrast(1.02);
}

/* ============================================================
   MUSEUM WALL SECTIONS
   ============================================================ */
.wall, .how, .about, .hours, .visit {
  padding: clamp(3.5rem, 9vw, 7rem) var(--pad-x);
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

.wall > *, .how > *, .about > *, .hours > *, .visit > * {
  max-width: var(--maxw);
  margin-inline: auto;
}

.wall-head { margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }

.wall-note {
  max-width: 58ch;
  color: var(--ink-soft);
  margin: 0;
}

/* sections that hard-swap to a dark bg get inverted ink */
.wall, .how, .hours { color: var(--bg); }
.wall .eyebrow, .how .eyebrow, .hours .eyebrow { color: color-mix(in srgb, var(--bg) 62%, transparent); }
.wall .wall-note, .how .wall-note, .hours .wall-note { color: color-mix(in srgb, var(--bg) 78%, transparent); }
.wall .label, .how .label, .hours .label { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.wall .work-meta, .how .step-num { color: color-mix(in srgb, var(--bg) 68%, transparent); }
.wall .work-body, .how .step p, .hours .hours-foot { color: color-mix(in srgb, var(--bg) 82%, transparent); }

/* ---------- works grid (museum labels) ---------- */
.works {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
}

.work {
  display: grid;
  gap: 1.1rem;
  align-items: start;
}

.work-figure { margin: 0; overflow: hidden; }

.work-figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid color-mix(in srgb, var(--bg) 22%, transparent);
  filter: saturate(0.9);
  transition: transform 0.7s var(--ease), filter 0.5s var(--ease);
}

.work:hover .work-figure img { transform: scale(1.025); filter: saturate(1); }

.work-label h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0.35rem 0 0.7rem;
}

.work-body { margin: 0 0 0.8rem; font-size: 0.95rem; }

.work-meta {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding-top: 0.7rem;
  border-top: 1px solid color-mix(in srgb, var(--bg) 22%, transparent);
}

/* ---------- how it works ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(1.8rem, 4vw, 2.6rem);
  counter-reset: step;
}

.step {
  padding-top: 1.2rem;
  border-top: 1px solid color-mix(in srgb, var(--bg) 26%, transparent);
}

.step-num {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 0.6rem;
}

.step h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.3rem, 2.6vw, 1.85rem);
  line-height: 1.12;
  margin: 0 0 0.6rem;
}

.step p { margin: 0; font-size: 0.95rem; }

.how-foot {
  margin: clamp(2.5rem, 5vw, 3.5rem) auto 0;
  max-width: 62ch;
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  line-height: 1.35;
  font-style: italic;
  color: color-mix(in srgb, var(--bg) 90%, transparent);
}

/* ---------- about ---------- */
.about-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}

.about-copy p { max-width: 60ch; color: var(--ink-soft); }
.about-copy p + p { margin-top: 1rem; }

.about-side { display: grid; gap: 1.6rem; }

.side-block {
  padding: 1.2rem 1.3rem;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
}

.plain-list {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.plain-list li {
  padding-left: 1rem;
  position: relative;
}

.plain-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 1px;
  background: var(--secondary);
}

/* ---------- hours ---------- */
.hours-table {
  width: 100%;
  max-width: 640px;
  border-collapse: collapse;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2.2vw, 1.5rem);
}

.hours-table th,
.hours-table td {
  text-align: left;
  padding: 0.7rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--bg) 24%, transparent);
  font-weight: 400;
}

.hours-table th { width: 45%; }
.hours-table td { color: color-mix(in srgb, var(--bg) 82%, transparent); }
.hours-table .weekend th,
.hours-table .weekend td { color: var(--bg); }

.hours-foot {
  margin: 1.6rem 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

/* ---------- visit ---------- */
.visit-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}

.visit-lede { max-width: 52ch; color: var(--ink-soft); margin: 0 0 1.8rem; }

.big-call {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  text-decoration: none;
  padding: 1.1rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  transition: transform 0.25s var(--ease), filter 0.25s var(--ease);
}

.big-call:hover { transform: translateY(-2px); filter: brightness(1.07); }

.big-call-k {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.82;
}

.big-call-v {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 4vw, 2.3rem);
  line-height: 1.05;
}

.visit-dl {
  margin: 2.2rem 0 0;
  display: grid;
  gap: 1.3rem;
  max-width: 56ch;
}

.visit-dl dt {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.3rem;
}

.visit-dl dd { margin: 0; color: var(--ink-soft); }

.visit-note {
  margin: 2rem 0 0;
  max-width: 52ch;
  font-size: 0.85rem;
  padding: 0.9rem 1.1rem;
  border-left: 2px solid var(--secondary);
  background: var(--paper);
  color: var(--ink-soft);
}

.visit-map { display: grid; gap: 0.7rem; }

.visit-map iframe {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--paper-edge);
  filter: saturate(0.85) contrast(1.02);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-foot {
  padding: clamp(2.5rem, 6vw, 4rem) var(--pad-x) clamp(3rem, 6vw, 4rem);
  border-top: 1px solid var(--rule);
  background: var(--paper);
}

.foot-inner { max-width: var(--maxw); margin-inline: auto; }

.foot-name {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 0 0 0.4rem;
}

.foot-line { margin: 0 0 0.3rem; color: var(--ink-soft); font-size: 0.9rem; }
.foot-line a { color: var(--accent); }
.foot-small { font-size: 0.8rem; color: var(--ink-faint); }

.claim-banner {
  display: inline-block;
  margin: 1.6rem 0 0.9rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border: 1px solid var(--rule);
  border-radius: 3px;
  text-decoration: none;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.claim-banner:hover { border-color: var(--accent); color: var(--accent); }

.attribution {
  margin: 0;
  font-size: 0.72rem;
  color: var(--ink-faint);
}

.attribution a { color: inherit; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 700px) {
  .hero-cols { grid-template-columns: 1.35fr 1fr; gap: 3rem; }
  .work { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 2rem; }
  .work:nth-child(even) .work-figure { order: 2; }
  .work:nth-child(even) .work-label { order: 1; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .about-grid { grid-template-columns: 1.5fr 1fr; }
  .visit-grid { grid-template-columns: 1.1fr 0.9fr; }
  .call-btn-label { display: inline; }
}

@media (min-width: 1000px) {
  .topnav { display: flex; }
  .works { gap: 5rem; }
  .work { grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr); gap: 3.5rem; }
}

/* ============================================================
   MOTION — view transitions + reduced motion
   ============================================================ */
@view-transition { navigation: auto; }

::view-transition-old(root) {
  animation: vt-out 0.32s var(--ease) both;
}

::view-transition-new(root) {
  animation: vt-in 0.42s var(--ease) both;
}

@keyframes vt-out {
  to { opacity: 0; transform: translateY(-1.2rem); }
}

@keyframes vt-in {
  from { opacity: 0; transform: translateY(1.2rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none !important; }

  .hero-title .alt { position: static; opacity: 1; transform: none; }
  .hero-title .default { display: none; }
  .work:hover .work-figure img { transform: none; }
}
