/* ============================================================
   NYC Emergency Plumber & Sewer
   warm earth editorial · diagonal split · expandable index
   ============================================================ */

:root {
  --bg: #f5efe4;
  --bg-tint: #efe6d6;
  --ink: #2b1e14;
  --ink-soft: #5c4a3a;
  --accent: #c25a37;
  --accent-deep: #9c4527;
  --secondary: #6a7a4a;
  --paper: #fbf7ef;
  --line: rgba(43, 30, 20, 0.16);
  --line-strong: rgba(43, 30, 20, 0.3);
  --warm-light: rgba(226, 178, 118, 0.5);
  --glow-y: 18%;
  --shadow: 0 1px 2px rgba(43, 30, 20, 0.06), 0 12px 32px -18px rgba(43, 30, 20, 0.35);
  --radius: 3px;
  --maxw: 1180px;
  --font-display: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', 'Inter', system-ui, -apple-system, sans-serif;
}

html[data-theme='dark'] {
  --bg: #17120d;
  --bg-tint: #1e1811;
  --ink: #f2e8da;
  --ink-soft: #c3b3a0;
  --accent: #e07a52;
  --accent-deep: #f09a76;
  --secondary: #9aab74;
  --paper: #211a13;
  --line: rgba(242, 232, 218, 0.16);
  --line-strong: rgba(242, 232, 218, 0.32);
  --warm-light: rgba(196, 122, 62, 0.28);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 34px -18px rgba(0, 0, 0, 0.8);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(
    circle 900px at 50% var(--glow-y),
    var(--warm-light) 0,
    transparent 62%
  );
  background-repeat: no-repeat;
  background-attachment: scroll;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

:focus-visible {
  outline: 3px 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;
}

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

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2.75rem);
}

/* ---------------- typography ---------------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.15rem, 6.2vw, 4.1rem); }
h2 { font-size: clamp(1.65rem, 3.6vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }

p { margin: 0 0 1.05em; max-width: 68ch; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin: 0 0 0.9rem;
}

.lede { font-size: 1.12rem; color: var(--ink-soft); }

/* ---------------- topbar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.7rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
  min-height: 44px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  flex: 0 0 42px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  border-radius: var(--radius);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 0.95rem; letter-spacing: -0.01em; }
.brand-text em {
  font-style: normal;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.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;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent-deep); }

.theme-icon {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: inset -4px -3px 0 0 var(--bg);
}
html[data-theme='dark'] .theme-icon {
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.call-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 1.05rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}
.call-pill:hover { background: var(--accent-deep); color: #fff; }
.call-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255,255,255,0.7);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,0.65); }
  70%  { box-shadow: 0 0 0 9px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

/* ---------------- hero : diagonal split ---------------- */

.hero { position: relative; }

.hero-split {
  display: grid;
  grid-template-columns: 1fr;
}

.hero-half { position: relative; }

.hero-half--paper {
  background: transparent;
  padding-block: clamp(2.5rem, 7vw, 5rem) clamp(3rem, 8vw, 5.5rem);
}

.hero-half--ink {
  background: var(--ink);
  color: var(--bg);
  padding-block: clamp(1.5rem, 5vw, 3rem);
}

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

.hero-copy h1 {
  font-variation-settings: 'wght' 300, 'opsz' 100;
  animation: weigh linear both;
  animation-timeline: scroll(root);
  animation-range: 0 32vh;
}

@keyframes weigh {
  from { font-variation-settings: 'wght' 220, 'opsz' 100; }
  to   { font-variation-settings: 'wght' 880, 'opsz' 100; }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.6rem 0 2.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
  border: 1px solid transparent;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-deep); color: #fff; transform: translateY(-1px); }
.btn--ghost { border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-deep); }

.hero-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem 1.5rem;
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.hero-facts dt {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.2rem;
}
.hero-facts dd { margin: 0; font-weight: 700; font-size: 0.98rem; }

