/* ============================================================
   Alpine Hvac — Chicago, IL
   Palette: cafe warmth (latte base, coffee ink, burgundy, olive)
   ============================================================ */

:root {
  --bg: #f4ead8;
  --bg-alt: #efe2cb;
  --ink: #3a2415;
  --ink-soft: #6b5540;
  --accent: #6b1f1a;
  --accent-strong: #4a1410;
  --on-accent: #fdf6ea;
  --on-accent-soft: rgba(253, 246, 234, 0.86);
  --secondary: #5a5e3a;
  --rule: rgba(58, 36, 21, 0.18);
  --warm-light: rgba(255, 214, 150, 0.55);
  --card: #fbf4e7;
  --shadow: 0 1px 0 rgba(58, 36, 21, 0.06), 0 18px 40px -28px rgba(58, 36, 21, 0.45);
  --glow-y: 12%;
  --maxw: 1180px;
  --pad: clamp(1.25rem, 5vw, 4rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b120b;
    --bg-alt: #221710;
    --ink: #f2e4cf;
    --ink-soft: #c2ab90;
    --accent: #e08a6f;
    --accent-strong: #f0a184;
    --secondary: #a8ad7c;
    --rule: rgba(242, 228, 207, 0.18);
    --warm-light: rgba(255, 176, 96, 0.22);
    --card: #241811;
    --on-accent: #2a1008;
    --on-accent-soft: rgba(42, 16, 8, 0.82);
    --muted: #c2ab90;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 18px 40px -28px rgba(0, 0, 0, 0.8);
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Bricolage Grotesque", system-ui, -apple-system, sans-serif;
  font-optical-sizing: auto;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--accent); }

h1, h2, h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 0.9em; }
p:last-child { margin-bottom: 0; }

.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;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--accent); color: var(--on-accent); padding: 0.6rem 1rem;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

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

/* ---------- ambient glow that follows scroll ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    circle at 50% var(--glow-y),
    var(--warm-light) 0,
    transparent 60%
  );
  transition: background 0.15s linear;
}

/* ============================================================
   HEADER
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem var(--pad);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  animation: slide-down 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.wordmark em { font-style: italic; color: var(--accent); }
.mark { color: var(--secondary); font-size: 0.85rem; }

.nav {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.5rem 0.15rem;
  border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.call-btn {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  min-height: 44px;
  align-items: center;
  padding: 0.55rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  border-radius: 2px;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}
.call-btn .call-label { color: var(--on-accent-soft); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; }
.call-btn .call-num { color: var(--on-accent); font-weight: 600; }
.call-btn:hover { background: var(--accent-strong); }

/* ============================================================
   HERO — diagonal split, opposing scroll
   ============================================================ */
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  padding: clamp(2.5rem, 7vw, 5.5rem) var(--pad) clamp(3rem, 8vw, 6rem);
  max-width: var(--maxw);
  margin: 0 auto;
}

.hero-copy { max-width: 34rem; }

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 0.9rem;
}

/* kinetic weight shift on hover */
.kinetic {
  font-size: clamp(3rem, 12vw, 6.5rem);
  font-variation-settings: "wght" 200, "SOFT" 0, "WONK" 0;
  transition: font-variation-settings 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}
.kinetic:hover,
.kinetic:focus-visible {
  font-variation-settings: "wght" 900, "SOFT" 40, "WONK" 1;
}

.lede {
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  color: var(--ink-soft);
  max-width: 32rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 1.25rem;
}

.btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0.8rem 1.4rem;
  text-decoration: none;
  border-radius: 2px;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}
.btn-primary { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { border: 1px solid var(--rule); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--secondary);
  flex: 0 0 auto;
}

/* the split */
.hero-split {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  min-height: clamp(280px, 46vw, 520px);
}

.panel {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: var(--shadow);
  will-change: transform;
}
.panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: clamp(280px, 46vw, 520px);
}
.panel-a { transform: translateY(var(--shift-a, 0)); }
.panel-b { transform: translateY(var(--shift-b, 0)); }

.split-rule {
  position: absolute;
  inset: -6% -4%;
  pointer-events: none;
  background: var(--bg);
  clip-path: polygon(48% 0, 56% 0, 44% 100%, 36% 100%);
  opacity: 0.92;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  position: relative;
  z-index: 1;
  padding: clamp(3rem, 8vw, 6rem) var(--pad);
  max-width: var(--maxw);
  margin: 0 auto;
}
.section-alt {
  max-width: none;
  background: var(--bg-alt);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.section-alt > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }

