/* Mandurah Roof Repairs - coastal, calm, sturdy */
:root {
  --sea-950: #0b2230;
  --sea-800: #133649;
  --sea-600: #2a5468;
  --slate-400: #7d919c;
  --zinc-300: #c3ced3;
  --zinc-200: #d6dfe3;
  --mist-50: #eff3f4;
  --white: #ffffff;
  --rust-600: #9a4a24;
  --rust-700: #7a3819;
  --rust-300: #d9a07e;
  --ink: #142630;
  --muted: #4a5f6a;

  --display: "Urbanist", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  --pitch: clamp(14px, 2.6vw, 36px);
  --band-pad: clamp(56px, 8vw, 104px);
  --gutter: 16px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --bar-h: 72px;
}

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

html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--sea-950); }
body { min-height: 100vh; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3 {
  font-family: var(--display);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-weight: 800; font-size: min(clamp(2.35rem, 6.2vw, 4.25rem), 12vw); letter-spacing: -0.025em; overflow-wrap: anywhere; }
h2 { font-weight: 800; font-size: clamp(1.75rem, 3.6vw, 2.6rem); }
h3 { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.005em; }
p { margin: 0; }
p + p { margin-top: 0.85em; }

a { color: inherit; }
:focus-visible { outline: 3px solid var(--rust-300); outline-offset: 3px; border-radius: 2px; }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 761px) { :root { --gutter: 32px; } }

.skip {
  position: absolute; left: 8px; top: 8px; transform: translateY(calc(-100% - 16px)); z-index: 100;
  background: var(--white); color: var(--sea-950);
  padding: 12px 16px; min-height: 44px; font-weight: 700;
}
.skip:focus { transform: none; }

.icon { width: 24px; height: 24px; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px;
  border: 2px solid transparent; border-radius: 4px;
  font-family: var(--display); font-weight: 700; font-size: 1.0625rem; letter-spacing: 0.005em;
  text-decoration: none; cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.btn:active { transform: scale(0.97); }
.btn .icon { width: 20px; height: 20px; }
.btn-rust { background: var(--rust-600); color: var(--white); border-color: var(--rust-600); }
.btn-ghost { background: transparent; color: var(--white); border-color: rgba(214, 223, 227, 0.55); }
.btn-ghost-dark { background: transparent; color: var(--sea-950); border-color: var(--sea-600); }
@media (hover: hover) and (pointer: fine) {
  .btn-rust:hover { background: var(--rust-700); border-color: var(--rust-700); }
  .btn-ghost:hover { border-color: var(--white); background: rgba(255, 255, 255, 0.06); }
  .btn-ghost-dark:hover { background: var(--mist-50); }
  .site-nav a:hover { color: var(--white); }
  .foot a:hover { color: var(--white); }
  .text-link:hover { color: var(--rust-700); }
}

/* ---------- Header ---------- */
.site-head { background: var(--sea-950); color: var(--zinc-200); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; min-height: 72px; }
.brand {
  white-space: nowrap; min-width: 0;
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  color: var(--white); text-decoration: none;
  font-family: var(--display); font-weight: 800; font-size: 1.125rem; letter-spacing: -0.01em;
}
.brand svg { width: 34px; height: 22px; }
.site-head .brand { flex: 0 1 auto; }
@media (max-width: 760px) { .brand { white-space: normal; } }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  color: var(--zinc-300); text-decoration: none; font-size: 0.97rem; font-weight: 600;
  transition: color 160ms ease;
}
.site-nav a[aria-current="page"] { color: var(--white); text-decoration: underline; text-decoration-color: var(--rust-300); text-underline-offset: 6px; text-decoration-thickness: 2px; }
.site-nav .btn { margin-left: 8px; min-height: 44px; padding: 0 16px; font-size: 0.97rem; }
.site-nav .btn-rust, .site-nav .btn-rust:hover { color: var(--white); }
.site-nav .nav-wide { display: none; }
.lbl-short { display: none; }
@media (max-width: 760px) { .lbl-long { display: none; } .lbl-short { display: inline; } .site-head .brand { font-size: 1.0625rem; } }
@media (min-width: 900px) { .site-nav .nav-wide { display: inline-flex; } }
@media (max-width: 760px) { .site-nav .btn { display: none; } }

