/* ============================================================
   DragonBridge — styles.css
   Palette: deep slate + Welsh red on warm neutral. WCAG AA.
   Humanist system sans. Mobile-first.
   ============================================================ */

:root {
  --bg: #fbf7f1;          /* warm neutral background */
  --surface: #ffffff;     /* cards */
  --soft: #f3ece1;        /* soft section band */
  --ink: #1c2733;         /* near-black slate, body text */
  --ink-soft: #3c4a59;    /* secondary text, still AA on bg */
  --slate: #243240;       /* deep slate surfaces */
  --slate-deep: #1a2530;
  --red: #c8102e;         /* Welsh red accent */
  --red-deep: #a50c24;    /* hover */
  --border: #e6dccb;      /* warm border */
  --border-strong: #d6c8b0;
  --ring: #2f6feb;        /* focus ring, high-contrast blue */
  --on-slate: #f4f1ea;    /* text on slate */
  --on-slate-soft: #cdd6df;

  --maxw: 1120px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(28, 39, 51, .06), 0 8px 24px rgba(28, 39, 51, .07);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { line-height: 1.2; color: var(--ink); margin: 0 0 .5em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }

a { color: var(--red-deep); text-underline-offset: 3px; }
a:hover { color: var(--red); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.center { text-align: center; }

/* Accessibility helpers */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 200;
  background: var(--slate); color: #fff; padding: 10px 16px;
  border-radius: var(--radius-sm); transition: top .15s ease;
}
.skip-link:focus { top: 12px; color: #fff; }

:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; font: inherit; font-weight: 600; line-height: 1.1;
  padding: 13px 22px; min-height: 48px; border-radius: 999px;
  border: 2px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 16px 28px; font-size: 1.05rem; min-height: 54px; }
.btn-primary { background: var(--red); color: #fff; border-color: var(--red); }
.btn-primary:hover { background: var(--red-deep); border-color: var(--red-deep); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); border-color: var(--slate); }

.link-arrow { display: inline-block; font-weight: 600; text-decoration: none; }
.link-arrow::after { content: " \2192"; }
.link-arrow:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251, 247, 241, .92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 70px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand-name { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; color: var(--slate); }
.brand-mark { border-radius: 8px; }
.brand-logo { height: 52px; width: auto; display: block; }

.main-nav { display: flex; align-items: center; }
.nav-list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: inline-block; padding: 10px 12px; color: var(--ink-soft);
  text-decoration: none; font-weight: 600; font-size: .98rem; border-radius: 8px;
}
.nav-list a:hover { color: var(--ink); background: var(--soft); }

.nav-toggle { display: none; }
.header-cta { white-space: nowrap; }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section-soft { background: var(--soft); }
.section-slate { background: var(--slate); color: var(--on-slate); }
.section-slate h2, .section-slate h3 { color: #fff; }
.section-head { max-width: 720px; margin: 0 0 36px; }
.section-sub { font-size: 1.15rem; color: var(--ink-soft); margin: 0; }
.section-sub.on-slate, .on-slate { color: var(--on-slate-soft); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; color: var(--red-deep); margin: 0 0 .6rem; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }

/* ---------- Hero ---------- */
.hero { padding: 84px 0 64px; }
.hero-inner { max-width: 820px; }
.hero h1 { margin-bottom: .4em; }
.lead { font-size: 1.25rem; color: var(--ink-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 24px; }
.center-actions { justify-content: center; }
.trust-row { display: flex; flex-wrap: wrap; gap: 10px 26px; list-style: none; padding: 0; margin: 8px 0 0; font-weight: 600; color: var(--ink); }
.trust-row li { display: flex; align-items: center; gap: 8px; }
.trust-row li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--red); display: inline-block; }

/* ---------- Steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; grid-template-columns: 1fr; counter-reset: none; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; font-size: 1.25rem; margin-bottom: 14px; }

/* ---------- Tiles ---------- */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: 1fr; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.tile h3 { margin-bottom: .35em; }
.tile p { margin: 0; color: var(--ink-soft); }

/* ---------- Pricing ---------- */
.price-group-title { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin: 8px 0 16px; }
.price-cards { list-style: none; margin: 0 0 40px; padding: 0; display: grid; gap: 20px; grid-template-columns: 1fr; }
.price-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.price-card.featured { border-color: var(--red); border-width: 2px; }
.badge { position: absolute; top: -13px; left: 24px; background: var(--red); color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; margin: 0; }
.price-card h4 { margin: 0 0 .25em; font-size: 1.3rem; }
.price { margin: 0 0 .5rem; }
.price .amount { font-size: 2rem; font-weight: 800; color: var(--slate); letter-spacing: -0.02em; }
.price .per { color: var(--ink-soft); font-weight: 600; }
.price-desc { margin: 0; color: var(--ink-soft); }

