/* Gutter guards for heavy rain in Nashville — one-page guide
   Purpose-built stylesheet. No external dependency. Mobile first. */

:root {
  --ink:        #0d1720;
  --ink-2:      #16283a;
  --body:       #2b3a45;
  --muted:      #5a6b76;
  --paper:      #ffffff;
  --sky:        #edf3f7;
  --shell:      #f4f7f9;
  --mist:       #e4edf2;
  --line:       #d3dee5;
  --line-2:     #e3eaee;
  --water:      #1d6f8b;
  --water-deep: #0f4f66;
  --water-lt:   #cfe4ec;
  --amber:      #8a5a12;
  --focus:      #0b5d78;
  --focus-lt:   #ffd18a;
  --rail:       70rem;
  --edge:       clamp(1rem, 4.5vw, 2.5rem);
  --gap:        clamp(2.6rem, 6vw, 4.6rem);
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--ui);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

@media (min-width: 48em) { body { font-size: 1.125rem; } }

h1, h2, h3 { color: var(--ink); font-weight: 700; line-height: 1.14; margin: 0; letter-spacing: -0.012em; }
h1 { font-size: clamp(2rem, 6.2vw, 3.35rem); letter-spacing: -0.022em; }
h2 { font-size: clamp(1.55rem, 4.2vw, 2.3rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1.05rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--water-deep); }
a:hover { color: var(--ink); }

strong { color: var(--ink); }

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

.vh {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 1rem; top: -6rem;
  z-index: 20;
  background: var(--ink);
  color: #fff;
  padding: 0.9rem 1.2rem;
  border-radius: 0 0 10px 10px;
  text-decoration: none;
  font-weight: 700;
}
.skip:focus { top: 0; color: #fff; }

/* ---------- shared rail + section leads ---------- */

.rail {
  width: min(100% - (var(--edge) * 2), var(--rail));
  margin-inline: auto;
}

.band { padding-block: var(--gap); }

.eyebrow {
  margin: 0 0 0.7rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--amber);
}
.eyebrow--light { color: #f0c47f; }

.lead h2 { margin-bottom: 0.85rem; }
.lead p { max-width: 66ch; }

.lead--full {
  padding-bottom: 1.6rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--line-2);
}

.note {
  margin-top: 1.2rem;
  padding-left: 1rem;
  border-left: 3px solid var(--water-lt);
  color: var(--muted);
  font-size: 0.97em;
}

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

