/* Invictus Campaign Solutions. Tokens and rules from DESIGN.md v2. */
:root {
  --paper: #F7F8F8;
  --paper-2: #EEF0F1;
  --ink: #121417;
  --ink-70: rgba(18,20,23,.72);
  --crimson: #9A1A10;
  --crimson-2: #7A1408;
  --gold: #A07010;
  --line: rgba(18,20,23,.14);

  --display: "Cinzel", Georgia, serif; /* wordmark only */
  --text: "Schibsted Grotesk", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: 24px;
  --section: 64px;
  --radius: 6px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--text);
  overflow-wrap: break-word;
}
[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: 2.5rem; line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.9375rem; line-height: 1.1; font-weight: 700; letter-spacing: -0.015em; }
h3 { font-size: 1.5rem; line-height: 1.25; font-weight: 500; letter-spacing: -0.01em; }

a { color: inherit; text-decoration-color: var(--crimson); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--crimson); outline-offset: 2px; }
main:focus { outline: none; }

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

.skip {
  position: absolute; left: var(--gutter); top: 8px; z-index: 50;
  padding: 8px 16px; background: var(--crimson); color: #fff;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

mark.todo {
  background: var(--paper-2);
  color: var(--ink);
  outline: 1px solid var(--crimson);
  outline-offset: 1px;
  border-radius: 2px;
  padding-inline: 0.2em;
  font: inherit;
  letter-spacing: 0;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  border: 1px solid var(--crimson); border-radius: var(--radius);
  font: 500 1rem/1 var(--text);
  text-decoration: none; cursor: pointer;
  transition: transform 150ms var(--ease), background-color 150ms ease, border-color 150ms ease;
}
.btn--primary { background: var(--crimson); color: #fff; }
.btn--secondary { background: transparent; color: var(--ink); border-color: var(--ink-70); }
.btn:active { transform: scale(0.97); }
.btn--primary:active { background: var(--crimson-2); }

/* Header + nav */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 64px; }
.wordmark {
  display: inline-flex; align-items: center; gap: 12px;
  font: 600 1.5rem/1 var(--display); text-decoration: none;
}
.wordmark img { width: 48px; height: 48px; }
.wordmark--small { font-size: 1.75rem; }
.wordmark--small img { width: 64px; height: 64px; }
.nav .btn { min-height: 44px; padding: 0 16px; }
.nav-links { display: none; }
.nav-links ul, .nav-list ul { display: flex; flex-wrap: wrap; gap: 8px 32px; }
.nav-links a, .nav-list a {
  display: inline-block; padding-block: 10px;
  font: 500 1rem/1.2 var(--text); text-decoration: none;
}
.nav-links a:focus-visible, .nav-list a:focus-visible { text-decoration: underline; text-decoration-color: var(--crimson); }
.nav-list { padding-block: 0 48px; }

/* Hero */
.hero { min-height: calc(100dvh - 64px); display: grid; align-items: center; padding-block: 32px 64px; }
@media (max-width: 1023px) { .hero { min-height: 0; } }
.hero-grid { display: grid; gap: 40px; }
.hero-map { width: 100%; max-width: 600px; }
.map { width: 100%; height: auto; }
.map-narrow { display: none; }
.map text { font-variant-numeric: tabular-nums; }
.hero-text { display: grid; gap: 24px; max-width: 40rem; }
.lead { font-size: 1.25rem; line-height: 1.5; }
.fact { color: var(--ink-70); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 8px; }

/* The pipeline map */
.map-band { fill: var(--paper-2); stroke: var(--line); stroke-width: 1; }
.map-band--top { stroke: var(--crimson); stroke-width: 1.5; }
.map-label { font: 500 15px var(--text); fill: var(--ink); }
.map-text { font: 400 14px var(--text); fill: var(--ink-70); }
.map-narrow .map-label { font-size: 17px; font-weight: 500; }
.map-narrow .map-text { font-size: 16px; }
.map-tick, .map-conn, .map-arrow { fill: none; stroke: var(--gold); stroke-width: 1.5; }

/* Draw-in: the one authored moment, 700ms, boxes left to right, each arrow after its box. Complete by default; animated only when motion is allowed. */
@media (prefers-reduced-motion: no-preference) {
  .map-layer { animation: map-rise 400ms var(--ease) calc(var(--s) * 150ms) both; }
  .map .map-conn { stroke-dasharray: 1; /* arrows in either map variant */ animation: map-draw 300ms var(--ease) calc(var(--s) * 150ms + 100ms) both; }
}
@keyframes map-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes map-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* Sections */
.section { padding-block: var(--section); }
.section h2 { margin-bottom: 32px; }
/* section rule: 96px with one tick */
.groma { position: relative; display: block; width: 96px; height: 1px; margin-bottom: 24px; background: var(--line); }
.groma::after { content: ""; position: absolute; left: 27px; top: -7px; width: 1px; height: 15px; background: var(--gold); }
.split { display: grid; gap: 40px 24px; }

/* Pillars: three columns, no boxes; a cardinal tick heads each */
.pillar-cols { display: grid; gap: 48px; }
.pillar-cols > li { display: grid; gap: 12px; align-content: start; max-width: 65ch; }
.tick { position: relative; display: block; width: 24px; height: 16px; }
.tick::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--gold); }
.tick::after { content: ""; position: absolute; left: 0; bottom: 0; width: 2px; height: 16px; background: var(--crimson); }
.pillar-cols p, .ops-intro p, .about-text p, .contact-sub, .section-sub, .systems p { color: var(--ink-70); }
.bullets { display: grid; gap: 8px; padding-top: 4px; }
.bullets li { position: relative; padding-left: 20px; }
.bullets li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 10px; height: 1px; background: var(--gold); }

