/* =========================================================
   Second Order AI — site layout (prototype)
   Layers on top of colors_and_type.css (CTI design tokens).
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }

.wrap { max-width: 1440px; margin: 0 auto; padding: 0 56px; }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-top: 22px; padding-bottom: 22px;
}
.brand {
  font-family: var(--font-display); font-size: 22px;
  color: var(--fg); text-decoration: none;
  letter-spacing: -0.01em; white-space: nowrap;
  display: inline-flex; align-items: baseline; gap: 12px;
}
.brand .mark { width: 8px; height: 8px; background: var(--cti-brass); display: inline-block; transform: translateY(-2px); }
.brand:hover { color: var(--fg); }
.nav { display: flex; align-items: baseline; gap: var(--sp-6); }
.nav a {
  font-family: var(--font-ui); font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--fg-1); text-decoration: none;
  padding-bottom: 3px; border-bottom: 1.5px solid transparent;
  transition: color var(--dur-quick) var(--ease-tick),
              border-color var(--dur-quick) var(--ease-tick);
}
.nav a:hover { color: var(--accent); }
.nav a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--cti-brass); }
/* Client login — distinguished CTA chip in the top nav (brass outline,
   set apart from the plain uppercase tabs). */
.nav a.nav-cta {
  color: var(--accent);
  border: 1px solid var(--cti-brass-50);
  border-radius: var(--radius-1);
  padding: 6px 12px;
}
.nav a.nav-cta:hover,
.nav a.nav-cta[aria-current="page"] {
  color: var(--accent); background: var(--cti-brass-12); border-color: var(--accent);
}
.chip {
  font-family: var(--font-ui); font-size: 10px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
  border: 1px solid var(--cti-brass-25); border-radius: var(--radius-1);
  padding: 2px 6px; margin-left: 7px; vertical-align: middle;
}

/* ---------- Hero ---------- */
.hero { padding: var(--sp-10) 0 var(--sp-8); }
.hero .eyebrow { margin-bottom: var(--sp-4); display: block; }
.hero h1 { font-size: clamp(38px, 5.2vw, var(--fs-hero)); max-width: 20ch; margin: 0; }
.hero .lead { max-width: 60ch; margin-top: var(--sp-5); }
.cal-mark { display: block; width: 320px; max-width: 100%; height: 40px; margin-top: var(--sp-7); opacity: 0.9; }

/* data -> AI -> better decisions */
.pipeline { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-6); flex-wrap: wrap; }
.pnode {
  font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--fg-2); border: 1px solid var(--rule-strong); border-radius: var(--radius-1); padding: 8px 14px;
}
.pnode--accent { color: var(--accent); border-color: var(--cti-brass-50); }
.parw { font-family: var(--font-ui); color: var(--accent); font-size: 15px; }

/* ---------- Deep hero band (CTI signature — used across all pages) ---------- */
.hero-deep {
  position: relative; overflow: hidden;
  background: var(--bg); color: var(--fg);
  border-bottom: 1px solid var(--rule);
}
.hero-deep .arc {
  position: absolute; left: -20px; top: 0; height: 100%; width: 240px;
  opacity: 0.5; pointer-events: none; user-select: none;
}
/* content sits in a column to the RIGHT of the arc so it never overlaps */
.hero-deep .wrap {
  position: relative;
  padding-top: 96px; padding-bottom: 64px;
  padding-left: 280px; padding-right: 56px;
}
.hero-deep .eyebrow { display: block; margin-bottom: var(--sp-4); }
.hero-deep h1 {
  font-size: clamp(48px, 5.6vw, 80px); line-height: 0.98;
  letter-spacing: -0.02em; text-wrap: balance; max-width: 20ch;
}
.hero-deep .lead { color: var(--fg-2); max-width: 60ch; margin-top: var(--sp-5); }
.lead-list { max-width: 60ch; margin: var(--sp-3) 0 0; padding-left: 1.6em; }
.hero-deep .lead-list { color: var(--fg-2); }
.lead-list li { margin-top: var(--sp-1); }
.lead-list li::marker { font-family: var(--font-mono); font-size: 0.85em; color: var(--fg-muted); }
.lead-list + .lead { margin-top: var(--sp-4); }
.hero-deep .pipeline { margin-top: var(--sp-6); }

