/* ============================================================
   Emmett's Speedy Plumbing Company
   bleached cream + oxblood + navy
   ============================================================ */

:root {
  --bg: #f4ecdc;
  --bg-raise: #efe5d1;
  --bg-sink: #e7dcc5;
  --ink: #1a1b2e;
  --ink-soft: #4a4a5e;
  --ink-faint: #7b7a86;
  --accent: #6b1f1a;
  --accent-bright: #8c2a22;
  --secondary: #1e2a4a;
  --rule: #c9bda3;
  --rule-soft: #d9cfb8;

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: 'Fraunces', 'Playfair Display', Georgia, serif;

  --measure: 55ch;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --pad-y: clamp(3.5rem, 9vw, 7rem);
}

html[data-theme="dark"] {
  --bg: #14151f;
  --bg-raise: #1b1d2a;
  --bg-sink: #101119;
  --ink: #ece5d6;
  --ink-soft: #b3aec0;
  --ink-faint: #837f92;
  --accent: #d9705f;
  --accent-bright: #e88a76;
  --secondary: #8fa6d8;
  --rule: #33364a;
  --rule-soft: #262a3b;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(0.9rem, 0.85rem + 0.2vw, 1rem);
  line-height: 1.72;
  font-weight: 400;
  letter-spacing: -0.005em;
  text-wrap: pretty;
  overflow-x: hidden;
}

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

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-bright); }

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

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--secondary); color: var(--bg);
  padding: 0.75rem 1.25rem; z-index: 100;
}
.skip:focus { left: 0; }

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

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.06; letter-spacing: -0.02em; margin: 0; }

h1 {
  font-size: clamp(2.4rem, 1.2rem + 6.2vw, 5.4rem);
  font-weight: 500;
  font-variation-settings: "SOFT" 0, "WONK" 1, "opsz" 120;
}
h1 em { font-style: italic; color: var(--accent); font-weight: 400; }

h2 {
  font-size: clamp(1.7rem, 1.1rem + 2.6vw, 3rem);
  font-weight: 500;
  font-variation-settings: "SOFT" 0, "WONK" 1, "opsz" 60;
  max-width: 22ch;
}

h3 { font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.35rem); font-weight: 600; }

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

.eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1.1rem;
}

.lede {
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-top: 1.4rem;
}

/* ---------- header ---------- */

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

.head-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.85rem var(--gutter);
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  flex-wrap: wrap;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}
.mark {
  display: grid;
  place-items: center;
  width: 2.6rem; height: 2.6rem;
  background: var(--secondary);
  color: var(--bg);
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: none;
}
.wordmark-text { display: flex; flex-direction: column; line-height: 1.25; }
.wordmark-text strong { font-family: var(--serif); font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; }
.wordmark-text em { font-style: normal; font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }

.site-nav { display: flex; gap: 1.35rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.head-actions { display: flex; align-items: center; gap: 0.7rem; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0 0.85rem;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-icon {
  width: 0.72rem; height: 0.72rem;
  border-radius: 50%;
  background: var(--ink-soft);
  box-shadow: inset -3px -2px 0 0 var(--bg);
}
html[data-theme="dark"] .theme-icon { background: var(--accent); box-shadow: none; }

.call-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 44px;
  padding: 0.4rem 1rem;
  background: var(--accent);
  color: #f7f1e4;
  text-decoration: none;
  line-height: 1.2;
}
.call-btn:hover { background: var(--accent-bright); color: #f7f1e4; }
.call-label { font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.85; }
.call-number { font-size: 0.92rem; font-weight: 600; letter-spacing: 0.01em; }

/* ---------- hero ---------- */

.hero { padding: clamp(2.5rem, 6vw, 5rem) var(--gutter) clamp(3rem, 7vw, 6rem); }

.hero-grid {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

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

.hero h1 { margin-bottom: 1.6rem; }

.dictated {
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.12rem);
  line-height: 1.85;
  color: var(--ink-soft);
  max-width: 40ch;
  margin: 0 0 2rem;
  min-height: 5.6em;
}
.d-word { display: inline-block; opacity: 0; transform: translateY(0.35em); }
.d-word.is-in { opacity: 1; transform: none; transition: opacity 340ms ease, transform 340ms ease; }
.dictated::after {
  content: "";
  display: inline-block;
  width: 0.55ch;
  height: 1.05em;
  margin-left: 0.15ch;
  background: var(--accent);
  vertical-align: -0.16em;
  animation: caret 1.05s steps(1) infinite;
}
.dictated.is-done::after { animation: none; opacity: 0.35; }
@keyframes caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2.6rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #f7f1e4; }
.btn-primary:hover { background: var(--accent-bright); color: #f7f1e4; }
.btn-ghost { border-color: var(--rule); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1.2rem;
  margin: 0;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
}
.hero-facts dt {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.3rem;
}
.hero-facts dd { margin: 0; font-size: 0.85rem; color: var(--ink); }

.hero-figure { margin: 0; }
.hero-figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--rule);
}
.hero-figure figcaption {
  margin-top: 0.8rem;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--ink-faint);
  max-width: 42ch;
  padding-left: 0.9rem;
  border-left: 2px solid var(--accent);
}