.hero {
  background:
    radial-gradient(120% 90% at 82% 0%, #1d3d52 0%, rgba(29, 61, 82, 0) 62%),
    linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
  color: #dbe6ee;
  padding-block: clamp(3.2rem, 9vw, 6rem) clamp(3rem, 8vw, 5.4rem);
  border-bottom: 5px solid var(--water);
}
.hero__in { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero__copy { min-width: 0; }
.hero h1 { color: #ffffff; max-width: 20ch; margin-bottom: 1.6rem; }
.hero__answer {
  color: #ffffff;
  font-size: clamp(1.13rem, 2.5vw, 1.42rem);
  line-height: 1.5;
  max-width: 46ch;
  margin-bottom: 1.5rem;
}
.hero__sub { color: #a9bdcb; max-width: 62ch; }
.hero a { color: #bfe3f0; }

.hero__visual {
  width: min(100%, 32rem);
  margin: 0 auto;
  padding: clamp(0.8rem, 2vw, 1.15rem);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(191, 227, 240, 0.22);
  border-radius: 20px;
  box-shadow: 0 20px 46px rgba(4, 12, 18, 0.24);
}
.hero__visual svg { display: block; width: 100%; height: auto; }
.hero__visual figcaption {
  display: grid;
  gap: 0.15rem;
  padding: 0.8rem 0.55rem 0.25rem;
  border-top: 1px solid rgba(191, 227, 240, 0.2);
  color: #a9bdcb;
  font-size: 0.85rem;
  line-height: 1.45;
}
.hero__visual figcaption strong { color: #ffffff; }

@media (min-width: 62em) {
  .hero__in { grid-template-columns: minmax(0, 1.18fr) minmax(20rem, 0.82fr); }
  .hero__visual { margin-inline: auto 0; }
}

/* ---------- section 1: guard types ---------- */

.band--types { background: var(--paper); }
.types__lead { margin-bottom: 1.5rem; }
.types {
  display: grid;
  gap: 1rem;
}
.type-card {
  min-width: 0;
  padding: clamp(1.15rem, 2.6vw, 1.5rem);
  background: var(--shell);
  border: 1px solid var(--line);
  border-top: 4px solid #91afbd;
  border-radius: 14px;
}
.type-card--best {
  background: #eaf4f7;
  border-top-color: var(--water);
}
.type-card__label {
  margin: 0 0 0.55rem;
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.type-card h3 { margin-bottom: 1rem; }
.type-card dl { margin: 0; display: grid; gap: 0.9rem; }
.type-card dt {
  margin-bottom: 0.18rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.type-card dd { margin: 0; }
.types__notes {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: clamp(1.1rem, 2.5vw, 1.45rem);
  background: var(--ink);
  color: #cddbe5;
  border-radius: 14px;
}
@media (min-width: 48em) {
  .types { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .types__notes { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
}

/* ---------- section 2: overflow diagnostic ---------- */

.band--diag { background: var(--sky); }

.diag__grid { display: grid; gap: clamp(1.8rem, 4vw, 2.5rem); }
.diag__grid .lead--side { max-width: 76ch; }

.diag {
  min-width: 0;
  margin: 0;
  padding: clamp(1.1rem, 3vw, 1.6rem);
  border: 0;
  background: var(--paper);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(13, 23, 32, 0.06), 0 10px 26px rgba(13, 23, 32, 0.07);
}
.diag legend {
  padding: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

.diag__opts { display: grid; gap: 0.5rem; margin-top: 0.9rem; }
@media (min-width: 46rem) {
  .diag__opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 68rem) {
  .diag__opts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.diag__opts label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 52px;
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--line);
  border-radius: 11px;
  background: var(--shell);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
}
.diag__opts label:hover { border-color: var(--water); }

.diag__dot {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  background: var(--paper);
}

#ov1:checked ~ .diag__opts label[for="ov1"],
#ov2:checked ~ .diag__opts label[for="ov2"],
#ov3:checked ~ .diag__opts label[for="ov3"],
#ov4:checked ~ .diag__opts label[for="ov4"] {
  border-color: var(--water);
  background: var(--water-lt);
}
#ov1:checked ~ .diag__opts label[for="ov1"] .diag__dot,
#ov2:checked ~ .diag__opts label[for="ov2"] .diag__dot,
#ov3:checked ~ .diag__opts label[for="ov3"] .diag__dot,
#ov4:checked ~ .diag__opts label[for="ov4"] .diag__dot {
  border-color: var(--water-deep);
  background: var(--water-deep);
  box-shadow: inset 0 0 0 3px var(--paper);
}
#ov1:focus-visible ~ .diag__opts label[for="ov1"],
#ov2:focus-visible ~ .diag__opts label[for="ov2"],
#ov3:focus-visible ~ .diag__opts label[for="ov3"],
#ov4:focus-visible ~ .diag__opts label[for="ov4"] {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.diag__out {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.1rem;
}
.dcard {
  display: block;
  opacity: 1;
  border: 2px solid transparent;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
#ov1:checked ~ .diag__out #ovp1,
#ov2:checked ~ .diag__out #ovp2,
#ov3:checked ~ .diag__out #ovp3,
#ov4:checked ~ .diag__out #ovp4 {
  border-color: var(--water);
  box-shadow: 0 0 0 2px rgba(41, 139, 172, 0.16);
}

.dcard {
  padding: clamp(1rem, 2.6vw, 1.4rem);
  background: var(--ink);
  color: #cddbe5;
  border-radius: 13px;
}
.dcard h3 { color: #ffffff; margin-bottom: 0.9rem; font-size: 1.08rem; line-height: 1.3; }
.dcard dl { margin: 0; display: grid; gap: 0.85rem; }
.dcard dt {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #f0c47f;
  margin-bottom: 0.2rem;
}
.dcard dd { margin: 0; }

@media (min-width: 46rem) {
  .diag__out { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .dcard { transition: none; }
}

/* ---------- section 2: company comparison ---------- */

.band--firms { background: var(--paper); }

.firms {
  display: block;
  width: 100%;
  border-collapse: collapse;
}
.firms caption {
  display: block;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.85rem;
}
.firms thead {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.firms tbody { display: grid; gap: 1.1rem; }
@media (min-width: 56em) {
  .firms tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
}

.firms tr {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--shell);
  border: 1px solid var(--line);
  border-top: 4px solid var(--water);
  border-radius: 14px;
  overflow: hidden;
}

.firms th[scope="row"],
.firms td {
  display: block;
  min-width: 0;
  padding: 0.95rem clamp(1rem, 2.4vw, 1.35rem);
  text-align: left;
  font-weight: 400;
  border-top: 1px solid var(--line-2);
  overflow-wrap: anywhere;
}
.firms th[scope="row"] { border-top: 0; background: var(--paper); }

.firms th[scope="row"]::before,
.firms td::before {
  content: attr(data-label);
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.firms th[scope="row"] a {
  display: inline-block;
  min-height: 44px;
  padding-block: 0.25rem;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--water-deep);
}

.firms__after { margin-top: 1.8rem; max-width: 72ch; }
.firms__cost {
  margin-top: 1.25rem;
  max-width: 72ch;
  padding: 1rem 1.15rem;
  background: var(--water-lt);
  border-left: 4px solid var(--water);
  border-radius: 0 10px 10px 0;
}

/* ---------- section 3: roof-water calculator ---------- */

.band--calc {
  background:
    radial-gradient(110% 80% at 15% 0%, #1b3c50 0%, rgba(27, 60, 80, 0) 60%),
    linear-gradient(170deg, var(--ink-2) 0%, var(--ink) 100%);
  color: #b9cbd7;
}
.band--calc h2, .band--calc h3 { color: #ffffff; }
.band--calc a { color: #bfe3f0; }

.calc__grid { display: grid; gap: 1.4rem; }
@media (min-width: 62em) {
  .calc__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: clamp(2rem, 4vw, 3.4rem);
    align-items: start;
  }
  .calc__eyebrow { grid-column: 1; grid-row: 1; }
  .calc__h       { grid-column: 1; grid-row: 2; }
  .calc__intro   { grid-column: 1; grid-row: 3; }
  .calc__after   { grid-column: 1; grid-row: 4; }
  .calc          { grid-column: 2; grid-row: 1 / span 4; }
}

.calc__h { margin-bottom: 0.9rem; }
.calc__intro, .calc__after { max-width: 60ch; }
.calc__after { color: #a9bdcb; }

.calc {
  min-width: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(191, 227, 240, 0.28);
  border-radius: 16px;
  padding: clamp(1.1rem, 3vw, 1.7rem);
}
.band--calc .calc__title {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f0c47f;
  margin-bottom: 1.2rem;
}

.calc__field { margin-bottom: 1.35rem; }
.calc__field label {
  display: block;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.02rem;
  margin-bottom: 0.35rem;
}
.calc__hint { color: #a9bdcb; font-size: 0.94rem; line-height: 1.5; margin: 0 0 0.65rem; }

.calc__entry { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.calc__entry input {
  width: 9.5rem;
  max-width: 100%;
  min-height: 48px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: #ffffff;
  border: 2px solid #bfd3de;
  border-radius: 9px;
}
.calc__entry input:focus-visible { outline: 3px solid var(--focus-lt); outline-offset: 2px; }
.calc__unit { color: #cddbe5; font-weight: 600; }

.calc__warn {
  margin: 0 0 1.2rem;
  padding: 0.55rem 0.8rem;
  border-left: 3px solid #f0c47f;
  background: rgba(240, 196, 127, 0.1);
  color: #f4dcbb;
  font-size: 0.92rem;
  line-height: 1.5;
}
.calc__warn[hidden] { display: none; }

.calc__result {
  margin-bottom: 1.2rem;
  padding: 1.1rem 1.15rem;
  background: rgba(207, 228, 236, 0.12);
  border-radius: 12px;
}
.calc__reslabel {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #f0c47f;
}
.calc__value {
  margin: 0 0 0.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.calc__value output {
  font-size: clamp(2.3rem, 7vw, 3.1rem);
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}
.calc__unit--big { font-size: 1.02rem; color: #cddbe5; }

.calc__note {
  margin: 0 0 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(191, 227, 240, 0.22);
  font-size: 0.94rem;
  line-height: 1.55;
  color: #a9bdcb;
}
.calc__note:last-child { margin-bottom: 0; }
.calc__note strong { color: #ffffff; }

/* ---------- section 4: roof valleys ---------- */

.band--valley { background: var(--mist); }

.valley__grid { display: grid; gap: clamp(1.8rem, 4vw, 3rem); align-items: start; }
@media (min-width: 62em) {
  .valley__grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
}

.valley { margin: 0; min-width: 0; }
.valley svg {
  display: block;
  width: 100%;
  max-width: 26rem;
  height: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.6rem;
}
.valley figcaption {
  margin-top: 0.85rem;
  max-width: 26rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* ---------- section 5: what works underneath ---------- */

.band--system { background: var(--shell); }

.path { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.35rem; }
.path li { position: relative; padding-left: 2.5rem; min-width: 0; }
.path li::before {
  content: "";
  position: absolute;
  left: 8px; top: 1.75rem; bottom: -1.35rem;
  width: 2px;
  background: var(--line);
}
.path li:last-child::before { display: none; }
.path__mark {
  position: absolute;
  left: 0; top: 0.42rem;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--water);
  box-shadow: 0 0 0 4px rgba(29, 111, 139, 0.16);
}
.path strong { display: block; font-size: 1.08rem; margin-bottom: 0.15rem; }
.path span:not(.path__mark) { display: block; }

@media (min-width: 56em) {
  .path { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1.4rem, 3vw, 2.2rem); }
  .path li { padding-left: 0; padding-top: 2.6rem; }
  .path li::before {
    left: 18px; right: calc(-1 * clamp(1.4rem, 3vw, 2.2rem));
    top: 8px; bottom: auto;
    width: auto; height: 2px;
  }
  .path__mark { top: 0; left: 0; }
}

.system__after {
  margin-top: 2.2rem;
  padding-top: 1.4rem;
  border-top: 2px solid var(--line-2);
  max-width: 72ch;
}

/* ---------- section 6: storm test ---------- */

.band--storm { background: var(--paper); }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 1.15rem; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 0 3.1rem;
  min-width: 0;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: -0.15rem;
  width: 2.2rem;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--water);
  font-variant-numeric: tabular-nums;
}
.steps li::after {
  content: "";
  position: absolute;
  left: 0.35rem; top: 2.3rem; bottom: -1.15rem;
  width: 2px;
  background: var(--line-2);
}
.steps li:last-child::after { display: none; }

@media (min-width: 56em) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(2rem, 4vw, 3.2rem); row-gap: 1.5rem; }
  .steps li::after { display: none; }
}

.closing {
  margin-top: 2.4rem;
  padding: clamp(1.2rem, 3vw, 1.7rem);
  background: var(--sky);
  border-left: 5px solid var(--water);
  border-radius: 0 13px 13px 0;
  color: var(--ink);
  max-width: 74ch;
}

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

.foot {
  background: var(--ink);
  color: #a9bdcb;
  padding-block: 2.2rem;
}
.foot__in {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
}
.foot p { margin: 0; max-width: 62ch; font-size: 0.96rem; line-height: 1.6; }
.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.9rem;
  border: 1px solid rgba(191, 227, 240, 0.35);
  border-radius: 8px;
  color: #bfe3f0;
  text-decoration: none;
  font-weight: 600;
}
.foot a:hover { background: rgba(191, 227, 240, 0.12); color: #ffffff; }
.foot a:focus-visible { outline: 3px solid var(--focus-lt); outline-offset: 3px; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
