/* Vespaan Corporation — corporate site. No external dependencies; system font stacks only. */

:root {
  --paper: #fbfaf7;
  --surface: #ffffff;
  --tint: #f3f1ec;
  --ink: #14171c;
  --ink-2: #3d434d;      /* body text: 9.5:1 on paper */
  --ink-3: #5c6370;      /* secondary text: 5.8:1 on paper, 5.4:1 on tint */
  --rule: #e2ded5;
  --rule-strong: #c9c3b6;
  --accent: #0f4c8a;     /* deep blue from the Vespaan logo: 8.31:1 on paper */
  --accent-soft: #e8eef7;

  --serif: ui-serif, "New York", "Iowan Old Style", Charter, "Bitstream Charter", Georgia, Cambria, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1160px;
  --gutter: clamp(20px, 4vw, 40px);
  --section-y: clamp(72px, 10vw, 128px);
  --radius: 4px;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3 {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }

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

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--paper); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 250, 247, 0.92);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-logo { width: auto; height: 40px; }
.brand-footer { margin-right: auto; gap: 10px; }
.brand-footer .brand-logo { height: 28px; }

.wordmark {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.32em;
  margin-right: -0.32em; /* optically cancel trailing tracking */
  color: var(--ink);
  text-decoration: none;
}
.wordmark:hover, .brand:hover .wordmark { color: var(--ink); }

.site-nav ul { display: flex; gap: clamp(20px, 3vw, 36px); }
.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9375rem;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--rule-strong); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  background: none;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  padding: 8px 12px;
  cursor: pointer;
  min-height: 44px;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  position: relative;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 760px) {
  /* Without JS the nav stays visible (wrapped below the wordmark); the toggle only appears once main.js runs. */
  .js .nav-toggle { display: inline-flex; }
  .header-inner { flex-wrap: wrap; }
  .site-nav { width: 100%; }
  .site-nav ul { flex-wrap: wrap; gap: 4px 20px; padding-bottom: 12px; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: block; }
  .js .site-nav ul { flex-direction: column; gap: 0; padding: 4px 0 16px; }
  .js .site-nav a { display: block; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 1.0625rem; }
}

/* ---------- Shared section furniture ---------- */

.section { padding: var(--section-y) 0; }
.section-tinted { background: var(--tint); }
.section-quiet { padding: clamp(48px, 6vw, 72px) 0; border-top: 1px solid var(--rule); }

.section-label, .eyebrow {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 18px;
}

h2 { font-size: clamp(2rem, 3.6vw, 2.75rem); }

.section-head { margin-bottom: clamp(40px, 5vw, 64px); max-width: 760px; }
.section-head.narrow { max-width: 720px; }
.section-intro { margin-top: 24px; font-size: 1.125rem; color: var(--ink-2); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.prose p { max-width: 62ch; }
.prose .large, .large {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2vw, 1.55rem);
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: 1.1em;
}

.text-link {
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.text-link:hover { border-bottom-color: transparent; }

.button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 500;
  border-radius: var(--radius);
  transition: background-color 0.15s ease;
}
.button:hover { background: var(--accent); color: var(--paper); }

/* ---------- Hero ---------- */

.hero {
  padding: clamp(72px, 12vw, 152px) 0 clamp(72px, 10vw, 128px);
  border-bottom: 1px solid var(--rule);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 3fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: end;
}
.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  max-width: 13ch;
}
.lede {
  margin-top: clamp(24px, 3vw, 36px);
  font-size: clamp(1.125rem, 1.7vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 40ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  margin-top: clamp(28px, 3.5vw, 44px);
}

.hero-fields { border-left: 1px solid var(--rule-strong); padding-left: 24px; }
.fields-title {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 14px;
}
.hero-fields li {
  font-size: 0.975rem;
  color: var(--ink);
  padding: 7px 0;
}
.hero-fields li + li { border-top: 1px solid var(--rule); }

/* ---------- Selected innovations ---------- */

.work {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
}
.work-feature {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 72px);
  border-top: 3px solid var(--accent);
  margin-bottom: clamp(20px, 2.5vw, 28px);
}
.work-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 2.5vw, 28px);
}

.work-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 40px;
  margin-bottom: 20px;
}
.brand-icon { width: 40px; height: auto; }
.work-kind {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 10px;
  border-radius: 2px;
}

.work-name { font-size: clamp(1.9rem, 3vw, 2.4rem); margin-bottom: 20px; }
/* Trademark symbol: subtle superscript, shared by every brand-name presentation. */
.tm { font-family: var(--sans); font-size: 0.4em; vertical-align: super; line-height: 0; margin-left: 2px; font-weight: 400; letter-spacing: 0; }
/* The wordmark is set small with wide tracking: cancel the trailing tracking before the symbol. */
.wordmark .tm { font-size: 0.6em; margin-left: -0.26em; vertical-align: 0.55em; }
.brand-wordmark { width: 200px; height: auto; margin: -4px 0 4px -4px; }

.work-desc {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1.5vw, 1.25rem);
  line-height: 1.5;
  color: var(--ink);
}
.work-detail { color: var(--ink-2); }
.work-link { margin: auto 0 0; padding-top: 12px; }

.vision {
  margin: 0 0 32px;
  padding: 0 0 28px;
  border-bottom: 1px solid var(--rule);
}
.vision-label, .list-title {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.vision p:last-child {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.4;
  color: var(--ink);
  margin: 0;
}

.capabilities { margin-bottom: 28px; }
.capabilities li {
  position: relative;
  padding: 9px 0 9px 22px;
  border-top: 1px solid var(--rule);
  font-size: 0.975rem;
  color: var(--ink);
}
.capabilities li:last-child { border-bottom: 1px solid var(--rule); }
.capabilities li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  width: 8px;
  height: 1px;
  background: var(--accent);
}
.work-feature .capabilities { margin-bottom: 0; }

