/* ==========================================================================
   Coventry Systems — styles.css
   Palette: Deep Navy + Slate Grey + Signal Gold accent
   Type:    Fraunces (display) + Inter (body)
   ========================================================================== */

:root {
  /* Palette */
  --navy:        #0F2A44;
  --navy-deep:   #0B1E33;
  --slate:       #475569;
  --slate-soft:  #64748B;
  --surface:     #F8FAFC;
  --surface-alt: #E2E8F0;
  --pale:        #F1F5F9;
  --ink:         #0B1220;
  --gold:        #C9A24A;
  --gold-deep:   #A8842D;

  /* Type */
  --font-display: 'Fraunces', 'Source Serif 4', Georgia, serif;
  --font-body:    'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Scale */
  --text-xs:   0.8125rem;     /* 13px */
  --text-sm:   0.9375rem;     /* 15px */
  --text-base: 1rem;          /* 16px */
  --text-lg:   1.1875rem;     /* 19px */
  --text-xl:   clamp(1.375rem, 1.1rem + 1.2vw, 1.875rem);    /* 22-30 */
  --text-2xl:  clamp(1.875rem, 1.4rem + 2vw, 2.75rem);       /* 30-44 */
  --text-hero: clamp(2.5rem, 1.6rem + 4.5vw, 4.5rem);        /* 40-72 */

  /* Space */
  --gap-1: 0.25rem;
  --gap-2: 0.5rem;
  --gap-3: 0.75rem;
  --gap-4: 1rem;
  --gap-5: 1.25rem;
  --gap-6: 1.5rem;
  --gap-8: 2rem;
  --gap-10: 2.5rem;
  --gap-12: 3rem;
  --gap-16: 4rem;
  --gap-20: 5rem;

  --container-max: 1200px;
  --section-pad-y: clamp(4rem, 6vw + 2rem, 7rem);

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(15, 42, 68, 0.06), 0 1px 3px rgba(15, 42, 68, 0.04);
  --shadow:    0 4px 14px rgba(15, 42, 68, 0.08), 0 2px 6px rgba(15, 42, 68, 0.05);
  --shadow-lg: 0 14px 40px rgba(15, 42, 68, 0.12), 0 4px 14px rgba(15, 42, 68, 0.06);

  --header-h: 72px;
}

/* Reset / base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
}
img, svg { display: block; max-width: 100%; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--gold-deep); }
button { font: inherit; cursor: pointer; }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

/* Eyebrows + section heads */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 0 0 var(--gap-4) 0;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-2xl);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin: 0 0 var(--gap-5) 0;
}
.section-title em {
  font-style: italic;
  color: var(--gold-deep);
  font-weight: 400;
}

.section-lede {
  font-size: var(--text-lg);
  color: var(--slate);
  max-width: 60ch;
  margin: 0;
  line-height: 1.55;
}

.section { padding: var(--section-pad-y) 0; }
.section-head { margin-bottom: clamp(2.5rem, 4vw, 4rem); max-width: 760px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--navy-deep);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--surface-alt);
}
.btn-ghost:hover {
  background: var(--pale);
  color: var(--navy);
  border-color: var(--slate-soft);
}
.btn-block { width: 100%; padding: 1rem 1.5rem; font-size: var(--text-base); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--surface-alt);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-3);
  color: var(--navy);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.005em;
}
.brand-mark { width: 32px; height: 32px; color: var(--navy); flex-shrink: 0; }
.brand-name { white-space: nowrap; }

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--gap-8);
}
.site-nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--slate);
  padding: 0.5rem 0;
  position: relative;
}
.site-nav a:hover { color: var(--navy); }
.site-nav .nav-portal {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid rgba(15, 42, 68, 0.18);
  border-radius: 999px;
  color: var(--navy);
  background: transparent;
  font-weight: 600;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.site-nav .nav-portal:hover {
  border-color: var(--gold);
  color: var(--navy);
  background: rgba(201, 162, 74, 0.08);
}
.site-nav .nav-portal .nav-portal-icon { color: var(--gold); }
.site-nav .nav-cta {
  background: var(--navy);
  color: #fff;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 600;
}
.site-nav .nav-cta:hover { background: var(--navy-deep); color: #fff; }

@media (max-width: 720px) {
  .site-nav a:not(.nav-cta):not(.nav-portal) { display: none; }
  .site-nav .nav-portal { padding: 0.4rem 0.7rem; }
  .site-nav .nav-portal span { display: none; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  padding: clamp(5rem, 10vw, 8rem) 0 clamp(5rem, 9vw, 7rem);
  overflow: hidden;
  background: linear-gradient(180deg, var(--surface) 0%, var(--pale) 100%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 880px;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-hero);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin: 0 0 var(--gap-6) 0;
}
.hero-title em {
  font-style: italic;
  color: var(--gold-deep);
  font-weight: 400;
}
.hero-lede {
  font-size: clamp(1.0625rem, 0.95rem + 0.4vw, 1.25rem);
  color: var(--slate);
  max-width: 60ch;
  margin: 0 0 var(--gap-8) 0;
  line-height: 1.55;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-3);
}
.hero-decor {
  position: absolute;
  inset: auto 0 0 0;
  height: 60%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.9;
}
.hero-decor svg { width: 100%; height: 100%; }

/* ==========================================================================
   Services
   ========================================================================== */
.section-services { background: var(--surface); }
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap-6);
}
.service-card {
  background: #fff;
  border: 1px solid var(--surface-alt);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 2.5vw, 2.5rem);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}