/* ---------- marquee strip ---------- */

.strip {
  overflow: hidden;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--bg-raise);
  padding: 0.85rem 0;
}
.strip-track {
  display: flex;
  gap: 1.6rem;
  width: max-content;
  animation: slide 46s linear infinite;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}
.strip-track span:nth-child(even) { color: var(--accent); }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- section scaffolding ---------- */

.section { padding: var(--pad-y) var(--gutter); }
.section-inner { max-width: 1320px; margin: 0 auto; }

.section-head { max-width: 1320px; margin: 0 auto clamp(2.5rem, 5vw, 4rem); }
.section-head h2 { margin-bottom: 0; }

.section-dark {
  background: var(--secondary);
  color: #f0e9da;
}
html[data-theme="dark"] .section-dark { background: #0d0e16; }
.section-dark .eyebrow { color: #9aa6c4; }
.section-dark .lede { color: #c3c9dc; }
.section-dark a { color: #f0c9a8; }

/* ---------- services ---------- */

.service-list {
  max-width: 1320px;
  margin: 0 auto;
  border-top: 1px solid var(--rule);
}

.service {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.6rem, 3vw, 2.4rem) 0;
  border-bottom: 1px solid var(--rule-soft);
}
.service-num {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--accent);
  font-variation-settings: "opsz" 40;
  line-height: 1;
  padding-top: 0.2rem;
}
.service-body { max-width: 68ch; }
.service-body h3 { margin-bottom: 0.6rem; }
.service-body p { color: var(--ink-soft); font-size: 0.88rem; }
.service-meta {
  font-size: 0.72rem !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent) !important;
  margin-bottom: 0 !important;
  padding-top: 0.5rem;
}

/* ---------- emergency steps ---------- */

.steps {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 1320px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1px;
  background: rgba(240, 233, 218, 0.18);
  border: 1px solid rgba(240, 233, 218, 0.18);
}
.steps li {
  background: var(--secondary);
  padding: clamp(1.4rem, 2.5vw, 2rem);
}
html[data-theme="dark"] .steps li { background: #0d0e16; }
.step-num {
  display: block;
  font-family: var(--serif);
  font-size: 1.9rem;
  color: #f0c9a8;
  line-height: 1;
  margin-bottom: 0.9rem;
}
.steps h3 { color: #f0e9da; font-size: 1.05rem; margin-bottom: 0.6rem; }
.steps p { color: #c3c9dc; font-size: 0.82rem; margin: 0; }

.emergency-callout {
  max-width: 1320px;
  margin: clamp(2.5rem, 5vw, 3.5rem) auto 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(240, 233, 218, 0.22);
}
.callout-line { margin: 0; font-size: 0.88rem; color: #c3c9dc; }
.callout-line strong { color: #f0e9da; font-size: 1.1rem; }
.section-dark .btn-primary { background: #f0c9a8; color: #1e2a4a; }
.section-dark .btn-primary:hover { background: #f7ddc4; color: #1e2a4a; }

/* ---------- about ---------- */

.about-grid {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.about-copy { max-width: var(--measure); }
.about-copy p { color: var(--ink-soft); font-size: 0.9rem; }
.about-copy > p:first-child::first-letter {
  font-family: var(--serif);
  font-size: 3.4em;
  float: left;
  line-height: 0.82;
  padding: 0.06em 0.1em 0 0;
  color: var(--accent);
}

.pull {
  margin: 2.4rem 0 0;
  padding: 1.6rem 0 0;
  border-top: 1px solid var(--rule);
}
.pull p {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1rem + 0.9vw, 1.6rem);
  line-height: 1.35;
  color: var(--ink);
  font-style: italic;
  font-variation-settings: "opsz" 40;
  margin-bottom: 0.9rem;
}
.pull cite {
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.about-aside figure { margin: 0 0 2rem; }
.about-aside img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--rule);
}
.about-aside figcaption {
  margin-top: 0.7rem;
  font-size: 0.72rem;
  color: var(--ink-faint);
  line-height: 1.6;
}

.cred-list { margin: 0; border-top: 1px solid var(--rule); }
.cred-list > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.cred-list dt {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.cred-list dd { margin: 0; font-size: 0.8rem; text-align: right; }

/* ---------- work grid ---------- */

.work-grid {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.work-item { margin: 0; }
.work-item img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border: 1px solid var(--rule);
  transition: transform 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.work-item:hover img { transform: scale(1.015); }
.work-item figcaption { margin-top: 1rem; }
.work-item strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.work-item span { font-size: 0.78rem; color: var(--ink-soft); line-height: 1.65; display: block; }

/* ---------- service area ---------- */

.area-columns {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: clamp(2rem, 5vw, 4rem);
}
.area-columns h3 { color: #f0e9da; font-size: 1rem; margin-bottom: 1.2rem; }
.area-list { list-style: none; margin: 0; padding: 0; }
.area-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(240, 233, 218, 0.14);
  font-size: 0.82rem;
  color: #c3c9dc;
}

/* ---------- visit ---------- */

.visit-grid {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.visit-card { background: var(--bg); padding: clamp(1.5rem, 3vw, 2.2rem); }
.visit-card h3 { margin-bottom: 1rem; }
.visit-card p { font-size: 0.82rem; color: var(--ink-soft); }
.visit-card address { font-style: normal; font-size: 0.85rem; line-height: 1.75; margin-bottom: 1rem; }

.big-phone {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  font-variation-settings: "opsz" 40;
}
.big-phone:hover { color: var(--accent-bright); }

.fine { font-size: 0.72rem !important; color: var(--ink-faint) !important; }
.map-link { font-size: 0.78rem; letter-spacing: 0.04em; }

.hours { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.hours th, .hours td {
  text-align: left;
  padding: 0.42rem 0;
  font-size: 0.78rem;
  font-weight: 400;
  border-bottom: 1px solid var(--rule-soft);
}
.hours th { color: var(--ink-faint); letter-spacing: 0.06em; }
.hours td { text-align: right; color: var(--ink); }

.pay-note {
  max-width: 1320px;
  margin: clamp(2rem, 4vw, 3rem) auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 3rem);
  align-items: start;
}
.pay-note p { font-size: 0.85rem; color: var(--ink-soft); max-width: 72ch; margin: 0; }

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

.site-foot {
  background: var(--bg-sink);
  border-top: 1px solid var(--rule);
  padding: clamp(2.5rem, 5vw, 4rem) var(--gutter) 2rem;
}

.foot-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule-soft);
}
.foot-brand { display: flex; gap: 1rem; align-items: flex-start; }
.foot-brand p { font-size: 0.78rem; color: var(--ink-soft); line-height: 1.8; margin: 0; }
.foot-brand strong { font-family: var(--serif); font-size: 0.95rem; color: var(--ink); font-weight: 600; }

.foot-nav { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.foot-nav a { font-size: 0.76rem; color: var(--ink-soft); text-decoration: none; }
.foot-nav a:hover { color: var(--accent); text-decoration: underline; }

.foot-legal {
  max-width: 1320px;
  margin: 1.5rem auto 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.claim-banner {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--ink-soft);
  background: var(--bg-raise);
  border: 1px solid var(--rule-soft);
  padding: 0.5rem 0.85rem;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.claim-banner:hover { color: var(--accent); border-color: var(--accent); }

.attribution { margin: 0; font-size: 0.72rem; }
.attribution a { color: var(--ink-faint); text-decoration: none; }
.attribution a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { max-width: none; }
  .about-grid { grid-template-columns: 1fr; }
  .about-aside { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 2rem; align-items: start; }
  .pay-note { grid-template-columns: 1fr; gap: 0.8rem; }
}

@media (max-width: 760px) {
  .site-nav { display: none; }
  .head-inner { gap: 0.75rem; }
  .wordmark-text em { display: none; }
  .theme-toggle .theme-label { display: none; }
  .theme-toggle { padding: 0 0.7rem; }
  .service { grid-template-columns: 1fr; gap: 0.6rem; }
  .service-num { font-size: 1.1rem; }
  .foot-inner { flex-direction: column; }
}

@media (max-width: 420px) {
  .call-btn { padding: 0.4rem 0.7rem; }
  .call-number { font-size: 0.82rem; }
  .hero-cta .btn { width: 100%; }
}

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .strip-track { animation: none; }
  .dictated::after { animation: none; opacity: 0.4; }
  .d-word { opacity: 1; transform: none; transition: none; }
  .work-item img { transition: none; }
  .work-item:hover img { transform: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
