/* ============================================================
   Plumbing Philadelphia Co
   warm earth editorial · diagonal split · expandable index
   ============================================================ */

:root {
  --bg: #f5efe4;
  --bg-2: #efe6d7;
  --ink: #2b1e14;
  --ink-soft: #5b4a3a;
  --accent: #c25a37;
  --accent-ink: #8f3d20;
  --secondary: #6a7a4a;
  --line: rgba(43, 30, 20, 0.16);
  --line-strong: rgba(43, 30, 20, 0.3);
  --card: rgba(255, 253, 248, 0.72);
  --shadow: 0 1px 2px rgba(43, 30, 20, 0.06), 0 12px 32px -18px rgba(43, 30, 20, 0.35);
  --grain-opacity: 0.05;
  --radius: 4px;
  --maxw: 1180px;
  --font-display: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', 'Inter', system-ui, sans-serif;
}

html[data-theme="dark"] {
  --bg: #17120d;
  --bg-2: #1f1811;
  --ink: #f3e9da;
  --ink-soft: #c3b3a0;
  --accent: #e07a52;
  --accent-ink: #f0a184;
  --secondary: #9aab72;
  --line: rgba(243, 233, 218, 0.16);
  --line-strong: rgba(243, 233, 218, 0.32);
  --card: rgba(255, 250, 242, 0.05);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 18px 40px -22px rgba(0, 0, 0, 0.8);
  --grain-opacity: 0.075;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 6.4vw, 4.6rem); }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.7rem); }
h3 { font-size: 1.15rem; line-height: 1.3; }
p { margin: 0 0 1em; max-width: 68ch; text-wrap: pretty; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--secondary);
  margin: 0 0 0.9rem;
}
.eyebrow--light { color: #b9c98f; }

/* ---------- animated noise field ---------- */
.noise-defs { position: absolute; width: 0; height: 0; }
.grain {
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grain-opacity);
  filter: url(#grain);
  background: #808080;
  will-change: transform;
  animation: drift 26s steps(6, end) infinite;
}
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0); }
  25%  { transform: translate3d(-2%, 1.5%, 0); }
  50%  { transform: translate3d(1.5%, -1%, 0); }
  75%  { transform: translate3d(-1%, -2%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
main, .topbar, .site-footer { position: relative; z-index: 1; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.7rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 0.7rem;
  text-decoration: none; color: inherit; margin-right: auto;
}
.brand-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  background: var(--ink); color: var(--bg);
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; }
.brand-text em {
  font-style: normal; font-size: 0.68rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-soft);
}
.topnav { display: flex; gap: 1.15rem; }
.topnav a {
  font-size: 0.86rem; color: var(--ink-soft); text-decoration: none;
  padding: 0.5rem 0; border-bottom: 1px solid transparent;
}
.topnav a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.topbar-actions { display: flex; align-items: center; gap: 0.6rem; }

.theme-toggle {
  display: inline-flex; align-items: center; gap: 0.45rem;
  min-height: 44px; padding: 0 0.85rem;
  background: transparent; color: var(--ink-soft);
  border: 1px solid var(--line-strong); border-radius: 999px;
  font: inherit; font-size: 0.8rem; cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--accent); }
.theme-toggle-icon {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--ink);
  box-shadow: inset -4px -2px 0 0 var(--bg);
}
html[data-theme="dark"] .theme-toggle-icon {
  background: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}

