/* ============================================================
   SEAMSURE — brand stylesheet
   Palette, type and balance per Corporate Identity Guide v1.0:
   60% white · 30% coal/charcoal · 10% deep gold (accent only).
   ============================================================ */

/* ---------- Fonts (self-hosted variable fonts, CI §5) ----------
   One latin-subset variable file per family covers every weight used. */
@font-face {
  font-family: "Montserrat";
  src: url("../assets/fonts/Montserrat-Variable.woff2") format("woff2-variations"),
       url("../assets/fonts/Montserrat-Variable.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/Inter-Variable.woff2") format("woff2-variations"),
       url("../assets/fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
}

/* ---------- Tokens (CI §4) ---------- */
:root {
  --coal: #101010;
  --charcoal: #292929;
  --white: #ffffff;
  --grey-light: #d0d0d0;
  --gold: #ba8119;
  --gold-dark: #a66f10;
  --gold-hi: #d49a28;
  /* Ratified derived shades (see docs/build-notes.md):
     --gold-text passes WCAG AA for small text on white; --error is the single functional error red. */
  --gold-text: #8a5c0c;
  --error: #a02c2c;
  --input-border: #8c8c8c;

  /* Derived neutrals (stay within the white/charcoal families) */
  --ink: var(--coal);
  --ink-soft: #4a4a4a;
  --paper: var(--white);
  --paper-tint: #f6f5f2;
  --rule: #e4e2dd;

  --font-display: "Montserrat", "Aptos Display", Arial, sans-serif;
  --font-body: "Inter", "Aptos", Arial, sans-serif;

  /* Fluid type scale */
  --step--1: clamp(0.78rem, 0.76rem + 0.1vw, 0.83rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --step-1: clamp(1.15rem, 1.08rem + 0.35vw, 1.35rem);
  --step-2: clamp(1.5rem, 1.35rem + 0.75vw, 1.9rem);
  --step-3: clamp(2rem, 1.7rem + 1.5vw, 2.9rem);
  --step-4: clamp(2.6rem, 2rem + 3vw, 4.4rem);

  /* Spacing scale */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 40px;
  --s5: 64px; --s6: 96px; --s7: 144px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-soft: 0 1px 2px rgba(16,16,16,0.05), 0 8px 28px rgba(16,16,16,0.07);
  --shadow-lift: 0 2px 4px rgba(16,16,16,0.06), 0 16px 48px rgba(16,16,16,0.12);
  --radius: 2px; /* report-like precision: near-square corners */
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { max-width: 100%; display: block; }
a { color: inherit; }
ul, ol { list-style: none; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; }
h2 { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
h3 { font-size: var(--step-1); font-weight: 700; letter-spacing: -0.01em; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--coal); color: var(--white); padding: 10px 18px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; }

.container { max-width: 1200px; margin-inline: auto; padding-inline: clamp(20px, 4vw, 48px); }

/* ---------- Wordmark lockup (typographic placeholder, CI §2) ---------- */
.lockup {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  display: inline-flex;
  line-height: 1;
}
.lockup-seam { color: var(--coal); transition: color 0.35s var(--ease-out); }
.lockup-sure { color: var(--gold); }
.lockup-reversed .lockup-seam { color: var(--white); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset-inline: 0; top: 0; z-index: 100;
  transition: box-shadow 0.35s var(--ease-out);
  background: transparent;
}
/* Blur lives on a pseudo-element: backdrop-filter on the header itself would turn it into
   the containing block for the fixed-position mobile menu and break it after scrolling. */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(255,255,255,0.92);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; transition: opacity 0.35s var(--ease-out);
}
.site-header.is-solid::before { opacity: 1; }
.site-header .lockup-seam { color: var(--white); } /* over the black cover */
.site-header.is-solid { box-shadow: 0 1px 0 var(--rule); }
.site-header.is-solid .lockup-seam { color: var(--coal); }

.header-inner {
  max-width: 1200px; margin-inline: auto;
  padding: 18px clamp(20px, 4vw, 48px);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
}
.site-nav { display: flex; align-items: center; gap: clamp(16px, 2.5vw, 36px); }
.site-nav a {
  font-size: var(--step--1); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; color: var(--white);
  transition: color 0.25s var(--ease-out);
}
.site-header.is-solid .site-nav a { color: var(--charcoal); }
.site-nav a:hover { color: var(--gold); }
.site-header.is-solid .site-nav a:hover { color: var(--gold-text); }
.site-nav .nav-cta {
  border: 1px solid var(--gold); color: var(--gold-hi); padding: 9px 18px;
  transition: background 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
.site-header.is-solid .nav-cta { color: var(--gold-text); }
.site-nav .nav-cta:hover { background: var(--gold); color: var(--coal); }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 40px; height: 40px; position: relative;
}
.nav-toggle span {
  position: absolute; left: 8px; right: 8px; height: 2px; background: var(--white);
  transition: transform 0.3s var(--ease-out), top 0.3s var(--ease-out);
}
.site-header.is-solid .nav-toggle span { background: var(--coal); }
.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 24px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { top: 19px; transform: rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: var(--step--1);
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 16px 32px; border: 1px solid transparent; border-radius: var(--radius);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out),
              background 0.3s var(--ease-out), color 0.3s var(--ease-out);
}
.btn:hover { transform: translateY(-2px); }
.btn-gold { background: var(--gold); color: var(--coal); }
.btn-gold:hover { background: var(--gold-hi); box-shadow: 0 12px 32px rgba(186,129,25,0.28); }
.btn-ghost { border-color: rgba(255,255,255,0.35); color: var(--white); }
.btn-ghost:hover { border-color: var(--white); background: rgba(255,255,255,0.06); }
.btn-block { width: 100%; }

/* ---------- Eyebrows & rules (report vernacular, CI §6) ---------- */
.eyebrow {
  font-family: var(--font-display); font-size: var(--step--1); font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-soft);
  margin-bottom: var(--s2);
}
.eyebrow-gold { color: var(--gold-hi); }
.gold-rule { display: block; width: 64px; height: 3px; background: var(--gold); margin-top: var(--s3); }

