/* Karavar website — the landing page served at `/` by the karavar-site
   module (core seam F). The visual system is one idea: Karavar's mark, a
   ring, in one colour, cobalt #3366cc. Everything else is a step on the
   same blue scale; the only other hues are status colours.

   Type is Archivo (variable, self-hosted, OFL): expanded and heavy for
   headings, normal width for reading. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("/modules/karavar-site/fonts/archivo-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: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("/modules/karavar-site/fonts/archivo-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --cobalt: #3366cc;        /* the brand colour, compiled into every client */
  --cobalt-deep: #24499a;
  --field: #3366cc;         /* the hero */
  --paper: #f5f7fc;
  --surface: #ffffff;
  --tint: #e9eefa;
  --ink: #0f1830;
  --slate: #55607a;
  --mist: #d7dff0;
  --link: #2a55b0;
  --night: #0a1124;
  --online: #1f9d55;
  --online-on-field: #7ee2a8;

  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --field: #234a9c; --paper: #0a1124; --surface: #101a33; --tint: #14214a;
    --ink: #e7ecf8; --slate: #9aa6c2; --mist: #22305a; --link: #9bb8f5;
    --night: #060b19; --online: #4ccf86;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --field: #234a9c; --paper: #0a1124; --surface: #101a33; --tint: #14214a;
  --ink: #e7ecf8; --slate: #9aa6c2; --mist: #22305a; --link: #9bb8f5;
  --night: #060b19; --online: #4ccf86;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.6;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 4px; }