.call-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 44px; padding: 0 1.05rem;
  background: var(--ink); color: var(--bg);
  border-radius: 999px; text-decoration: none;
  font-size: 0.88rem; font-weight: 600; letter-spacing: 0.01em;
  transition: transform 0.2s, background 0.2s;
}
.call-btn:hover { color: var(--bg); background: var(--accent-ink); transform: translateY(-1px); }
.call-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--secondary);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.5rem;
  border-radius: var(--radius); text-decoration: none;
  font-size: 0.95rem; font-weight: 600; letter-spacing: 0.01em;
  transition: transform 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
}
.btn--primary { background: var(--accent); color: #fffaf4; }
.btn--primary:hover { background: var(--accent-ink); color: #fffaf4; transform: translateY(-2px); }
.btn--ghost { border: 1px solid var(--line-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }

/* ============================================================
   HERO — diagonal split
   ============================================================ */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  position: relative;
  isolation: isolate;
}
.hero-slice { position: relative; padding: clamp(2.5rem, 7vw, 5.5rem) clamp(1.25rem, 5vw, 3.5rem); }
.hero-slice--paper { background: var(--bg); }
.hero-slice--ink {
  background: var(--ink);
  color: var(--bg);
  display: flex; flex-direction: column; gap: 1.25rem;
  justify-content: center;
}
.hero-inner { max-width: 34rem; margin-left: auto; }
.hero h1 { margin-bottom: 1rem; }

/* kinetic hero — weight shifts with scroll */
@keyframes weigh {
  from { font-variation-settings: 'wght' 260, 'opsz' 100; }
  to   { font-variation-settings: 'wght' 780, 'opsz' 20; }
}
@supports (animation-timeline: scroll()) {
  .hero h1 {
    animation: weigh linear both;
    animation-timeline: scroll(root);
    animation-range: 0 42vh;
  }
}
.hero-lede { font-size: 1.08rem; color: var(--ink-soft); max-width: 30rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.75rem 0 2.25rem; }
.hero-facts {
  list-style: none; margin: 0; padding: 1.25rem 0 0;
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
.hero-facts li { display: flex; flex-direction: column; gap: 0.15rem; }
.hero-facts strong {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 600;
  color: var(--accent-ink); line-height: 1;
}
.hero-facts span { font-size: 0.76rem; line-height: 1.4; color: var(--ink-soft); }

.hero-figure { margin: 0; max-width: 34rem; }
.hero-figure img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius);
  filter: saturate(0.92) contrast(1.04);
}
.hero-figure figcaption {
  margin-top: 0.7rem; font-size: 0.78rem; letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--bg) 62%, transparent);
}
.hero-stamp {
  margin: 0; font-family: var(--font-display); font-style: italic;
  font-size: 1.05rem; color: #b9c98f; max-width: 30rem;
}

@media (min-width: 900px) {
  .hero { grid-template-columns: 1fr 1fr; }
  .hero-slice--paper {
    clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%);
    padding-right: clamp(4rem, 9vw, 8rem);
  }
  .hero-slice--ink {
    margin-left: -8%;
    clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%);
    padding-left: clamp(4rem, 9vw, 8rem);
  }
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1.25rem, 5vw, 2.5rem);
}
.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-lede { color: var(--ink-soft); }

