/* ============================================================
   Positronic Solutions — site stylesheet
   Brand: purple nucleus (#4a1e7a) + warm orange (#f08a1a)
   ============================================================ */

/* OpenDyslexic font (loaded lazily — only fetched when
   body.a11y-dyslexic class is present, no perf cost otherwise) */
@font-face {
  font-family: 'OpenDyslexic';
  src: url('../fonts/OpenDyslexic-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'OpenDyslexic';
  src: url('../fonts/OpenDyslexic-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --purple: #4a1e7a;
  --purple-dark: #341354;
  --purple-light: #6b3da0;
  --orange: #f08a1a;
  --orange-light: #ffa340;
  --ink: #1f1d26;
  --ink-soft: #4a4754;
  --muted: #6f6c7a;
  --line: #e6e3ec;
  --bg: #ffffff;
  --bg-soft: #faf8fc;
  --bg-tint: #f3eef9;
  --shadow-sm: 0 1px 2px rgba(20, 12, 40, 0.06), 0 1px 3px rgba(20, 12, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(20, 12, 40, 0.08), 0 2px 4px rgba(20, 12, 40, 0.04);
  --shadow-lg: 0 12px 32px rgba(20, 12, 40, 0.10), 0 4px 8px rgba(20, 12, 40, 0.05);
  --radius: 10px;
  --radius-sm: 6px;
  --max-w: 1140px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--purple);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover { color: var(--orange); }

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 4.5vw, 2.75rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.015em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.4em; margin: 0 0 1.1em; }
li { margin-bottom: 0.4em; }

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- skip link ---------- */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--purple);
  color: #fff;
  padding: 8px 16px;
  z-index: 100;
  text-decoration: none;
}
.skip-link:focus { top: 0; color: #fff; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }

.brand img {
  width: 42px;
  height: auto;
}

.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.brand-tag {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0;
}

/* ---------- nav ---------- */
.site-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.site-nav a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--bg-tint);
  color: var(--purple);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--ink);
}

/* ---------- hero ---------- */
.hero {
  padding: 80px 0 60px;
  background:
    radial-gradient(ellipse 60% 80% at 80% 0%, rgba(240, 138, 26, 0.10), transparent 70%),
    radial-gradient(ellipse 60% 80% at 0% 100%, rgba(74, 30, 122, 0.08), transparent 70%),
    var(--bg);
}

.hero h1 {
  max-width: 22ch;
  margin-bottom: 0.5em;
}

.hero .eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 12px;
}

.hero .lede {
  font-size: 1.2rem;
  color: var(--ink-soft);
  max-width: 56ch;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-align: center;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--purple);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--purple-dark);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--purple);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: var(--purple);
  color: var(--purple);
  background: var(--bg-tint);
}

/* ---------- sections ---------- */
.section {
  padding: 64px 0;
}
.section-tint { background: var(--bg-soft); }

.section-head {
  max-width: 64ch;
  margin: 0 auto 40px;
  text-align: center;
}
.section-head p {
  color: var(--ink-soft);
  font-size: 1.1rem;
}

/* ---------- card grid ---------- */
.grid {
  display: grid;
  gap: 24px;
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.card h3 {
  margin-bottom: 8px;
  color: var(--purple);
}
.card h3 a {
  color: inherit;
  text-decoration: none;
}
.card h3 a:hover { color: var(--orange); }

.card p { color: var(--ink-soft); }

.card-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--orange);
  margin-bottom: 8px;
}

/* ---------- value-prop badges ---------- */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tint);
  color: var(--purple);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---------- testimonial blocks ---------- */
.testimonial {
  background: var(--bg);
  border-left: 4px solid var(--orange);
  padding: 24px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.testimonial blockquote {
  margin: 0 0 12px;
  font-size: 1.1rem;
  color: var(--ink);
  font-style: italic;
  line-height: 1.55;
}
.testimonial cite {
  display: block;
  font-style: normal;
  font-weight: 600;
  color: var(--purple);
  font-size: 0.95rem;
}
.testimonial cite span {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- case study page ---------- */
.case-study-header {
  background:
    radial-gradient(ellipse 60% 100% at 100% 0%, rgba(74, 30, 122, 0.12), transparent 70%),
    var(--bg-soft);
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--line);
}
.case-study-header .eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 8px;
}

