/* ============================================================
   Wardstone Digital — design system
   Bold & modern, trustworthy, WCAG 2.1 AA.
   ============================================================ */

/* ---- Fonts (self-hosted variable fonts, no third-party requests) ---- */
@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---- Tokens ---- */
:root {
  --ink: #0e1116;
  --ink-soft: #3a4150;
  --base: #ffffff;
  --base-alt: #f4f6f8;
  --accent: #2d5bff;        /* buttons / fills */
  --accent-ink: #1e44d6;    /* accent text on white (AA for body text) */
  --accent-2: #0fb88a;      /* secondary highlight (AA-safe vs white/ink) */
  --line: #e2e6eb;
  --on-accent: #ffffff;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --maxw: 1200px;
  --maxw-narrow: 780px;
  --radius: 12px;
  --radius-lg: 18px;

  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 40px; --s6: 64px; --s7: 96px;

  --shadow-sm: 0 1px 2px rgba(14, 17, 22, 0.06), 0 4px 12px rgba(14, 17, 22, 0.05);
  --shadow-md: 0 8px 30px rgba(14, 17, 22, 0.10);
  --shadow-accent: 0 12px 34px rgba(45, 91, 255, 0.28);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent-ink); }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(2.3rem, 6vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.2rem; line-height: 1.25; }

/* ---- Accessibility helpers ---- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Layout ---- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(20px, 5vw, 40px); }
.container.narrow { max-width: var(--maxw-narrow); }
.section { padding-block: clamp(56px, 9vw, 96px); }
.section-alt { background: var(--base-alt); }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.eyebrow {
  font-family: var(--font-display); font-weight: 500; font-size: 0.85rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: var(--s3);
}
.lead { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--ink-soft); max-width: 60ch; }
.section-head { max-width: 60ch; margin-bottom: var(--s5); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font-family: var(--font-display); font-weight: 500; font-size: 1rem;
  padding: 13px 22px; border-radius: var(--radius); border: 2px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .15s ease, background .15s ease, box-shadow .15s ease, color .15s ease;
  line-height: 1;
}
.btn-sm { padding: 9px 16px; font-size: 0.92rem; }
.btn-lg { padding: 16px 28px; font-size: 1.08rem; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-ink); box-shadow: var(--shadow-accent); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn-on-accent { background: #fff; color: var(--accent-ink); }
.btn-on-accent:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn .icon-arrow { width: 16px; height: 16px; }
@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }

.text-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-display); font-weight: 500; color: var(--accent-ink);
  text-decoration: none; background: none; border: none; cursor: pointer; font-size: 1rem; padding: 0;
}
.text-link .icon-arrow { width: 15px; height: 15px; transition: transform .15s ease; }
.text-link:hover { text-decoration: underline; }
.text-link:hover .icon-arrow { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) { .text-link:hover .icon-arrow { transform: none; } }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.85); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s ease, box-shadow .2s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: var(--s4); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 700; }
.brand-mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 1.1rem; box-shadow: var(--shadow-accent);
}
.brand-word { font-size: 1.12rem; letter-spacing: -0.02em; }
.brand-accent { color: var(--accent-ink); }
.primary-nav { display: flex; gap: var(--s4); }
.primary-nav a { color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 0.98rem; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: var(--s3); }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; width: 44px; height: 44px; flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
.menu-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-menu { border-top: 1px solid var(--line); background: var(--base); }
.mobile-menu nav { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4) clamp(20px, 5vw, 40px); }
.mobile-menu a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.1rem; }
.mobile-menu .btn { margin-top: var(--s2); }

@media (max-width: 860px) {
  .primary-nav { display: none; }
  .header-actions .btn-primary { display: none; }
  .menu-toggle { display: flex; }
}

/* ---- Hero ---- */
.hero { padding-block: clamp(48px, 8vw, 88px); overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero h1 { margin-block: var(--s2) var(--s4); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }
.hero-svg { width: 100%; height: auto; filter: drop-shadow(var(--shadow-md)); }
@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 440px; }
}

/* ---- Trust strip ---- */
.trust-strip { background: var(--ink); color: #fff; }
.trust-strip p { text-align: center; padding-block: var(--s4); font-family: var(--font-display); font-weight: 500; font-size: clamp(0.95rem, 2vw, 1.15rem); letter-spacing: 0.01em; }

/* ---- Pain list ---- */
.pain-list { list-style: none; padding: 0; margin: var(--s5) 0 var(--s4); display: grid; gap: var(--s3); }
.pain-list li { position: relative; padding-left: 38px; font-size: 1.1rem; }
.pain-list li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--base-alt); border: 2px solid var(--line);
}
.pain-list li::after { content: "?"; position: absolute; left: 7px; top: 3px; color: var(--accent-ink); font-weight: 700; font-family: var(--font-display); }
.pain-resolve { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.2rem, 2.5vw, 1.6rem); color: var(--ink); margin-top: var(--s4); }