.audit-cta { display: grid; gap: 20px; align-items: center; background: var(--slate); color: var(--on-slate); border-radius: var(--radius); padding: 32px; }
.audit-cta h3 { color: #fff; }
.audit-cta p { color: var(--on-slate-soft); }
.audit-cta .muted { color: var(--on-slate-soft); }
.audit-cta strong { color: #fff; }

.grant-note { margin: 28px 0 0; padding: 18px 22px; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--red); border-radius: var(--radius-sm); }

/* ---------- Proof ---------- */
.proof-grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
.proof-col { background: var(--slate-deep); border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius); padding: 26px; }
.proof-col h3 { margin-bottom: .4em; }
.proof-col p { color: var(--on-slate); margin: 0; }

/* ---------- Why us ---------- */
.why-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; grid-template-columns: 1fr; }
.why-list h3 { margin-bottom: .3em; }
.why-list p { margin: 0; color: var(--ink-soft); }

/* ---------- About ---------- */
.about-grid { display: grid; gap: 32px; grid-template-columns: 1fr; align-items: start; }
.about-photo img { width: 100%; max-width: 320px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.photo-caption { margin-top: 10px; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0; }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 22px; font-weight: 700;
  font-size: 1.08rem; display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; color: var(--red); line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq-body { padding: 0 22px 20px; }
.faq-body p { margin: 0; color: var(--ink-soft); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 36px; grid-template-columns: 1fr; }
.contact-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.field { margin-bottom: 18px; border: 0; padding: 0; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.optional { font-weight: 400; color: var(--ink-soft); }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); padding: 12px 14px;
}
.field input:focus, .field textarea:focus { border-color: var(--slate); }
.field textarea { resize: vertical; }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.radio { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
.radio input { width: auto; }

/* ---------- Final CTA ---------- */
.final-cta { background: var(--slate); color: var(--on-slate); }
.final-cta h2 { color: #fff; }
.final-cta .lead { color: var(--on-slate-soft); }

/* ---------- Error page ---------- */
.error-page { padding: 96px 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--slate-deep); color: var(--on-slate-soft); padding: 48px 0 28px; }
.footer-inner { display: grid; gap: 28px; grid-template-columns: 1fr; border-bottom: 1px solid rgba(255,255,255,.12); padding-bottom: 28px; }
.footer-brand .brand-name { color: #fff; }
.footer-logo { height: 64px; width: auto; display: block; margin-bottom: 10px; }
.footer-brand p { margin-top: 10px; }
.footer-nav { display: flex; flex-direction: column; gap: 10px; }
.footer-nav a, .footer-contact a { color: var(--on-slate-soft); text-decoration: none; font-weight: 600; }
.footer-nav a:hover, .footer-contact a:hover { color: #fff; text-decoration: underline; }
.footer-contact a { display: inline-block; margin-bottom: 8px; color: #fff; }
.site-footer .muted { color: var(--on-slate-soft); }
.copyright { margin: 22px 0 0; }
.legal h2 { margin-top: 1.6em; }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: .5em; }

/* ============================================================
   Responsive
   ============================================================ */
@media (min-width: 620px) {
  .tiles, .price-cards, .why-list { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  .nav-list { gap: 6px; }
  .tiles, .why-list { grid-template-columns: repeat(3, 1fr); }
  .price-cards { grid-template-columns: repeat(3, 1fr); }
  .proof-grid { grid-template-columns: repeat(3, 1fr); }
  .audit-cta { grid-template-columns: 1fr auto; }
  .about-grid { grid-template-columns: 300px 1fr; }
  .contact-grid { grid-template-columns: 1fr 1.1fr; }
  .footer-inner { grid-template-columns: 1.4fr 1fr 1fr; }
}

/* Mobile nav */
@media (max-width: 780px) {
  .header-cta { display: none; }
  .brand-logo { height: 44px; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; background: transparent; border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm); cursor: pointer; position: relative;
  }
  .nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
    content: ""; position: absolute; width: 22px; height: 2px; background: var(--ink); border-radius: 2px;
    transition: transform .2s ease, opacity .2s ease;
  }
  .nav-toggle-bar::before { transform: translateY(-7px); }
  .nav-toggle-bar::after { transform: translateY(7px); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: rotate(-45deg); }

  .nav-list {
    position: absolute; top: 70px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 12px 16px;
    display: none;
  }
  .nav-list.open { display: flex; }
  .nav-list a { padding: 14px 12px; border-radius: 8px; font-size: 1.05rem; }
  .nav-list li:last-child { margin-top: 8px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