/* ---------- expandable index ---------- */
.index { border-top: 1px solid var(--line-strong); }
.entry { border-bottom: 1px solid var(--line); }
.entry summary {
  display: flex; align-items: baseline; gap: 1rem;
  padding: 1.15rem 0.25rem;
  cursor: pointer; list-style: none;
  min-height: 44px;
  transition: color 0.2s, padding-left 0.25s;
}
.entry summary::-webkit-details-marker { display: none; }
.entry summary::after {
  content: "+";
  margin-left: auto; flex: none;
  font-family: var(--font-display); font-size: 1.4rem; line-height: 1;
  color: var(--accent); transition: transform 0.3s;
}
.entry[open] summary::after { content: "\2212"; }
.entry summary:hover { color: var(--accent-ink); padding-left: 0.6rem; }
.entry-num {
  font-family: var(--font-body); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.12em; color: var(--secondary); flex: none;
  padding-top: 0.35rem;
}
.entry-title {
  font-family: var(--font-display); font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  font-weight: 500; line-height: 1.2;
}
.entry-meta {
  margin-left: auto; flex: none;
  font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-soft); padding-top: 0.35rem;
}
.entry-body {
  padding: 0 0.25rem 1.6rem 2.6rem;
  animation: unfold 0.35s ease both;
}
@keyframes unfold {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.entry-body p { color: var(--ink-soft); }
.entry-list {
  list-style: none; margin: 0 0 1rem; padding: 0;
  display: grid; gap: 0.4rem;
}
.entry-list li {
  position: relative; padding-left: 1.3rem;
  font-size: 0.97rem; color: var(--ink);
}
.entry-list li::before {
  content: ""; position: absolute; left: 0; top: 0.72em;
  width: 8px; height: 1px; background: var(--accent);
}
.entry-note {
  font-size: 0.85rem; font-style: italic;
  color: var(--secondary); border-left: 2px solid var(--secondary);
  padding-left: 0.9rem; margin: 0;
}
.index--faq .entry-body { padding-left: 0.25rem; }

/* ============================================================
   BAND — diagonal, inverted
   ============================================================ */
.band {
  display: grid; grid-template-columns: 1fr;
  position: relative;
}
.band-slice { padding: clamp(3rem, 7vw, 5.5rem) clamp(1.25rem, 5vw, 3.5rem); }
.band-slice--ink { background: var(--ink); color: var(--bg); }
.band-slice--ink p { color: color-mix(in srgb, var(--bg) 78%, transparent); }
.band-slice--ink h2 { color: var(--bg); }
.band-inner { max-width: 34rem; margin-left: auto; }
.band-slice--paper { background: var(--bg-2); }

.creed { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.6rem; max-width: 34rem; }
.creed h3 { margin-bottom: 0.3rem; color: var(--accent-ink); }
.creed p { margin: 0; font-size: 0.95rem; color: var(--ink-soft); }

@media (min-width: 900px) {
  .band { grid-template-columns: 1fr 1fr; }
  .band-slice--ink {
    clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%);
    padding-right: clamp(4rem, 9vw, 8rem);
  }
  .band-slice--paper {
    margin-left: -8%;
    clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%);
    padding-left: clamp(4rem, 9vw, 8rem);
  }
}

/* ============================================================
   AREA
   ============================================================ */
.area-grid { display: grid; gap: clamp(1.5rem, 4vw, 3rem); }
.area-photo { margin: 0; }
.area-photo img {
  width: 100%; aspect-ratio: 16 / 11; object-fit: cover;
  border-radius: var(--radius); filter: saturate(0.9);
}
.area-photo figcaption {
  margin-top: 0.7rem; font-size: 0.8rem; color: var(--ink-soft); max-width: 40ch;
}
.area-lists { display: grid; gap: 1.75rem; align-content: start; }
.area-lists h3 { font-size: 1rem; letter-spacing: 0.02em; }
.pill-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.pill-list li {
  font-size: 0.82rem; padding: 0.3rem 0.7rem;
  border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--ink-soft);
}
.pill-list--muted li { border-style: dashed; color: var(--ink-soft); opacity: 0.85; }

@media (min-width: 820px) {
  .area-grid { grid-template-columns: 1.05fr 1fr; align-items: start; }
}

/* ============================================================
   WORK
   ============================================================ */
.section--work { padding-top: 0; }
.work-grid { display: grid; gap: clamp(1.5rem, 3vw, 2.25rem); }
.work-grid figure { margin: 0; }
.work-grid img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.work-grid figure:hover img { transform: scale(1.02); }
.work-grid figcaption {
  margin-top: 0.8rem; font-size: 0.86rem; color: var(--ink-soft);
  line-height: 1.55;
}
.work-grid figcaption strong { color: var(--ink); font-weight: 600; }

@media (min-width: 760px) { .work-grid { grid-template-columns: repeat(3, 1fr); } }

/* ============================================================
   VISIT
   ============================================================ */