.hero-figure { margin: 0; }
.hero-figure img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  border-radius: var(--radius);
}
.hero-figure figcaption {
  margin-top: 0.7rem;
  font-size: 0.82rem;
  color: color-mix(in srgb, var(--bg) 72%, transparent);
  max-width: 46ch;
}

/* ---------------- sections ---------------- */

.section { padding-block: clamp(3.2rem, 8vw, 6rem); }
.section--tint { background: var(--bg-tint); }

.section-head { max-width: 46rem; margin-bottom: clamp(1.8rem, 4vw, 3rem); }
.section-sub { color: var(--ink-soft); }

/* ---------------- expandable index ---------------- */

.index {
  border-top: 1px solid var(--line-strong);
}

.entry {
  border-bottom: 1px solid var(--line);
}

.entry > summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 0.9rem 1.1rem;
  padding: 1.15rem 0.25rem;
  cursor: pointer;
  list-style: none;
  min-height: 56px;
  transition: color 0.18s ease, padding-left 0.22s ease;
}
.entry > summary::-webkit-details-marker { display: none; }
.entry > summary::marker { content: ''; }

.entry > summary:hover { color: var(--accent-deep); padding-left: 0.6rem; }

.entry-num {
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding-top: 0.35rem;
}

.entry-title {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.5vw, 1.6rem);
  font-weight: 500;
  line-height: 1.25;
  font-variation-settings: 'wght' 480;
  transition: font-variation-settings 0.25s ease;
}
.entry[open] .entry-title { font-variation-settings: 'wght' 700; }

.entry-meta {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  white-space: nowrap;
  padding-top: 0.35rem;
}
.entry-meta::after {
  content: ' +';
  display: inline-block;
  color: var(--accent);
  font-weight: 700;
  transition: transform 0.22s ease;
}
.entry[open] .entry-meta::after { content: ' –'; }

.entry-body {
  padding: 0 0.25rem 1.6rem;
  max-width: 62ch;
  animation: unfold 0.28s ease both;
}
.entry-body p { color: var(--ink-soft); }
.entry-body ul {
  margin: 0 0 1.05em;
  padding-left: 1.1rem;
  color: var(--ink-soft);
}
.entry-body li { margin-bottom: 0.35rem; }
.entry-note {
  font-size: 0.9rem;
  border-left: 2px solid var(--secondary);
  padding-left: 0.9rem;
  color: var(--ink) !important;
}

@keyframes unfold {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.index--tight .entry-title { font-size: clamp(1.05rem, 2vw, 1.3rem); }

/* ---------------- diagonal split section ---------------- */

.split { display: grid; grid-template-columns: 1fr; }

.split-half { position: relative; }

.split-half--paper { padding-block: clamp(2.5rem, 6vw, 4.5rem); }

.split-half--ink {
  background: var(--ink);
  color: var(--bg);
  padding-block: clamp(2.2rem, 6vw, 4rem);
}
.split-half--ink h2 { color: var(--bg); }
.split-half--ink p { color: color-mix(in srgb, var(--bg) 82%, transparent); }

.split-media {
  display: grid;
  gap: 1.6rem;
}
.split-media figure { margin: 0; }
.split-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}
.split-media figcaption {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: color-mix(in srgb, var(--bg) 68%, transparent);
}

/* ---------------- neighborhoods ---------------- */