/* ---------- Hero — the executive cover ---------- */
.hero {
  position: relative; min-height: 100svh;
  background: var(--coal); color: var(--white);
  display: flex; align-items: center; overflow: hidden;
}
.hero-strata { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner {
  position: relative; z-index: 2;
  max-width: 1200px; margin-inline: auto;
  padding: calc(var(--s7) + 40px) clamp(20px, 4vw, 48px) var(--s7);
}
.hero-title {
  font-size: var(--step-4); font-weight: 800; letter-spacing: -0.025em;
  max-width: 17ch; margin-bottom: var(--s4);
}
.hero-title-gold { color: var(--gold-hi); }
.hero-sub {
  max-width: 58ch; font-size: var(--step-1); font-weight: 400;
  color: rgba(255,255,255,0.78); margin-bottom: var(--s5); line-height: 1.6;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }

.scroll-cue {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  width: 26px; height: 44px; border: 1px solid rgba(255,255,255,0.35);
  border-radius: 14px; z-index: 2;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 9px; width: 3px; height: 9px;
  margin-left: -1.5px; border-radius: 2px; background: var(--gold-hi);
  animation: cue 2.2s var(--ease-out) infinite;
}
@keyframes cue {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ---------- Audience strip ---------- */
.audience { padding: var(--s5) 0; border-bottom: 1px solid var(--rule); }
.audience .container { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.audience-lead {
  font-family: var(--font-display); font-weight: 600; font-size: var(--step--1);
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft);
  flex-shrink: 0;
}
.audience-list { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.audience-list li {
  font-family: var(--font-display); font-weight: 700; font-size: var(--step-1);
  color: var(--charcoal); position: relative; padding-left: 22px;
}
.audience-list li::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 10px; height: 3px; background: var(--gold);
}

/* ---------- Sections ---------- */
.section { padding: var(--s7) 0; }
.section-tint { background: var(--paper-tint); }
.section-head { max-width: 640px; margin-bottom: var(--s6); }
.section-sub { margin-top: var(--s3); color: var(--ink-soft); }

/* ---------- Foundation ---------- */
.foundation-grid {
  display: grid; grid-template-columns: 5fr 7fr; gap: var(--s6);
  align-items: start;
}
.lede { font-size: var(--step-1); font-weight: 500; color: var(--charcoal); margin-bottom: var(--s3); }
.foundation-copy p:not(.lede) { color: var(--ink-soft); }

.attributes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4) var(--s4); }
.attributes li { display: flex; gap: var(--s2); align-items: flex-start; }
.attributes h3 { font-size: var(--step-0); margin-bottom: 6px; color: var(--coal); }
.attributes p { font-size: var(--step--1); color: var(--ink-soft); line-height: 1.55; }

