/* SPDX-License-Identifier: Apache-2.0 */
/* Copyright (c) 2024-2025 ArcherDB Contributors */

:root {
  --ink: #071729;
  --ink-soft: #0d2438;
  --navy: #06192b;
  --navy-2: #092238;
  --white: #ffffff;
  --paper: #f7faf8;
  --text: #0a1728;
  --muted: #526071;
  --green: #2d5a27;
  --green-bright: #68ad43;
  --blue: #4a90a4;
  --blue-bright: #68bfd9;
  --gold: #e8b84a;
  --line: #dce5e2;
  --line-dark: rgba(157, 199, 214, 0.2);
  --radius: 10px;
  --shell: min(1480px, calc(100vw - 64px));
  --display: "Inter", "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--white);
  font-family: var(--display);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
.shell { width: var(--shell); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 100; padding: 10px 14px; background: var(--white); color: var(--ink); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  height: 88px;
  color: var(--white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.site-header.is-scrolled {
  position: fixed;
  height: 72px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border-color: var(--line);
  backdrop-filter: blur(16px);
  animation: header-in 180ms ease-out;
}
@keyframes header-in { from { transform: translateY(-100%); } }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.wordmark { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 23px; font-weight: 740; letter-spacing: -0.035em; }
.wordmark-mark {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  color: var(--navy);
  background: var(--green-bright);
  font-size: 17px;
  font-weight: 850;
  line-height: 1;
  clip-path: polygon(50% 0, 100% 100%, 73% 100%, 61% 72%, 38% 72%, 27% 100%, 0 100%);
}
.site-nav { display: flex; align-items: center; gap: clamp(22px, 3vw, 46px); font-size: 14px; font-weight: 580; }
.site-nav > a { position: relative; text-decoration: none; }
.site-nav > a:not(.nav-github)::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -8px; height: 1px; background: var(--green-bright); transition: right 180ms ease; }
.site-nav > a:not(.nav-github):hover::after, .site-nav > a:not(.nav-github):focus-visible::after { right: 0; }
.nav-github { display: inline-flex; align-items: center; gap: 8px; padding: 11px 15px; border: 1px solid currentColor; border-radius: 7px; }
.nav-github svg { width: 18px; height: 18px; fill: currentColor; }
.menu-toggle { display: none; background: none; border: 0; color: currentColor; }

.hero {
  position: relative;
  min-height: 900px;
  padding: 176px 0 94px;
  overflow: hidden;
  color: var(--white);
  background:
    radial-gradient(circle at 74% 38%, rgba(74, 144, 164, 0.14), transparent 36%),
    linear-gradient(115deg, #06192b 0%, #06192b 54%, #071d31 100%);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(90deg, transparent 0, black 56%, black 100%);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(510px, 0.92fr) minmax(600px, 1.1fr); gap: clamp(36px, 4vw, 70px); align-items: center; }
.hero-grid > *, .feature-workbench > *, .architecture-grid > *, .start-grid > *, .console-content > * { min-width: 0; }
.hero-copy h1 { max-width: 690px; margin: 0; font-size: clamp(62px, 5.55vw, 88px); line-height: 0.94; letter-spacing: -0.065em; font-weight: 760; }
.hero-copy h1 span { display: block; color: var(--green-bright); }
.hero-copy > p { max-width: 590px; margin: 35px 0 0; color: #c7d3dd; font-size: clamp(18px, 1.45vw, 23px); line-height: 1.58; letter-spacing: -0.015em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 38px; }
.button { display: inline-flex; min-height: 54px; align-items: center; justify-content: center; gap: 12px; padding: 0 23px; border: 1px solid transparent; border-radius: 7px; text-decoration: none; font-size: 15px; font-weight: 670; transition: transform 160ms ease, background 160ms ease, border 160ms ease; }
.button:hover { transform: translateY(-2px); }
.button:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.button-primary { color: var(--white); background: var(--green); border-color: #477f3c; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2); }
.button-primary:hover { background: #376d30; }
.button-secondary { color: #bde7f2; border-color: rgba(104, 191, 217, 0.68); background: rgba(5, 21, 36, 0.35); }
.button-secondary:hover { border-color: var(--blue-bright); background: rgba(74, 144, 164, 0.12); }

.query-stage { position: relative; min-height: 600px; border: 1px solid rgba(123, 178, 198, 0.26); border-radius: var(--radius); overflow: hidden; background: #081b2c; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28); }
.map-canvas { position: absolute; inset: 0 0 172px; overflow: hidden; }
.terrain { width: 100%; height: 100%; }
.contours path { fill: none; stroke: rgba(148, 188, 204, 0.13); stroke-width: 1.4; }
.river { fill: none; stroke: rgba(74, 144, 164, 0.2); stroke-width: 36; }
.roads path { fill: none; stroke: rgba(225, 235, 237, 0.12); stroke-width: 3; stroke-dasharray: 2 8; }
.route path { fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 8 11; animation: route-move 10s linear infinite; }
.route circle { stroke: #081b2c; stroke-width: 3; }
.route-blue path, .route-blue circle { stroke: var(--blue-bright); fill: var(--blue-bright); }
.route-green path, .route-green circle { stroke: var(--green-bright); fill: var(--green-bright); }
@keyframes route-move { to { stroke-dashoffset: -190; } }
.query-shape { opacity: 0; transition: opacity 240ms ease; }
.query-shape.is-active { opacity: 1; }
.query-radius > circle:first-child { fill: rgba(74, 144, 164, 0.1); stroke: var(--gold); stroke-width: 3; stroke-dasharray: 11 9; }
.query-radius .query-center { fill: var(--gold); }
.query-polygon path { fill: rgba(104, 173, 67, 0.16); stroke: var(--green-bright); stroke-width: 4; stroke-dasharray: 12 8; }
.query-latest circle { fill: rgba(232, 184, 74, 0.15); stroke: var(--gold); stroke-width: 4; }
.vehicle rect, .vehicle path { fill: #eef7f7; }.vehicle circle { fill: var(--navy); }
.map-label { position: absolute; padding: 6px 8px; border: 1px solid rgba(114, 164, 183, 0.3); border-radius: 4px; color: #a9c4cf; background: rgba(6, 25, 43, 0.8); font: 11px var(--mono); }
.label-a { top: 17%; left: 9%; }.label-b { right: 8%; bottom: 13%; }
.query-console { position: absolute; inset: auto 16px 16px; min-height: 194px; border: 1px solid rgba(113, 164, 182, 0.28); border-radius: 8px; background: rgba(5, 18, 31, 0.92); backdrop-filter: blur(14px); }
.query-tabs { display: flex; gap: 5px; padding: 0 14px; border-bottom: 1px solid var(--line-dark); }
.query-tabs button { position: relative; padding: 14px 13px 12px; border: 0; color: #99adba; background: none; font-size: 12px; font-weight: 650; cursor: pointer; }
.query-tabs button[aria-selected="true"] { color: var(--white); }
.query-tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--green-bright); }
.console-content { display: grid; grid-template-columns: 1.3fr 0.7fr; min-height: 147px; }
.console-content pre { margin: 0; padding: 16px 19px; overflow: auto; color: #b9deea; font: 12px/1.55 var(--mono); border-right: 1px solid var(--line-dark); white-space: pre-wrap; }
.query-result { padding: 18px; color: #d6e0e6; font: 11px/1.6 var(--mono); }
.query-result strong { display: block; margin-bottom: 8px; color: var(--gold); font: 600 10px var(--display); letter-spacing: .12em; text-transform: uppercase; }
.query-result span { display: block; color: #8ea5b4; }
.hero-coordinate { position: absolute; z-index: 2; right: 26px; bottom: 27px; color: rgba(194, 213, 220, 0.45); font: 10px var(--mono); letter-spacing: .12em; }

.section { padding: 130px 0; }
.section-intro { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 70px; align-items: end; margin-bottom: 82px; }
.section h2 { margin: 0; font-size: clamp(48px, 5vw, 76px); line-height: 1; letter-spacing: -0.055em; }
.section-intro p { max-width: 720px; margin: 0 0 4px; color: var(--muted); font-size: clamp(18px, 1.7vw, 24px); line-height: 1.55; }
.spatial { background: var(--white); }
.feature-workbench { display: grid; grid-template-columns: 390px minmax(0, 1fr); gap: 64px; }
.feature-rail { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.feature-item { display: grid; grid-template-columns: 36px 1fr; gap: 20px; padding: 28px 4px; border-bottom: 1px solid var(--line); opacity: .55; transition: opacity 180ms ease, padding 180ms ease; cursor: default; }
.feature-item.is-active, .feature-item:hover { opacity: 1; padding-left: 12px; }
.feature-number { padding-top: 4px; color: var(--blue); font: 11px var(--mono); }
.feature-item:nth-child(2) .feature-number { color: var(--green); }
.feature-item:nth-child(3) .feature-number { color: #b98200; }
.feature-item h3 { margin: 0 0 8px; font-size: 20px; letter-spacing: -.025em; }
.feature-item p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.text-link { align-self: flex-start; margin-top: 28px; color: var(--green); font-weight: 680; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.text-link span { display: inline-block; margin-left: 8px; transition: transform 160ms ease; }.text-link:hover span { transform: translateX(5px); }
.spatial-diagram { position: relative; min-height: 570px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.spatial-diagram svg { width: 100%; height: 100%; min-height: 570px; }
.topo-light path { fill: none; stroke: #dce9e5; stroke-width: 1.4; }
.diagram-area { fill: rgba(74, 144, 164, 0.08); stroke: var(--blue); stroke-width: 2.5; stroke-dasharray: 8 7; }
.diagram-radius circle:not(.diagram-origin) { fill: var(--blue); }.diagram-origin { fill: var(--blue); stroke: var(--white); stroke-width: 4; }
.diagram-measure { stroke: var(--blue); stroke-width: 1.5; }
.diagram-polygon .diagram-area { fill: rgba(45, 90, 39, 0.08); stroke: var(--green); stroke-dasharray: none; }
.diagram-polygon circle { fill: var(--green); }
.latest-path { fill: none; stroke: #c99108; stroke-width: 3; stroke-dasharray: 8 8; }.diagram-latest circle { fill: var(--gold); }.diagram-latest .latest-ring { fill: rgba(232, 184, 74, 0.12); stroke: var(--gold); stroke-width: 3; }
.spatial-diagram text { fill: var(--muted); font: 600 11px var(--mono); letter-spacing: .15em; }

.architecture { color: var(--white); background: var(--navy); overflow: hidden; }
.architecture-grid { display: grid; grid-template-columns: 0.72fr 1.28fr; gap: 100px; align-items: center; }
.architecture-copy h2 span { color: var(--green-bright); }
.architecture-copy > p { max-width: 570px; margin: 32px 0 0; color: #bdccd5; font-size: 19px; line-height: 1.65; }
.architecture-copy .boundary-note { padding-left: 18px; border-left: 2px solid var(--gold); color: #8fa5b3; font-size: 13px; }
.architecture-flow { display: grid; grid-template-columns: 1fr 42px 1fr 42px 1fr 42px 1.16fr; align-items: center; }
.flow-node { min-height: 218px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 12px; text-align: center; border: 1px solid rgba(112, 162, 180, 0.27); border-radius: var(--radius); background: rgba(12, 38, 59, 0.72); }
.flow-node strong { margin-top: 22px; font-size: 15px; line-height: 1.3; }.flow-node small { margin-top: 7px; color: #91a8b7; font-size: 11px; line-height: 1.4; }
.flow-line { height: 1px; background: var(--blue); position: relative; }.flow-line::after { content: ""; position: absolute; right: -1px; top: -3px; border: 4px solid transparent; border-left-color: var(--blue); }
.node-glyph { display: grid; place-items: center; width: 60px; height: 60px; color: var(--blue-bright); font: 42px/1 var(--mono); }
.s2-glyph { border: 1px solid var(--gold); border-radius: 50%; background-image: linear-gradient(30deg, transparent 45%, var(--gold) 46% 48%, transparent 49%), linear-gradient(90deg, transparent 45%, var(--gold) 46% 48%, transparent 49%), linear-gradient(150deg, transparent 45%, var(--gold) 46% 48%, transparent 49%); }
.lsm-glyph { gap: 6px; }.lsm-glyph i { display: block; width: 54px; height: 10px; border: 1px solid var(--blue-bright); border-radius: 4px; }
.vsr-glyph { position: relative; }.vsr-glyph i { position: absolute; width: 18px; height: 18px; border: 2px solid var(--green-bright); border-radius: 50%; }.vsr-glyph i:nth-child(1) { top: 2px; left: 21px; }.vsr-glyph i:nth-child(2) { left: 3px; bottom: 5px; }.vsr-glyph i:nth-child(3) { right: 3px; bottom: 5px; }
.sdk-rail { display: grid; grid-template-columns: 1.3fr repeat(5, 1fr); margin-top: 88px; border-top: 1px solid var(--line-dark); border-bottom: 1px solid var(--line-dark); }
.sdk-rail > * { padding: 23px 18px; border-left: 1px solid var(--line-dark); text-align: center; }.sdk-rail > :first-child { border-left: 0; color: #8da2b0; text-align: left; font: 11px var(--mono); letter-spacing: .13em; text-transform: uppercase; }.sdk-rail strong { font-size: 15px; }

.start { color: var(--white); background: #041526; }
.start-grid { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: 90px; align-items: center; }
.start-copy > p { max-width: 500px; margin: 27px 0 0; color: #a9bdc8; font-size: 18px; line-height: 1.6; }
.start-actions { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 35px; }
.button-gold { color: #141b1f; background: var(--gold); }.button-gold:hover { background: #f1c660; }
.button-dark-outline { color: var(--white); border-color: rgba(255, 255, 255, 0.34); }.button-dark-outline:hover { border-color: var(--white); background: rgba(255, 255, 255, .05); }
.terminal { border: 1px solid rgba(121, 169, 186, 0.28); border-radius: var(--radius); overflow: hidden; background: #071b2d; box-shadow: 0 30px 80px rgba(0, 0, 0, .28); }
.terminal-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 52px; padding: 0 15px; border-bottom: 1px solid rgba(121, 169, 186, .18); color: #8ba4b3; font: 11px var(--mono); }
.terminal-dots { display: flex; gap: 7px; }.terminal-dots i { width: 10px; height: 10px; border-radius: 50%; background: #eb6659; }.terminal-dots i:nth-child(2) { background: var(--gold); }.terminal-dots i:nth-child(3) { background: var(--green-bright); }
.terminal-bar button { justify-self: end; display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; color: #cce0e7; border: 1px solid rgba(117, 171, 190, .3); border-radius: 5px; background: rgba(74, 144, 164, .12); cursor: pointer; font-size: 11px; }
.terminal-bar button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.terminal pre { margin: 0; padding: 30px 34px 36px; overflow: auto; color: #d5e8ed; font: 14px/1.75 var(--mono); }.terminal .comment { color: var(--green-bright); }

.site-footer { padding: 55px 0; color: var(--text); background: var(--white); border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: .9fr 1.4fr .7fr; gap: 80px; align-items: center; }
.footer-wordmark { color: var(--green); }.footer-grid p { color: var(--muted); font-size: 12px; line-height: 1.6; }.footer-grid a { text-underline-offset: 3px; }
.attribution { max-width: 610px; }
.footer-grid nav { display: flex; justify-content: flex-end; gap: 22px; font-size: 12px; font-weight: 620; }.footer-grid nav a { text-decoration: none; }

@media (max-width: 1180px) {
  :root { --shell: min(100% - 44px, 1100px); }
  .hero { min-height: auto; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { max-width: 850px; }
  .query-stage { min-height: 620px; }
  .architecture-grid { grid-template-columns: 1fr; gap: 68px; }
  .architecture-copy { max-width: 780px; }
  .start-grid { grid-template-columns: 1fr; gap: 55px; }
  .start-copy { max-width: 760px; }
  .footer-grid { gap: 36px; }
}

@media (max-height: 820px) and (min-width: 1181px) {
  .hero { min-height: 760px; padding-top: 132px; padding-bottom: 58px; }
  .hero-copy h1 { font-size: clamp(62px, 5.15vw, 80px); }
  .hero-copy > p { margin-top: 24px; font-size: 18px; }
  .hero-actions { margin-top: 27px; }
  .query-stage { min-height: 550px; }
}

@media (max-width: 820px) {
  :root { --shell: min(100% - 32px, 760px); }
  .site-header { height: 74px; }
  .menu-toggle { display: grid; gap: 6px; width: 38px; height: 38px; padding: 9px; }
  .menu-toggle span:not(.sr-only) { display: block; height: 1px; background: currentColor; transition: transform 160ms ease; }
  .site-nav { position: absolute; top: 74px; left: 16px; right: 16px; display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 14px; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 24px 60px rgba(7, 23, 41, .18); }
  .site-nav.is-open { display: flex; }.site-nav > a { padding: 13px 12px; }.site-nav > a::after { display: none; }.nav-github { margin-top: 7px; justify-content: center; }
  .hero { padding-top: 136px; }
  .hero-copy h1 { font-size: clamp(52px, 15vw, 78px); }
  .query-stage { min-height: 560px; }
  .map-canvas { inset-bottom: 226px; }
  .query-console { inset-inline: 9px; bottom: 9px; min-height: 223px; }
  .console-content { grid-template-columns: 1fr; }.console-content pre { min-height: 104px; border-right: 0; border-bottom: 1px solid var(--line-dark); }.query-result { min-height: 74px; }
  .section { padding: 92px 0; }
  .section-intro { grid-template-columns: 1fr; gap: 25px; margin-bottom: 54px; }
  .feature-workbench { grid-template-columns: 1fr; gap: 45px; }.spatial-diagram { min-height: 410px; }.spatial-diagram svg { min-height: 410px; }
  .architecture-flow { grid-template-columns: 1fr; gap: 12px; }.flow-node { min-height: 145px; }.flow-line { width: 1px; height: 28px; margin: 0 auto; }.flow-line::after { top: auto; bottom: -3px; right: -3px; transform: rotate(90deg); }
  .sdk-rail { grid-template-columns: repeat(5, 1fr); }.sdk-rail > :first-child { grid-column: 1 / -1; border-bottom: 1px solid var(--line-dark); text-align: center; }.sdk-rail > * { padding-inline: 8px; }
  .footer-grid { grid-template-columns: 1fr; gap: 25px; }.footer-grid nav { justify-content: flex-start; }
}

@media (max-width: 520px) {
  :root { --shell: calc(100% - 24px); }
  .hero { padding: 124px 0 72px; }.hero-copy h1 { max-width: 100%; font-size: clamp(42px, 13.2vw, 53px); overflow-wrap: anywhere; }.hero-copy > p { font-size: 17px; }.hero-actions { align-items: stretch; }.button { flex: 1 1 100%; }
  .query-stage { min-height: 500px; }.map-canvas { inset-bottom: 235px; }.map-label { display: none; }.console-content pre { font-size: 10px; }.query-result { font-size: 10px; }
  .section h2 { font-size: 44px; }.section-intro p { font-size: 17px; }
  .spatial-diagram { min-height: 300px; }.spatial-diagram svg { min-height: 300px; }
  .sdk-rail { grid-template-columns: repeat(2, 1fr); }.sdk-rail > :first-child { grid-column: 1 / -1; }.sdk-rail > :last-child { grid-column: 1 / -1; }
  .terminal pre { padding: 23px 18px 28px; font-size: 10px; }.terminal-bar { grid-template-columns: 1fr 1fr; }.terminal-bar > span:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