.case-study-body {
  padding: 56px 0;
}

.case-study-body h2 {
  margin-top: 1.5em;
  color: var(--purple);
}
.case-study-body h2:first-child { margin-top: 0; }

.case-study-body ul { margin-bottom: 1.5em; }

.tech-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.tech-list li {
  display: inline-block;
  background: var(--bg-tint);
  color: var(--purple);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
}

.cta-band {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  color: #fff;
  padding: 56px 0;
  text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255, 255, 255, 0.85); font-size: 1.1rem; }
.cta-band .btn-primary {
  background: var(--orange);
  color: #fff;
}
.cta-band .btn-primary:hover {
  background: var(--orange-light);
  color: #fff;
}

/* ---------- contact form ---------- */
.contact-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: 1fr;
}
@media (min-width: 820px) {
  .contact-grid { grid-template-columns: 1.2fr 1fr; }
}

.form-field {
  margin-bottom: 18px;
}
.form-field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 6px;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 11px 14px;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
/* Mouse-focus on form fields — soft purple shadow, no harsh outline */
.form-field input:focus:not(:focus-visible),
.form-field select:focus:not(:focus-visible),
.form-field textarea:focus:not(:focus-visible) {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(74, 30, 122, 0.12);
}
.form-field textarea {
  resize: vertical;
  min-height: 140px;
}
.form-field .hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 4px;
}
.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-aside h3 { color: var(--purple); margin-top: 0; }
.contact-aside ul {
  list-style: none;
  padding: 0;
}
.contact-aside ul li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}
.contact-aside ul li:last-child { border-bottom: none; }

/* ---------- footer ---------- */
.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.7);
  padding: 48px 0 24px;
  font-size: 0.92rem;
}
.site-footer .container {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .site-footer .container {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
}
.site-footer h4 {
  color: #fff;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 12px;
}
.site-footer a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--orange-light);
  text-decoration: underline;
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-footer ul li { margin-bottom: 6px; }
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.footer-brand img { width: 36px; }
.footer-brand strong { color: #fff; font-size: 1.05rem; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 32px;
  padding-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  grid-column: 1 / -1;
}

/* ---------- partner badge ---------- */
.partner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.partner img { width: 72px; height: auto; }
.partner p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.partner strong { color: var(--ink); display: block; }

/* ---------- responsive nav ---------- */
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 16px;
    box-shadow: var(--shadow-md);
  }
  .site-nav.open { display: block; }
  .site-nav ul {
    flex-direction: column;
    gap: 4px;
  }
  .site-nav a {
    display: block;
    width: 100%;
    padding: 12px 14px;
  }
  .site-header .container { position: relative; }
  .hero { padding: 56px 0 40px; }
  .section { padding: 48px 0; }
}

