/* OPC Telematics — site.css. Single stylesheet, spec: skills/opc-website-builder/SKILL.md */

:root {
  /* Brand constants */
  --opc-orange: #ED6D05;
  --opc-orange-deep: #D35917;
  --opc-orange-light: #F3954C;
  --opc-grey: #878787;

  /* Light theme */
  --bg: #FBF7F2;
  --bg-raised: #FFFFFF;
  --bg-sunken: #F3EDE5;
  --ink: #241A11;
  --ink-soft: #5C4F42;
  --ink-faint: #8A7B6B;
  --line: #E4DACC;
  --line-strong: #CBBBA6;
  --accent-text: #B44F00;
  --accent-wash: #FDEEDF;
  --shadow: 0 1px 2px rgba(60,35,10,.06), 0 8px 28px rgba(60,35,10,.07);

  --good-bg: #E8F2E4;  --good-ink: #2E6023;
  --warn-bg: #FDEEDF;  --warn-ink: #8C3D06;
  --bad-bg:  #F9E4DC;  --bad-ink:  #A03418;
  --mute-bg: #F3EDE5;  --mute-ink: #5C4F42;

  --grad-hero: linear-gradient(118deg, #F3954C 0%, #ED6D05 46%, #D35917 100%);
  --grad-ink:  linear-gradient(180deg, #241A11, #3A2A1C);
  --grad-wash: linear-gradient(180deg, #FDEEDF, #FBF7F2);

  --font-head: 'Barlow','Arial',sans-serif;
  --font-body: 'Futura PT','Jost','Century Gothic','Avenir Next',sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 3px solid var(--opc-orange); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 12px 20px; font-family: var(--font-head);
}
.skip-link:focus { left: 0; }

/* ---------- Type ---------- */
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0 0 .5em; }
.display { font-weight: 800; font-size: clamp(34px,5vw,56px); line-height: 1.04; letter-spacing: -0.02em; }
h1 { font-weight: 800; font-size: clamp(30px,4vw,42px); line-height: 1.06; letter-spacing: -0.02em; }
h2 { font-weight: 700; font-size: clamp(26px,3.4vw,34px); line-height: 1.12; letter-spacing: -0.015em; text-wrap: balance; }
h3 { font-weight: 600; font-size: 22px; line-height: 1.3; }
p { margin: 0 0 1em; max-width: 65ch; }
.lede { font-size: 20px; line-height: 1.5; color: var(--ink-soft); max-width: 52ch; }
.caption { font-size: 13px; line-height: 1.5; color: var(--ink-faint); }
.accent { color: var(--accent-text); }
.on-dark .accent, .on-grad .accent { color: #F3954C; }

.eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 700; font-size: 11.5px;
  letter-spacing: .24em; text-transform: uppercase; color: var(--accent-text);
  margin: 0 0 14px;
}
.eyebrow::before { content: ""; width: 26px; height: 3px; background: var(--opc-orange); flex: none; }
.on-grad .eyebrow, .on-dark .eyebrow { color: #fff; }
.on-grad .eyebrow::before, .on-dark .eyebrow::before { background: #fff; }

a { color: var(--accent-text); }
.link-more {
  font-family: var(--font-head); font-weight: 600; color: var(--accent-text);
  text-decoration: none;
}
.link-more:hover, .link-more:focus { text-decoration: underline; }
.link-more::after { content: " →"; }

/* ---------- Layout: rail + content ---------- */
.rail {
  position: fixed; inset: 0 auto 0 0; width: 240px; z-index: 40;
  background: var(--bg-sunken); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow-y: auto;
}
.rail-logo { display: block; padding: 22px 22px 10px; }
.rail-group { margin: 14px 0 0; }
.rail-label {
  font-family: var(--font-head); font-weight: 700; font-size: 10.5px;
  letter-spacing: .2em; text-transform: uppercase; color: var(--ink-faint);
  padding: 8px 22px 4px;
}
.rail a.rail-link {
  display: block; padding: 7px 22px;
  font-family: var(--font-head); font-weight: 500; font-size: 14.5px;
  color: var(--ink-soft); text-decoration: none;
  border-left: 3px solid transparent;
}
.rail a.rail-link:hover, .rail a.rail-link:focus {
  color: var(--accent-text); background: var(--accent-wash);
}
.rail a.rail-link[aria-current="page"] {
  border-left-color: var(--opc-orange); color: var(--accent-text); font-weight: 600;
}
.rail-foot { margin-top: auto; padding: 18px 22px 22px; border-top: 1px solid var(--line); }
.rail-phone {
  display: flex; align-items: center; gap: 8px; min-height: 44px;
  font-family: var(--font-head); font-weight: 600; font-size: 15px;
  color: var(--ink); text-decoration: none;
}
.rail-phone svg { flex: none; }
.rail-foot .btn { width: 100%; margin-top: 10px; }

main { margin-left: 240px; }
footer.site-footer { margin-left: 240px; }

/* Mobile top bar + drawer */
.topbar { display: none; }
@media (max-width: 900px) {
  .rail { display: none; }
  main, footer.site-footer { margin-left: 0; }
  .topbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-sunken); border-bottom: 1px solid var(--line);
    padding: 10px 14px;
  }
  .topbar-logo { margin-right: auto; display: flex; }
  .topbar a.icon-phone {
    display: flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; color: var(--ink); text-decoration: none;
  }
  .menu-btn {
    display: flex; align-items: center; gap: 7px; min-height: 48px; padding: 0 14px;
    font-family: var(--font-head); font-weight: 600; font-size: 15px;
    background: var(--bg-raised); color: var(--ink);
    border: 1.5px solid var(--ink); border-radius: 8px; cursor: pointer;
  }
  .drawer {
    position: fixed; inset: 0; z-index: 50; background: var(--bg);
    overflow-y: auto; padding: 14px 18px 30px;
  }
  .drawer[hidden] { display: none; }
  .drawer-close {
    display: flex; align-items: center; gap: 7px; min-height: 48px; padding: 0 14px;
    margin-left: auto; font-family: var(--font-head); font-weight: 600; font-size: 15px;
    background: var(--bg-raised); border: 1.5px solid var(--ink); border-radius: 8px; cursor: pointer;
  }
  .drawer .btn { display: flex; margin: 4px 0 14px; }
  .drawer .rail-label { padding: 14px 4px 4px; }
  .drawer a.rail-link {
    display: flex; align-items: center; min-height: 48px; padding: 0 12px;
    font-family: var(--font-head); font-weight: 500; font-size: 16px;
    color: var(--ink-soft); text-decoration: none; border-left: 3px solid transparent;
  }
  .drawer a.rail-link[aria-current="page"] {
    border-left-color: var(--opc-orange); color: var(--accent-text); font-weight: 600;
  }
  .drawer .rail-phone { min-height: 48px; margin-top: 6px; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(44px, 7vw, 76px) clamp(18px, 5vw, 56px); }
.section-tight { padding-top: clamp(30px, 4vw, 44px); padding-bottom: clamp(30px, 4vw, 44px); }
.wrap { max-width: 1080px; margin: 0 auto; }
.wrap-narrow { max-width: 760px; margin: 0 auto; }

/* Power-button tessellation tile (texture only, tone-on-tone) */
.hero-grad, .cta-band {
  background: var(--grad-hero); color: #fff; position: relative; overflow: hidden;
}
.hero-grad::before, .cta-band::before {
  content: ""; position: absolute; inset: 0; opacity: .13; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 76 76' width='76' height='76'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='10'%3E%3Cpath d='M 26 14 A 24 24 0 1 0 50 14' stroke-linecap='round'/%3E%3C/g%3E%3Crect x='33' y='4' width='10' height='28' rx='3' fill='%23ffffff'/%3E%3C/svg%3E");
  background-size: 152px 152px;
}
.hero-grad > *, .cta-band > * { position: relative; }
.hero-grad h1, .hero-grad .display, .cta-band h2 { color: #fff; }
.hero-grad .lede, .cta-band .lede { color: rgba(255,255,255,.92); }
.hero-wash { background: var(--grad-wash); }

.band-dark { background: var(--grad-ink); color: #fff; }
.band-dark h2, .band-dark h3 { color: #fff; }
.band-wash { background: var(--accent-wash); }

/* Proof strip */
.proof-strip {
  background: var(--bg-raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.proof-strip .wrap {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  padding: 26px 0;
}
.proof-cell { display: flex; align-items: center; gap: 12px; }
.proof-cell svg { flex: none; color: var(--opc-orange); }
.proof-cell b { font-family: var(--font-head); font-weight: 600; font-size: 15px; }
@media (max-width: 900px) { .proof-strip .wrap { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .proof-strip .wrap { grid-template-columns: 1fr; } }

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

/* Split feature */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.frame { background: var(--bg-raised); border: 1px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.frame img { width: 100%; }

/* ---------- Components ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px; border-radius: 8px; cursor: pointer;
  font-family: var(--font-head); font-weight: 600; font-size: 15px;
  text-decoration: none; border: 1.5px solid transparent;
}
.btn-primary { background: var(--opc-orange); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: var(--opc-orange-deep); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover, .btn-secondary:focus { background: var(--ink); color: #fff; }
.btn-tertiary { background: transparent; color: var(--accent-text); border-color: #F3D3B4; }
.btn-tertiary:hover, .btn-tertiary:focus { background: var(--accent-wash); }
.btn-inverse { background: #fff; color: var(--ink); }
.btn-inverse:hover, .btn-inverse:focus { background: var(--bg-sunken); }
.on-grad .btn-ghost, .on-dark .btn-ghost { background: transparent; color: #fff; border-color: #fff; }
.on-grad .btn-ghost:hover, .on-dark .btn-ghost:hover { background: rgba(255,255,255,.15); }

.card {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: 12px;
  padding: 22px; box-shadow: var(--shadow);
}
.card h3 { margin-top: 12px; }
.card > svg:first-child { color: var(--opc-orange); }
a.card { display: block; color: inherit; text-decoration: none; }
a.card:hover, a.card:focus { border-color: var(--line-strong); }

.card-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.card-dark h3 { color: #fff; }
.card-dark > svg:first-child { color: var(--opc-orange-light); }

.stat { font-family: var(--font-head); font-weight: 800; font-size: clamp(34px, 4vw, 46px); font-variant-numeric: tabular-nums; color: var(--accent-text); line-height: 1.1; }
.band-dark .stat { color: var(--opc-orange); }
.stat-label {
  font-family: var(--font-head); font-weight: 700; font-size: 11.5px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin-top: 6px;
}
.band-dark .stat-label { color: rgba(255,255,255,.75); }

/* Quote band */
.quote { font-style: italic; font-size: clamp(20px, 2.6vw, 26px); line-height: 1.45; max-width: 46ch; margin: 18px auto 14px; }
.quote-attrib {
  font-family: var(--font-head); font-weight: 700; font-size: 11.5px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint);
}
.card-dark .quote-attrib { color: #F3954C; }

/* Pricing */
.card-price { border: 1.5px solid var(--opc-orange); }
.price-figure { font-family: var(--font-head); font-weight: 800; font-size: 40px; font-variant-numeric: tabular-nums; }
.price-figure small { font-size: 15px; font-weight: 600; color: var(--ink-faint); }

/* Forms */
form label {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 700; font-size: 11.5px;
  letter-spacing: .24em; text-transform: uppercase; color: var(--accent-text);
  margin: 18px 0 6px;
}
form label::before { content: ""; width: 26px; height: 3px; background: var(--opc-orange); flex: none; }
input, select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  font-family: var(--font-body); font-size: 15px;
  background: #fff; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 8px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--opc-orange); }

/* Chips */
.chip {
  display: inline-flex; align-items: center; border-radius: 99px; padding: 4px 12px;
  font-family: var(--font-head); font-weight: 700; font-size: 11.5px;
  letter-spacing: .06em; text-transform: uppercase;
}
.chip-good { background: var(--good-bg); color: var(--good-ink); }
.chip-warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip-bad  { background: var(--bad-bg);  color: var(--bad-ink); }
.chip-mute { background: var(--mute-bg); color: var(--mute-ink); }

/* Notice */
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  border-left: 4px solid; border-radius: 0 10px 10px 0;
  padding: 14px 16px; font-size: 14.5px;
}
.notice-warn { background: var(--warn-bg); border-color: var(--warn-ink); color: var(--warn-ink); }
.notice-good { background: var(--good-bg); border-color: var(--good-ink); color: var(--good-ink); }
.notice-info { background: var(--bg-sunken); border-color: var(--opc-orange); color: var(--ink); }
.notice-label {
  display: block; font-family: var(--font-head); font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: .12em; margin-bottom: 8px;
}
.notice-info .notice-label, .notice-warn .notice-label { color: var(--opc-orange); }

/* Checkmark list (blog articles) */
.checklist { list-style: none; margin: 14px 0; padding: 0; }
.checklist li {
  padding: 10px 0 10px 30px; position: relative; border-bottom: 1px solid var(--line);
}
.checklist li:last-child { border-bottom: none; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 12px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--opc-orange) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M4 9l3.5 3.5 6.5-7'/%3E%3C/svg%3E") center/10px no-repeat;
}

/* Dash list (warning notices) */
.dash-list { list-style: none; margin: 10px 0 0; padding: 0; }
.dash-list li { padding: 5px 0 5px 20px; position: relative; }
.dash-list li::before { content: "\2014"; position: absolute; left: 0; color: var(--opc-orange); font-weight: 700; }

/* Dark callout with brand glow (blog articles) */
.callout-glow { position: relative; overflow: hidden; }
.callout-glow::after {
  content: ""; position: absolute; top: -30px; right: -30px; width: 130px; height: 130px;
  background: radial-gradient(circle, rgba(237,109,5,.35) 0%, transparent 70%); pointer-events: none;
}
.callout-glow > * { position: relative; }

/* Numbered steps (blog articles) */
.steps { counter-reset: steps; list-style: none; padding: 0; margin: 16px 0; }
.steps li {
  counter-increment: steps; padding: 18px 20px 18px 62px; position: relative;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: var(--bg-raised);
}
.steps li::before {
  content: counter(steps); position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%; background: var(--opc-orange); color: #fff;
  font-family: var(--font-head); font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.steps li strong { display: block; font-family: var(--font-head); margin-bottom: 4px; }
.steps li p { margin: 0; color: var(--ink-soft); }

/* FAQ accordion */
.faq details {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 10px; box-shadow: var(--shadow);
}
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 20px; min-height: 44px; cursor: pointer; list-style: none;
  font-family: var(--font-head); font-weight: 600; font-size: 15.5px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "▾"; color: var(--opc-orange); flex: none; }
.faq details[open] summary::after { content: "▴"; }
.faq .faq-a { padding: 0 20px 16px; font-size: 14.5px; background: transparent; }
.faq .faq-a p { margin-bottom: .6em; }

/* Tables */
.table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; background: var(--bg-raised); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th {
  font-family: var(--font-head); font-weight: 700; font-size: 11.5px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint);
  text-align: left; padding: 14px 18px; border-bottom: 2px solid var(--line-strong);
}
td { padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 15px; }
tr:last-child td { border-bottom: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,.85); }
.site-footer .wrap { padding: clamp(36px,5vw,56px) clamp(18px,5vw,56px) 24px; max-width: 1080px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 28px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-tag { font-family: var(--font-head); font-weight: 600; color: #fff; margin-top: 12px; }
.site-footer h4 {
  font-family: var(--font-head); font-weight: 700; font-size: 11.5px;
  letter-spacing: .2em; text-transform: uppercase; color: #F3954C; margin-bottom: 10px;
}
.site-footer a { color: rgba(255,255,255,.85); text-decoration: none; }
.site-footer a:hover, .site-footer a:focus { color: #fff; text-decoration: underline; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 5px 0; font-size: 15px; }
.footer-legal {
  border-top: 1px solid rgba(255,255,255,.15); margin-top: 30px; padding-top: 18px;
  font-size: 13px; color: rgba(255,255,255,.6);
}

/* Utilities */
.center { text-align: center; }
.center p, .center .lede { margin-left: auto; margin-right: auto; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 24px; }
.center .btn-row { justify-content: center; }