.section-head { max-width: 44rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-head h2 {
  font-size: clamp(1.75rem, 4.2vw, 2.9rem);
  margin-bottom: 0.75rem;
}
.section-intro { color: var(--ink-soft); }

/* ---------- museum wall labels ---------- */
.wall {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
}
.wall-tight { gap: clamp(2rem, 4vw, 3rem); }

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

.work-media {
  overflow: hidden;
  border-radius: 2px;
  box-shadow: var(--shadow);
  background: var(--card);
}
.work-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.label h3 {
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  margin-bottom: 0.4rem;
}
.label .meta {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 0.7rem;
}
.label p:not(.meta) { color: var(--ink-soft); font-size: 0.95rem; }

/* ============================================================
   HOURS
   ============================================================ */
.hours-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
}

.hours {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
.hours th, .hours td {
  text-align: left;
  padding: 0.7rem 0.25rem;
  border-bottom: 1px solid var(--rule);
}
.hours th { font-weight: 500; color: var(--ink-soft); }
.hours td { text-align: right; color: var(--secondary); font-variant-numeric: tabular-nums; }

.hours-aside h3 { font-size: 1.2rem; margin-bottom: 0.9rem; }
.checklist { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.checklist li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.6rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.checklist li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}
.aside-note {
  border-left: 3px solid var(--accent);
  padding-left: 0.9rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ============================================================
   VISIT
   ============================================================ */
.visit-grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
}
.visit-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: clamp(1.25rem, 3vw, 1.9rem);
}
.visit-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
}
.visit-card address { font-style: normal; line-height: 1.7; }
.visit-card .meta {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary);
  margin: 0.75rem 0;
}
.wayfinding { font-size: 0.95rem; color: var(--ink-soft); }
.big-phone {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 0.25rem 0;
}
.big-phone a { text-decoration: none; }
.big-phone a:hover { text-decoration: underline; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  position: relative;
  z-index: 1;
  padding: clamp(2.5rem, 6vw, 4rem) var(--pad) 5rem;
  border-top: 1px solid var(--rule);
  background: var(--bg-alt);
}
.footer-inner { max-width: var(--maxw); margin: 0 auto; }
.footer-name {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
}
.footer-line { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 1.5rem; }

.claim-banner {
  display: inline-block;
  font-size: 0.78rem;
  padding: 0.45rem 0.8rem;
  background: color-mix(in srgb, var(--secondary) 14%, transparent);
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink-soft);
  text-decoration: none;
}
.claim-banner:hover { color: var(--accent); border-color: var(--accent); }

.attribution {
  position: fixed;
  bottom: 0.5rem;
  right: 0.75rem;
  z-index: 30;
  font-size: 0.7rem;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
}
.attribution a { color: var(--muted); text-decoration: none; }
.attribution a:hover { color: var(--ink); text-decoration: underline; }

/* ============================================================
   PAGE-LOAD ORCHESTRATION (one-shot, then still)
   ============================================================ */
@keyframes slide-down {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes rise-in {
  from { transform: translateY(1.5rem); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes type-in {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.hero-copy .eyebrow { animation: fade-in 0.6s ease-out 0.15s both; }
.hero-copy .kinetic { animation: type-in 0.9s cubic-bezier(0.65, 0, 0.35, 1) 0.3s both; }
.hero-copy .lede    { animation: rise-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.75s both; }
.hero-copy .hero-actions { animation: rise-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.87s both; }
.hero-copy .hero-note    { animation: rise-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.99s both; }
.hero-split { animation: fade-in 1s ease-out 0.45s both; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 720px) {
  .wall { grid-template-columns: repeat(2, 1fr); }
  .work { grid-template-columns: 1fr; }
  .hours-grid { grid-template-columns: 1.1fr 1fr; }
  .visit-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1000px) {
  .hero {
    grid-template-columns: 1fr 1.05fr;
    align-items: center;
  }
  .wall { grid-template-columns: repeat(3, 1fr); }
  .wall-tight { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 719px) {
  .nav { order: 3; width: 100%; margin-left: 0; gap: 1rem; overflow-x: auto; }
  .call-btn { margin-left: auto; }
  .hero-split { grid-template-columns: 1fr; }
  .panel-b { display: none; }
  .split-rule { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .panel-a, .panel-b { transform: none !important; }
  .kinetic { font-variation-settings: "wght" 600; }
}
