/* site.css — Ace Countertops content-page design system (served pages).
   Shares the landing's tokens: near-black + gold ramp, Segoe UI. Used by every
   aceserve-rendered page (server/templates/*). The one-page landing keeps its
   own landing.css; this styles /about, /services, /projects, /guides, etc. */
:root {
  --bg: #141414; --bg-deep: #0F0F0E; --surface: #1B1A17; --surface-2: #211F1B;
  --surface-hover: #262420; --fg: #F5F1E6; --fg-muted: #C8C1B2; --fg-subtle: #9B9483;
  --border: #2D2A24; --border-strong: #4A4232;
  --gold-hi: #F1E2A0; --gold: #D2AE5A; --gold-deep: #8C6E2E;
  --radius: 8px; --maxw: 1140px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --pad: clamp(1.25rem, 5vw, 4rem);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 34px rgba(0,0,0,.32);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { line-height: 1.14; letter-spacing: -.01em; margin: 0 0 .45em; font-weight: 700; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hi); text-decoration: underline; }
img { max-width: 100%; display: block; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; background: var(--surface); padding: 10px 16px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 12px; top: 12px; }
.center { text-align: center; }
.muted { color: var(--fg-muted); }

/* buttons */
.btn { display: inline-block; padding: 12px 22px; border-radius: var(--radius); font-weight: 600; border: 1px solid transparent; cursor: pointer; font-size: 15px; line-height: 1.2; transition: transform .12s ease, background .2s ease, border-color .2s; text-align: center; }
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, var(--gold-hi), var(--gold)); color: #201a0c; }
.btn-primary:hover { background: linear-gradient(135deg, #fff0bf, var(--gold-hi)); color: #201a0c; }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-hi); }
.btn-sm { padding: 9px 15px; font-size: 14px; }
/* .mainnav a / .site-foot a set light link colors at higher specificity than
   .btn-primary — gold buttons inside them must keep the dark label. */
.mainnav a.btn-primary, .site-foot a.btn-primary,
.mainnav a.btn-primary:hover, .site-foot a.btn-primary:hover { color: #201a0c; }

/* header */
.site-head { position: sticky; top: 0; z-index: 50; background: rgba(20,20,20,.86); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.head-row { display: flex; align-items: center; gap: 20px; padding-block: 13px; } /* padding-block: the shorthand would zero .wrap's side padding */
.brand { display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand img { height: 22px; width: auto; }
.mainnav { margin-left: auto; }
.mainnav a { color: var(--fg); font-weight: 500; font-size: 15px; }
.mainnav a:hover, .mainnav a[aria-current=page] { color: var(--gold-hi); text-decoration: none; }
.navlist { display: flex; gap: 22px; align-items: center; list-style: none; margin: 0; padding: 0; }
.navitem { position: relative; }

/* Group triggers are real buttons (disclosure pattern) — the menus open on
   click/Enter/Space and on ArrowDown, never on hover, so they are usable by
   keyboard and touch alike. Visibility is driven straight off aria-expanded,
   which means the ARIA state and the pixels can never disagree. */
.navbtn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 6px 0; margin: 0;
  font: inherit; font-weight: 500; font-size: 15px; color: var(--fg); cursor: pointer; }
.navbtn:hover, .navbtn[aria-expanded=true], .navbtn[data-section=current] { color: var(--gold-hi); }
.navbtn .caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid currentColor; opacity: .7; transition: transform .15s ease; }
.navbtn[aria-expanded=true] .caret { transform: rotate(180deg); }
.navbtn:focus-visible, .navtoggle:focus-visible, .mainnav a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.submenu { display: none; position: absolute; top: 100%; left: -14px; min-width: 15rem; z-index: 60;
  list-style: none; margin: 8px 0 0; padding: 8px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.navbtn[aria-expanded=true] + .submenu { display: block; }
.submenu li { margin: 0; }
.submenu a { display: block; padding: 9px 12px; border-radius: 7px; font-weight: 400; white-space: nowrap; }
.submenu a:hover, .submenu a:focus-visible { background: rgba(210,174,90,.12); }
.submenu a[aria-current=page] { background: rgba(210,174,90,.16); }
.navcta { margin-left: 4px; }

.navtoggle { display: none; margin-left: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; cursor: pointer; color: var(--fg); font-size: 18px; }

/* No JS: nothing can toggle aria-expanded, so lay every group out in flow
   rather than leaving four dead buttons. The footer already links the whole
   site, but the header must not be a trap either. */
.nojs .navbtn { cursor: default; }
.nojs .navbtn .caret { display: none; }
.nojs .submenu { display: block; position: static; min-width: 0; margin: 0; padding: 0 0 0 10px;
  background: none; border: 0; box-shadow: none; }

@media (max-width: 860px) {
  .mainnav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface);
    border-bottom: 1px solid var(--border); padding: 8px var(--pad) 16px; max-height: calc(100vh - 60px); overflow-y: auto; }
  .site-head[data-open=true] .mainnav, .nojs .mainnav { display: block; }
  .navlist { flex-direction: column; gap: 0; align-items: stretch; }
  .navitem { position: static; }
  .navbtn { width: 100%; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .submenu { position: static; min-width: 0; margin: 0 0 8px; padding: 4px 0 4px 12px;
    background: none; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; }
  .submenu a { padding: 10px 0; white-space: normal; }
  .navcta { margin: 12px 0 0; }
  .navcta .btn { display: block; text-align: center; }
  .navtoggle { display: block; }
}

/* breadcrumbs */
.crumbs { font-size: .85rem; color: var(--fg-subtle); padding-block: 18px 0; } /* padding-block: the shorthand would zero .wrap's side padding */
.crumbs a { color: var(--fg-subtle); }
.crumbs a:hover { color: var(--gold); }
.crumbs .sep { margin: 0 7px; opacity: .5; }
.crumbs .here { color: var(--fg-muted); }

/* hero / page head */
.phead { padding: 54px 0 30px; position: relative; overflow: hidden; }
.phead::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 90% at 85% -20%, rgba(210,174,90,.14), transparent 70%); }
.eyebrow { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; background: rgba(210,174,90,.12); color: var(--gold-hi); margin-bottom: 14px; }
.phead h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 .2em; }
.phead .tag { font-size: clamp(1.02rem, 2.2vw, 1.25rem); color: var(--fg-muted); max-width: 60ch; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* sections */
main section { padding: 30px 0; }
main section:last-of-type { padding-bottom: 64px; }
section h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
.lead { color: var(--fg-muted); margin: 0 0 26px; max-width: 62ch; font-size: 1.05rem; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.cardx { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); transition: transform .15s ease, border-color .2s ease; display: block; color: inherit; }
a.cardx:hover { transform: translateY(-3px); border-color: var(--border-strong); text-decoration: none; }
.cardx h3 { margin: 0 0 7px; font-size: 1.16rem; }
.cardx p { margin: 0; color: var(--fg-muted); font-size: .95rem; }
.cardx .more { display: inline-block; margin-top: 12px; color: var(--gold); font-weight: 600; font-size: .9rem; }
.pill { display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: 12px; font-weight: 600; background: rgba(210,174,90,.13); color: var(--gold-hi); margin-bottom: 10px; }

/* page hero image band */
.pagehero { position: relative; margin-bottom: 8px; }
.pagehero picture, .pagehero-img { display: block; width: 100%; }
.pagehero-img { height: clamp(220px, 40vh, 460px); object-fit: cover; }
.pagehero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(20,20,20,.15), rgba(20,20,20,.55)); }

