/* ==========================================================================
   POLARITY — Electrical Compliance Specialists
   Design system: warm ink base, copper accent, editorial serif + technical sans
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400&family=IBM+Plex+Sans:wght@300;400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  /* Warm ink palette */
  --ink:        #14150f;   /* base background, warm near-black */
  --ink-2:      #1c1d15;   /* raised surface */
  --ink-3:      #26271c;   /* card / border-lit surface */
  --line:       #35362a;   /* hairlines */
  --paper:      #f2eee2;   /* warm off-white text on dark */
  --paper-dim:  #b9b6a5;   /* muted body text on dark */
  --paper-mute: #86846f;   /* captions */

  /* Copper — the signal */
  --copper:     #cf7043;
  --copper-lo:  #a9552d;
  --copper-hi:  #e79263;
  --amber:      #e6b25a;   /* live-wire highlight, used sparingly */

  /* Light sections */
  --cream:      #f2eee2;
  --cream-2:    #e8e2d1;
  --ink-on-cream: #17180f;
  --dim-on-cream: #5a5849;

  --maxw: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 3px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.65;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(4.5rem, 9vw, 8rem); position: relative; }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--copper);
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}
.eyebrow::before {
  content: "";
  width: 1.8rem; height: 1px;
  background: var(--copper);
  display: inline-block;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.04; letter-spacing: -0.015em; }
.display {
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  font-weight: 400;
  line-height: 0.98;
}
.display em { font-style: italic; color: var(--copper-hi); }
h2.title { font-size: clamp(2rem, 4.4vw, 3.4rem); }
h3 { font-size: 1.5rem; }
.lede { font-size: clamp(1.1rem, 1.7vw, 1.35rem); color: var(--paper-dim); line-height: 1.55; font-weight: 300; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 1rem 1.7rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: transform 0.4s var(--ease), background 0.3s, color 0.3s, border-color 0.3s;
  will-change: transform;
}
.btn svg { width: 1em; height: 1em; transition: transform 0.4s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn--primary { background: var(--copper); color: var(--ink); }
.btn--primary:hover { background: var(--copper-hi); transform: translateY(-2px); }
.btn--ghost { border-color: var(--line); color: var(--paper); }
.btn--ghost:hover { border-color: var(--copper); color: var(--copper-hi); }
.btn--dark { background: var(--ink); color: var(--paper); }
.btn--dark:hover { background: var(--ink-3); transform: translateY(-2px); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background 0.4s var(--ease), border-color 0.4s, backdrop-filter 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 78px; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; font-family: var(--font-display); font-size: 1.4rem; letter-spacing: -0.02em; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand small { font-family: var(--font-mono); font-size: 0.56rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--paper-mute); display: block; line-height: 1; margin-top: 3px; }
.nav__links { display: flex; align-items: center; gap: 2rem; }
.nav__links a { font-size: 0.9rem; color: var(--paper-dim); transition: color 0.25s; position: relative; }
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--paper); }
.nav__links a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; bottom: -6px; width: 100%; height: 1px; background: var(--copper);
}
.nav__cta { display: inline-flex; align-items: center; gap: 1.4rem; }
.nav__phone { font-family: var(--font-mono); font-size: 0.85rem; color: var(--paper); white-space: nowrap; }
.nav__phone span { color: var(--copper); }
.nav__toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius); width: 44px; height: 40px; color: var(--paper); }

/* Mobile drawer */
.drawer { position: fixed; inset: 0; z-index: 99; background: var(--ink-2); transform: translateY(-100%); transition: transform 0.5s var(--ease); display: flex; flex-direction: column; justify-content: center; padding: var(--gutter); }
.drawer.is-open { transform: translateY(0); }
.drawer a { font-family: var(--font-display); font-size: 2rem; padding-block: 0.5rem; border-bottom: 1px solid var(--line); }
.drawer .btn { margin-top: 2rem; align-self: flex-start; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: clamp(9rem, 16vh, 12rem); padding-bottom: clamp(4rem, 8vw, 7rem); overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: clamp(2rem, 5vw, 4rem); align-items: end; }
.hero__title { margin-block: 1.5rem 1.8rem; }
.hero__meta { border-top: 1px solid var(--line); padding-top: 1.5rem; display: grid; gap: 1.4rem; }
.hero__stat b { font-family: var(--font-display); font-size: 2.6rem; font-weight: 500; display: block; line-height: 1; }
.hero__stat span { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-mute); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 0.5rem; }

/* Ambient background: circuit / phase field */
.field { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.field::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 85% -10%, color-mix(in srgb, var(--copper) 26%, transparent), transparent 55%),
    radial-gradient(90% 80% at -10% 110%, color-mix(in srgb, var(--amber) 10%, transparent), transparent 50%);
}
.field__lines { position: absolute; inset: 0; opacity: 0.5; }

.grain { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- Trust bar ---------- */
.trustbar { border-block: 1px solid var(--line); }
.trustbar__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 2.5rem; padding-block: 1.6rem; }
.trustbar span { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-mute); display: inline-flex; align-items: center; gap: 0.6rem; }
.trustbar span svg { width: 1.1rem; height: 1.1rem; color: var(--copper); }

