/* ============================================================
   Dan Bull Roofing · Bespoke Sites demo
   Design language: slate ink + cool paper + burnt amber
   Display/Body: Satoshi · Labels/numbers: IBM Plex Mono
   Shape system (documented rule): interactive elements and
   media = 12px radius, everything else sharp. One accent: amber.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --ink: #131A21;          /* slate ink, primary text / footer bg */
  --slate: #1A232D;        /* dark section background */
  --slate-2: #222D39;      /* elevated dark panels */
  --paper: #F3F5F6;        /* cool light surface */
  --panel: #EAEEF1;        /* deeper light panel */
  --muted: #5B6772;        /* secondary text on light (AA 5.2:1) */
  --muted-dark: #ADB7C0;   /* secondary text on dark */
  --accent: #E07B24;       /* burnt amber, the one accent */
  --accent-deep: #B95F14;  /* accent text on light (AA 4.6:1) */
  --line: rgba(19, 26, 33, 0.14);
  --line-soft: rgba(19, 26, 33, 0.08);
  --line-dark: rgba(243, 245, 246, 0.14);

  --font-display: 'Satoshi', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Satoshi', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;

  --radius: 12px;

  --container: 1160px;
  --header-h: 64px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* fluid type scale */
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.82rem);
  --text-sm: clamp(0.85rem, 0.82rem + 0.2vw, 0.95rem);
  --text-base: clamp(1rem, 0.96rem + 0.25vw, 1.13rem);
  --text-lg: clamp(1.15rem, 1.05rem + 0.5vw, 1.35rem);
  --text-xl: clamp(1.45rem, 1.2rem + 1.2vw, 1.9rem);
  --text-2xl: clamp(1.9rem, 1.4rem + 2.5vw, 2.9rem);
  --text-3xl: clamp(2.1rem, 1.5rem + 3vw, 3.4rem);
  --text-hero: clamp(2.5rem, 2rem + 3vw, 4.4rem);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

h1, h2, h3, p, ul, figure, dl, dd, blockquote { margin: 0; }
ul { padding: 0; list-style: none; }

::selection { background: var(--accent); color: var(--ink); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 100;
  border-radius: 0 0 var(--radius) 0;
  font-size: var(--text-sm);
}
.skip-link:focus { left: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.35rem, 4vw, 2rem);
}

/* ---------- Typography ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.section-title {
  font-size: var(--text-3xl);
  max-width: 18ch;
}
.section-lead {
  margin-top: 1rem;
  max-width: 46ch;
  color: var(--muted);
  font-size: var(--text-lg);
}

.section-title-dark { color: var(--paper); }
.section-lead-dark { color: var(--muted-dark); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.7rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.98); }

.btn-accent {
  background: var(--accent);
  color: var(--ink);
  box-shadow: 0 2px 0 rgba(19, 26, 33, 0.18);
}
.btn-accent:hover { background: #ED8A35; transform: translateY(-2px); }

.btn-lg { padding: 1.05rem 2.3rem; font-size: var(--text-lg); }

.btn-ghost-dark {
  background: transparent;
  color: var(--paper);
  box-shadow: inset 0 0 0 1.5px rgba(243, 245, 246, 0.5);
}
.btn-ghost-dark:hover { background: rgba(243, 245, 246, 0.1); transform: translateY(-2px); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(243, 245, 246, 0.94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line-soft);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  text-decoration: none;
  line-height: 1;
}
.brand-mark {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--paper);
  line-height: 1;
  transition: color 0.35s var(--ease);
}
.site-header.is-scrolled .brand-mark { color: var(--ink); }
.brand-name {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.site-nav {
  display: none;
  gap: 2rem;
}
.site-nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--paper);
  text-decoration: none;
  position: relative;
  padding-block: 0.4rem;
  transition: color 0.35s var(--ease);
}
.site-header.is-scrolled .site-nav a { color: var(--ink); }
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.site-nav a:hover::after { transform: scaleX(1); }

.nav-call {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--paper);
  background: rgba(19, 26, 33, 0.55);
  text-decoration: none;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-dark);
  transition: background-color 0.3s var(--ease), transform 0.3s var(--ease);
  white-space: nowrap;
}
.site-header.is-scrolled .nav-call {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line);
}
.nav-call:hover { transform: translateY(-1px); background: var(--accent); color: var(--ink); }
.nav-call-icon { flex: none; fill: currentColor; }

/* ---------- Mobile menu ---------- */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--paper);
  transition: transform 0.35s var(--ease), opacity 0.2s var(--ease), background-color 0.35s var(--ease);
}
.site-header.is-scrolled .nav-toggle-bar { background: var(--ink); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--slate);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2.2rem;
  padding: 6rem clamp(1.25rem, 8vw, 3rem) 3rem;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu nav {
  display: grid;
  gap: 0.6rem;
}
.mobile-menu nav a {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--paper);
  text-decoration: none;
  opacity: 0;
  transform: translateY(14px);
  animation: menu-in 0.6s var(--ease) forwards;
}
.mobile-menu nav a:nth-child(1) { animation-delay: 0.05s; }
.mobile-menu nav a:nth-child(2) { animation-delay: 0.12s; }
.mobile-menu nav a:nth-child(3) { animation-delay: 0.19s; }
@keyframes menu-in {
  to { opacity: 1; transform: none; }
}
body.menu-open { overflow: hidden; }