/* ---------- Approach ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  margin-bottom: clamp(56px, 7vw, 88px);
  counter-reset: none;
}
.steps li { padding: 22px 20px 0 0; }
.steps li + li { padding-left: 20px; border-left: 1px solid var(--rule); }
.step-n { display: block; font-family: var(--mono); font-size: 0.8rem; color: var(--accent); margin-bottom: 14px; }
.steps h3 { font-size: 1.35rem; margin-bottom: 8px; }
.steps p { font-size: 0.975rem; margin: 0; }

.matrix { overflow-x: auto; }
.matrix:focus-visible { outline-offset: 6px; }
.matrix table { width: 100%; border-collapse: collapse; min-width: 640px; }
.matrix caption {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  padding-bottom: 14px;
}
.matrix th, .matrix td {
  text-align: left;
  vertical-align: top;
  padding: 18px 24px 18px 0;
  border-top: 1px solid var(--rule);
}
.matrix thead th {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-top: 1px solid var(--ink);
  padding-top: 14px;
  padding-bottom: 14px;
}
.matrix tbody th {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.2rem;
  color: var(--ink);
  width: 18%;
}
.matrix tbody tr:last-child > * { border-bottom: 1px solid var(--rule); }
.matrix tbody tr:last-child th, .matrix tbody tr:last-child td { color: var(--ink-3); }
.matrix td:last-child { width: 34%; color: var(--ink); }

/* ---------- Earlier innovation (intentionally subordinate) ---------- */

.earlier {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 24px;
  max-width: 820px;
  align-items: start;
}
.earlier-icon { width: 48px; height: 48px; border-radius: 10px; filter: saturate(0.55); opacity: 0.9; }
.earlier .section-label { margin-bottom: 8px; }
.earlier-name { font-size: 1.5rem; margin-bottom: 10px; }
.earlier p { color: var(--ink-3); max-width: 66ch; }
.earlier .earlier-link { margin: 14px 0 0; font-size: 0.9375rem; }

/* ---------- Company ---------- */

.facts { margin: 0 0 28px; }
.facts div {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(0, 3fr);
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}
.facts div:last-child { border-bottom: 1px solid var(--rule); }
.facts dt { font-size: 0.875rem; color: var(--ink-3); }
.facts dd { margin: 0; color: var(--ink); }
.prose-p { max-width: 62ch; }

/* ---------- Contact ---------- */

.section-contact { background: var(--ink); color: #c9ccd1; }
.section-contact .section-label { color: #a2a8b1; }  /* 7.4:1 on ink */
.section-contact h2 { color: var(--paper); }
.contact { max-width: 760px; }
.contact-copy { margin-top: 20px; font-size: 1.125rem; }
.contact-email { margin: 8px 0 0; }
.contact-email a {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4.4vw, 2.6rem);
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid rgba(251, 250, 247, 0.35);
  overflow-wrap: anywhere;
  transition: border-color 0.15s ease;
}
.contact-email a:hover { border-bottom-color: var(--paper); }
.section-contact :focus-visible { outline-color: var(--paper); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: #a2a8b1;
  border-top: 1px solid #2c3139;
  font-size: 0.875rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 32px;
  padding-top: 28px;
  padding-bottom: 28px;
}
.footer-inner p { margin: 0; }
.wordmark-small { color: var(--paper); font-size: 0.8rem; }

/* ---------- Motion (opt-in, subtle) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .work-feature { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 28px; }
  .steps li:nth-child(4) { padding-left: 0; border-left: 0; }
}

@media (max-width: 760px) {
  body { font-size: 1rem; }
  .hero-grid, .split, .work-pair { grid-template-columns: minmax(0, 1fr); }
  .hero-fields { border-left: 0; border-top: 1px solid var(--rule-strong); padding: 20px 0 0; }
  .hero-fields ul { display: flex; flex-wrap: wrap; gap: 8px; }
  .hero-fields li, .hero-fields li + li {
    border: 1px solid var(--rule-strong);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.875rem;
  }
  .steps { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .steps li, .steps li + li, .steps li:nth-child(4) {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    column-gap: 12px;
    padding: 18px 0;
    border-left: 0;
    border-bottom: 1px solid var(--rule);
  }
  .step-n { grid-row: span 2; margin: 4px 0 0; }
  .facts div { grid-template-columns: minmax(0, 1fr); gap: 2px; }

  /* Portfolio table becomes stacked, labelled rows rather than a sideways-scrolling table. */
  .matrix { overflow: visible; }
  .matrix table, .matrix tbody, .matrix tr, .matrix th, .matrix td { display: block; width: auto; min-width: 0; }
  .matrix thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .matrix caption { display: block; border-bottom: 1px solid var(--ink); }
  .matrix tbody tr { padding: 18px 0; border-bottom: 1px solid var(--rule); }
  .matrix tbody tr:last-child > * { border-bottom: 0; }
  .matrix th, .matrix td { border-top: 0; padding: 0; }
  .matrix tbody th { width: auto; margin-bottom: 10px; }
  .matrix td + td { margin-top: 10px; }
  .matrix td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: 2px;
  }
  .matrix td:last-child { width: auto; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media print {
  .site-header, .skip-link { display: none; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .section-contact, .site-footer { background: none; color: var(--ink); }
  .section-contact h2, .contact-email a, .wordmark-small { color: var(--ink); }
}