/* CTI lockup (first-encounter mode — CTI pages only) */
.lockup { display: flex; align-items: center; gap: 16px; margin-bottom: var(--sp-6); }
.lockup .cti { font-family: var(--font-display); font-size: 44px; line-height: 1; color: var(--fg); }
.lockup .bar { width: 1.25px; height: 40px; background: var(--cti-brass); }
.lockup .full {
  font-family: var(--font-ui); font-weight: 600; font-size: 11px;
  letter-spacing: 0.16em; line-height: 1.5; color: var(--fg);
}

/* Status chip (mono, brass dot) */
.status {
  display: inline-flex; align-items: center; gap: 10px; margin-top: var(--sp-6);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg); border: 1px solid rgba(176, 141, 60, 0.4); border-radius: var(--radius-1);
  padding: 6px 10px;
}
.status .dot { width: 7px; height: 7px; background: var(--cti-brass); border-radius: 50%; }
.hero-deep .fine { color: var(--fg-muted); margin-top: var(--sp-6); }

@media (max-width: 900px) {
  .hero-deep .arc { display: none; }
  .hero-deep .wrap { padding-left: var(--sp-6); }
}

/* ---------- Section scaffolding ---------- */
.section { padding: var(--sp-8) 0; }
.section-head { max-width: 62ch; margin-bottom: var(--sp-6); }
.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }

/* ---------- Stream / feature cards ---------- */
.streams { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.streams-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  display: flex; flex-direction: column; gap: var(--sp-3);
  background: var(--bg); border: 1px solid var(--rule);
  border-radius: var(--radius-2); padding: var(--sp-6);
  transition: border-color var(--dur-quick) var(--ease-tick);
}
.card:hover { border-color: var(--rule-strong); }
.card .icon { width: 26px; height: 26px; color: var(--fg-2); }
.card h3 { margin: 0; }
.card p { margin: 0; font-size: var(--fs-body-sm); }
.card .go {
  margin-top: auto; padding-top: var(--sp-3);
  font-family: var(--font-ui); font-size: 13px; font-weight: 600;
  color: var(--fg-1); text-decoration: none; display: inline-flex; gap: 6px;
}
.card .go:hover { color: var(--accent); }
.card .go .arw { transition: transform var(--dur-quick) var(--ease-tick); }
.card:hover .go .arw { transform: translateX(3px); }

/* ---------- Panel (parchment) ---------- */
.panel {
  background: var(--bg-panel); border: 1px solid var(--rule);
  border-radius: var(--radius-2); padding: var(--sp-8);
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-8); align-items: start; }

/* ---------- Posture line ---------- */
.posture-block { text-align: center; padding: var(--sp-9) 0; }
.posture-block .cti-posture { max-width: 30ch; margin: 0 auto; }

/* ---------- Definition / spec rows ---------- */
.spec { border-top: 1px solid var(--rule); }
.spec-row {
  display: grid; grid-template-columns: 220px 1fr; gap: var(--sp-6);
  padding: var(--sp-5) 0; border-bottom: 1px solid var(--rule);
}
.spec-row .k { font-family: var(--font-ui); font-weight: 600; color: var(--fg); }
.spec-row .v { color: var(--fg-1); }
.spec-row .v p { margin: 0; }

