/* ============================================================
   New York Plumbing Supply — Manhattan
   Design tokens
   ============================================================ */
:root {
  --pipe-blue: #1d3a5f;
  --pipe-blue-dark: #142942;
  --fitting-gray: #4f5765;
  --fitting-gray-light: #aab2bc;
  --copper: #b5651d;
  --copper-dark: #8f4f16;
  --ledger-cream: #f3f1ea;
  --ledger-cream-2: #eae6da;
  --ink: #1a1d22;
  --safety-yellow: #f2b705;
  --white: #ffffff;

  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;

  --max-width: 1180px;
  --radius: 3px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--ledger-cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.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-link {
  position: absolute;
  left: 8px; top: -60px;
  background: var(--pipe-blue);
  color: var(--white);
  padding: 10px 16px;
  z-index: 1000;
  border-radius: var(--radius);
  transition: top 0.15s ease-out;
}
.skip-link:focus { top: 8px; }

:focus-visible {
  outline: 3px solid var(--safety-yellow);
  outline-offset: 2px;
}

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ledger-cream);
  border-bottom: 3px solid var(--pipe-blue);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand img {
  height: 40px;
  width: auto;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: none;
  border: 2px solid var(--pipe-blue);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0;
}
.nav-toggle-bar {
  width: 20px;
  height: 2px;
  background: var(--pipe-blue);
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--pipe-blue);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a:focus-visible {
  border-bottom-color: var(--copper);
}

.call-btn {
  background: var(--copper);
  color: var(--white) !important;
  padding: 10px 18px !important;
  border-radius: var(--radius);
  border-bottom: none !important;
}
.call-btn:hover, .call-btn:focus-visible {
  background: var(--copper-dark);
}

/* Mobile nav */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    flex-direction: column;
    align-items: stretch;
    background: var(--ledger-cream);
    border-bottom: 3px solid var(--pipe-blue);
    box-shadow: 0 12px 24px -8px rgba(26, 29, 34, 0.35);
    padding: 8px 20px 20px;
    gap: 4px;
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a {
    padding: 12px 4px;
    border-bottom: 1px solid var(--ledger-cream-2);
  }
  .call-btn {
    text-align: center;
    margin-top: 8px;
  }
}
@media (min-width: 861px) {
  .nav-toggle { display: none; }
  .site-nav { display: flex !important; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  background: var(--pipe-blue);
  color: var(--ledger-cream);
  overflow: hidden;
  padding: 72px 0 64px;
}

.hero-fitting {
  position: absolute;
  top: 50%;
  right: -120px;
  transform: translateY(-50%);
  width: 620px;
  height: 620px;
  color: rgba(243, 241, 234, 0.14);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--safety-yellow);
  margin: 0 0 14px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(2.6rem, 8vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
  margin: 0 0 22px;
}

.hero-desc {
  font-size: 1.08rem;
  max-width: 60ch;
  color: rgba(243, 241, 234, 0.92);
  margin: 0 0 30px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
}

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 1rem;
  text-decoration: none;
  padding: 14px 26px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  min-height: 44px;
}

.btn-primary {
  background: var(--copper);
  color: var(--white);
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--copper-dark);
}

.btn-secondary {
  background: transparent;
  border-color: var(--ledger-cream);
  color: var(--ledger-cream);
}
.btn-secondary:hover, .btn-secondary:focus-visible {
  background: rgba(243, 241, 234, 0.12);
}

.btn-ghost {
  background: transparent;
  border-color: var(--pipe-blue);
  color: var(--pipe-blue);
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  background: var(--pipe-blue);
  color: var(--white);
}