/* ---- Cards ---- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
@media (max-width: 880px) { .card-grid { grid-template-columns: 1fr; } }
.service-card {
  background: var(--base); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--s5) var(--s4); display: flex; flex-direction: column; gap: var(--s3);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: transparent; }
.pillar-icon { width: 48px; height: 48px; color: var(--ink); }
.service-card .text-link { margin-top: auto; }
@media (prefers-reduced-motion: reduce) { .service-card:hover { transform: none; } }

/* ---- Process ---- */
.process { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s5) var(--s5); counter-reset: step; }
@media (max-width: 720px) { .process { grid-template-columns: 1fr; } }
.process li { display: flex; gap: var(--s3); align-items: flex-start; }
.step-num {
  flex: none; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--on-accent); background: var(--accent);
}
.process h3 { margin-bottom: 4px; }
.process p { color: var(--ink-soft); }

/* ---- Case cards ---- */
.case-card { background: var(--base); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s4); position: relative; display: flex; flex-direction: column; gap: 10px; }
.case-sector { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.case-problem { color: var(--ink-soft); }
.case-result { font-size: 1.05rem; }
.case-result strong { color: var(--accent-ink); font-family: var(--font-display); }
.case-tag { align-self: flex-start; margin-top: auto; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); background: var(--base-alt); border: 1px solid var(--line); padding: 3px 9px; border-radius: 999px; }
.case-card-lg .case-row { display: grid; gap: 2px; padding-block: 6px; border-top: 1px solid var(--line); }
.case-card-lg .case-row:first-of-type { border-top: none; }
.case-k { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-ink); }
.work-grid { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 720px) { .work-grid { grid-template-columns: 1fr; } }
.work-note { text-align: center; margin-top: var(--s6); max-width: 56ch; margin-inline: auto; display: grid; gap: var(--s4); justify-items: center; }

/* ---- About teaser ---- */
.about-teaser { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(28px, 5vw, 56px); align-items: center; }
@media (max-width: 820px) { .about-teaser { grid-template-columns: 1fr; } }
.portrait-svg { width: 100%; height: auto; border-radius: var(--radius-lg); }
.about-teaser-photo picture, .about-hero-photo picture { display: block; }
.portrait-photo { width: 100%; height: auto; border-radius: var(--radius-lg); object-fit: cover; box-shadow: var(--shadow-md); }
.about-teaser-photo .portrait-photo { aspect-ratio: 1/1; }
.about-teaser-copy h2 { margin-bottom: var(--s3); }

/* ---- About page ---- */
.about-hero-inner { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(28px, 5vw, 56px); align-items: center; }
@media (max-width: 820px) { .about-hero-inner { grid-template-columns: 1fr; } .about-hero-photo { max-width: 320px; } }
.prose p { margin-bottom: var(--s4); font-size: 1.08rem; }
.prose p:last-child { margin-bottom: 0; }
.principles { list-style: none; padding: 0; margin: var(--s5) 0 0; display: grid; gap: var(--s4); }
.principles li { padding-left: 34px; position: relative; font-size: 1.08rem; }
.principles li::before { content: ""; position: absolute; left: 0; top: 9px; width: 18px; height: 18px; border-radius: 5px; background: var(--accent-2); }
.principles strong { font-family: var(--font-display); }

/* ---- Services pillars ---- */
.pillars { display: grid; gap: clamp(48px, 8vw, 96px); }
.pillar { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.pillar-right .pillar-media { order: 2; }
.pillar-media { display: grid; place-items: center; background: var(--base-alt); border-radius: var(--radius-lg); aspect-ratio: 4/3; }
.pillar-media .pillar-icon { width: 96px; height: 96px; color: var(--ink); }
.pillar-copy h2 { margin-bottom: var(--s2); }
.pillar-intro { font-size: 1.15rem; color: var(--ink-soft); margin-bottom: var(--s4); }
.pillar-label, .case-k { margin-bottom: var(--s2); }
.pillar-label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-ink); }
.check-list { list-style: none; padding: 0; margin: 0 0 var(--s4); display: grid; gap: 10px; }
.check-list li { position: relative; padding-left: 30px; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4 9l3.5 3.5L14 6' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4 9l3.5 3.5L14 6' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat;
}
.pillar-good { margin-bottom: var(--s4); }
@media (max-width: 820px) {
  .pillar { grid-template-columns: 1fr; }
  .pillar-right .pillar-media { order: 0; }
  .pillar-media { aspect-ratio: 16/7; }
}