.visit { display: grid; grid-template-columns: 1fr; }
.visit-slice { padding: clamp(3rem, 7vw, 5.5rem) clamp(1.25rem, 5vw, 3.5rem); }
.visit-slice--paper { background: var(--bg-2); }
.visit-slice--ink { background: var(--ink); color: var(--bg); }
.visit-slice--ink h2 { color: var(--bg); }
.visit-inner { max-width: 32rem; margin-left: auto; }

.hours { width: 100%; border-collapse: collapse; margin: 0 0 1.25rem; }
.hours th, .hours td {
  text-align: left; padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem; font-weight: 400;
}
.hours th { color: var(--ink-soft); font-weight: 500; }
.hours td { text-align: right; color: var(--secondary); font-weight: 600; }
.visit-note { font-size: 0.88rem; color: var(--ink-soft); }
.visit-note--light { color: color-mix(in srgb, var(--bg) 70%, transparent); }

.big-phone {
  display: inline-block;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.9rem, 5vw, 2.9rem); line-height: 1.1;
  color: var(--bg); text-decoration: none;
  border-bottom: 2px solid var(--accent);
  margin: 0.25rem 0 1.5rem;
  transition: color 0.2s, border-color 0.2s;
}
.big-phone:hover { color: var(--accent); border-color: var(--accent); }
.addr {
  font-style: normal; font-size: 1rem; line-height: 1.7;
  color: color-mix(in srgb, var(--bg) 82%, transparent);
  margin-bottom: 1rem;
}

@media (min-width: 900px) {
  .visit { grid-template-columns: 1fr 1fr; }
  .visit-slice--paper {
    clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%);
    padding-right: clamp(4rem, 9vw, 8rem);
  }
  .visit-slice--ink {
    margin-left: -8%;
    clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%);
    padding-left: clamp(4rem, 9vw, 8rem);
  }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: clamp(2.5rem, 5vw, 3.5rem) clamp(1.25rem, 5vw, 2.5rem) 5rem;
  background: var(--bg);
}
.footer-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 1.25rem 2rem;
  align-items: center; justify-content: space-between;
}
.footer-brand { display: flex; align-items: center; gap: 0.85rem; }
.brand-mark--footer { width: 36px; height: 36px; font-size: 0.85rem; }
.footer-brand strong { font-family: var(--font-display); font-size: 1.05rem; }
.footer-brand p { margin: 0.15rem 0 0; font-size: 0.85rem; color: var(--ink-soft); }
.footer-line { margin: 0; font-size: 0.82rem; color: var(--ink-soft); max-width: 34ch; }

.claim-banner {
  display: block;
  max-width: var(--maxw);
  margin: 2.5rem auto 0;
  padding: 0.6rem 0.9rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  width: fit-content;
}
.claim-banner:hover { color: var(--accent-ink); border-color: var(--accent); }

.attribution {
  max-width: var(--maxw);
  margin: 1.25rem auto 0;
  font-size: 0.72rem;
  opacity: 0.55;
}
.attribution a { color: inherit; }

/* ============================================================
   MOTION PREFERENCES
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain { animation: none; }
  .call-dot { animation: none; }
  .entry-body { animation: none; }
  .hero h1 { animation: none; font-variation-settings: 'wght' 520, 'opsz' 60; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ============================================================
   SMALL SCREENS
   ============================================================ */
@media (max-width: 720px) {
  .topnav { display: none; }
  .brand-text em { display: none; }
  .theme-toggle-label { display: none; }
  .theme-toggle { padding: 0 0.7rem; }
  .entry summary { flex-wrap: wrap; gap: 0.35rem 0.75rem; }
  .entry-meta { margin-left: 0; width: 100%; padding-top: 0; }
  .entry-body { padding-left: 0.25rem; }
  .hero-facts { grid-template-columns: 1fr; gap: 0.75rem; }
  .hero-facts li { flex-direction: row; align-items: baseline; gap: 0.6rem; }
  .hero-facts strong { font-size: 1.2rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