/* ---------- Bands + roofline dividers ---------- */
.band { position: relative; padding-block: var(--band-pad); }
.band.pitch {
  margin-top: calc(var(--pitch) * -1);
  padding-top: calc(var(--band-pad) + var(--pitch));
  -webkit-clip-path: polygon(0 var(--pitch), 64% 0, 100% var(--pitch), 100% 100%, 0 100%);
  clip-path: polygon(0 var(--pitch), 64% 0, 100% var(--pitch), 100% 100%, 0 100%);
}
.tone-dark { background: var(--sea-950); color: var(--zinc-200); }
.tone-deep { background: var(--sea-800); color: var(--zinc-200); }
.tone-mist { background: var(--mist-50); }
.tone-white { background: var(--white); }
.tone-dark h1, .tone-dark h2, .tone-dark h3, .tone-deep h2, .tone-deep h3 { color: var(--white); }

.lede { font-size: 1.125rem; color: var(--muted); max-width: 62ch; margin-top: 16px; }
.tone-dark .lede, .tone-deep .lede { color: var(--zinc-300); }
.head-block { max-width: 760px; margin-bottom: clamp(32px, 4vw, 48px); }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(40px, 6vw, 80px); padding-bottom: calc(var(--band-pad) + 8px); }
.hero-grid { display: grid; gap: clamp(32px, 5vw, 64px); align-items: center; }
@media (min-width: 980px) { .hero-grid { grid-template-columns: 1.05fr 1fr; } }
.hero h1 { color: var(--white); max-width: 15ch; }
.hero .lede { color: var(--zinc-300); font-size: 1.1875rem; margin-top: 20px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-note { margin-top: 20px; font-size: 0.95rem; color: var(--slate-400); max-width: 46ch; }

.diagram { margin: 0; }
.diagram svg { width: 100%; height: auto; }
.diagram figcaption { margin-top: 12px; font-size: 0.9rem; color: var(--slate-400); max-width: 52ch; }
.d-frame { stroke: var(--zinc-300); stroke-width: 3; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.d-thin { stroke: var(--slate-400); stroke-width: 1.5; fill: none; stroke-linecap: round; }
.d-faint { stroke: var(--sea-600); stroke-width: 2; fill: none; }
.d-tile { stroke: var(--zinc-200); stroke-width: 4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.d-sheet { stroke: var(--zinc-200); stroke-width: 4; fill: none; stroke-linecap: round; }
.d-fault { stroke: var(--rust-300); stroke-width: 4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.d-fault-fill { fill: var(--rust-300); }
.d-screw { fill: var(--zinc-300); }
.d-rust { fill: var(--rust-300); }
.d-bed { fill: var(--sea-600); stroke: var(--zinc-300); stroke-width: 1.5; }
.d-mark circle { fill: var(--rust-600); stroke: var(--sea-950); stroke-width: 3; }
.d-mark text { fill: var(--white); font-family: var(--display); font-weight: 800; font-size: 19px; text-anchor: middle; dominant-baseline: central; }
.d-lead { stroke: var(--rust-300); stroke-width: 1.5; fill: none; stroke-dasharray: 3 4; }

.d-draw { stroke-dasharray: 700; stroke-dashoffset: 0; animation: draw 1100ms var(--ease-out) 120ms both; }
@keyframes draw { from { stroke-dashoffset: 700; } to { stroke-dashoffset: 0; } }
.d-mark { animation: pop 320ms var(--ease-out) both; transform-box: fill-box; transform-origin: center; }
.d-mark:nth-of-type(1) { animation-delay: 700ms; }
.d-mark:nth-of-type(2) { animation-delay: 760ms; }
.d-mark:nth-of-type(3) { animation-delay: 820ms; }
.d-mark:nth-of-type(4) { animation-delay: 880ms; }
.d-mark:nth-of-type(5) { animation-delay: 940ms; }
.d-mark:nth-of-type(6) { animation-delay: 1000ms; }
.d-mark:nth-of-type(7) { animation-delay: 1060ms; }
@keyframes pop { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .d-draw, .d-mark { animation: none; }
  .btn, .btn:active { transition: none; transform: none; }
}

/* ---------- Steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; counter-reset: step; }
@media (min-width: 761px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 32px; } }
.steps li { counter-increment: step; position: relative; padding-top: 20px; border-top: 3px solid var(--sea-950); }
.steps li::before {
  content: counter(step); display: block;
  font-family: var(--display); font-weight: 800; font-size: 2.75rem; line-height: 1; color: var(--rust-600);
  margin-bottom: 14px;
}
.steps .icon { position: absolute; right: 0; top: 24px; color: var(--sea-600); width: 28px; height: 28px; }
.steps h3 { margin-bottom: 8px; }
.steps p { color: var(--muted); }

/* ---------- Problems ---------- */
.problems { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 48px; }
@media (min-width: 761px) { .problems { grid-template-columns: 1fr 1fr; } }
.problems li { display: grid; grid-template-columns: 40px 1fr; gap: 16px; padding: 22px 0; border-top: 1px solid var(--zinc-300); }
.num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--rust-600); color: var(--white);
  font-family: var(--display); font-weight: 800; font-size: 1.05rem;
}
.problems h3 { margin: 4px 0 6px; }
.problems p { color: var(--muted); }

/* ---------- Options (dark) ---------- */
.options { display: grid; gap: 0; margin: 0; }
@media (min-width: 761px) { .options { grid-template-columns: 1fr 1fr; column-gap: 48px; } }
.options div { padding: 22px 0; border-top: 1px solid rgba(195, 206, 211, 0.25); }
.options dt { font-family: var(--display); font-weight: 700; font-size: 1.3rem; color: var(--white); margin-bottom: 6px; }
.options dd { margin: 0; color: var(--zinc-300); }
.roof-types { display: grid; gap: 20px; margin-top: clamp(36px, 5vw, 56px); }
@media (min-width: 761px) { .roof-types { grid-template-columns: 1fr 1fr; gap: 24px; } }
.roof-type { background: var(--sea-950); border-left: 4px solid var(--rust-600); padding: 24px; border-radius: 2px; }
.roof-type h3 { margin-bottom: 4px; }
.roof-type .sub { color: var(--slate-400); font-size: 0.95rem; margin-bottom: 12px; }
.roof-type ul { margin: 0; padding-left: 20px; color: var(--zinc-200); }
.roof-type li + li { margin-top: 4px; }
.roof-type li::marker { color: var(--rust-300); }

/* ---------- Cost factors ---------- */
.factors { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 48px; }
@media (min-width: 761px) { .factors { grid-template-columns: 1fr 1fr; } }
.factors li { padding: 18px 0 18px 20px; border-top: 1px solid var(--zinc-300); position: relative; }
.factors li::before { content: ""; position: absolute; left: 0; top: 27px; width: 8px; height: 8px; background: var(--rust-600); transform: rotate(45deg); }
.factors strong { font-family: var(--display); font-weight: 700; font-size: 1.15rem; display: block; margin-bottom: 2px; }
.factors span { color: var(--muted); }
.note-line { margin-top: 28px; max-width: 64ch; color: var(--muted); font-size: 1rem; }

/* ---------- Local ---------- */
.local-grid { display: grid; gap: 28px 48px; }
@media (min-width: 761px) { .local-grid { grid-template-columns: 1fr 1fr; } }
.local-item { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.local-item .ico-box { width: 44px; height: 44px; border-radius: 4px; background: var(--mist-50); color: var(--sea-600); display: inline-flex; align-items: center; justify-content: center; }
.local-item h3 { margin: 8px 0 6px; }
.local-item p { color: var(--muted); }

.suburbs { margin-top: clamp(48px, 6vw, 72px); padding-top: 32px; border-top: 3px solid var(--sea-950); }
.suburbs h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.suburbs p { color: var(--muted); margin-top: 10px; max-width: 64ch; }
.suburb-list { list-style: none; margin: 20px 0 0; padding: 0; columns: 2; column-gap: 24px; }
@media (min-width: 761px) { .suburb-list { columns: 4; } }
.suburb-list li { padding: 6px 0; break-inside: avoid; font-weight: 600; border-bottom: 1px solid var(--zinc-200); }

/* ---------- FAQ ---------- */
.faq { max-width: 860px; }
.faq details { border-top: 1px solid var(--zinc-300); }
.faq details:last-child { border-bottom: 1px solid var(--zinc-300); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; padding: 14px 0;
  font-family: var(--display); font-weight: 700; font-size: 1.2rem; line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 12px; height: 12px;
  border-right: 2.5px solid var(--rust-600); border-bottom: 2.5px solid var(--rust-600);
  transform: translateY(-3px) rotate(45deg);
  transition: transform 200ms var(--ease-out);
}
.faq details[open] summary::after { transform: translateY(3px) rotate(-135deg); }
.faq .answer { padding: 0 0 22px; color: var(--muted); max-width: 70ch; }

/* ---------- Quote ---------- */
.quote-grid { display: grid; gap: 36px; align-items: start; }
.quote-grid > * { min-width: 0; }
@media (min-width: 980px) { .quote-grid { grid-template-columns: 0.9fr 1.1fr; gap: 64px; } }
.quote-copy .lede { margin-top: 16px; }
.quote-small { margin-top: 20px; color: var(--slate-400); font-size: 0.95rem; max-width: 48ch; }

.form-panel { background: var(--white); color: var(--ink); border-radius: 6px; padding: clamp(20px, 4vw, 36px); border-top: 6px solid var(--rust-600); }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 1rem; }
.field .opt { font-weight: 400; color: var(--muted); }
.field input, .field textarea, .field select {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%;
  min-height: 52px; padding: 12px 14px;
  font: inherit; font-size: 17px; line-height: 1.4;
  color: var(--ink); background-color: var(--white);
  border: 1.5px solid var(--slate-400); border-radius: 4px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field textarea { min-height: 132px; resize: vertical; }
.field select {
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%239a4a24' stroke-width='2.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--sea-600); box-shadow: 0 0 0 3px rgba(42, 84, 104, 0.25); }
.field-row { display: grid; gap: 0 16px; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.form-panel .btn { width: 100%; margin-top: 4px; }
.form-panel .btn:disabled { opacity: 0.6; cursor: wait; transform: none; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-msg { margin-top: 16px; padding: 14px 16px 14px 18px; border-radius: 4px; background: var(--mist-50); color: var(--ink); border-left: 4px solid var(--sea-600); font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.form-msg:focus { outline: none; }
.form-msg:focus-visible { outline: 3px solid var(--rust-300); outline-offset: 3px; }
.form-msg[hidden] { display: none; }
.form-msg[data-state="ok"] { background: #e7f0f3; color: var(--sea-950); border-left-color: var(--sea-600); }
.form-msg[data-state="error"] { background: #fbeee7; color: var(--rust-700); border-left-color: var(--rust-600); }
.form-msg.show { animation: msg-in 220ms var(--ease-out) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .form-msg.show { animation: none; } }
.form-fine { margin-top: 14px; font-size: 0.93rem; color: var(--muted); }
.text-link {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--rust-600); font-weight: 700; text-underline-offset: 4px;
}

/* ---------- Plain pages ---------- */
.page-head { padding-top: clamp(40px, 6vw, 72px); padding-bottom: calc(var(--band-pad) * 0.8); }
.page-head h1 { color: var(--white); max-width: 18ch; font-size: clamp(2.1rem, 5vw, 3.4rem); }
.prose { max-width: 70ch; }
.prose h2 { font-size: clamp(1.45rem, 2.8vw, 1.9rem); margin: 44px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--muted); }
.prose ul, .prose ol { padding-left: 22px; margin: 12px 0 0; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--rust-600); font-weight: 700; }
.prose .btn { margin-top: 20px; }

/* ---------- 404 ---------- */
.nf { padding-bottom: calc(var(--band-pad) * 1.2); }
.nf-code { font-family: var(--display); font-weight: 800; font-size: clamp(3.5rem, 12vw, 6rem); line-height: 1; color: var(--rust-300); letter-spacing: -0.03em; margin-bottom: 12px; }
.nf .hero-ctas { margin-top: 28px; }

/* ---------- Footer ---------- */
.foot { background: var(--sea-950); color: var(--slate-400); padding: 48px 0 40px; font-size: 0.95rem; border-top: 1px solid rgba(125, 145, 156, 0.25); }
.foot .brand { font-size: 1.05rem; }
.foot-links { list-style: none; display: flex; flex-wrap: wrap; gap: 0 20px; margin: 12px 0 20px; padding: 0; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; color: var(--zinc-300); text-decoration: none; font-weight: 600; }
.foot p { max-width: 70ch; }

/* ---------- Phone bottom bar ---------- */
.bottom-bar { display: none; }
@media (max-width: 760px) {
  body { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px)); }
  .bottom-bar {
    display: block;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    width: 100%;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--sea-950);
    border-top: 1px solid rgba(195, 206, 211, 0.2);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden; backface-visibility: hidden;
  }
  .bottom-bar .btn { display: flex; min-height: 52px; padding: 0 12px; width: 100%; }
}

/* 200% text: let hero columns shrink instead of pushing past the screen */
.hero > *, .hero * { min-width: 0; }