/* ---- CTA band ---- */
.cta-band { background: var(--accent); color: var(--on-accent); }
.cta-inner { text-align: center; padding-block: clamp(56px, 9vw, 88px); display: grid; gap: var(--s4); justify-items: center; }
.cta-band h2 { color: var(--on-accent); }
.cta-band p { max-width: 52ch; color: rgba(255, 255, 255, 0.92); font-size: 1.1rem; }

/* ---- Contact ---- */
.contact-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 5vw, 64px); align-items: start; }
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-primary h2, .contact-secondary h2 { margin-bottom: var(--s4); }
.booking-embed { min-height: 560px; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.booking-embed iframe { width: 100%; height: 620px; border: 0; }
.booking-fallback { background: var(--base-alt); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s5); display: grid; gap: var(--s4); }
.contact-form { display: grid; gap: var(--s3); }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 0.95rem; }
.optional { color: var(--ink-soft); font-weight: 400; }
.field input, .field textarea {
  font: inherit; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--base); color: var(--ink); width: 100%;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(45, 91, 255, 0.18); }
.field-error { color: #b3261e; font-size: 0.88rem; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #b3261e; }
.form-status { font-weight: 600; min-height: 1.2em; }
.form-status.ok { color: var(--accent-2); }
.form-status.err { color: #b3261e; }
.reassurance { color: var(--ink-soft); margin-top: var(--s4); font-size: 0.96rem; }
.direct-contact { display: flex; gap: var(--s4); margin-top: var(--s3); }

/* ---- Legal ---- */
.legal h2 { font-size: 1.3rem; margin: var(--s5) 0 var(--s2); }
.legal p, .legal ul { margin-bottom: var(--s3); }
.legal ul { padding-left: var(--s4); }
.legal li { margin-bottom: 6px; }
.legal-flag { background: #fff8e6; border: 1px solid #f2d680; border-radius: 10px; padding: var(--s3) var(--s4); margin-bottom: var(--s5); color: #5c4708; }
.page-hero { padding-block: clamp(48px, 7vw, 80px) clamp(8px, 2vw, 16px); }
.page-hero h1 { margin-block: var(--s2) var(--s3); }

/* ---- Footer ---- */
.site-footer { background: var(--ink); color: #fff; padding-block: var(--s6) var(--s4); margin-top: var(--s2); }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s5); padding-bottom: var(--s5); border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
@media (max-width: 720px) { .footer-inner { grid-template-columns: 1fr; gap: var(--s4); } }
.site-footer .brand { color: #fff; }
.footer-tag { color: rgba(255, 255, 255, 0.6); margin-top: var(--s2); font-size: 0.95rem; }
.footer-nav, .footer-contact { display: flex; flex-direction: column; gap: 10px; }
.site-footer a { color: rgba(255, 255, 255, 0.78); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-legal { padding-top: var(--s4); }
.footer-legal p { color: rgba(255, 255, 255, 0.5); font-size: 0.88rem; }

/* ---- Modal ---- */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: var(--s4); }
.modal-backdrop { position: absolute; inset: 0; background: rgba(14, 17, 22, 0.55); backdrop-filter: blur(3px); }
.modal-dialog {
  position: relative; background: var(--base); border-radius: var(--radius-lg); width: min(640px, 100%);
  max-height: 90vh; overflow: auto; box-shadow: var(--shadow-md);
  animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .modal-dialog { animation: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s4); border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 1.3rem; }
.modal-close { background: none; border: none; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--ink-soft); width: 40px; height: 40px; border-radius: 8px; }
.modal-close:hover { background: var(--base-alt); color: var(--ink); }
.modal-body { padding: var(--s4); }
.modal-body .booking-fallback { margin: 0; }
.booking-embed iframe, .modal-body .booking-embed { min-height: 540px; }
body.modal-open { overflow: hidden; }

/* ---- Cookie banner ---- */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; z-index: 150; background: var(--ink); color: #fff; box-shadow: 0 -6px 30px rgba(0,0,0,0.2); }
.cookie-banner[hidden] { display: none; }
.cookie-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding-block: var(--s3); flex-wrap: wrap; }
.cookie-inner p { font-size: 0.95rem; color: rgba(255,255,255,0.88); max-width: 70ch; }
.cookie-actions { display: flex; gap: var(--s2); }
.cookie-banner .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.4); }
.cookie-banner .btn-ghost:hover { border-color: #fff; }

/* ---- Reveal on scroll (progressive enhancement: only hidden when JS is active) ---- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }
