/* ==========================================================================
   Xperts LLC — Design system
   Concept: the visual language of a certification dossier — hairline rules,
   ledger numerals, and an official seal motif — built from the actual ISO
   standard codes the firm works with, rather than decorative iconography.
   ========================================================================== */

:root {
  /* Color */
  --ink:        #16222C;   /* primary text, blue-black */
  --ink-soft:   #4B5A63;   /* secondary text */
  --navy:       #0E2A40;   /* structural / header / footer */
  --navy-2:     #133A57;   /* navy gradient partner, hover states */
  --paper:      #EEF0EA;   /* page background — cool paper, not cream */
  --surface:    #FBFBF8;   /* card / panel background, near-white */
  --seal:       #2E6B52;   /* certification-seal green, primary accent */
  --seal-dark:  #204C3B;
  --seal-tint:  #E4EEE8;
  --line:       #CBD0C6;   /* hairline rule */
  --line-soft:  #DEE1DA;

  /* Type */
  --font-serif: 'Source Serif 4', 'Iowan Old Style', Georgia, serif;
  --font-sans:  'IBM Plex Sans', -apple-system, 'Segoe UI', sans-serif;
  --font-mono:  'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --step-0: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.4vw, 1.375rem);
  --step-2: clamp(1.5rem, 1.3rem + 0.8vw, 1.9rem);
  --step-3: clamp(2rem, 1.6rem + 1.6vw, 2.75rem);
  --step-4: clamp(2.6rem, 2rem + 2.6vw, 4rem);

  --container: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 3px;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--navy);
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); font-family: var(--font-sans); font-weight: 600; }

p { margin: 0 0 1.1em; max-width: 62ch; }
p.lede { font-size: var(--step-1); color: var(--ink-soft); max-width: 52ch; }

:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.hairline { border: none; border-top: 1px solid var(--line); margin: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Skip link -------------------------------------------------- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--navy); color: #fff; padding: 0.75em 1.25em;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Buttons ------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--font-sans); font-weight: 600; font-size: 0.95rem;
  padding: 0.85em 1.6em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.btn-primary { background: var(--seal); color: #fff; }
.btn-primary:hover { background: var(--seal-dark); }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,0.4); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,0.08); }
.btn-outline { background: transparent; border-color: var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }

/* ==========================================================================
   Site header / navigation
   ========================================================================== */
.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
}
.brand {
  display: flex; align-items: baseline; gap: 0.6em;
  text-decoration: none; color: #fff;
}
.brand-mark {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em;
  color: var(--seal-tint); border: 1px solid rgba(255,255,255,0.35);
  padding: 0.15em 0.4em; border-radius: 2px;
}
.brand-name {
  font-family: var(--font-serif); font-size: 1.4rem; font-weight: 600;
}

.main-nav { display: flex; align-items: center; gap: 2rem; }
.main-nav ul { list-style: none; display: flex; gap: 1.75rem; margin: 0; padding: 0; }
.main-nav a {
  text-decoration: none; font-size: 0.95rem; font-weight: 500;
  color: rgba(255,255,255,0.85);
  padding-block: 0.3em; border-bottom: 2px solid transparent;
}
.main-nav a:hover,
.main-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--seal); }

.nav-toggle {
  display: none;
  background: transparent; border: 1px solid rgba(255,255,255,0.4);
  border-radius: 3px; padding: 0.5em 0.7em; color: #fff; cursor: pointer;
}

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; top: 76px; left: 0; right: 0;
    background: var(--navy); flex-direction: column; align-items: stretch;
    padding: 0 var(--gutter) 1.5rem; gap: 0;
    max-height: 0; overflow: hidden; transition: max-height 220ms ease;
  }
  .main-nav.is-open { max-height: 480px; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav li { border-top: 1px solid rgba(255,255,255,0.08); }
  .main-nav a { display: block; padding: 0.9em 0; }
  .main-nav .btn { margin-top: 1rem; width: 100%; justify-content: center; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  background: linear-gradient(155deg, var(--navy) 0%, var(--navy-2) 62%, var(--navy) 100%);
  color: #fff;
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
  overflow: hidden;
}
.hero .container {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero-eyebrow-code {
  font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.04em;
  color: var(--seal-tint); margin-bottom: 1rem; display: block;
}
.hero h1 { color: #fff; }
.hero p.lede { color: rgba(255,255,255,0.78); }
.hero-actions { display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }

.hero-seal-wrap {
  display: flex; justify-content: center;
  opacity: 0; transform: scale(0.92);
  animation: seal-in 900ms 200ms cubic-bezier(.2,.8,.2,1) forwards;
}
@media (prefers-reduced-motion: reduce) {
  .hero-seal-wrap { opacity: 1; transform: none; animation: none; }
}
@keyframes seal-in { to { opacity: 1; transform: scale(1); } }

.seal {
  width: min(280px, 70vw); height: min(280px, 70vw);
}
.seal circle.ring { fill: none; stroke: rgba(255,255,255,0.5); }
.seal circle.ring-inner { fill: none; stroke: var(--seal-tint); stroke-width: 1; }
.seal text { fill: #fff; font-family: var(--font-mono); }
.seal .seal-check { stroke: var(--seal-tint); }

@media (max-width: 780px) {
  .hero .container { grid-template-columns: 1fr; text-align: left; }
  .hero-seal-wrap { order: -1; margin-bottom: 1rem; }
  .seal { width: 190px; height: 190px; }
}

/* ==========================================================================
   Ledger strip (standards index, shown under hero on the homepage)
   ========================================================================== */
.ledger {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.ledger .container {
  display: flex; flex-wrap: wrap; gap: 0;
  padding-block: 0;
}
.ledger-item {
  flex: 1 1 200px;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1.1rem 1.4rem;
  border-right: 1px solid var(--line-soft);
  text-decoration: none; color: var(--ink);
  transition: background-color 160ms ease;
}
.ledger-item:last-child { border-right: none; }
.ledger-item:hover { background: var(--seal-tint); }
.ledger-code {
  font-family: var(--font-mono); font-weight: 600; color: var(--seal);
  font-size: 1.05rem;
}
.ledger-label { font-size: 0.88rem; color: var(--ink-soft); }

/* ==========================================================================
   Section rhythm
   ========================================================================== */
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-head { max-width: 640px; margin-bottom: 2.5rem; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }

.section-nav-mark {
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--seal);
  display: block; margin-bottom: 0.6rem;
}

/* ---------- Why-choose list (structured, not icon-grid) -------------- */
.differentiators {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0;
  border-top: 1px solid var(--line);
}
.differentiator {
  padding: 1.75rem 1.75rem 1.75rem 0;
  border-bottom: 1px solid var(--line);
}
.differentiator:nth-child(odd) { padding-right: clamp(1rem, 4vw, 3rem); border-right: 1px solid var(--line); padding-left: 0; }
.differentiator:nth-child(even) { padding-left: clamp(1rem, 4vw, 3rem); }
.differentiator h4 { margin-bottom: 0.4em; }
.differentiator p { margin: 0; color: var(--ink-soft); max-width: 44ch; }
@media (max-width: 700px) {
  .differentiators { grid-template-columns: 1fr; }
  .differentiator:nth-child(odd) { border-right: none; padding-right: 0; }
  .differentiator:nth-child(even) { padding-left: 0; }
}

/* ---------- Spec-sheet cards (services) ------------------------------ */
.spec-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line);
}
.spec-card {
  background: var(--surface);
  padding: 1.75rem;
  text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; gap: 0.9rem;
  transition: background-color 160ms ease;
}
.spec-card:hover { background: var(--seal-tint); }
.spec-card:hover .spec-code { color: var(--seal-dark); }
.spec-code {
  font-family: var(--font-mono); font-size: 2.1rem; font-weight: 600;
  color: var(--seal); letter-spacing: -0.01em; transition: color 160ms ease;
}
.spec-family { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
.spec-card h3 { font-size: 1.15rem; font-family: var(--font-sans); font-weight: 600; margin: 0; color: var(--ink); }
.spec-card p { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }
.spec-scope { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto; padding-top: 0.5rem; }
.spec-scope span {
  font-size: 0.72rem; font-family: var(--font-mono); color: var(--navy);
  background: var(--paper); border: 1px solid var(--line); padding: 0.2em 0.5em; border-radius: 2px;
}

/* ---------- Process list (genuine sequence — numbered legitimately) --- */
.process-list { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.process-list li {
  counter-increment: step;
  display: grid; grid-template-columns: 3.5rem 1fr; gap: 1.25rem;
  padding-block: 1.5rem; border-top: 1px solid var(--line);
}
.process-list li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono); font-size: 1.1rem; color: var(--seal);
}
.process-list li:last-child { border-bottom: 1px solid var(--line); }
.process-list h4 { margin-bottom: 0.3em; }
.process-list p { margin: 0; color: var(--ink-soft); }

/* ---------- Stat / credential strip ----------------------------------- */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 2rem; }
.stat { border-left: 2px solid var(--seal); padding-left: 1rem; }
.stat-figure { font-family: var(--font-serif); font-size: var(--step-2); color: var(--navy); display: block; }
.stat-label { color: var(--ink-soft); font-size: 0.88rem; }

/* ==========================================================================
   Forms
   ========================================================================== */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1.25rem; }
.form-field { display: flex; flex-direction: column; gap: 0.4rem; }
.form-field.full { grid-column: 1 / -1; }
label { font-size: 0.88rem; font-weight: 600; color: var(--navy); }
input, select, textarea {
  font: inherit; padding: 0.75em 0.9em;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--seal); }
textarea { resize: vertical; min-height: 130px; }
.field-error { color: #A3402C; font-size: 0.85rem; }
.field-invalid { border-color: #A3402C; }
.honeypot-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.alert { padding: 1rem 1.25rem; border-radius: var(--radius); margin-bottom: 1.5rem; font-size: 0.95rem; }
.alert-success { background: var(--seal-tint); color: var(--seal-dark); border: 1px solid var(--seal); }
.alert-error { background: #FBEAE6; color: #7A2A17; border: 1px solid #D97757; }

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

/* ==========================================================================
   Contact info panel
   ========================================================================== */
.contact-layout { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 900px) { .contact-layout { grid-template-columns: 1fr; } }
.info-panel { background: var(--navy); color: #fff; padding: 2rem; border-radius: var(--radius); }
.info-panel h3 { color: #fff; }
.info-panel dl { margin: 1.25rem 0 0; }
.info-panel dt { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.6); margin-top: 1.1rem; }
.info-panel dd { margin: 0.2rem 0 0; font-size: 1.02rem; }
.info-panel a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,0.4); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--navy); color: rgba(255,255,255,0.75); padding-block: 3rem 2rem; margin-top: 4rem; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem;
  padding-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-grid h5 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 1rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.footer-grid a { color: rgba(255,255,255,0.75); text-decoration: none; font-size: 0.92rem; }
.footer-grid a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-top: 1.5rem; font-size: 0.85rem; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Page header (interior pages)
   ========================================================================== */
.page-header { background: var(--navy); color: #fff; padding-block: clamp(2.5rem, 6vw, 4rem); }
.page-header h1 { color: #fff; margin-bottom: 0.4em; }
.breadcrumb { font-family: var(--font-mono); font-size: 0.8rem; color: rgba(255,255,255,0.6); margin-bottom: 1rem; }
.breadcrumb a { color: rgba(255,255,255,0.85); text-decoration: none; }

.two-col { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: clamp(2rem, 5vw, 4rem); }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

.side-card { background: var(--surface); border: 1px solid var(--line); padding: 1.75rem; border-radius: var(--radius); }
.side-card h4 { margin-bottom: 0.6em; }
.side-card ul { padding-left: 1.1em; color: var(--ink-soft); }
.side-card li { margin-bottom: 0.5em; }