/* ---------- Services (asymmetric) ---------- */
.services { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.svc { background: var(--ink-2); padding: clamp(1.8rem, 3vw, 2.6rem); display: flex; flex-direction: column; gap: 1rem; min-height: 260px; transition: background 0.4s var(--ease); position: relative; }
.svc:hover { background: var(--ink-3); }
.svc--wide { grid-column: span 4; }
.svc--half { grid-column: span 3; }
.svc--third { grid-column: span 2; }
.svc__num { font-family: var(--font-mono); font-size: 0.72rem; color: var(--copper); letter-spacing: 0.12em; }
.svc h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin-top: auto; }
.svc p { color: var(--paper-dim); font-size: 0.98rem; }
.svc__link { font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--paper); display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
.svc__link svg { width: 0.9em; transition: transform 0.4s var(--ease); }
.svc:hover .svc__link { color: var(--copper-hi); }
.svc:hover .svc__link svg { transform: translateX(5px); }

/* ---------- Split feature ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.split--reverse .split__media { order: -1; }
.figure { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink-2); overflow: hidden; }
.figure__tag { position: absolute; left: 1rem; bottom: 1rem; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; background: var(--ink); color: var(--copper); padding: 0.4rem 0.7rem; border-radius: 2px; border: 1px solid var(--line); }

/* ---------- Section on cream ---------- */
.section--cream { background: var(--cream); color: var(--ink-on-cream); }
.section--cream .eyebrow { color: var(--copper-lo); }
.section--cream .eyebrow::before { background: var(--copper-lo); }
.section--cream .lede { color: var(--dim-on-cream); }
.section--cream .display em { color: var(--copper-lo); }

/* ---------- Process steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.section--cream .steps, .section--cream .steps { background: color-mix(in srgb, var(--ink-on-cream) 12%, transparent); border-color: color-mix(in srgb, var(--ink-on-cream) 15%, transparent); }
.step { padding: 2rem clamp(1.2rem,2vw,1.8rem); background: var(--cream); display: flex; flex-direction: column; gap: 0.8rem; }
.step__n { font-family: var(--font-mono); font-size: 0.72rem; color: var(--copper-lo); letter-spacing: 0.14em; }
.step h4 { font-size: 1.35rem; }
.step p { color: var(--dim-on-cream); font-size: 0.95rem; }

/* ---------- Codes explainer (C1/C2/C3) ---------- */
.codes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.code { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; background: var(--ink-2); }
.code__badge { font-family: var(--font-mono); font-weight: 500; font-size: 0.95rem; padding: 0.3rem 0.7rem; border-radius: 2px; display: inline-block; margin-bottom: 1rem; }
.code--c1 .code__badge { background: #7a2f22; color: #ffd9cc; }
.code--c2 .code__badge { background: #7a5a1e; color: #ffeccb; }
.code--c3 .code__badge { background: #2f4a2c; color: #d4f0cf; }
.code h4 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.code p { font-size: 0.92rem; color: var(--paper-dim); }

/* ---------- Pricing ---------- */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.price { border: 1px solid var(--line); border-radius: var(--radius); padding: 2.2rem; background: var(--ink-2); display: flex; flex-direction: column; gap: 1rem; }
.price--feature { border-color: var(--copper); background: var(--ink-3); position: relative; }
.price--feature::after { content: "Most requested"; position: absolute; top: -0.75rem; left: 2.2rem; font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.14em; text-transform: uppercase; background: var(--copper); color: var(--ink); padding: 0.3rem 0.7rem; border-radius: 2px; }
.price h4 { font-size: 1.3rem; }
.price__amt { font-family: var(--font-display); font-size: 2.8rem; font-weight: 500; line-height: 1; }
.price__amt small { font-size: 0.9rem; font-family: var(--font-mono); color: var(--paper-mute); font-weight: 400; }
.price ul { list-style: none; display: grid; gap: 0.6rem; font-size: 0.95rem; color: var(--paper-dim); }
.price li { display: flex; gap: 0.6rem; }
.price li svg { width: 1.1rem; flex: none; color: var(--copper); margin-top: 0.2rem; }

/* ---------- Feature list / checks ---------- */
.checks { list-style: none; display: grid; gap: 1rem; }
.checks li { display: flex; gap: 0.9rem; align-items: flex-start; }
.checks svg { width: 1.4rem; height: 1.4rem; flex: none; color: var(--copper); margin-top: 0.15rem; }
.checks b { font-weight: 500; color: var(--paper); }
.checks span { color: var(--paper-dim); }

/* ---------- Stats band ---------- */
.statband { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.statband > div { background: var(--ink); padding: 2.2rem var(--gutter); text-align: center; }
.statband b { font-family: var(--font-display); font-size: clamp(2.2rem, 4vw, 3.2rem); font-weight: 500; display: block; line-height: 1; }
.statband span { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--paper-mute); }

/* ---------- Testimonial ---------- */
.quote { max-width: 900px; }
.quote blockquote { font-family: var(--font-display); font-size: clamp(1.6rem, 3.3vw, 2.6rem); line-height: 1.28; font-weight: 400; letter-spacing: -0.01em; }
.quote blockquote em { color: var(--copper-hi); font-style: italic; }
.quote figcaption { margin-top: 1.6rem; font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.08em; color: var(--paper-mute); text-transform: uppercase; }
.quote figcaption b { color: var(--paper); font-weight: 500; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 0; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); padding: 1.4rem 0; }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-family: var(--font-display); font-size: clamp(1.15rem, 2vw, 1.5rem); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .plus { flex: none; width: 1.5rem; height: 1.5rem; position: relative; transition: transform 0.3s var(--ease); }
.faq summary .plus::before, .faq summary .plus::after { content: ""; position: absolute; background: var(--copper); }
.faq summary .plus::before { top: 50%; left: 0; right: 0; height: 1.5px; transform: translateY(-50%); }
.faq summary .plus::after { left: 50%; top: 0; bottom: 0; width: 1.5px; transform: translateX(-50%); transition: opacity 0.3s; }
.faq details[open] summary .plus::after { opacity: 0; }
.faq p { color: var(--paper-dim); margin-top: 1rem; max-width: 68ch; }

/* ---------- CTA band ---------- */
.cta { background: var(--copper); color: var(--ink); border-radius: var(--radius); padding: clamp(2.5rem, 6vw, 5rem); position: relative; overflow: hidden; }
.cta h2 { font-size: clamp(2rem, 5vw, 4rem); max-width: 16ch; }
.cta p { color: color-mix(in srgb, var(--ink) 75%, transparent); max-width: 46ch; margin-top: 1rem; }
.cta .btn--dark { margin-top: 2rem; }
.cta__deco { position: absolute; right: -4%; top: -20%; width: 45%; opacity: 0.16; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1.2rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.field-group { display: flex; flex-direction: column; gap: 0.5rem; }
.field-group label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--paper-mute); }
.field-group input, .field-group select, .field-group textarea {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--paper); font-family: var(--font-body); font-size: 1rem; padding: 0.9rem 1rem; width: 100%;
  transition: border-color 0.25s, background 0.25s;
}
.field-group textarea { resize: vertical; min-height: 130px; }
.field-group input:focus, .field-group select:focus, .field-group textarea:focus { outline: none; border-color: var(--copper); background: var(--ink-3); }
.field-group input::placeholder, .field-group textarea::placeholder { color: var(--paper-mute); }
.form__note { font-size: 0.82rem; color: var(--paper-mute); }
.hp { position: absolute; left: -9999px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: clamp(3.5rem, 6vw, 5rem) 2.5rem; }
.footer__top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
.footer h5 { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--paper-mute); margin-bottom: 1.2rem; }
.footer ul { list-style: none; display: grid; gap: 0.7rem; }
.footer a { color: var(--paper-dim); font-size: 0.95rem; transition: color 0.2s; }
.footer a:hover { color: var(--copper-hi); }
.footer__brand p { color: var(--paper-dim); max-width: 34ch; margin-top: 1rem; font-size: 0.95rem; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 0.74rem; color: var(--paper-mute); letter-spacing: 0.04em; }