/* thumbs */
.thumb { aspect-ratio: 4/3; width: 100%; object-fit: cover; border-radius: 6px; margin-bottom: 14px; background: var(--surface-2); }
.thumb picture { display: block; }
.thumb-sm { aspect-ratio: 1/1; border-radius: 6px; }
.cardx picture img.thumb { margin-bottom: 14px; }
.prodhero { aspect-ratio: 16/11; }

/* offer band */
.band { background: linear-gradient(135deg, var(--surface-2), var(--surface)); border: 1px solid var(--border-strong); border-radius: 14px; padding: 30px; display: flex; gap: 22px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.band h3 { font-size: 1.5rem; margin: 0 0 6px; color: var(--gold-hi); }
.band p { margin: 0; color: var(--fg-muted); }

/* stats / areas */
.stats { display: flex; gap: 40px; flex-wrap: wrap; margin: 8px 0 4px; }
.stat b { font-size: 2rem; display: block; color: var(--gold); }
.stat span { color: var(--fg-muted); font-size: .88rem; }
.areas { display: flex; gap: 8px; flex-wrap: wrap; }
.areas span { padding: 5px 13px; border: 1px solid var(--border); border-radius: 20px; font-size: .85rem; background: var(--surface); color: var(--fg-muted); }

/* prose / article */
.prose { max-width: 72ch; }
.prose h2 { font-size: 1.4rem; margin: 1.5em 0 .4em; }
.prose h3 { font-size: 1.15rem; margin: 1.3em 0 .35em; }
.prose p { margin: 0 0 1.1em; color: var(--fg); }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.3em; color: var(--fg-muted); }
.prose li { margin: .3em 0; }
.byline { color: var(--fg-subtle); font-size: .9rem; margin-bottom: 10px; }

/* reviews */
.review { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stars { color: var(--gold); letter-spacing: 2px; }
.review .who { color: var(--fg-subtle); font-size: .88rem; margin-top: 8px; }

/* faq */
.faq { max-width: 74ch; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; padding: 2px 20px; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 600; font-size: 1.04rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold); font-size: 1.4rem; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .ans { padding: 0 0 18px; color: var(--fg-muted); }

/* forms */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 26px; box-shadow: var(--shadow); max-width: 640px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field input, .field textarea { width: 100%; font: inherit; font-size: 15px; padding: 11px 13px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--bg-deep); color: var(--fg); }
.field textarea { min-height: 96px; resize: vertical; }
.formmsg { margin-top: 12px; font-size: .95rem; color: var(--gold-hi); }