.hours-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: rgba(243, 241, 234, 0.1);
  border: 1px solid rgba(243, 241, 234, 0.35);
  padding: 8px 14px;
  border-radius: var(--radius);
  margin: 0;
}
.hours-badge .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--fitting-gray-light);
  flex-shrink: 0;
}
.hours-badge.is-open .dot { background: #4caf6b; }
.hours-badge.is-closed .dot { background: #c0392b; }

/* hide the badge until JS confirms state, but keep accessible fallback text already in HTML?
   Actually: show by default with "Checking hours..." text, JS updates it. If no JS, this stays but is a harmless neutral message.
   To be safer for no-JS users, we replace via noscript-style approach below in HTML is not present, so keep generic. */

/* ============================================================
   Sections (shared)
   ============================================================ */
.section {
  padding: 72px 0;
}
.section-alt {
  background: var(--ledger-cream-2);
}

.section-head {
  max-width: 680px;
  margin-bottom: 40px;
}
.section-head .eyebrow { color: var(--copper-dark); }

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(1.9rem, 4.5vw, 2.7rem);
  line-height: 1.05;
  margin: 0 0 12px;
  color: var(--pipe-blue);
}

.section-sub {
  font-size: 1.05rem;
  color: var(--ink);
  margin: 0;
}

/* ============================================================
   About
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-copy p {
  font-size: 1.05rem;
  margin: 0 0 20px;
}
.about-copy p:last-child { margin-bottom: 0; }

.about-mark {
  border: 1px solid var(--fitting-gray-light);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  color: var(--fitting-gray);
  background: var(--white);
}
.about-mark svg {
  width: 100%;
  max-width: 160px;
  height: auto;
  margin: 0 auto 16px;
}
.mark-caption {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--pipe-blue);
  margin: 0;
}

@media (max-width: 780px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-mark { max-width: 280px; }
}

/* ============================================================
   What We Carry — tile grid
   ============================================================ */
.tile-grid {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 620px) {
  .tile-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .tile-grid { grid-template-columns: repeat(4, 1fr); }
}

.tile {
  background: var(--white);
  border: 1px solid var(--fitting-gray-light);
  border-left: 4px solid var(--pipe-blue);
  border-radius: var(--radius);
  padding: 18px 16px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 1.02rem;
  color: var(--pipe-blue);
  transition: border-color 0.15s ease-out, transform 0.15s ease-out;
}

.fab-note {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--fitting-gray);
  margin: 0;
}

/* ============================================================
   Who We Serve
   ============================================================ */
.serve-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 32px;
}
@media (min-width: 700px) {
  .serve-grid { grid-template-columns: repeat(2, 1fr); }
}

.serve-card {
  background: var(--white);
  border: 1px solid var(--fitting-gray-light);
  border-radius: var(--radius);
  padding: 26px;
}
.serve-card h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 1.2rem;
  color: var(--pipe-blue);
  margin: 0 0 10px;
}
.serve-card p {
  margin: 0;
  font-size: 0.98rem;
}

.cert-strip {
  border-top: 2px solid var(--safety-yellow);
  padding-top: 18px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--fitting-gray);
  margin: 0;
}

/* ============================================================
   Hours & Visit
   ============================================================ */
.visit-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
}
@media (min-width: 780px) {
  .visit-grid { grid-template-columns: 1.1fr 1fr; }
}

.visit-info address {
  font-style: normal;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1.5rem;
  color: var(--pipe-blue);
  margin: 0 0 14px;
  line-height: 1.2;
}

.visit-note {
  font-size: 1.02rem;
  margin: 0 0 24px;
}

.visit-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hours-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--fitting-gray-light);
  border-radius: var(--radius);
  overflow: hidden;
}
.hours-table tr:not(:last-child) th,
.hours-table tr:not(:last-child) td {
  border-bottom: 1px solid var(--ledger-cream-2);
}
.hours-table th, .hours-table td {
  padding: 13px 20px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.98rem;
}
.hours-table th {
  font-weight: 600;
  color: var(--pipe-blue);
  width: 40%;
}
.hours-table td {
  color: var(--ink);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--pipe-blue-dark);
  color: var(--ledger-cream);
  padding-top: 56px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(243, 241, 234, 0.18);
}
@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand img {
  height: 44px;
  width: auto;
  margin-bottom: 14px;
  background: var(--ledger-cream);
  padding: 8px 12px;
  border-radius: var(--radius);
}
.footer-brand p {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: rgba(243, 241, 234, 0.75);
  margin: 0;
}

.footer-col h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
  color: var(--safety-yellow);
  margin: 0 0 12px;
}
.footer-col p { margin: 0 0 8px; }
.footer-col a {
  text-decoration: none;
  color: var(--ledger-cream);
}
.footer-col a:hover, .footer-col a:focus-visible {
  color: var(--safety-yellow);
  text-decoration: underline;
}

.footer-bottom {
  padding: 20px;
  font-size: 0.85rem;
  color: rgba(243, 241, 234, 0.6);
}

/* ============================================================
   Scroll reveal
   ============================================================ */
.reveal {
  opacity: 1;
  transform: none;
}
.js-reveal-ready .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
.js-reveal-ready .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .js-reveal-ready .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