/* ---------- Page hero (interior) ---------- */
.phead { padding-top: clamp(9rem, 15vh, 12rem); padding-bottom: clamp(3rem, 6vw, 5rem); position: relative; overflow: hidden; }
.phead__crumbs { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--paper-mute); margin-bottom: 1.5rem; }
.phead__crumbs a:hover { color: var(--copper); }
.phead h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); max-width: 18ch; }
.phead .lede { margin-top: 1.4rem; max-width: 60ch; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
[data-delay="1"] { transition-delay: 0.08s; }
[data-delay="2"] { transition-delay: 0.16s; }
[data-delay="3"] { transition-delay: 0.24s; }
[data-delay="4"] { transition-delay: 0.32s; }

/* ---------- Utilities ---------- */
.stack > * + * { margin-top: 1.2rem; }
.mt-s { margin-top: 1rem; } .mt-m { margin-top: 2rem; } .mt-l { margin-top: 3rem; }
.mb-m { margin-bottom: 2rem; } .mb-l { margin-bottom: 3.5rem; }
.max-52 { max-width: 52ch; } .max-60 { max-width: 60ch; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem,5vw,4rem); }
.text-copper { color: var(--copper-hi); }
.center { text-align: center; margin-inline: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav__links, .nav__phone { display: none; }
  .nav__toggle { display: inline-flex; align-items: center; justify-content: center; }
  .hero__grid, .split, .grid-2 { grid-template-columns: 1fr; }
  .split--reverse .split__media { order: 0; }
  .services { grid-template-columns: 1fr; }
  .svc--wide, .svc--half, .svc--third { grid-column: auto; }
  .steps, .pricing, .codes, .statband { grid-template-columns: 1fr 1fr; }
  .footer__top { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .steps, .pricing, .codes, .statband, .footer__top { grid-template-columns: 1fr; }
  .hero__meta { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: 0.01ms !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
