/* ============================================================
   Operations Journal — shared stylesheet
   Editorial / systems-precision / business-intelligence look
   ============================================================ */

:root {
  /* Palette: near-black ink, warm-white surfaces, ONE cobalt accent */
  --ink:        #0d0f14;
  --ink-soft:   #2a2f3a;
  --muted:      #5a6172;
  --line:       #e3e5ea;
  --line-soft:  #eef0f3;
  --surface:    #ffffff;
  --paper:      #f6f7f9;
  --paper-2:    #fbfbfc;
  --accent:     #2b54ff;   /* electric cobalt */
  --accent-ink: #1b39c7;
  --accent-wash:#eef1ff;
  --signal:     #00b37e;   /* secondary positive signal, used sparingly */

  --max:   1180px;
  --gutter: clamp(20px, 5vw, 64px);

  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(13,15,20,.05), 0 1px 1px rgba(13,15,20,.04);
  --shadow-md: 0 18px 40px -24px rgba(13,15,20,.28);
  --shadow-lg: 0 40px 80px -40px rgba(13,15,20,.34);

  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- reset ---------- */
*,*::before,*::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--surface);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

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

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 12px 18px; z-index: 999;
  border-radius: 0 0 var(--r-sm) 0; font: 600 14px/1 var(--sans);
}
.skip:focus { left: 0; }

/* ---------- type ---------- */
h1,h2,h3,h4 { font-weight: 600; line-height: 1.08; letter-spacing: -.02em; color: var(--ink); }
h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.32rem; letter-spacing: -.01em; }
p  { color: var(--ink-soft); }

.mono {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 500;
}
.mono-accent { color: var(--accent); }

/* ---------- layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
section { position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--muted);
  margin-bottom: 22px;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; background: var(--accent);
  display: inline-block;
}
.lead { font-size: clamp(1.05rem, 1.7vw, 1.28rem); color: var(--ink-soft); max-width: 46ch; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px;
  border-radius: var(--r-sm);
  font-weight: 600; font-size: .95rem;
  letter-spacing: -.01em;
  transition: transform .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease), color .25s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }

.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 22px -10px rgba(43,84,255,.7); }
.btn-primary:hover { background: var(--accent-ink); transform: translateY(-2px); box-shadow: 0 14px 30px -10px rgba(43,84,255,.75); }

.btn-ghost { color: var(--ink); border: 1px solid var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 70px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 600; letter-spacing: -.02em; font-size: 1.06rem; }
.brand .logo { width: 30px; height: 30px; }
.brand b { font-weight: 600; }
.brand .tld { color: var(--muted); font-weight: 500; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 8px 14px; border-radius: var(--r-sm);
  font-size: .92rem; font-weight: 500; color: var(--ink-soft);
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--ink); background: var(--paper); }
.nav-cta { margin-left: 12px; }
/* keep CTA legible: nav-links a color rules out-specify .btn-ink otherwise */
.nav-links a.nav-cta { color: #fff; }
.nav-links a.nav-cta:hover { color: #fff; background: var(--ink); }

.nav-toggle { display: none; width: 42px; height: 42px; border-radius: var(--r-sm); border: 1px solid var(--line); align-items: center; justify-content: center; }
.nav-toggle svg { width: 20px; height: 20px; }

@media (max-width: 860px) {
  .nav-links {
    position: fixed; inset: 70px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 16px var(--gutter) 26px;
    transform: translateY(-130%); transition: transform .38s var(--ease);
    box-shadow: var(--shadow-md);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 14px 12px; font-size: 1.05rem; border-bottom: 1px solid var(--line-soft); }
  .nav-cta { margin: 12px 0 0; justify-content: center; }
  .nav-toggle { display: inline-flex; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero { padding: clamp(56px, 9vw, 110px) 0 clamp(40px, 6vw, 80px); position: relative; }
.hero::before {
  /* faint engineering grid backdrop */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(120% 80% at 70% 0%, #000 0%, transparent 72%);
          mask-image: radial-gradient(120% 80% at 70% 0%, #000 0%, transparent 72%);
  opacity: .8;
}
.hero-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { margin: 6px 0 24px; }
.hero h1 .hl { color: var(--accent); position: relative; }
.hero .lead { max-width: 50ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero-note { margin-top: 22px; color: var(--muted); font-size: .92rem; display: flex; align-items: center; gap: 9px; }
.hero-note .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 4px rgba(0,179,126,.15); }

/* hero diagram card */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft); background: var(--paper-2);
}
.panel-head .dots { display: flex; gap: 6px; }
.panel-head .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.panel-head .dots i:first-child { background: var(--accent); }
.panel-body { padding: 22px; }

.flow { display: grid; gap: 12px; }
.flow-row { display: flex; align-items: center; gap: 12px; }
.flow-node {
  flex: 1; display: flex; align-items: center; gap: 12px;
  padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--paper-2);
}
.flow-node .ic { width: 34px; height: 34px; flex: none; border-radius: 9px; background: var(--accent-wash); color: var(--accent); display: grid; place-items: center; }
.flow-node .ic svg { width: 18px; height: 18px; }
.flow-node .t { font-weight: 600; font-size: .95rem; }
.flow-node .s { font-family: var(--mono); font-size: .68rem; color: var(--muted); letter-spacing: .04em; }
.flow-arrow { color: var(--line); display: grid; place-items: center; }
.flow-arrow svg { width: 18px; height: 18px; }
.flow-node.is-accent { border-color: var(--accent); background: #fff; box-shadow: 0 10px 26px -16px rgba(43,84,255,.55); }
.flow-node.is-accent .ic { background: var(--accent); color: #fff; }

.spark {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; height: 64px;
}
.spark i { flex: 1; background: var(--accent-wash); border-radius: 3px 3px 0 0; }
.spark i.on { background: var(--accent); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero .panel { order: 2; }
}

/* ============================================================
   GENERIC SECTION
   ============================================================ */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-head { max-width: 60ch; margin-bottom: clamp(36px, 5vw, 60px); }
.section-head h2 { margin-bottom: 18px; }
.section.alt { background: var(--paper); border-block: 1px solid var(--line-soft); }

/* metric strip ----------------------------------------------- */
.metrics {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface);
}
.metric { padding: 30px 26px; border-right: 1px solid var(--line-soft); }
.metric:last-child { border-right: 0; }
.metric .n { font-size: clamp(2.1rem, 4vw, 2.9rem); font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.metric .n span { color: var(--accent); }
.metric .l { margin-top: 12px; color: var(--muted); font-size: .9rem; line-height: 1.45; }
@media (max-width: 720px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
}

/* services / cards ------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.card {
  background: var(--surface); padding: 34px 30px; position: relative;
  transition: background .3s var(--ease);
}
.card:hover { background: var(--paper-2); }
.card .num { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; color: var(--accent); }
.card .ic { width: 46px; height: 46px; margin: 20px 0 18px; border-radius: var(--r-md); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink); background: var(--paper-2); transition: border-color .3s, color .3s, background .3s; }
.card:hover .ic { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }
.card .ic svg { width: 23px; height: 23px; }
.card h3 { margin-bottom: 10px; }
.card p { font-size: .96rem; }
.card ul { list-style: none; padding: 0; margin: 16px 0 0; }
.card li { font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; color: var(--muted); padding: 6px 0; border-top: 1px solid var(--line-soft); display: flex; align-items: center; gap: 8px; }
.card li::before { content: ""; width: 5px; height: 5px; background: var(--accent); border-radius: 1px; flex: none; }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }

/* method / steps --------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: step; }
.step { position: relative; padding-top: 26px; border-top: 2px solid var(--ink); }
.step::after { content: ""; position: absolute; top: -2px; left: 0; width: 38px; height: 2px; background: var(--accent); }
.step .k { font-family: var(--mono); font-size: .72rem; letter-spacing: .16em; color: var(--muted); }
.step h3 { margin: 10px 0 10px; font-size: 1.4rem; }
.step p { font-size: .95rem; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }

/* principles / split feature --------------------------------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 6vw, 80px); align-items: center; }
.split .panel { box-shadow: var(--shadow-md); }
.principles { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 2px; }
.principles li { display: flex; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.principles li .pk { font-family: var(--mono); font-size: .72rem; color: var(--accent); padding-top: 4px; }
.principles li .pt b { display: block; font-weight: 600; margin-bottom: 4px; }
.principles li .pt span { color: var(--muted); font-size: .94rem; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

/* dashboard mini panel (about/approach) */
.kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi .cell { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; background: var(--paper-2); }
.kpi .cell .lab { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; color: var(--muted); }
.kpi .cell .val { font-size: 1.7rem; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; }
.kpi .cell .val em { font-style: normal; color: var(--accent); font-size: .9rem; margin-left: 4px; }
.bars { margin-top: 14px; display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 12px; }
.bar .bl { font-family: var(--mono); font-size: .66rem; letter-spacing: .06em; color: var(--muted); }
.bar .track { height: 8px; background: var(--line-soft); border-radius: 99px; overflow: hidden; }
.bar .fill { height: 100%; background: linear-gradient(90deg, var(--accent), #5b7bff); border-radius: 99px; }

/* contact ---------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 6vw, 72px); align-items: start; }
.contact-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 34px; background: var(--surface); box-shadow: var(--shadow-md); }
.field { margin-bottom: 16px; }
.field label { display: block; font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; color: var(--muted); margin-bottom: 7px; text-transform: uppercase; }
.field input, .field textarea {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--r-sm);
  font: inherit; font-size: .95rem; background: var(--paper-2); color: var(--ink);
  transition: border-color .2s, background .2s;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); background: #fff; outline: none; }
.field textarea { resize: vertical; min-height: 110px; }
.contact-meta { display: grid; gap: 22px; }
.contact-line { display: flex; gap: 14px; align-items: flex-start; }
.contact-line .ic { width: 42px; height: 42px; flex: none; border-radius: var(--r-md); background: var(--accent-wash); color: var(--accent); display: grid; place-items: center; }
.contact-line .ic svg { width: 20px; height: 20px; }
.contact-line .lab { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.contact-line .val { font-weight: 600; font-size: 1.05rem; }
.contact-line .val a:hover { color: var(--accent); }
.form-note { font-size: .8rem; color: var(--muted); margin-top: 4px; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }

/* CTA band --------------------------------------------------- */
.cta-band { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: clamp(40px, 6vw, 70px); position: relative; overflow: hidden; }
.cta-band::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(90% 120% at 100% 0%, #000, transparent 70%);
          mask-image: radial-gradient(90% 120% at 100% 0%, #000, transparent 70%);
}
.cta-band > * { position: relative; }
.cta-band h2 { color: #fff; max-width: 18ch; }
.cta-band p { color: rgba(255,255,255,.72); max-width: 48ch; margin-top: 16px; }
.cta-band .btn-primary { margin-top: 28px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { border-top: 1px solid var(--line); padding: clamp(48px,6vw,72px) 0 36px; background: var(--paper-2); }
.foot-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid var(--line); }
.foot-brand .brand { margin-bottom: 16px; }
.foot-brand p { max-width: 34ch; font-size: .94rem; }
.foot-col h4 { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; margin-bottom: 16px; font-weight: 500; }
.foot-col a { display: block; padding: 6px 0; color: var(--ink-soft); font-size: .95rem; }
.foot-col a:hover { color: var(--accent); }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 28px; flex-wrap: wrap; }
.foot-bottom p { font-size: .86rem; color: var(--muted); }
.foot-bottom .mono { color: var(--muted); }
@media (max-width: 720px) { .foot-top { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }

/* ============================================================
   SUBPAGE HEADER (about/legal)
   ============================================================ */
.page-hero { padding: clamp(56px,8vw,96px) 0 clamp(36px,5vw,56px); border-bottom: 1px solid var(--line-soft); position: relative; }
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 8px 0 18px; }
.page-hero .lead { max-width: 56ch; }

.prose { max-width: 72ch; }
.prose h2 { font-size: 1.5rem; margin: 44px 0 14px; }
.prose h3 { font-size: 1.12rem; margin: 28px 0 8px; }
.prose p { margin-bottom: 16px; }
.prose ul { margin: 0 0 18px; padding-left: 0; list-style: none; }
.prose ul li { position: relative; padding: 6px 0 6px 26px; color: var(--ink-soft); }
.prose ul li::before { content: ""; position: absolute; left: 4px; top: 15px; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.prose a { color: var(--accent); font-weight: 500; }
.prose a:hover { text-decoration: underline; }
.prose .updated { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }

/* about team band */
.values { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.value { background: var(--surface); padding: 30px 28px; }
.value .ic { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--accent-wash); color: var(--accent); display: grid; place-items: center; margin-bottom: 16px; }
.value .ic svg { width: 20px; height: 20px; }
.value h3 { font-size: 1.1rem; margin-bottom: 8px; }
.value p { font-size: .93rem; }
@media (max-width: 820px) { .values { grid-template-columns: 1fr; } }

/* 404 */
.nf { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 60px 0; }
.nf .code { font-family: var(--mono); font-size: clamp(4rem, 14vw, 9rem); font-weight: 600; letter-spacing: -.04em; line-height: 1; color: var(--ink); }
.nf .code span { color: var(--accent); }
.nf p { max-width: 40ch; margin: 18px auto 28px; }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .07s; }
.reveal.d2 { transition-delay: .14s; }
.reveal.d3 { transition-delay: .21s; }
.reveal.d4 { transition-delay: .28s; }