/* Assurance check node */
.check {
  flex-shrink: 0; width: 22px; height: 22px; margin-top: 2px;
  border: 1.5px solid var(--gold); border-radius: 50%; position: relative;
}
.check::after {
  content: ""; position: absolute; left: 6px; top: 5px;
  width: 7px; height: 4px;
  border-left: 2px solid var(--gold); border-bottom: 2px solid var(--gold);
  transform: rotate(-45deg);
}

/* ---------- Black divider band (CI §6: full-black section dividers) ---------- */
.divider-band {
  background: var(--coal); color: var(--white);
  padding: var(--s6) 0;
  border-top: 3px solid var(--gold);
}
.divider-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.divider-stat { text-align: left; }
.stat-value {
  display: block; font-family: var(--font-display); font-weight: 800;
  font-size: var(--step-3); letter-spacing: -0.02em; color: var(--gold-hi);
  margin-bottom: 6px;
}
.stat-label {
  font-size: var(--step--1); letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.65);
}

/* ---------- Services ---------- */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.service-card {
  background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: var(--s4) var(--s3);
  position: relative; overflow: hidden;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out),
              border-color 0.4s var(--ease-out);
}
.service-card::before {
  content: ""; position: absolute; inset-inline: 0; top: 0; height: 3px;
  background: var(--gold); transform: scaleX(0); transform-origin: left;
  transition: transform 0.45s var(--ease-out);
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: transparent; }
.service-card:hover::before { transform: scaleX(1); }
.service-card h3 { margin-bottom: var(--s2); color: var(--coal); }
.service-card p { font-size: var(--step--1); color: var(--ink-soft); line-height: 1.6; }

/* ---------- Process — the traceability path ---------- */
.path {
  counter-reset: step;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s3);
  position: relative;
}
.path::before {
  /* the seam: a light track the gold line draws over */
  content: ""; position: absolute; top: 10px; left: 0; right: 0; height: 2px;
  background: var(--grey-light);
}
.path::after {
  content: ""; position: absolute; top: 10px; left: 0; right: 0; height: 2px;
  background: var(--gold);
  transform: scaleX(var(--path-progress, 0)); transform-origin: left;
  transition: transform 0.15s linear;
}
.path-step { position: relative; padding-top: var(--s4); counter-increment: step; }
.path-node {
  position: absolute; top: 0; left: 0; z-index: 1;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--paper-tint);
  border: 2px solid var(--grey-light);
  transition: border-color 0.4s var(--ease-out), background 0.4s var(--ease-out);
}
.path-node::after {
  content: ""; position: absolute; left: 5px; top: 4px;
  width: 7px; height: 4px;
  border-left: 2px solid transparent; border-bottom: 2px solid transparent;
  transform: rotate(-45deg);
  transition: border-color 0.4s var(--ease-out);
}
.path-step.is-verified .path-node { border-color: var(--gold); background: var(--white); }
.path-step.is-verified .path-node::after { border-color: var(--gold); }
.path-step h3 { font-size: var(--step-0); margin-bottom: 8px; }
.path-step h3::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-size: var(--step--1); font-weight: 600; letter-spacing: 0.14em;
  color: var(--gold-text); margin-bottom: 4px;
}
.path-step p { font-size: var(--step--1); color: var(--ink-soft); line-height: 1.55; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 5fr 6fr; gap: var(--s6); align-items: start; }
.contact-copy p { color: var(--ink-soft); margin-top: var(--s3); max-width: 46ch; }
.contact-details { margin-top: var(--s4); display: grid; gap: var(--s2); }
.contact-details li { display: flex; gap: var(--s3); align-items: baseline; }
.detail-label {
  font-family: var(--font-display); font-size: var(--step--1); font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft);
  min-width: 90px;
}
.contact-details a { color: var(--gold-text); font-weight: 500; text-decoration: none; border-bottom: 1px solid transparent; }
.contact-details a:hover { border-bottom-color: var(--gold-text); }
.contact-note { font-size: var(--step--1); color: var(--ink-soft); border-left: 2px solid var(--gold); padding-left: var(--s2); }

