/* ============================================================================
   CROWN COMFORT SOLUTIONS - shared styles for every page.
   Change a color or font here once and it updates the whole site.
   ============================================================================ */

/* ---- Crown Comfort brand tokens (from the Brand Kit) ---- */
:root {
  --green:      #3DAA0B;   /* Crown Green - the one accent */
  --green-dk:   #2E8B03;   /* darker green for hover */
  --ink:        #000000;   /* Black - page ground */
  --ink-2:      #000000;   /* black (sections separated by hairline borders) */
  --white:      #FFFFFF;
  --grey:       #9CA3AF;   /* mid grey */
  --grey-soft:  rgba(255,255,255,0.64);
  --line:       rgba(156,163,175,0.18);
  --font: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-display: 'sweet-square-pro', 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --header-h: 76px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  font-family: var(--font);
  background: var(--ink);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { display: block; }

/* Keyboard focus: a strong, visible indicator everywhere (green on the black
   ground; white ring on the green buttons so it shows against green). */
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-radius: 2px; }
.btn-primary:focus-visible, .call-btn:focus-visible { outline-color: #fff; }

/* Skip-to-content link (visually hidden until focused) */
.skip { position: absolute; left: -9999px; top: 0; z-index: 300; background: var(--green); color: #000; font-family: var(--font-display); font-weight: 900; padding: 12px 18px; border-radius: 0 0 6px 0; }
.skip:focus { left: 0; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

h2 {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(1.7rem, 4.2vw, 2.7rem); line-height: 1.1; letter-spacing: -.005em;
}
.accent { color: var(--green); }

/* =====================  HEADER / NAV  ===================== */
/* Fixed overlay header. On the home page it is transparent over the hero and
   fades into a solid bar (with the logo) once you scroll past the hero. On the
   interior pages the header carries class="scrolled" so it is solid from the
   start. The menu button is always visible. */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); padding: 0 22px;
  background: transparent; border-bottom: 1px solid transparent;
  transition: background .35s ease, border-color .35s ease, backdrop-filter .35s ease;
}
header.scrolled {
  background: rgba(0,0,0,0.86);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .4s ease, transform .4s ease; }
header.scrolled .brand { opacity: 1; transform: none; pointer-events: auto; }
.brand img { height: 36px; width: auto; }

.nav-right { display: flex; align-items: center; gap: 22px; }
nav.links { display: none; }
nav.links a { font-family: var(--font); font-weight: 600; font-size: 13px; letter-spacing: .03em; color: var(--grey-soft); position: relative; padding: 8px 0; transition: color .18s ease; }
nav.links a:hover { color: var(--white); }
nav.links a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -5px; height: 2px; background: var(--green); transition: right .22s ease; }
nav.links a:hover::after { right: 0; }