/* definition list (specs) */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.dl dt { color: var(--fg-subtle); }
.dl dd { margin: 0; }

/* footer */
.site-foot { border-top: 1px solid var(--border); margin-top: 12px; padding: 46px 0 40px; color: var(--fg-muted); font-size: .92rem; background: var(--bg-deep); }
.foot-grid { display: grid; gap: 28px; grid-template-columns: 1.6fr repeat(4, 1fr); }
@media (max-width: 960px) { .foot-grid { grid-template-columns: 1fr 1fr 1fr; } }
@media (max-width: 620px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 400px) { .foot-grid { grid-template-columns: 1fr; } }
.site-foot h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--fg); margin-bottom: 12px; }
.site-foot a { color: var(--fg-muted); display: block; padding: 3px 0; }
.site-foot a:hover { color: var(--gold); }
.site-foot .brand img { height: 24px; margin-bottom: 12px; }
.foot-legal { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--fg-subtle); }
.foot-legal .links a { display: inline; margin-right: 14px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto; } }

/* ── page_sections renderer (templates/sections.html) ─────────────────────── */
.pg-toc { border-bottom: 1px solid var(--border); background: var(--bg-deep); }
.pg-toc ol { display: flex; flex-wrap: wrap; gap: 4px 22px; list-style: none; margin: 0; padding: 12px 0; font-size: .88rem; }
.pg-toc a { color: var(--fg-muted); }
.pg-toc a:hover { color: var(--gold-hi); }
.pg-sec { padding: 34px 0 6px; }
.pg-sec h2 { margin-bottom: 6px; }
.pg-sec .sub { color: var(--fg-subtle); margin-bottom: 18px; max-width: 70ch; }
.pg-sec p { color: var(--fg-muted); max-width: 74ch; }
.pg-sec ul, .pg-sec ol { color: var(--fg-muted); max-width: 74ch; padding-left: 1.2em; }
.pg-sec li { margin-bottom: .4em; }
/* faq kind reuses the .faq details look */
.pg-sec .qa { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; padding: 2px 20px; max-width: 74ch; }
.pg-sec .qa summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.pg-sec .qa summary::-webkit-details-marker { display: none; }
.pg-sec .qa summary::after { content: "+"; color: var(--gold); font-size: 1.3rem; line-height: 1; transition: transform .2s; }
.pg-sec .qa[open] summary::after { transform: rotate(45deg); }
.pg-sec .qa p { padding-bottom: 6px; }
/* tables */
.pg-sec .tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; max-width: 100%; }
.pg-sec table { border-collapse: collapse; width: 100%; font-size: .93rem; }
.pg-sec th { text-align: left; padding: 11px 14px; background: var(--surface); color: var(--fg); border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.pg-sec td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--fg-muted); }
.pg-sec tbody tr:last-child td { border-bottom: 0; }
.pg-sec .footnote { font-size: .82rem; color: var(--fg-subtle); margin-top: 8px; }
/* steps */
.pg-sec .steps { list-style: none; padding: 0; counter-reset: step; max-width: 74ch; }
.pg-sec .steps > li { counter-increment: step; position: relative; padding: 0 0 18px 52px; }
.pg-sec .steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(210,174,90,.14); color: var(--gold-hi); font-weight: 700; }
.pg-sec .steps h3 { margin: 4px 0 4px; font-size: 1.05rem; }
.pg-sec .stepmeta { font-size: .82rem; color: var(--fg-subtle); margin-bottom: 4px; }
.pg-sec .steptip { font-size: .9rem; color: var(--fg-subtle); border-left: 2px solid var(--gold); padding-left: 10px; }
/* cards + gallery */
.pg-sec .cardgrid { list-style: none; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); max-width: none; }
.pg-sec .cardgrid .card a { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; height: 100%; color: var(--fg); }
.pg-sec .cardgrid .card a:hover { border-color: var(--gold); text-decoration: none; }
.pg-sec .cardgrid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; margin-bottom: 10px; }
.pg-sec .cardgrid h3 { font-size: 1rem; margin-bottom: 4px; }
.pg-sec .gallery { list-style: none; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); max-width: none; }
.pg-sec .gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; }
.pg-sec .gallery figcaption { font-size: .82rem; color: var(--fg-subtle); padding-top: 6px; }
/* cta kind buttons (generator emits .btn / .btn.ghost) */
.pg-sec .ctarow { display: flex; gap: 12px; flex-wrap: wrap; }
.pg-sec .ctarow .btn { background: linear-gradient(135deg, var(--gold-hi), var(--gold)); color: #201a0c; }
.pg-sec .ctarow .btn.ghost { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.pg-sec .ctarow .btn.ghost:hover { border-color: var(--gold); color: var(--gold-hi); }
.pg-sec .cite { font-size: .8rem; color: var(--fg-subtle); }