.hoods {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}
.hoods li {
  padding: 0.95rem 0.2rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.hoods strong {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
}
.hoods span { font-size: 0.84rem; color: var(--ink-soft); }

/* ---------------- contact ---------------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.2rem;
}

.contact-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  box-shadow: var(--shadow);
}
.contact-card h3 { margin-bottom: 0.7rem; }
.contact-card p { font-size: 0.96rem; color: var(--ink-soft); }
.contact-card address {
  font-style: normal;
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: 0.9rem;
}

.contact-card--accent {
  background: var(--ink);
  color: var(--bg);
  border-color: transparent;
}
.contact-card--accent h3 { color: var(--bg); }
.contact-card--accent p { color: color-mix(in srgb, var(--bg) 80%, transparent); }

.big-phone {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4.5vw, 2.3rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.8rem;
}
.big-phone a { color: var(--accent); text-decoration: none; }
.big-phone a:hover { text-decoration: underline; }

.fine { font-size: 0.84rem !important; opacity: 0.85; }

.link-out { font-weight: 700; font-size: 0.92rem; }

.hours {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  margin-bottom: 1rem;
}
.hours th, .hours td {
  text-align: left;
  padding: 0.42rem 0;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
}
.hours th { color: var(--ink-soft); }
.hours td { text-align: right; font-weight: 700; }

/* ---------------- quotes ---------------- */

.quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}
.quotes blockquote {
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem;
}
.quotes p { font-size: 0.98rem; color: var(--ink); }
.quotes cite {
  display: block;
  margin-top: 0.9rem;
  font-style: normal;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------------- footer ---------------- */

.site-footer {
  background: var(--ink);
  color: var(--bg);
  padding-block: clamp(2.2rem, 5vw, 3.2rem) 1.6rem;
  margin-top: clamp(2rem, 5vw, 4rem);
}
.site-footer a { color: color-mix(in srgb, var(--bg) 88%, transparent); }
.site-footer a:hover { color: var(--accent); }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem 2.5rem;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid color-mix(in srgb, var(--bg) 18%, transparent);
}
.footer-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
}
.footer-meta {
  font-size: 0.86rem;
  margin: 0 0 0.2rem;
  color: color-mix(in srgb, var(--bg) 74%, transparent);
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.3rem; }
.footer-nav a {
  font-size: 0.88rem;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.footer-nav a:hover { text-decoration: underline; }

.footer-claim { padding-top: 1.3rem; }

.claim-banner {
  display: inline-block;
  font-size: 0.78rem;
  line-height: 1.5;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--bg) 20%, transparent);
  color: color-mix(in srgb, var(--bg) 82%, transparent) !important;
  text-decoration: none;
}
.claim-banner:hover {
  background: color-mix(in srgb, var(--bg) 16%, transparent);
  color: var(--bg) !important;
}

.footer-attr { padding-top: 1.1rem; }
.attribution { font-size: 0.76rem; margin: 0; }
.attribution a {
  color: color-mix(in srgb, var(--bg) 58%, transparent);
  text-decoration: none;
}
.attribution a:hover { color: var(--bg); text-decoration: underline; }

/* ---------------- wide screens : the diagonals ---------------- */

@media (min-width: 900px) {
  .hero-split {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: stretch;
  }
  .hero-half--paper {
    padding-block: clamp(3.5rem, 7vw, 6rem) clamp(5rem, 9vw, 8rem);
    clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
    margin-bottom: -4.5rem;
    z-index: 2;
  }
  .hero-half--ink {
    padding-block: clamp(3.5rem, 7vw, 6rem) clamp(3rem, 6vw, 5rem);
    clip-path: polygon(0 12%, 100% 0, 100% 100%, 0 100%);
    margin-top: -1.5rem;
  }
  .hero-figure img { aspect-ratio: 4 / 5; }

  .split {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
  .split-half--paper {
    padding-block: clamp(3rem, 6vw, 5rem) clamp(4rem, 8vw, 7rem);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 90%);
    margin-bottom: -3rem;
    z-index: 2;
  }
  .split-half--ink {
    padding-block: clamp(3rem, 6vw, 5rem) clamp(3rem, 6vw, 5rem);
    clip-path: polygon(0 8%, 100% 0, 100% 100%, 0 100%);
  }
  .split-media { gap: 2rem; }
}

@media (min-width: 1180px) {
  .hero-half--paper { padding-right: 3rem; }
  .hero-half--ink { padding-left: 2.5rem; }
}

/* ---------------- 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;
  }
  .hero-copy h1 { font-variation-settings: 'wght' 620, 'opsz' 100; }
  .call-pill .dot { animation: none; }
  .entry-body { animation: none; }
}

/* browsers without scroll-driven animation support: static weight */
@supports not (animation-timeline: scroll()) {
  .hero-copy h1 { font-variation-settings: 'wght' 620, 'opsz' 100; }
}