.call-btn {
  display: none; align-items: center; gap: 8px;
  background: var(--green); color: #000;
  font-family: var(--font-display); font-weight: 900; font-size: 15px; letter-spacing: .03em;
  padding: 13px 20px; border-radius: 4px; white-space: nowrap;
  transition: background .18s ease, transform .18s ease;
}
.call-btn:hover { background: var(--green-dk); color: #000; transform: translateY(-1px); }

.burger { display: inline-flex; flex-direction: column; gap: 5px; padding: 10px; cursor: pointer; background: none; border: 0; }
.burger span { width: 26px; height: 2px; background: var(--white); transition: .25s ease; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 200; background: var(--ink-2);
  display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 32px 30px;
  transform: translateY(-100%); transition: transform .32s cubic-bezier(.4,0,.2,1);
}
.mobile-menu.open { transform: translateY(0); }
.mobile-menu a {
  font-family: var(--font-display); font-weight: 900; font-size: 26px; color: var(--white);
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.mobile-menu a small { display: block; font-family: var(--font); font-weight: 400; font-size: 12px; letter-spacing: .04em; color: var(--grey); margin-top: 4px; }
.mobile-menu .call-btn { display: inline-flex; margin-top: 26px; font-size: 17px; padding: 16px 22px; justify-content: center; }
.mobile-menu .mm-close { position: absolute; top: 22px; right: 22px; }

/* =====================  BUTTONS  ===================== */
.cta-row { display: flex; flex-wrap: wrap; gap: 13px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 900; font-size: 15px; letter-spacing: .02em;
  padding: 16px 24px; border-radius: 4px; transition: .18s ease;
}
.btn-primary { background: var(--green); color: #000; }
.btn-primary:hover { background: var(--green-dk); color: #000; transform: translateY(-1px); }
.btn-ghost { border: 1.5px solid rgba(255,255,255,.45); color: var(--white); }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.btn .arrow { transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(4px); }

/* =====================  HOME HERO (contact above the fold)  ===================== */
.hero {
  position: relative; overflow: hidden;
  min-height: 100svh;
  display: flex; align-items: center;
  padding: var(--header-h) 0 48px;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(58% 55% at 80% 45%, rgba(61,170,11,0.20), transparent 70%);
}
/* airflow motif - white + green particle wave (rendered on canvas) */
.airflow {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 1; pointer-events: none;
  -webkit-mask-image: radial-gradient(130% 100% at 78% 60%, #000 35%, rgba(0,0,0,.35) 78%, transparent 100%);
          mask-image: radial-gradient(130% 100% at 78% 60%, #000 35%, rgba(0,0,0,.35) 78%, transparent 100%);
}
/* service banner pinned to the bottom of the hero */
.ribbon {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  height: 46px; display: flex; align-items: center; overflow: hidden;
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,0.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.ribbon-track { display: flex; align-items: center; white-space: nowrap; will-change: transform; }
.ribbon span { font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--grey-soft); padding: 0 20px; }
.ribbon i { color: var(--green); font-style: normal; font-size: 8px; }

.hero .wrap { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
.hero .copy { max-width: 640px; }
.badge-hero { width: clamp(190px, 60vw, 300px); height: auto; margin: 0 auto 8px; filter: drop-shadow(0 20px 50px rgba(0,0,0,.5)); }

h1 {
  font-family: var(--font-display); font-weight: 900; line-height: 1.08; letter-spacing: -.01em;
  font-size: clamp(2.3rem, 9vw, 4.6rem); margin-bottom: 16px;
}
.sub { font-weight: 400; color: var(--grey-soft); line-height: 1.55; font-size: clamp(1rem, 2.4vw, 1.18rem); max-width: 32em; margin-bottom: 14px; }
.area { font-weight: 500; font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--grey); margin-bottom: 26px; }
.area b { color: var(--white); font-weight: 900; }

/* =====================  INTERIOR PAGE HERO  ===================== */
.page-hero { position: relative; padding: calc(var(--header-h) + 48px) 0 32px; }
.page-hero h1 { font-size: clamp(2rem, 5.5vw, 3.4rem); line-height: 1.07; margin-bottom: 18px; }
.page-hero .sub { max-width: 48em; color: rgba(255,255,255,.78); }

/* =====================  SECTIONS  ===================== */
section { padding: clamp(48px, 6.5vw, 80px) 0; }
.hero + section { padding-top: clamp(44px, 5.5vw, 68px); }      /* settle the dark->light jump */
.page-hero + section { padding-top: clamp(36px, 5vw, 56px); }   /* close the intro->content gap */
.page-hero + section.alt { padding-top: clamp(28px, 4vw, 48px); }
.section-head { max-width: 720px; margin-bottom: clamp(24px, 3vw, 32px); }
.section-head p { color: var(--grey-soft); font-size: 1.05rem; line-height: 1.6; margin-top: 14px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 900; font-size: 12px; letter-spacing: .22em; color: var(--green); text-transform: uppercase; margin-bottom: 16px; }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--green); }

.alt { background: var(--ink-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* prose / body content */
.prose .lead { color: rgba(255,255,255,.9); font-size: 1.2rem; line-height: 1.6; margin-bottom: 22px; max-width: 62ch; }
.prose p { color: var(--grey-soft); font-size: 1.05rem; line-height: 1.7; margin-bottom: 18px; max-width: 62ch; }
.prose h3 { font-family: var(--font-display); font-weight: 900; font-size: 1.32rem; margin: 34px 0 10px; }
.prose ul { list-style: none; margin: 0 0 18px; max-width: 62ch; }
.prose li { color: var(--grey-soft); font-size: 1.05rem; line-height: 1.6; padding-left: 24px; position: relative; margin-bottom: 12px; }
.prose li::before { content: ""; position: absolute; left: 0; top: 11px; width: 9px; height: 9px; background: var(--green); border-radius: 2px; }

/* What We Do - cards */
.cards { display: grid; grid-template-columns: 1fr; gap: 14px; }
.card {
  background: rgba(255,255,255,0.02); border: 1px solid var(--line); border-radius: 8px;
  padding: 24px 22px; transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.card:hover { border-color: rgba(61,170,11,.6); transform: translateY(-2px); background: rgba(61,170,11,0.04); }
.card h3 { font-family: var(--font-display); font-weight: 900; font-size: 1.18rem; margin-bottom: 8px; }
.card p { color: var(--grey-soft); font-size: .96rem; line-height: 1.55; }
.card .num { font-family: var(--font-display); font-weight: 900; color: var(--green); font-size: .8rem; letter-spacing: .14em; display: block; margin-bottom: 12px; }
.more-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 26px; font-family: var(--font-display); font-weight: 900; color: var(--green); font-size: .95rem; }
.more-link .arrow { transition: transform .2s ease; }
.more-link:hover .arrow { transform: translateX(4px); }

/* Who We Serve - points */
.points { display: grid; grid-template-columns: 1fr; gap: 26px; margin-top: 8px; }
.point { padding-left: 20px; border-left: 2px solid var(--green); }
.point h3 { font-family: var(--font-display); font-weight: 900; font-size: 1.08rem; margin-bottom: 7px; }
.point p { color: var(--grey-soft); font-size: .98rem; line-height: 1.55; }

/* FAQ (native accordion, no JS) */
.faq { max-width: 820px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { cursor: pointer; list-style: none; padding: 22px 0; font-family: var(--font-display); font-weight: 900; font-size: 1.12rem; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--green); font-size: 1.6rem; font-weight: 400; line-height: 1; transition: transform .2s ease; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { color: var(--grey-soft); font-size: 1rem; line-height: 1.7; padding: 0 0 24px; max-width: 74ch; }

/* Contact form */
.contact-grid { display: grid; gap: 44px; }
.form { display: grid; gap: 16px; }
.form label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--white); }
.form input, .form textarea {
  width: 100%; background: rgba(255,255,255,0.03); border: 1px solid var(--line); border-radius: 6px;
  padding: 13px 14px; color: var(--white); font-family: var(--font); font-size: 1rem;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); background: rgba(61,170,11,0.05); }
.form textarea { min-height: 120px; resize: vertical; }
.form .req { color: var(--green); font-weight: 700; font-size: .8rem; }
.form .opt { color: var(--grey); font-weight: 400; font-size: .8rem; }
.form-status { font-size: .95rem; line-height: 1.5; margin-top: 2px; }
.form-status.error { color: #ff8a80; }
.form-status.ok { color: var(--green); }
.form-ok h3 { font-family: var(--font-display); font-weight: 900; font-size: 1.4rem; margin-bottom: 10px; }
.form-ok p { color: var(--grey-soft); line-height: 1.6; margin-bottom: 18px; }
.form ::placeholder { color: #6b7178; }
.form .row2 { display: grid; gap: 16px; }
.form button { justify-content: center; border: 0; cursor: pointer; }
.contact-direct h3 { font-family: var(--font-display); font-weight: 900; font-size: 1.1rem; margin-bottom: 10px; }
.contact-direct p { color: var(--grey-soft); line-height: 1.9; margin-bottom: 18px; }
.contact-direct a:hover { color: var(--white); }

/* Closing CTA band */
.cta-band { text-align: center; }
.cta-band .wrap { max-width: 760px; }
.cta-band p { color: var(--grey-soft); font-size: 1.1rem; line-height: 1.6; margin: 16px auto 30px; max-width: 40em; }
.cta-band .cta-row { justify-content: center; }

/* Footer */
footer { background: var(--ink-2); border-top: 1px solid var(--line); padding: 48px 0 40px; }
footer .wrap { display: grid; grid-template-columns: 1fr; gap: 26px; }
footer .f-logo img { height: 40px; width: auto; margin-bottom: 16px; }
footer .f-rule { height: 2px; width: 48px; background: var(--green); margin-bottom: 16px; }
footer .f-col h4 { font-family: var(--font-display); font-weight: 900; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--grey); margin-bottom: 12px; }
footer .f-col a, footer .f-col p { color: var(--grey-soft); font-size: .96rem; line-height: 1.9; }
footer .f-col a:hover { color: var(--white); }
footer .copyright { color: var(--grey); font-size: .82rem; border-top: 1px solid var(--line); padding-top: 22px; margin-top: 6px; }

/* Hero content paints immediately (no opacity-gated reveal: keeps LCP fast and
   follows the firm's no-scroll-reveals rule). Only the service ribbon animates. */
@media (prefers-reduced-motion: no-preference) {
  .ribbon-track { animation: marquee 40s linear infinite; }
  @keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
}

/* =====================  DESKTOP  ===================== */
@media (min-width: 900px) {
  :root { --header-h: 88px; }
  header { padding: 0 52px; }
  .brand img { height: 40px; }
  nav.links { display: flex; gap: 22px; align-items: center; }
  .call-btn { display: inline-flex; }
  .burger { display: none; }

  .hero .wrap { grid-template-columns: 1.05fr 0.95fr; gap: 48px; }
  .hero .copy { order: 1; }
  .hero .emblem { order: 2; display: flex; justify-content: center; }
  .badge-hero { width: min(100%, 600px); margin: 0; }
  .hero { text-align: left; }

  .cards { grid-template-columns: repeat(3, 1fr); }
  .cards .card.span2 { grid-column: span 2; }
  .points { grid-template-columns: repeat(3, 1fr); gap: 30px; }
  .form .row2 { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1.1fr 0.9fr; gap: 56px; }
  footer .wrap { grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
}

/* ============================================================================
   LIGHT CONTENT SECTIONS
   The hero (home) and the footer stay dark; every other section is white /
   light grey with dark text, so the site reads predominantly white.
   ============================================================================ */
:root { --text: #15181c; --text-soft: #454b52; --line-d: rgba(0,0,0,0.12); }

section:not(.hero) { background: #ffffff; color: var(--text); }
section.alt:not(.hero) { background: #eef1f3; border-top: 1px solid var(--line-d); border-bottom: 1px solid var(--line-d); }

/* text colors on light */
section:not(.hero) h2,
section:not(.hero) h3,
section:not(.hero) .card h3,
section:not(.hero) .point h3,
section:not(.hero) .faq-item summary,
section:not(.hero) .contact-direct h3,
section:not(.hero) .form label,
section:not(.hero) .form-ok h3 { color: var(--text); }

section:not(.hero) .sub,
section:not(.hero) .section-head p,
section:not(.hero) .card p,
section:not(.hero) .point p,
section:not(.hero) .prose p,
section:not(.hero) .prose .lead,
section:not(.hero) .prose li,
section:not(.hero) .faq-item p,
section:not(.hero) .cta-band p,
section:not(.hero) .contact-direct p,
section:not(.hero) .form-ok p { color: var(--text-soft); }

/* .cta-band is the section itself (not nested), so target it directly */
.cta-band:not(.hero) p { color: var(--text-soft); }
.cta-band:not(.hero) h2 { color: var(--text); }

/* cards + components on light */
section:not(.hero) .card { background: #ffffff; border-color: var(--line-d); }
section:not(.hero) .card:hover { border-color: var(--green); background: rgba(61,170,11,0.06); }
section:not(.hero) .faq-item { border-color: var(--line-d); }
section:not(.hero) .point { border-left-color: var(--green); }
section:not(.hero) .prose li::before { background: var(--green); }

/* ghost button on light = dark outline + dark text */
section:not(.hero) .btn-ghost { border-color: rgba(0,0,0,0.30); color: var(--text); }
section:not(.hero) .btn-ghost:hover { border-color: var(--green); color: var(--green-dk); }

/* form fields on light */
section:not(.hero) .form input,
section:not(.hero) .form textarea { background: #ffffff; border-color: rgba(0,0,0,0.20); color: var(--text); }
section:not(.hero) .form input:focus,
section:not(.hero) .form textarea:focus { border-color: var(--green); background: rgba(61,170,11,0.05); }
section:not(.hero) .form ::placeholder { color: #8a9099; }
section:not(.hero) .form .opt { color: #6b7178; }
section:not(.hero) .contact-direct a { color: var(--green-dk); }

/* center the home hero on mobile (badge + copy stacked, badge on top) */
@media (max-width: 899px) {
  .hero { text-align: center; align-items: stretch; padding: var(--header-h) 0 62px; }
  .hero .wrap {
    display: flex; flex-direction: column; gap: 12px;
    min-height: calc(100svh - var(--header-h) - 62px);
  }
  .hero .emblem { order: -1; }
  .badge-hero { width: clamp(210px, 62vw, 320px); margin: 4px auto 0; }
  .hero .copy { margin: 0 auto; width: 100%; display: flex; flex-direction: column; flex: 1 1 auto; }
  .hero .copy .cta-row { margin-top: auto; }
  .hero .cta-row { justify-content: center; }
  .hero .eyebrow { justify-content: center; }
  .airflow { opacity: .8; }
  h1 { margin-bottom: 12px; margin-top: 6px; }
  .sub { margin-bottom: 12px; font-size: 1rem; color: rgba(255,255,255,.82); }
  .area { margin-bottom: 12px; }
}