/* ---------- print ---------- */
@media print {
  .site-header, .site-footer, .cta-band, .a11y-button, .a11y-panel { display: none; }
  a { color: var(--ink); text-decoration: underline; }
  body { font-size: 11pt; }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

/* Better focus indicators — visible only on keyboard, not mouse.
   Outline + halo + !important to guarantee visibility regardless
   of any element-specific :focus overrides further up. */
:focus-visible {
  outline: 3px solid var(--orange) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 6px rgba(240, 138, 26, 0.28) !important;
}
:focus:not(:focus-visible) { outline: none; }

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Card heading — h2 or h3 both render the same so we can fix
   heading hierarchy without affecting the look */
.card h2, .card h3 {
  margin-bottom: 8px;
  color: var(--purple);
  font-size: 1.25rem;
}
.card h2 a, .card h3 a { color: inherit; text-decoration: none; }
.card h2 a:hover, .card h3 a:hover { color: var(--orange); }

/* ---------- user-toggleable accessibility classes ---------- */

/* Dyslexic-friendly font */
body.a11y-dyslexic,
body.a11y-dyslexic .site-nav,
body.a11y-dyslexic .form-field input,
body.a11y-dyslexic .form-field select,
body.a11y-dyslexic .form-field textarea {
  font-family: 'OpenDyslexic', var(--font-sans);
}
/* Keep the a11y widget itself in the default font for clarity */
body.a11y-dyslexic .a11y-button,
body.a11y-dyslexic .a11y-panel { font-family: var(--font-sans); }

/* Text size adjustments */
body.a11y-text-large  { font-size: 19px; }
body.a11y-text-xlarge { font-size: 22px; line-height: 1.7; }

/* High contrast — pure black/white, no tints/shadows */
body.a11y-high-contrast {
  --ink: #000;
  --ink-soft: #000;
  --muted: #222;
  --line: #000;
  --bg: #fff;
  --bg-soft: #fff;
  --bg-tint: #fff;
  --purple: #000;
  --purple-dark: #000;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
}
body.a11y-high-contrast a { color: #000; text-decoration: underline; }
body.a11y-high-contrast a:hover { color: #000; background: #ff0; }
body.a11y-high-contrast .btn-primary { background: #000; color: #fff; border-color: #000; }
body.a11y-high-contrast .btn-primary:hover { background: #222; color: #fff; }
body.a11y-high-contrast .btn-ghost { background: #fff; color: #000; border: 2px solid #000; }
body.a11y-high-contrast .card,
body.a11y-high-contrast .testimonial,
body.a11y-high-contrast .partner,
body.a11y-high-contrast .form-field input,
body.a11y-high-contrast .form-field select,
body.a11y-high-contrast .form-field textarea {
  border: 2px solid #000;
}
body.a11y-high-contrast .hero,
body.a11y-high-contrast .case-study-header { background: #fff !important; }
body.a11y-high-contrast .cta-band {
  background: #000 !important;
  color: #fff !important;
}
body.a11y-high-contrast .cta-band h2,
body.a11y-high-contrast .cta-band p { color: #fff !important; }
body.a11y-high-contrast .cta-band .btn-primary { background: #fff; color: #000; }
body.a11y-high-contrast .site-footer { background: #000; color: #fff; }
body.a11y-high-contrast .badge,
body.a11y-high-contrast .card-tag,
body.a11y-high-contrast .tech-list li {
  background: #fff; color: #000; border: 1px solid #000;
}

/* Underline-all-links option */
body.a11y-underline-links a { text-decoration: underline !important; }

/* ---------- accessibility widget ---------- */
.a11y-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  border: 2px solid #fff;
  box-shadow: var(--shadow-md);
  font: 700 1rem/1 var(--font-sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.a11y-button:hover { background: var(--purple-dark); }
.a11y-button:focus-visible { outline-offset: 4px; }

.a11y-panel {
  position: fixed;
  bottom: 78px;
  right: 20px;
  z-index: 100;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-lg);
  width: 280px;
  max-width: calc(100vw - 40px);
  font: 14px/1.4 var(--font-sans);
}
.a11y-panel h2 { font-size: 1rem; margin: 0 0 14px; color: var(--ink); }
.a11y-panel fieldset { border: none; padding: 0; margin: 0 0 14px; }
.a11y-panel legend {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink);
  margin-bottom: 4px;
  padding: 0;
}
.a11y-panel label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  cursor: pointer;
  color: var(--ink);
}
.a11y-panel input[type="radio"],
.a11y-panel input[type="checkbox"] { margin: 0; flex-shrink: 0; }
.a11y-panel .a11y-reset {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  width: 100%;
  color: var(--ink);
  font-family: inherit;
}
.a11y-panel .a11y-reset:hover { background: var(--bg-tint); }

/* Hide the panel until JS opens it */
.a11y-panel[hidden] { display: none; }

@media (max-width: 480px) {
  .a11y-button { bottom: 12px; right: 12px; }
  .a11y-panel  { bottom: 70px; right: 12px; }
}
