/* Cheznet — tokens */
:root {
  --ink: #13213C;          /* deep navy: text, dark sections */
  --ink-soft: #46546E;     /* body copy */
  --ink-faint: #6A7790;    /* captions (4.6:1 on white) */
  --paper: #FFFFFF;
  --mist: #EEF2F7;         /* tinted sections, diagram panel */
  --rule: #D5DCE6;
  --cobalt: #2457E6;       /* actions */
  --cobalt-deep: #1A43B8;
  --live: #17A34A;         /* "healthy" status in the diagram only */
  --on-ink: #E8EDF5;
  --on-ink-soft: #AEB9CC;

  --display: 'Bricolage Grotesque', 'IBM Plex Sans', system-ui, sans-serif;
  --body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: clamp(2rem, 3.6vw, 2.75rem);
  --step-4: clamp(2.75rem, 6.4vw, 4.75rem);

  --gutter: clamp(20px, 4vw, 40px);
  --block: clamp(72px, 10vw, 128px);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 var(--step-0)/1.6 var(--body); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-family: var(--display); color: inherit; }
p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--cobalt); text-underline-offset: 3px; }
a:hover { color: var(--cobalt-deep); }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: 1200px; margin: 0 auto; padding-inline: var(--gutter); }

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 20; background: var(--paper); color: var(--ink); padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1.5px solid transparent; font: 600 0.9375rem/1.2 var(--body); text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.btn-lg { min-height: 52px; padding: 14px 24px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-deep); color: #fff; }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-ghost { border-color: var(--rule); color: var(--ink); background: var(--paper); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--rule); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 36px; height: 36px; flex: none; }
.brand-mark rect { fill: var(--ink); }
.brand-mark path { fill: none; stroke: #7FA2FF; stroke-width: 3; stroke-linecap: round; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font: 800 1.25rem/1.1 var(--display); letter-spacing: -0.02em; }
.brand-tag { font-size: 0.8125rem; color: var(--ink-faint); }
.nav { display: flex; align-items: center; gap: 28px; }
.nav-links { display: flex; gap: 24px; }
.nav-links a, .nav-phone { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.9375rem; }
.nav-links a:hover, .nav-phone:hover { color: var(--cobalt); }
.nav-phone { font-variant-numeric: tabular-nums; }

/* Hero */
.hero { padding-block: clamp(48px, 7vw, 96px) clamp(48px, 6vw, 80px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 80px); align-items: center; }
.hero h1 { font-size: var(--step-4); font-weight: 800; line-height: 0.98; letter-spacing: -0.035em; max-width: 11ch; font-variation-settings: 'opsz' 96; }
.hero-lead { margin-top: 28px; font-size: var(--step-1); line-height: 1.55; color: var(--ink-soft); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-note { margin-top: 20px; font-size: var(--step--1); color: var(--ink-faint); }

.hero-figure { background: var(--mist); border-radius: 24px; padding: clamp(16px, 3vw, 32px); }
.system-map { width: 100%; height: auto; overflow: visible; }
.system-map .boundary { fill: none; stroke: #9DB0CC; stroke-width: 1.5; stroke-dasharray: 6 6; }
.system-map .boundary-label { font: 500 17px var(--body); fill: var(--ink-soft); }
.system-map .link { fill: none; stroke: #8C9DB8; stroke-width: 2; }
.system-map .node rect { fill: var(--paper); stroke: var(--rule); stroke-width: 1.5; }
.system-map .node-hub rect { fill: var(--ink); stroke: var(--ink); }
.system-map .node text { font: 600 18px var(--body); fill: var(--ink); }
.system-map .node-hub text { fill: #fff; }
.system-map .node-icon { fill: none; stroke: var(--cobalt); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.system-map .node-hub .node-icon { stroke: #7FA2FF; }
.system-map .status { fill: var(--live); }

/* The one orchestrated moment: links draw in, then every system reports healthy */
@media (prefers-reduced-motion: no-preference) {
  .system-map .link { stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw .7s ease-out forwards; }
  .system-map .l1 { animation-delay: .2s; }
  .system-map .l2 { animation-delay: .35s; }
  .system-map .l3 { animation-delay: .6s; }
  .system-map .l4 { animation-delay: .7s; }
  .system-map .l5 { animation-delay: .9s; }
  .system-map .status { opacity: 0; transform-box: fill-box; transform-origin: center; animation: light .4s ease-out forwards; }
  .system-map .s1 { animation-delay: 1.3s; }
  .system-map .s2 { animation-delay: 1.38s; }
  .system-map .s3 { animation-delay: 1.46s; }
  .system-map .s4 { animation-delay: 1.54s; }
  .system-map .s5 { animation-delay: 1.62s; }
  .system-map .s6 { animation-delay: 1.7s; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes light { 0% { opacity: 0; transform: scale(.2); } 70% { opacity: 1; transform: scale(1.4); } 100% { opacity: 1; transform: scale(1); } }

/* Blocks */
.block { padding-block: var(--block); }
.block-tint { background: var(--mist); }
.block-ink { background: var(--ink); color: var(--on-ink); }
.block-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 64px; align-items: end; margin-bottom: clamp(40px, 6vw, 64px); }
.block h2 { font-size: var(--step-3); font-weight: 700; line-height: 1.05; letter-spacing: -0.025em; }
.block-head p { color: var(--ink-soft); max-width: 36em; }

/* Services */
.service-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.service-group { padding: 28px 32px 8px 0; }
.service-group + .service-group { padding-left: 32px; border-left: 1px solid var(--rule); }
.service-group h3 { font-size: var(--step-2); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 24px; }
.service-list dt { font-weight: 600; font-size: var(--step-0); }
.service-list dd { color: var(--ink-soft); font-size: 0.9375rem; line-height: 1.6; margin-bottom: 22px; }

/* Process timeline */
.timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; position: relative; }
.timeline::before { content: ""; position: absolute; top: 21px; left: 22px; right: 22px; height: 2px; background: var(--rule); }
.timeline li { position: relative; }
.step-dot { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); font: 700 1.0625rem var(--display); }
.timeline h3 { margin-top: 20px; font-size: var(--step-1); font-weight: 700; }
.timeline p { margin-top: 8px; color: var(--ink-soft); font-size: 0.9375rem; max-width: 26ch; }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.about-copy p { margin-top: 24px; font-size: var(--step-1); line-height: 1.6; color: var(--ink-soft); max-width: 32em; }
.values { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.values div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.values dt { font: 700 var(--step-0) var(--display); }
.values dd { color: var(--ink-soft); font-size: 0.9375rem; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(40px, 6vw, 88px); align-items: start; }
.block-ink h2 { color: #fff; }
.contact-lead { margin-top: 20px; color: var(--on-ink-soft); font-size: var(--step-1); }
.next-steps { margin-top: 24px; counter-reset: next; display: grid; gap: 14px; }
.next-steps li { counter-increment: next; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: baseline; color: var(--on-ink); }
.next-steps li::before { content: counter(next); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid #5A6B8A; font: 700 0.875rem var(--display); color: #fff; transform: translateY(-2px); }
.contact-list { margin-top: 40px; padding-top: 28px; border-top: 1px solid #2C3B5A; display: grid; gap: 10px; color: var(--on-ink-soft); }
.contact-list a { color: #fff; }
.contact-list a:hover { color: #A9C1FF; }

.contact-form { background: var(--paper); color: var(--ink); border-radius: 20px; padding: clamp(24px, 4vw, 40px); display: grid; gap: 20px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 20px; }
.field { display: grid; gap: 8px; }
.field label { font-weight: 600; font-size: 0.9375rem; }
.optional { font-weight: 400; color: var(--ink-faint); }
.field input, .field select, .field textarea { width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 1.5px solid #B7C2D3; border-radius: 10px; padding: 12px 14px; min-height: 50px; }
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px rgba(36, 87, 230, .2); }
.field [aria-invalid="true"] { border-color: #C2261B; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.6em; font-size: 0.9375rem; }
.form-status.ok { color: #127A38; }
.form-status.err { color: #C2261B; }

/* Footer */
.site-footer { background: #0D1830; color: var(--on-ink-soft); padding-block: 32px; font-size: var(--step--1); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-links a { color: var(--on-ink-soft); text-decoration: none; }
.footer-links a:hover { color: #fff; }

/* 404 */
.page-404 { min-height: 100vh; display: flex; align-items: center; }
.page-404 h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.03em; color: #fff; }
.page-404 p { margin-top: 16px; font-size: var(--step-1); color: var(--on-ink-soft); }
.page-404 .btn { margin-top: 32px; }

/* Responsive */
@media (max-width: 1020px) {
  .nav-links { display: none; }
  .hero-grid, .about-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .block-head { grid-template-columns: minmax(0, 1fr); }
  .service-groups { grid-template-columns: minmax(0, 1fr); border-top: none; }
  .service-group, .service-group + .service-group { padding: 28px 0 4px; border-left: none; border-top: 2px solid var(--ink); }
  .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .timeline::before { display: none; }
}
@media (max-width: 600px) {
  .nav-phone { display: none; }
  .brand-tag { display: none; }
  .header-inner .btn { padding-inline: 14px; }
  .timeline { grid-template-columns: minmax(0, 1fr); }
  .values div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .hero-actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