/* ---------- Hero ---------- */
.hero {
  background: var(--slate);
  color: var(--paper);
  padding-top: calc(var(--header-h) + clamp(2.6rem, 6vh, 4rem));
  padding-bottom: clamp(2.5rem, 6vh, 4rem);
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.2rem;
  align-items: center;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  font-size: var(--text-hero);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin-top: 1rem;
  color: var(--paper);
}
.hero-accent { color: var(--accent); }

.hero-sub {
  margin-top: 1.2rem;
  max-width: 40ch;
  color: var(--muted-dark);
  font-size: var(--text-lg);
}

.hero-cta {
  margin-top: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-figure {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line-dark), 0 24px 50px rgba(0, 0, 0, 0.35);
  max-height: 400px;
}
.hero-figure img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}

.header-sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
}

/* load-in entrance (JS adds .anim-ready to <html>) */
.anim-ready .load-in {
  opacity: 0;
  animation: rise 0.9s var(--ease) forwards;
  animation-delay: var(--d, 0s);
}
.anim-ready .hero-eyebrow { --d: 0s; }
.anim-ready .hero-title { --d: 0.08s; }
.anim-ready .hero-sub { --d: 0.18s; }
.anim-ready .hero-cta { --d: 0.28s; }
.anim-ready .hero-figure { --d: 0.12s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Proof band ---------- */
.proof {
  background: var(--slate-2);
  color: var(--paper);
  padding-block: 1.9rem;
  border-top: 1px solid var(--line-dark);
}

.proof-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem 0.75rem;
  text-align: center;
}

.proof-num {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1;
  color: var(--paper);
}
.proof-stat dd {
  margin-top: 0.4rem;
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-dark);
  max-width: 16ch;
  margin-inline: auto;
  min-height: 2.5em;
}

.proof-note {
  margin-top: 1.5rem;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--muted-dark);
}
.stars {
  color: var(--accent);
  letter-spacing: 0.12em;
  font-size: 0.95rem;
  margin-right: 0.35rem;
}

/* ---------- Services ---------- */
.services { padding-block: clamp(3.5rem, 8vw, 5.5rem); }

.service-clusters {
  margin-top: 2.8rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.service-cluster {
  padding-block: 1.6rem;
  border-top: 1px solid var(--line);
}
.service-cluster:last-child { border-bottom: 1px solid var(--line); }

.cluster-name {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 1.1rem;
  padding-left: 0.9rem;
  border-left: 3px solid var(--accent);
}

.service-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem;
}
.service-list li {
  padding: 0.42rem 0;
  font-size: var(--text-lg);
  color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
  transition: transform 0.35s var(--ease), color 0.35s var(--ease);
}
.service-list li:last-child { border-bottom: none; }
.service-list li::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--accent);
  margin-right: 0.7rem;
  vertical-align: middle;
}
.service-list li:hover {
  transform: translateX(6px);
  color: var(--accent-deep);
}

.services-note {
  margin-top: 2.6rem;
  max-width: 52ch;
  color: var(--muted);
  font-size: var(--text-sm);
}

/* ---------- Why us ---------- */
.why {
  background: var(--slate);
  color: var(--paper);
  padding-block: clamp(3.5rem, 8vw, 5.5rem);
  border-top: 1px solid var(--line-dark);
}

.why-rows {
  margin-top: 2.8rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.why-row {
  padding-block: 1.35rem;
  border-top: 1px solid var(--line-dark);
  display: grid;
  gap: 0.35rem;
}
.why-row:last-child { border-bottom: 1px solid var(--line-dark); }

.why-label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.why-detail {
  color: var(--muted-dark);
  max-width: 44ch;
}

.why-quote {
  margin-top: 3rem;
  padding-left: 1.2rem;
  border-left: 3px solid var(--accent);
  max-width: 46ch;
}
.why-quote p {
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.35;
  color: var(--paper);
}
.why-quote cite {
  display: block;
  margin-top: 0.8rem;
  font-style: normal;
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-dark);
}