.service-card:hover {
  border-color: var(--slate-soft);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.service-card--feature {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
/* Specificity note: `.service-card h3` (below) ties with `.service-card--feature h3`,
   and the later-declared rule would win the cascade. We raise specificity by
   chaining both classes so the feature overrides are guaranteed to apply. */
.service-card.service-card--feature h3 { color: #fff; }
.service-card.service-card--feature .service-tagline { color: rgba(255, 255, 255, 0.78); }
.service-card.service-card--feature .service-list li { color: rgba(255, 255, 255, 0.86); }
.service-card.service-card--feature .service-list li::before { background: var(--gold); }
.service-card.service-card--feature .service-num { color: var(--gold); }

.service-num {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--gold-deep);
  margin-bottom: var(--gap-4);
}
.service-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-xl);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin: 0 0 var(--gap-3) 0;
}
.service-tagline {
  font-size: var(--text-sm);
  color: var(--slate);
  font-style: italic;
  margin: 0 0 var(--gap-5) 0;
}
.service-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap-3);
}
.service-list li {
  position: relative;
  padding-left: 1.25rem;
  font-size: var(--text-sm);
  color: var(--slate);
  line-height: 1.5;
}
.service-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-deep);
}

/* ==========================================================================
   Why
   ========================================================================== */
.section-why {
  background: var(--pale);
  border-top: 1px solid var(--surface-alt);
  border-bottom: 1px solid var(--surface-alt);
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(2rem, 4vw, 3rem);
}
.why-item h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-lg);
  line-height: 1.3;
  color: var(--navy);
  margin: 0 0 var(--gap-3) 0;
}
.why-item p {
  margin: 0;
  color: var(--slate);
  font-size: var(--text-base);
  line-height: 1.6;
}
.why-num {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--gold-deep);
  margin-bottom: var(--gap-3);
}

/* ==========================================================================
   About
   ========================================================================== */
.section-about { background: var(--surface); }
.about-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.about-text p {
  color: var(--slate);
  font-size: var(--text-base);
  line-height: 1.7;
  margin: 0 0 var(--gap-5) 0;
  max-width: 60ch;
}
.about-card {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 2.5vw, 2.25rem);
  position: relative;
  overflow: hidden;
}
.about-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 4px;
  background: var(--gold);
}
.about-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-lg);
  margin: 0 0 var(--gap-5) 0;
  color: #fff;
}
.about-card dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap-4);
}
.about-card dl > div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.about-card dt {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--gold);
}
.about-card dd {
  margin: 0;
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.5;
}

