/* CommandStack Technologies corporate site. Its own identity, separate from MotorCommandAI:
   ink and warm paper with a copper accent, a serif display face and a humanist sans, system fonts only. */
:root {
  --ink: #101418;
  --ink-2: #1b2128;
  --paper: #f4f1ea;
  --paper-2: #ebe6da;
  --line: #d6cfbf;
  --text: #1a1d21;
  --muted: #5f5a50;
  --on-ink: #e9e4d8;
  --on-ink-muted: #a7a194;
  --copper: #c8794a;
  --copper-deep: #9a4f25;
  --serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: "Avenir Next", "Avenir", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
.frame { width: min(1160px, 100% - 48px); margin: 0 auto; }

/* Masthead and wordmark */
.masthead { position: sticky; top: 0; z-index: 10; background: rgba(16, 20, 24, 0.94); color: var(--on-ink); border-bottom: 1px solid rgba(233, 228, 216, 0.1); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 68px; }
.wordmark { display: inline-flex; align-items: baseline; gap: 10px; text-decoration: none; white-space: nowrap; }
.glyph { align-self: center; flex: none; }
.word { font-family: var(--serif); font-size: 21px; letter-spacing: -0.005em; }
.word-sub { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--on-ink-muted); }
.menu { display: flex; gap: 32px; }
.menu a { font-size: 14px; letter-spacing: 0.04em; text-decoration: none; color: var(--on-ink-muted); padding: 6px 0; border-bottom: 1px solid transparent; }
.menu a:hover, .menu a:focus-visible { color: var(--on-ink); border-bottom-color: var(--copper); }

/* Hero */
.hero { background: var(--ink); color: var(--on-ink); padding: 112px 0 128px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 64px; align-items: center; }
.label, .index, .product-kind { font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; }
.label { color: var(--copper); margin-bottom: 32px; }
.hero h1 { font-size: clamp(44px, 6.4vw, 84px); line-height: 1.02; letter-spacing: -0.025em; max-width: 12ch; }
.hero h1 span { color: var(--on-ink-muted); }
.statement { margin-top: 36px; max-width: 34em; font-size: 20px; line-height: 1.6; color: var(--on-ink); opacity: 0.86; }
.hero-actions, .product-links { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 44px; }
.lattice { width: 100%; height: auto; }
.cta { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; background: var(--copper); color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 600; letter-spacing: 0.01em; transition: background 0.15s; }
.cta::after { content: "\2192"; font-weight: 400; }
.cta:hover, .cta:focus-visible { background: #d98d60; }
.quiet { font-size: 15px; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; opacity: 0.85; }
.quiet:hover, .quiet:focus-visible { opacity: 1; }
a:focus-visible { outline: 2px solid var(--copper); outline-offset: 4px; }

/* Chapters: a numbered label column and a content column */
.chapter { padding: 112px 0; border-top: 1px solid var(--line); scroll-margin-top: 68px; }
.chapter.tint { background: var(--paper-2); }
.chapter-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 64px; }
.index { color: var(--copper-deep); margin-bottom: 18px; }
.chapter-head h2 { font-size: 44px; line-height: 1.1; }
.chapter-note { margin-top: 20px; color: var(--muted); font-size: 16px; }

/* Products: a grid of cards; the first spans the row, later products sit two to a row */
.products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.product { grid-column: span 2; background: #fbfaf6; border: 1px solid var(--line); border-top: 3px solid var(--ink); padding: 44px 48px 48px; }
.product + .product { grid-column: span 1; }
.product-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.product-head > div { min-width: 0; }
.product-icon { flex: none; border-radius: 11px; }
.product-kind { color: var(--muted); font-size: 11px; letter-spacing: 0.12em; }
.product h3 { font-size: 32px; line-height: 1.2; margin-top: 4px; }
.product-tagline { margin-top: 36px; font-family: var(--serif); font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15; letter-spacing: -0.015em; }
.product-summary { margin-top: 14px; max-width: 32em; color: var(--muted); font-size: 18px; }
.product .cta { background: var(--ink); color: var(--paper); }
.product .cta:hover, .product .cta:focus-visible { background: var(--ink-2); }

/* About */
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.principle { border-top: 1px solid var(--text); padding-top: 22px; }
.principle h3 { font-size: 26px; margin-bottom: 14px; }
.principle p { color: var(--muted); font-size: 16px; }

/* Contact */
.contact-lead { font-size: 20px; }
.contact-email { margin-top: 18px; font-family: var(--serif); font-size: clamp(18px, 5.4vw, 40px); line-height: 1.25; overflow-wrap: anywhere; }
.contact-email a { text-decoration: none; border-bottom: 2px solid var(--copper); }
.contact-email a:hover { color: var(--copper-deep); }
.contact-note { margin-top: 28px; color: var(--muted); font-size: 15px; }

/* Colophon */
.colophon { background: var(--ink); color: var(--on-ink-muted); padding: 72px 0 56px; font-size: 14px; line-height: 1.7; }
.colophon-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr) auto; gap: 32px 64px; }
.colophon-brand .word { color: var(--on-ink); font-size: 24px; }
.colophon-company strong { color: var(--on-ink); font-weight: 600; }
.colophon-links { display: flex; flex-direction: column; gap: 6px; }
.colophon-links a { text-decoration: none; color: var(--on-ink); }
.colophon-links a:hover, .colophon-links a:focus-visible { color: var(--copper); }
.colophon-note { grid-column: 1 / -1; padding-top: 28px; border-top: 1px solid rgba(233, 228, 216, 0.14); font-size: 13px; }

/* 404 */
.lost { padding: 128px 0 144px; }
.lost h1 { font-size: clamp(36px, 5vw, 60px); line-height: 1.1; max-width: 16ch; }
.lost p { margin-top: 24px; color: var(--muted); max-width: 34em; }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .lattice { display: none; }
  .chapter-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .chapter-note { max-width: 36em; }
  .colophon-grid { grid-template-columns: minmax(0, 1fr) auto; }
  .colophon-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .frame { width: min(1160px, 100% - 40px); }
  .bar { flex-direction: column; align-items: flex-start; gap: 0; min-height: 0; padding: 14px 0 4px; }
  .menu { gap: 24px; }
  .hero { padding: 64px 0 80px; }
  .label { margin-bottom: 24px; font-size: 11px; }
  .statement { font-size: 18px; margin-top: 28px; }
  .hero-actions { margin-top: 36px; }
  .chapter { padding: 72px 0; scroll-margin-top: 92px; }
  .chapter-head h2 { font-size: 36px; }
  .products { grid-template-columns: minmax(0, 1fr); }
  .product, .product + .product { grid-column: auto; padding: 28px 24px 32px; }
  .product h3 { font-size: 28px; }
  .product-tagline { margin-top: 28px; }
  .product-summary { font-size: 17px; }
  .principles { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .colophon { padding: 56px 0 40px; }
  .colophon-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cta { transition: none; }
}