/* ---------- Visit ---------- */
.visit { padding-block: clamp(3.5rem, 8vw, 5.5rem); }

.visit-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.5rem;
}

.visit-address {
  margin-top: 1.4rem;
  font-style: normal;
  font-size: var(--text-lg);
  color: var(--ink);
  line-height: 1.55;
}

.directions-link {
  display: inline-block;
  margin-top: 0.9rem;
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--accent-deep);
  text-decoration: none;
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 2px;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.directions-link:hover { color: var(--ink); border-color: var(--ink); }

.visit-notes {
  margin-top: 1.6rem;
  display: grid;
  gap: 0.7rem;
}
.visit-notes li {
  color: var(--muted);
  padding-left: 1.6rem;
  position: relative;
}
.visit-notes li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.85rem;
  height: 1.5px;
  background: var(--accent-deep);
}

.visit-contact {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 2rem 1.8rem;
  box-shadow: 0 0 0 1px var(--line-soft);
}

.contact-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.contact-phone {
  margin-top: 0.9rem;
}
.contact-phone a {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.contact-phone a:hover { color: var(--accent-deep); }

.contact-note {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: var(--text-sm);
  max-width: 34ch;
}

.visit-contact .btn { margin-top: 1.5rem; }

/* ---------- Final CTA ---------- */
.cta {
  background: var(--slate);
  color: var(--paper);
  text-align: center;
  padding-block: clamp(4.5rem, 11vw, 7.5rem);
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line-dark);
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(42rem 20rem at 85% -10%, rgba(224, 123, 36, 0.14), transparent 60%),
    radial-gradient(36rem 18rem at 8% 110%, rgba(173, 183, 192, 0.08), transparent 60%);
  pointer-events: none;
}

.cta-inner { position: relative; }

.cta-title {
  font-size: var(--text-3xl);
  font-weight: 900;
  color: var(--paper);
}

.cta-sub {
  margin: 1.1rem auto 0;
  max-width: 44ch;
  color: var(--muted-dark);
}

.cta .btn { margin-top: 2rem; }

.cta-note {
  margin-top: 1.3rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-dark);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--muted-dark);
  padding-block: 3rem 2.6rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.4rem;
  justify-items: start;
}

.footer-brand { display: inline-flex; align-items: baseline; gap: 0.55rem; }
.footer-brand .brand-mark { color: var(--paper); font-size: 1.3rem; }
.footer-brand .brand-name { color: var(--muted-dark); }

.footer-meta p { font-size: var(--text-sm); line-height: 1.8; }
.footer-meta a { color: var(--paper); text-decoration: none; font-weight: 600; }
.footer-meta a:hover { text-decoration: underline; }

.footer-legal {
  font-size: var(--text-xs);
  color: rgba(173, 183, 192, 0.75);
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-legal a {
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.footer-legal a:hover { border-color: var(--accent); }

/* ---------- Scroll reveal (JS) ---------- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--d, 0s);
}
html.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Small screens ---------- */
@media (max-width: 560px) {
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-cta .btn { width: 100%; }
}

@media (max-width: 439px) {
  .nav-call {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
  }
  .nav-call-text { display: none; }
  .brand-name { display: none; }
  .brand-mark { font-size: 1.35rem; }
}

/* ---------- Tablet (768px+) ---------- */
@media (min-width: 768px) {
  .site-nav { display: flex; }

  .proof-stats { grid-template-columns: repeat(4, 1fr); gap: 1rem; }

  .service-list { grid-template-columns: 1fr 1fr; column-gap: 2.5rem; }
  .service-cluster { padding-block: 2rem; }
  .service-list li:last-child { border-bottom: 1px solid var(--line-soft); }
  .service-list li:nth-last-child(-n+2) { border-bottom: none; }

  .why-rows { grid-template-columns: 1fr 1fr; column-gap: 3.5rem; }
  .why-row:nth-last-child(-n+2) { border-bottom: 1px solid var(--line-dark); }

  .visit-grid { grid-template-columns: 3fr 2fr; gap: clamp(2rem, 4vw, 3.5rem); }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-items: stretch;
    row-gap: 1.6rem;
  }
  .footer-legal { grid-column: 1 / -1; justify-self: stretch; }
}

/* ---------- Desktop (1024px+) ---------- */
@media (min-width: 1024px) {
  .hero { padding-top: calc(var(--header-h) + clamp(3rem, 7vh, 4.5rem)); }
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: clamp(2.5rem, 6vw, 5rem);
  }
  .hero-figure, .hero-figure img { max-height: none; height: auto; }
  .hero-figure img { height: auto; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html.js [data-reveal] {
    opacity: 1;
    transform: none;
  }
  .anim-ready .load-in { opacity: 1; }
}