.contact-form {
  background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: var(--s4); box-shadow: var(--shadow-soft);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.field { margin-bottom: var(--s2); }
.field label {
  display: block; font-size: var(--step--1); font-weight: 600;
  color: var(--charcoal); margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: var(--step--1); color: var(--ink);
  background: var(--white); border: 1px solid var(--input-border); border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(186,129,25,0.4);
}
.field textarea { resize: vertical; min-height: 120px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin-top: var(--s2); font-size: var(--step--1); font-weight: 500; min-height: 1.4em; }
.form-status.is-ok { color: var(--gold-text); }
.form-status.is-error { color: var(--error); }

/* ---------- Footer — the back cover ---------- */
.site-footer { background: var(--coal); color: var(--white); padding: var(--s6) 0 var(--s4); }
.footer-grid {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5);
}
.footer-tagline { margin-top: var(--s2); color: rgba(255,255,255,0.6); font-size: var(--step--1); }
.footer-nav { display: flex; gap: var(--s3); flex-wrap: wrap; }
.footer-nav a {
  font-size: var(--step--1); letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.7); text-decoration: none;
}
.footer-nav a:hover { color: var(--gold-hi); }
.footer-legal {
  display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.12); padding-top: var(--s3);
  font-size: var(--step--1); color: rgba(255,255,255,0.45);
}

/* ---------- Reveal animation ----------
   Hidden state is gated on the .js root class so content is never
   invisible if JavaScript fails to load or run. */
.js .reveal { opacity: 0; transform: translateY(26px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); }
.js .reveal.in { opacity: 1; transform: none; }

/* Stagger siblings slightly */
.attributes .reveal:nth-child(2n), .services-grid .reveal:nth-child(3n-1) { transition-delay: 0.08s; }
.services-grid .reveal:nth-child(3n) { transition-delay: 0.16s; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue span { animation: none; }
  .btn:hover, .service-card:hover { transform: none; }
  .path::after { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .foundation-grid, .contact-grid { grid-template-columns: 1fr; gap: var(--s5); }
  .services-grid { grid-template-columns: 1fr 1fr; }
  .path { grid-template-columns: 1fr; gap: var(--s4); padding-left: 10px; }
  .path::before, .path::after {
    top: 0; bottom: 0; left: 10px; right: auto; width: 2px; height: auto;
  }
  .path::after { transform: scaleY(var(--path-progress, 0)); transform-origin: top; }
  .path-step { padding-top: 0; padding-left: var(--s4); }
  .path-node { left: -10px; } /* centres the node (22px wide) on the 2px line at x=11 */
  .divider-grid { grid-template-columns: 1fr; gap: var(--s4); }
}
@media (max-width: 720px) {
  .services-grid { grid-template-columns: 1fr; }
  .attributes { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero-title { font-size: clamp(2.2rem, 11vw, 3rem); }

  .nav-toggle { display: block; z-index: 95; } /* stays above the open menu overlay */
  .site-nav {
    position: fixed; inset: 0; z-index: 90;
    background: var(--coal);
    flex-direction: column; justify-content: center; align-items: center; gap: var(--s4);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.35s var(--ease-out), visibility 0s linear 0.35s;
  }
  .site-nav.is-open {
    opacity: 1; visibility: visible; pointer-events: auto;
    transition: opacity 0.35s var(--ease-out), visibility 0s;
  }
  body.no-scroll { overflow: hidden; }
  .site-nav a, .site-header.is-solid .site-nav a { color: var(--white); font-size: var(--step-1); }
  .site-nav .nav-cta { color: var(--gold-hi); }
}
