/* ====================================================================
   AP Labs — design system
   Typeface: Inter (SIL OFL), self-hosted — no third-party requests.
   ==================================================================== */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* surfaces */
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-sunken: #eef0f4;
  --ink: #0b1220;           /* footer / deep surfaces */
  --ink-2: #131c2e;

  /* type */
  --text: #0d1526;
  --text-muted: #56617a;
  --text-faint: #8590a6;
  --on-ink: #e8ecf4;
  --on-ink-muted: #9aa5ba;

  /* line + accent */
  --line: #e4e7ee;
  --line-strong: #d3d8e3;
  --accent: #1740a6;
  --accent-hover: #12357f;
  --accent-soft: #eef2fc;

  /* illustration tokens */
  --il-panel: #ffffff;
  --il-panel-2: #f2f4f9;
  --il-line: #dde1ea;
  --il-ink: #c8cedb;

  --shadow-sm: 0 1px 2px rgba(11,18,32,.04);
  --shadow: 0 1px 3px rgba(11,18,32,.06), 0 10px 30px rgba(11,18,32,.05);

  --radius: 10px;
  --radius-sm: 7px;
  --maxw: 1140px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1018;
    --bg-soft: #11161f;
    --bg-sunken: #171d28;
    --ink: #080c13;
    --ink-2: #0f141d;

    --text: #e9edf4;
    --text-muted: #9aa5b8;
    --text-faint: #6f7b90;
    --on-ink: #e8ecf4;
    --on-ink-muted: #94a0b5;

    --line: #222a37;
    --line-strong: #2d3644;
    --accent: #7fa0f0;
    --accent-hover: #9db6f6;
    --accent-soft: #151d33;

    --il-panel: #171e29;
    --il-panel-2: #121821;
    --il-line: #2a3341;
    --il-ink: #384252;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 1px 3px rgba(0,0,0,.45), 0 10px 30px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: 'cv05' 1, 'ss03' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 640; line-height: 1.2; letter-spacing: -.021em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.1rem); letter-spacing: -.032em; line-height: 1.08; }
h2 { font-size: clamp(1.5rem, 2.9vw, 2rem); letter-spacing: -.026em; }
h3 { font-size: 1.06rem; letter-spacing: -.013em; font-weight: 620; }
p { margin: 0 0 1.05em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
@media (max-width: 520px) { .wrap { padding: 0 20px; } }

/* ---------- utility bar ---------- */
.topbar {
  background: var(--ink);
  color: var(--on-ink-muted);
  font-size: .8rem;
  letter-spacing: .005em;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 38px; flex-wrap: wrap;
}
.topbar a { color: var(--on-ink); }
.topbar a:hover { color: #fff; }
.topbar .set { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.topbar .set span { display: inline-flex; align-items: center; gap: 7px; }
.topbar svg { width: 13px; height: 13px; opacity: .65; flex: none; }
@media (max-width: 640px) { .topbar .loc { display: none; } }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; min-height: 68px; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 11px;
  font-weight: 640; font-size: 1.04rem; color: var(--text);
  letter-spacing: -.019em;
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand svg { width: 30px; height: 30px; flex: none; border-radius: 7px; }
nav.main { display: flex; gap: 2px; flex-wrap: wrap; }
nav.main a {
  color: var(--text-muted); font-size: .91rem; font-weight: 500;
  padding: 8px 13px; border-radius: var(--radius-sm);
}
nav.main a:hover { color: var(--text); background: var(--bg-sunken); text-decoration: none; }
nav.main a[aria-current="page"] { color: var(--text); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: 11px 21px;
  border-radius: var(--radius-sm);
  font-weight: 560; font-size: .93rem; letter-spacing: -.008em;
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost { border-color: var(--line-strong); color: var(--text); background: var(--bg); }
.btn-ghost:hover { background: var(--bg-sunken); border-color: var(--text-faint); color: var(--text); }
@media (prefers-color-scheme: dark) {
  .btn-primary { color: #0a0e16; }
  .btn-primary:hover { color: #0a0e16; }
}

/* ---------- sections ---------- */
section { padding: 84px 0; }
section.tight { padding: 52px 0; }
.soft { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hero { padding: 104px 0 88px; position: relative; overflow: hidden; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background-image: radial-gradient(currentColor 1px, transparent 1px);
  background-size: 30px 30px; color: var(--il-ink); opacity: .42;
  mask-image: radial-gradient(ellipse 72% 62% at 46% 0%, #000 22%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 72% 62% at 46% 0%, #000 22%, transparent 72%);
}
.hero p.lede { font-size: 1.14rem; color: var(--text-muted); max-width: 56ch; letter-spacing: -.005em; }
.hero-split {
  display: grid; gap: 56px;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  align-items: center;
}
@media (max-width: 920px) { .hero-split { grid-template-columns: 1fr; gap: 40px; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: .755rem; font-weight: 620; letter-spacing: .105em;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 20px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 2px; background: var(--accent); border-radius: 2px;
}
.actions { display: flex; gap: 11px; flex-wrap: wrap; margin-top: 30px; }

.sec-head { max-width: 60ch; margin-bottom: 40px; }
.sec-head p { color: var(--text-muted); margin: 0; }

/* ---------- grids + cards ---------- */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); }

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: border-color .16s ease;
}
.card:hover { border-color: var(--line-strong); }
.card.flat { box-shadow: none; }
.card h3 { margin-bottom: 7px; }
.card p { color: var(--text-muted); margin: 0; font-size: .935rem; }
.card .ico {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--accent);
  margin-bottom: 16px;
}
.card .ico svg { width: 18px; height: 18px; }

/* ---------- prose ---------- */
.prose { max-width: 70ch; }
.wrap.prose { max-width: var(--maxw); }
.wrap.prose > * { max-width: 70ch; }
.prose h2 { margin-top: 2.1em; }
.prose h3 { margin-top: 1.7em; }
.prose ul { padding-left: 1.15em; color: var(--text-muted); }
.prose li { margin-bottom: .42em; }
.prose .meta { color: var(--text-faint); font-size: .89rem; }

dl.facts { margin: 0; display: grid; gap: 0; }
dl.facts > div { padding: 13px 0; border-bottom: 1px solid var(--line); }
dl.facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
dl.facts > div:first-child { padding-top: 0; }
dl.facts dt {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .085em;
  color: var(--text-faint); font-weight: 620;
}
dl.facts dd { margin: 5px 0 0; font-size: .96rem; }

/* ---------- process steps ---------- */
ol.steps { list-style: none; counter-reset: s; margin: 34px 0 0; padding: 0; display: grid; gap: 4px; }
ol.steps li {
  counter-increment: s;
  display: grid; grid-template-columns: 34px 1fr; gap: 16px;
  padding: 18px 0; border-top: 1px solid var(--line);
}
ol.steps li:last-child { border-bottom: 1px solid var(--line); }
ol.steps li::before {
  content: counter(s, decimal-leading-zero);
  grid-column: 1; grid-row: 1 / span 2;
  font-size: .78rem; font-weight: 650; color: var(--accent);
  letter-spacing: .04em; padding-top: 2px;
}
ol.steps strong { grid-column: 2; grid-row: 1; font-weight: 620; }
ol.steps span { grid-column: 2; grid-row: 2; color: var(--text-muted); font-size: .93rem; }

/* ---------- technology strip ---------- */
.tech { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.tech li {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); background: var(--bg);
  border-radius: 999px; padding: 6px 15px;
  font-size: .855rem; font-weight: 520; color: var(--text-muted);
  letter-spacing: -.004em;
}

/* ---------- illustration ---------- */
.il { width: 100%; height: auto; display: block; overflow: visible; }
.il .panel { fill: var(--il-panel); stroke: var(--il-line); stroke-width: 1.5; }
.il .panel-2 { fill: var(--il-panel-2); stroke: var(--il-line); stroke-width: 1.5; }
.il .bar { fill: var(--il-ink); }
.il .bar-soft { fill: var(--il-ink); opacity: .52; }
.il .acc { fill: var(--accent); }
.il .acc-soft { fill: var(--accent); opacity: .2; }
.il .ln { stroke: var(--il-line); stroke-width: 1.5; fill: none; }
.il .ln-acc { stroke: var(--accent); stroke-width: 2; fill: none; stroke-linecap: round; }
.il-shadow { filter: drop-shadow(0 20px 40px rgba(11,18,32,.13)); }
@media (prefers-color-scheme: dark) { .il-shadow { filter: drop-shadow(0 20px 40px rgba(0,0,0,.6)); } }

.banner {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-soft); overflow: hidden; margin: 10px 0 46px;
}
.banner svg { display: block; width: 100%; height: auto; }

/* ---------- office / map ---------- */
.office {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--bg); box-shadow: var(--shadow-sm);
}
@media (max-width: 780px) { .office { grid-template-columns: 1fr; } }
.office .body { padding: 30px; }
.office .map {
  position: relative; min-height: 262px;
  background: var(--il-panel-2);
  border-left: 1px solid var(--line);
  display: grid; place-items: center;
}
@media (max-width: 780px) { .office .map { border-left: 0; border-top: 1px solid var(--line); } }
.office .map svg.grid-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.office .pin { position: relative; z-index: 2; display: grid; place-items: center; gap: 12px; text-align: center; padding: 20px; }
.office .pin .dot {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent); display: grid; place-items: center; color: #fff;
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 14%, transparent);
}
@media (prefers-color-scheme: dark) { .office .pin .dot { color: #0a0e16; } }
.office .pin .dot svg { width: 22px; height: 22px; }
.office .pin span { font-size: .84rem; color: var(--text-muted); line-height: 1.6; }

/* ---------- footer ---------- */
footer.site-footer {
  background: var(--ink);
  color: var(--on-ink-muted);
  padding: 62px 0 30px;
  font-size: .9rem;
  border-top: 1px solid var(--line);
}
footer.site-footer .cols {
  display: grid; gap: 36px;
  grid-template-columns: 1.4fr 1fr 1fr 1.3fr;
}
@media (max-width: 860px) { footer.site-footer .cols { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); } }
footer.site-footer .fbrand {
  display: inline-flex; align-items: center; gap: 10px;
  color: #fff; font-weight: 620; font-size: 1rem; margin-bottom: 12px;
  letter-spacing: -.019em;
}
footer.site-footer .fbrand svg { width: 27px; height: 27px; border-radius: 6px; }
footer.site-footer h4 {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .095em;
  color: var(--on-ink-muted); opacity: .72; margin: 0 0 14px; font-weight: 620;
}
footer.site-footer ul { list-style: none; margin: 0; padding: 0; }
footer.site-footer li { margin-bottom: 9px; }
footer.site-footer a { color: var(--on-ink); }
footer.site-footer a:hover { color: #fff; }
footer.site-footer address { font-style: normal; line-height: 1.75; }
footer.site-footer p { color: var(--on-ink-muted); }
.legal {
  margin-top: 44px; padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.09);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: .83rem; color: var(--on-ink-muted); opacity: .85;
}

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 14px; top: 14px; z-index: 60; background: var(--bg); color: var(--text);
  padding: 10px 15px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.lede-sm { color: var(--text-muted); }