/* Systems built: 2x2 panels */
.systems h2 { margin-bottom: 12px; }
.section-sub { margin-bottom: 40px; max-width: 65ch; }
.system-grid { display: grid; gap: 16px; }
.system-grid li { background: var(--paper-2); border-radius: var(--radius); padding: 32px 24px; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; }
.system-grid .outcome { font: 700 1.5rem/1.2 var(--text); color: var(--ink); border-top: 1px solid var(--line); padding-top: 16px; margin-top: auto; font-variant-numeric: tabular-nums; }

/* Retained operations */
.ops-intro { max-width: 65ch; }
.routines { display: grid; gap: 16px; align-content: start; }
.routines strong { font-weight: 700; }

/* About */
.photo, .photo img {
  aspect-ratio: 1; width: 100%; max-width: 420px;
  border-radius: 0 100% 0 0; /* the quadrant arc */
}
.photo { display: grid; place-items: end start; padding: 24px; background: var(--paper-2); overflow: hidden; }
.photo:has(img) { padding: 0; }
.photo img { object-fit: cover; }
.slot-label { font-size: 0.875rem; }
.about-text { display: grid; gap: 20px; align-content: start; max-width: 65ch; }
.about-text h2 { margin-bottom: 4px; }

/* Contact */
.panel { background: var(--paper-2); border-radius: var(--radius); padding: 40px 24px; display: grid; gap: 48px; }
.contact-sub { margin-bottom: 32px; max-width: 55ch; }
.contact-main h2 { margin-bottom: 16px; }
form { display: grid; gap: 24px; max-width: 40rem; }
.field { display: grid; gap: 8px; }
label { font: 500 1rem/1.3 var(--text); }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  background: var(--paper); color: var(--ink);
  border: 1px solid rgba(18,20,23,.5); border-radius: var(--radius); /* 3:1 boundary */
  font: 400 1.0625rem/1.4 var(--text);
}
textarea { resize: vertical; min-height: 144px; }
select { appearance: none; padding-right: 40px; background-image: none; }
.sel { position: relative; }
.sel::after {
  content: ""; position: absolute; right: 18px; top: 50%; margin-top: -6px;
  width: 7px; height: 7px; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink);
  transform: rotate(45deg); pointer-events: none;
}
[aria-invalid="true"] { border-color: var(--crimson); border-width: 2px; }
.error { color: var(--crimson); font-size: 1rem; }
form .btn { justify-self: start; }
.sent { padding: 20px 24px; border: 1px solid var(--crimson); border-radius: var(--radius); margin-bottom: 24px; }
.sent p + p { margin-top: 12px; }
.direct { margin: 0; display: grid; gap: 4px 0; align-content: start; }
.direct dt { font-size: 0.875rem; color: var(--ink-70); }
.direct dd { margin: 0 0 20px; }

/* Footer */
.site-footer { padding-block: 48px; }
.footer { display: grid; gap: 16px; }
.footer p { font-size: 0.875rem; color: var(--ink-70); max-width: 65ch; }

/* Hover, fine pointers only */
@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover, .nav-list a:hover { text-decoration: underline; text-decoration-color: var(--crimson); }
  .btn--primary:hover { background: var(--crimson-2); border-color: var(--crimson-2); }
  .btn--secondary:hover { border-color: var(--crimson); }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: background-color 150ms ease, border-color 150ms ease; }
  .btn:active { transform: none; }
}

/* below 1024 the header sticks; desktop stays static */
@media (max-width: 1023px) {
  .site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
  main, section { scroll-margin-top: 72px; }
}

/* phone: narrow map variant, boxes stacked */
@media (max-width: 767px) {
  .map-wide { display: none; }
  .map-narrow { display: block; }
}

/* 768: tablet */
@media (min-width: 768px) {
  :root { --gutter: 32px; }
  h1 { font-size: 3.0625rem; }
  h2 { font-size: 2.4375rem; }
  .system-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .panel { padding: 56px 48px; }
}

/* 1024: desktop splits */
@media (min-width: 1024px) {
  :root { --section: 96px; }
  h1 { font-size: 3.8125rem; }
  .nav-links { display: block; }
  .nav-list { display: none; }
  .hero { padding-block: 48px 96px; }
  .hero-grid { grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: center; }
  .hero-text { grid-column: 1 / span 6; grid-row: 1; max-width: none; padding-right: 24px; }
  .hero-map { grid-column: 7 / span 6; grid-row: 1; justify-self: end; }
  .pillar-cols { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .pillar-cols > li { padding-right: 24px; }
  .system-grid li { padding: 40px; }
  .split { grid-template-columns: repeat(12, 1fr); }
  .ops-intro { grid-column: 1 / span 7; padding-right: 48px; }
  .routines { grid-column: 8 / span 5; }
  .split--reverse .photo { grid-column: 1 / span 5; }
  .split--reverse .about-text { grid-column: 7 / span 6; }
  .panel { grid-template-columns: repeat(12, 1fr); gap: 24px; padding: 64px; }
  .contact-main { grid-column: 1 / span 7; }
  .contact-main:only-child { grid-column: 1 / span 12; }
  .contact-main:only-child form { max-width: none; }
  .direct { grid-column: 9 / span 4; padding-top: 72px; }
  .footer { grid-template-columns: auto 1fr; align-items: center; gap: 32px; }
}