/* ---------- Links inline ---------- */
a.link {
  color: var(--fg); text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
}
a.link:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-ui); font-size: 14px; font-weight: 600;
  padding: 11px 18px; border-radius: var(--radius-2);
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background var(--dur-quick) var(--ease-tick),
              border-color var(--dur-quick) var(--ease-tick);
}
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { background: #000; }
.cti-deep .btn-primary { background: var(--cti-brass); color: var(--cti-instrument-black); }
.cti-deep .btn-primary:hover { background: #c79a44; }
.btn-ghost { border-color: var(--rule-strong); color: var(--fg); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--cti-instrument-black);
  color: rgba(207, 202, 193, 0.6);
  padding: 32px 0;
  border-top: 1px solid rgba(207, 202, 193, 0.14);
  margin-top: var(--sp-8);
}
.site-footer .wrap {
  display: flex; justify-content: space-between;
  gap: var(--sp-5); flex-wrap: wrap;
}
.site-footer, .site-footer a {
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: rgba(207, 202, 193, 0.6); text-decoration: none;
}
.site-footer a:hover { color: var(--cti-brass); }
.fine { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--fg-muted); line-height: 1.7; }

/* Expanded footer (legal details + links) */
.footer-grid { align-items: flex-start; }
.footer-brand { font-family: var(--font-ui); font-weight: 600; font-size: 14px; color: var(--fg); margin-bottom: var(--sp-2); }
.footer-links { display: flex; flex-direction: column; gap: var(--sp-2); text-align: right; }
@media (max-width: 600px) { .footer-links { text-align: left; } }

/* ---------- Utilities ---------- */
.icon-inline { width: 20px; height: 20px; vertical-align: -4px; }
.stack-4 > * + * { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.brass { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .wrap { padding: 0 20px; }
  .streams { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; gap: var(--sp-6); }
  .spec-row { grid-template-columns: 1fr; gap: var(--sp-2); }
  .nav { gap: var(--sp-4); flex-wrap: wrap; justify-content: flex-end; }
  .hero { padding-top: var(--sp-8); }
}

/* Small screens: nav drops to its own row under the brand */
@media (max-width: 620px) {
  .site-header .wrap { flex-wrap: wrap; row-gap: var(--sp-2); }
  .nav { width: 100%; justify-content: flex-start; }
}

/* ---------- Round 2 conformity: tender page as baseline ---------- */
/* Labels/eyebrows: tender page uses mono uppercase labels */
.cti-eyebrow {
  font-family: var(--font-mono); font-weight: 400;
  font-size: 11px; letter-spacing: 0.16em; color: var(--fg-muted);
}
/* Section titles: closer to the tender page's display scale */
.section-head .cti-h1, .section-head .cti-h2 {
  font-size: clamp(30px, 3.2vw, 44px); line-height: 1.05; letter-spacing: -0.015em;
}
/* Brand is never underlined */
.brand, .brand:hover { text-decoration: none; }

/* ---------- Numbered link rows (research series, logistics notes) ----------
   Rows are <a class="post"> when the whole row is one link (research series)
   or <div class="post"> with inner links when the row has sub-links (notes). */
.series { border-top: 1px solid var(--rule); }
.series .post {
  display: grid; grid-template-columns: 40px 1fr auto; gap: var(--sp-4); align-items: baseline;
  padding: var(--sp-4) 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--fg);
  transition: color var(--dur-quick) var(--ease-tick);
}
.series a.post:hover { color: var(--accent); }
.series .post .num { font-family: var(--font-mono); font-size: 12px; color: var(--fg-muted); }
.series .post .ttl { font-family: var(--font-body); font-size: 18px; color: inherit; text-decoration: none; }
.series .post a.ttl:hover { color: var(--accent); }
.series .post .arw { font-family: var(--font-ui); font-size: 13px; color: var(--fg-muted); text-decoration: none; }
.series a.post:hover .arw, .series .post a.arw:hover { color: var(--accent); }
.series .post .ttl-wrap { display: flex; flex-direction: column; gap: var(--sp-1); }
.series .post .desc { font-family: var(--font-body); font-size: var(--fs-body-sm); color: var(--fg-2); max-width: 66ch; }
.series .post .sublinks { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); margin-top: var(--sp-2); }
.series .post .sublinks a {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--fg-2); text-decoration: none;
  padding-bottom: 2px; border-bottom: 1px solid var(--rule-strong);
  transition: color var(--dur-quick) var(--ease-tick), border-color var(--dur-quick) var(--ease-tick);
}
.series .post .sublinks a:hover { color: var(--accent); border-bottom-color: var(--accent); }