@media (max-width: 760px) {
  .about-inner { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Contact
   ========================================================================== */
.section-contact {
  background: var(--navy);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.section-contact::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 0%, rgba(201, 162, 74, 0.18) 0%, transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(201, 162, 74, 0.10) 0%, transparent 50%);
  pointer-events: none;
}
.section-contact .container { position: relative; z-index: 1; }
.section-contact .eyebrow { color: var(--gold); }
.section-contact .section-title { color: #fff; }

.contact-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.contact-text p {
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--text-base);
  line-height: 1.65;
  max-width: 50ch;
  margin: 0 0 var(--gap-8) 0;
}
.contact-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--gap-6);
}
.contact-meta li {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
}
.contact-meta strong {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: var(--text-xs);
  color: var(--gold);
  margin-bottom: 0.25rem;
}
.contact-meta a {
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  padding-bottom: 1px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.contact-meta a:hover { color: var(--gold); border-bottom-color: var(--gold); }

/* Contact form */
.contact-form {
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 3vw, 2.5rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-5);
  box-shadow: var(--shadow-lg);
  position: relative;
}
.field { display: flex; flex-direction: column; }
.field-full { grid-column: 1 / -1; }
.field label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--slate);
  margin-bottom: 0.4rem;
}
.field input,
.field select,
.field textarea {
  font: inherit;
  font-size: var(--text-base);
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--surface-alt);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--navy);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 42, 68, 0.12);
}
.field textarea { resize: vertical; min-height: 110px; }
.form-actions { display: flex; flex-direction: column; gap: var(--gap-3); }
.form-note {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--slate-soft);
  line-height: 1.5;
  text-align: center;
}
.form-success,
.form-error {
  grid-column: 1 / -1;
  background: var(--pale);
  border: 1px solid var(--surface-alt);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.form-error {
  border-left-color: #B23A3A;
  background: #FDF2F2;
  border-color: #F4D6D6;
}
.form-success strong,
.form-error strong {
  display: block;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-bottom: 0.4rem;
}
.form-error strong { color: #8B1F1F; }
.form-success p,
.form-error p { margin: 0; color: var(--slate); font-size: var(--text-sm); line-height: 1.55; }
.form-error a { color: #8B1F1F; border-bottom: 1px solid currentColor; }

@media (max-width: 760px) {
  .contact-inner { grid-template-columns: 1fr; }
  .contact-form { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--gap-12) 0;
  font-size: var(--text-sm);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--gap-8);
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--gap-4);
  color: #fff;
}
.footer-brand .brand-mark { color: #fff; }
.footer-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  color: #fff;
  margin: 0;
}
.footer-tag {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.6);
  margin: 0.2rem 0 0 0;
}
.footer-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: var(--gap-2);
}
.footer-meta p { margin: 0; }
.footer-meta a {
  color: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.footer-meta a:hover { color: var(--gold); border-bottom-color: var(--gold); }

@media (max-width: 600px) {
  .footer-meta { text-align: left; }
}

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

/* ==========================================================================
   Accessibility — Atkinson Hyperlegible font mode
   Activated by <html data-a11y="hyperlegible">
   ========================================================================== */

html[data-a11y="hyperlegible"],
html[data-a11y="hyperlegible"] body,
html[data-a11y="hyperlegible"] h1,
html[data-a11y="hyperlegible"] h2,
html[data-a11y="hyperlegible"] h3,
html[data-a11y="hyperlegible"] h4,
html[data-a11y="hyperlegible"] h5,
html[data-a11y="hyperlegible"] h6,
html[data-a11y="hyperlegible"] p,
html[data-a11y="hyperlegible"] a,
html[data-a11y="hyperlegible"] button,
html[data-a11y="hyperlegible"] input,
html[data-a11y="hyperlegible"] textarea,
html[data-a11y="hyperlegible"] label,
html[data-a11y="hyperlegible"] li,
html[data-a11y="hyperlegible"] .hero-eyebrow,
html[data-a11y="hyperlegible"] .section-eyebrow {
  font-family: "Atkinson Hyperlegible", system-ui, -apple-system, sans-serif !important;
}

/* Keep italic semantics — Atkinson has italics */
html[data-a11y="hyperlegible"] em,
html[data-a11y="hyperlegible"] .accent-italic {
  font-style: italic;
}

/* Accessibility toggle button */
.a11y-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid rgba(15, 42, 68, 0.18);
  border-radius: 999px;
  background: transparent;
  color: var(--navy);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.a11y-toggle:hover { border-color: var(--gold); background: rgba(201, 162, 74, 0.08); }
.a11y-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.a11y-toggle[aria-pressed="true"] {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.a11y-toggle[aria-pressed="true"]:hover { background: var(--navy-deep); }

@media (max-width: 720px) {
  .a11y-toggle span { display: none; }
  .a11y-toggle { padding: 0.4rem 0.55rem; }
}