.hero :focus-visible, .footer :focus-visible { outline-color: #fff; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: #fff; color: var(--ink); padding: 10px 16px; border-radius: 999px;
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

h1, h2, h3 { font-family: var(--sans); margin: 0; text-wrap: balance; }
h1 {
  font-size: clamp(2.3rem, 1.45rem + 3.4vw, 4.1rem);
  font-stretch: 118%; font-weight: 780; line-height: 1.03; letter-spacing: -0.025em;
}
h2 {
  font-size: clamp(1.75rem, 1.25rem + 1.9vw, 2.65rem);
  font-stretch: 115%; font-weight: 740; line-height: 1.08; letter-spacing: -0.018em;
}
h3 { font-size: 1.125rem; font-stretch: 106%; font-weight: 660; line-height: 1.3; letter-spacing: -0.005em; }
p { margin: 0; }

/* ---- buttons: pills, the ring's shape ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.4em; border-radius: 999px;
  font: inherit; font-weight: 640; font-stretch: 104%; line-height: 1; text-decoration: none;
  border: 2px solid transparent; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-light { background: #fff; color: var(--cobalt-deep); }
.btn-light:hover { background: #e6edfb; }
.btn-outline-light { color: #fff; border-color: rgba(255,255,255,.7); }
.btn-outline-light:hover { border-color: #fff; background: rgba(255,255,255,.1); }
.btn-primary { background: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-deep); }

/* ---- hero: the cobalt field and the ring ---- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--field); color: #fff;
}
.masthead { position: relative; z-index: 2; }
.masthead-row { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  color: inherit; text-decoration: none;
  font-size: 1.3rem; font-stretch: 125%; font-weight: 800; letter-spacing: -0.01em;
}
.wordmark .mark { width: 28px; height: 28px; }
.topnav { margin-left: auto; display: flex; align-items: center; gap: clamp(14px, 2.4vw, 30px); }
.topnav a { color: #fff; text-decoration: none; font-weight: 560; opacity: .9; }
.topnav a:hover { opacity: 1; text-decoration: underline; }
.topnav .signin {
  opacity: 1; padding: 9px 18px; border-radius: 999px; border: 2px solid rgba(255,255,255,.7);
}
.topnav .signin:hover { text-decoration: none; border-color: #fff; background: rgba(255,255,255,.1); }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; padding: 9px;
  background: transparent; border: 0; color: #fff; cursor: pointer; opacity: .85;
}
.theme-toggle:hover { opacity: 1; background: rgba(255,255,255,.12); }
.theme-toggle svg { width: 22px; height: 22px; }

.hero-body { position: relative; z-index: 1; display: grid; padding-top: clamp(28px, 7vh, 88px); padding-bottom: clamp(56px, 11vh, 128px); }
.hero-copy { max-width: 43rem; }
.hero-copy h1 { margin-bottom: 26px; }
.lead { font-size: clamp(1.08rem, 1rem + .35vw, 1.25rem); line-height: 1.55; color: rgba(255,255,255,.92); max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-note { margin-top: 22px; font-size: .95rem; color: rgba(255,255,255,.82); max-width: 40em; text-wrap: pretty; }

/* The ring is Karavar's mark at architectural scale: the thick band is the
   logo, the thin line is the orbit the devices sit on. */
.orbit { margin: 0; position: relative; aspect-ratio: 1; pointer-events: none; }
.orbit-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.orbit-track { fill: none; stroke: rgba(255,255,255,.11); stroke-width: 196; }
.orbit-draw {
  fill: none; stroke: rgba(255,255,255,.9); stroke-width: 2.5; vector-effect: non-scaling-stroke;
  stroke-dasharray: 100; stroke-dashoffset: 0;
}
.node {
  position: absolute; left: var(--x); top: var(--y);
  transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px 9px 11px; border-radius: 999px;
  background: #fff; color: #0f1830; white-space: nowrap;
  box-shadow: 0 10px 30px -8px rgba(6, 14, 40, .45);
  pointer-events: auto;
}
.node svg {
  width: 30px; height: 30px; padding: 5px; border-radius: 50%; flex: none;
  background: #e9eefa; stroke: #3366cc; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.node > span { display: flex; flex-direction: column; line-height: 1.15; }
.node b { font-weight: 650; font-stretch: 104%; font-size: .95rem; }
.node i { font-style: normal; font-size: .8rem; color: #3f4a63; display: inline-flex; align-items: center; gap: 6px; }
.node i::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--online); box-shadow: 0 0 0 3px rgba(31,157,85,.16); }

/* Small screens: the whole ring sits under the copy. */
.orbit { width: min(100%, 480px); margin: 40px auto 0; }
@media (max-width: 1179px) { .hero-body { padding-bottom: 48px; } }
.node[data-pos="a"] { --x: 28.1%; --y: 18.7%; }   /* 235deg */
.node[data-pos="b"] { --x: 71.9%; --y: 18.7%; }   /* 305deg */
.node[data-pos="c"] { --x: 71.9%; --y: 81.3%; }   /* 55deg */
.node[data-pos="d"] { --x: 28.1%; --y: 81.3%; }   /* 125deg */

/* Wide screens: the ring grows past the right edge of the field, and the
   devices sit on its visible arc. The hero is the positioning context. */
@media (min-width: 1180px) {
  .hero-body { position: static; min-height: min(760px, calc(100vh - 76px)); align-items: center; }
  .hero-copy { position: relative; z-index: 1; }
  .orbit {
    --size: clamp(720px, 62vw, 960px);
    position: absolute; z-index: 0; margin: 0; width: var(--size);
    right: calc(var(--size) * -0.36); top: calc(50% + 38px);
    transform: translateY(-50%);
  }
  .node[data-pos="a"] { --x: 29.8%; --y: 17.6%; }
  .node[data-pos="b"] { --x: 14.8%; --y: 35.1%; }
  .node[data-pos="c"] { --x: 12.6%; --y: 57.9%; }
  .node[data-pos="d"] { --x: 25.4%; --y: 79.3%; }
}

/* The one orchestrated moment: the orbit draws, the devices arrive. */
@media (prefers-reduced-motion: no-preference) {
  .orbit-draw { stroke-dashoffset: 100; animation: orbit-draw 1.5s cubic-bezier(.6,.05,.25,1) .15s forwards; }
  .node { opacity: 0; animation: node-in .5s cubic-bezier(.2,.7,.3,1) forwards; animation-delay: calc(.9s + var(--i) * .14s); }
}
@keyframes orbit-draw { to { stroke-dashoffset: 0; } }
@keyframes node-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.85); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ---- features ---- */
.features { padding: clamp(72px, 10vw, 136px) 0; }
.features-grid { display: grid; gap: 40px; }
.features-intro h2 { margin-bottom: 18px; }
.features-intro p { color: var(--slate); max-width: 30em; }
.capabilities { margin: 0; display: grid; }
.cap { padding: 26px 0 28px; border-top: 1px solid var(--mist); display: grid; gap: 8px; }
.cap:last-child { border-bottom: 1px solid var(--mist); }
.cap dt {
  display: flex; align-items: center; gap: 14px;
  font-size: 1.2rem; font-stretch: 108%; font-weight: 680; letter-spacing: -0.008em;
}
.cap-mark { width: 18px; height: 18px; border-radius: 50%; border: 4.5px solid var(--cobalt); flex: none; }
:root[data-theme="dark"] .cap-mark { border-color: var(--link); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cap-mark { border-color: var(--link); } }
.cap dd { margin: 0 0 0 32px; color: var(--slate); max-width: 38em; }
@media (min-width: 900px) {
  .features-grid { grid-template-columns: 5fr 7fr; gap: 72px; align-items: start; }
  .features-intro { position: sticky; top: 40px; }
}

/* ---- steps: a real sequence, so they are numbered, on one line ---- */
.steps { padding: clamp(64px, 9vw, 112px) 0; background: var(--tint); }
.steps h2 { margin-bottom: 48px; max-width: 18em; }
.step-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 36px; counter-reset: step; position: relative; }
.step-list li { counter-increment: step; position: relative; padding-left: 76px; }
.step-list li::before {
  content: counter(step);
  position: absolute; left: 0; top: -6px;
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  border: 6px solid var(--cobalt); background: var(--tint);
  font-size: 1.15rem; font-stretch: 120%; font-weight: 800; color: var(--ink);
}
.step-list h3 { margin-bottom: 6px; }
.step-list p { color: var(--slate); max-width: 26em; }
@media (min-width: 860px) {
  .step-list { grid-template-columns: repeat(3, 1fr); gap: 40px; }
  .step-list::before {
    content: ""; position: absolute; left: 26px; top: 20px; height: 2px;
    width: calc((100% - 80px) / 3 * 2 + 80px);
    background: var(--cobalt); opacity: .35;
  }
  .step-list li { padding-left: 0; padding-top: 76px; }
  .step-list li::before { top: -6px; }
}

/* ---- download ---- */
.download { padding: clamp(72px, 10vw, 136px) 0; }
.download-head { display: grid; gap: 14px; margin-bottom: 44px; }
.download-head p { color: var(--slate); max-width: 34em; }
.platforms {
  display: grid; gap: 1px; background: var(--mist);
  border: 1px solid var(--mist); border-radius: 18px; overflow: hidden;
}
.platform { background: var(--surface); padding: clamp(22px, 3vw, 34px); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.platform header { display: grid; gap: 6px; margin-bottom: 6px; }
.platform h3 { font-size: 1.45rem; font-stretch: 116%; font-weight: 760; }
.req { color: var(--slate); font-size: .98rem; }
.how { font-weight: 600; font-size: .95rem; }
.fine { color: var(--slate); font-size: .92rem; }
.alt { font-size: .95rem; color: var(--slate); }
.cmd {
  display: flex; align-items: stretch; min-width: 0;
  border-radius: 12px; background: var(--tint); border: 1px solid var(--mist);
}
.cmd code {
  flex: 1; min-width: 0; padding: 13px 14px; overflow-wrap: anywhere;
  font-family: var(--mono); font-size: .86rem; color: var(--ink);
}
.copy {
  flex: none; border: 0; border-left: 1px solid var(--mist); background: transparent;
  padding: 0 16px; border-radius: 0 12px 12px 0;
  font: inherit; font-size: .9rem; font-weight: 620; color: var(--link); cursor: pointer;
}
.copy:hover { background: rgba(51,102,204,.08); }
code.inline { font-family: var(--mono); font-size: .82rem; overflow-wrap: anywhere; }
.android-row { display: flex; gap: 22px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.android-links { display: grid; gap: 10px; justify-items: start; flex: 1 1 220px; }
.qr { display: none; }
@media (min-width: 720px) {
  .platforms { grid-template-columns: 1fr 1fr; }
  .qr {
    display: block; width: 128px; height: 128px; padding: 8px; flex: none;
    background: #fff; border-radius: 12px; border: 1px solid var(--mist);
  }
  .qr img, .qr canvas { width: 100% !important; height: 100% !important; }
}

/* ---- contact ---- */
.contact { padding: 0 0 clamp(72px, 10vw, 120px); }
.contact-row {
  display: grid; gap: 12px; padding-top: 44px; border-top: 1px solid var(--mist);
}
.contact h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); }
.contact p { color: var(--slate); font-size: 1.1rem; }
@media (min-width: 900px) {
  .contact-row { grid-template-columns: 1fr auto; align-items: baseline; gap: 40px; }
}

/* ---- footer ---- */
.footer { background: var(--night); color: #dbe3f6; padding: 40px 0 48px; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 32px; }
.footer .wordmark { color: #fff; font-size: 1.15rem; }
.footer .wordmark .mark { width: 24px; height: 24px; color: #6f95e6; }
.footnav { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.footnav a { color: #dbe3f6; text-decoration: none; font-size: .95rem; }
.footnav a:hover { color: #fff; text-decoration: underline; }
.copyright { margin-left: auto; color: #95a2c2; font-size: .9rem; }
@media (max-width: 720px) {
  .copyright { margin-left: 0; width: 100%; }
}

@media (max-width: 560px) {
  .topnav .hide-sm { display: none; }
  .node .long { display: none; }
  .node { padding: 7px 12px 7px 8px; gap: 8px; }
  .node svg { width: 26px; height: 26px; padding: 4px; }
  .node b { font-size: .86rem; }
}
