/* QbitVoice — styles. Tokens are the source of truth; see DESIGN.md. */

@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans-regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans-bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* Brand (from the logo gradient) */
  --navy: #2f5586;
  --teal: #3f84a6;
  --aqua: #62bcc8;

  /* Surfaces and text */
  --bg: #ffffff;
  --bg-tint: #f2f6f8;
  --surface: #ffffff;
  --ink: #0f2133;
  --ink-muted: #4a5b6c;
  --ink-faint: #7a8a99;
  --line: #dce4ea;

  /* Actions */
  --action: #1f3d63;
  --action-hover: #2f5586;
  --action-ink: #ffffff;

  /* Deep band (security) */
  --deep: #0d1f31;
  --deep-ink: #e8eef3;
  --deep-muted: #a3b4c4;
  --deep-line: #23384d;

  --lattice-opacity: 0.55;
  --shadow-card: 0 1px 2px rgba(15, 33, 51, 0.06), 0 12px 32px -8px rgba(31, 61, 99, 0.18);

  /* Type */
  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --step-0: 1.0625rem;                         /* 17px body */
  --step-1: 1.25rem;                           /* 20px lead, h3 */
  --step-2: clamp(1.875rem, 1.4rem + 2vw, 2.75rem);   /* h2 */
  --step-3: clamp(2.5rem, 1.6rem + 4vw, 4.5rem);      /* h1 */

  /* Space */
  --wrap: 1180px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section: clamp(4.5rem, 9vw, 8rem);
  --radius-btn: 999px;
  --radius-card: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b1826;
    --bg-tint: #0f2032;
    --surface: #12263a;
    --ink: #e8eef3;
    --ink-muted: #a3b4c4;
    --ink-faint: #7f93a6;
    --line: #22384d;
    --action: #62bcc8;
    --action-hover: #86cfd8;
    --action-ink: #0b1826;
    --deep: #071220;
    --deep-ink: #e8eef3;
    --deep-muted: #a3b4c4;
    --deep-line: #1c3145;
    --lattice-opacity: 0.5;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -12px rgba(0, 0, 0, 0.55);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }

h1, h2 { font-weight: 400; color: var(--ink); text-wrap: balance; }
h1 { font-size: var(--step-3); line-height: 1.04; letter-spacing: -0.03em; }
h2 { font-size: var(--step-2); line-height: 1.1; letter-spacing: -0.022em; }
h3 { font-size: var(--step-1); font-weight: 400; line-height: 1.3; letter-spacing: -0.01em; text-wrap: balance; }
.nowrap { white-space: nowrap; }
p { text-wrap: pretty; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--action); color: var(--action-ink);
  padding: 0.5rem 1rem; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: 1rem; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }

/* Buttons and links */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0 1.5rem;
  border-radius: var(--radius-btn);
  font: inherit; font-size: 1rem; line-height: 1; text-decoration: none;
  transition: background-color 0.15s ease;
}
.btn-primary { background: var(--action); color: var(--action-ink); }
.btn-primary:hover { background: var(--action-hover); }
.btn-small { min-height: 2.5rem; padding: 0 1.125rem; font-size: 0.9375rem; }
.text-link {
  color: var(--ink-muted); text-decoration: underline;
  text-decoration-color: var(--line); text-underline-offset: 0.25em;
  font-size: 1rem;
}
.text-link:hover { color: var(--ink); text-decoration-color: currentColor; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 2.25rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 4.5rem; }
.brand {
  display: inline-flex; align-items: center; gap: 0.625rem;
  text-decoration: none; font-weight: 700; font-size: 1.1875rem; letter-spacing: -0.015em;
}
.nav nav { display: flex; align-items: center; gap: 2rem; }
.nav-link { text-decoration: none; color: var(--ink-muted); font-size: 0.9375rem; }
.nav-link:hover { color: var(--ink); }

/* Hero */
.hero { padding-block: clamp(3rem, 7vw, 6.5rem) clamp(4rem, 8vw, 7rem); overflow: hidden; }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2.5rem, 5vw, 5rem); align-items: center;
}
.hero-copy h1 { max-width: 13ch; }
.lead { font-size: var(--step-1); line-height: 1.5; color: var(--ink-muted); max-width: 34rem; margin-top: 1.75rem; }

.hero-visual { position: relative; display: grid; place-items: center; min-height: 30rem; }
.lattice {
  position: absolute; width: 150%; max-width: none; aspect-ratio: 1;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  opacity: var(--lattice-opacity); pointer-events: none; user-select: none;
}

/* Conversation card */
.call {
  position: relative; width: 100%; max-width: 27rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card);
  padding: 1.25rem 1.375rem 1.125rem;
}
.call-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.875rem; color: var(--ink-muted);
  padding-bottom: 1rem; border-bottom: 1px solid var(--line);
}
.call-status { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink); }
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--teal) 45%, transparent);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--teal) 45%, transparent); }
  70%, 100% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--teal) 0%, transparent); }
}
.call-meta { display: inline-flex; align-items: center; gap: 0.75rem; }
.call-lang {
  padding: 0.1875rem 0.625rem; border-radius: 999px;
  background: var(--bg-tint); color: var(--ink);
  transition: opacity 0.3s ease;
}
.call-time { font-variant-numeric: tabular-nums; min-width: 2.5em; text-align: right; }

.call-body { display: grid; gap: 1.125rem; padding-block: 1.25rem; min-height: 14.75rem; align-content: start; }
.turn { display: grid; gap: 0.25rem; transition: opacity 0.35s ease; }
.who { font-size: 0.8125rem; color: var(--ink-faint); }
.said { font-size: 1.0625rem; line-height: 1.45; }
.turn-caller .said { color: var(--ink-muted); }
.turn-agent .said { color: var(--ink); }
.said .w { opacity: 0; transition: opacity 0.18s ease; }
.said .w.on { opacity: 1; }

.call-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-top: 1rem; border-top: 1px solid var(--line);
}
.wave { display: inline-flex; align-items: center; gap: 3px; height: 1.5rem; }
.wave i {
  display: block; width: 3px; height: 4px; border-radius: 2px;
  background: var(--line); transition: height 0.12s ease, background-color 0.2s ease;
}
.wave.caller i { background: var(--ink-faint); }
.wave.agent i { background: var(--teal); }
.reply-time { font-size: 0.8125rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; transition: opacity 0.3s ease; }

/* Product */
.product { padding-block: var(--section); border-top: 1px solid var(--line); }
.product h2 { max-width: 18ch; }
.points {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 3.5rem); margin-top: clamp(2.5rem, 5vw, 4rem);
}
.point { padding-top: 1.5rem; border-top: 1px solid var(--ink); }
.point p { color: var(--ink-muted); margin-top: 0.75rem; max-width: 36ch; }

/* Security */
.security { background: var(--deep); color: var(--deep-ink); padding-block: var(--section); }
.security h2, .security h3 { color: var(--deep-ink); }
.security-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2.5rem, 6vw, 6rem); }
.security-intro p { color: var(--deep-muted); margin-top: 1.25rem; max-width: 30rem; font-size: var(--step-1); line-height: 1.5; }
.assurances { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 3rem; align-content: start; }
.assurances li { padding-top: 1.25rem; border-top: 1px solid var(--deep-line); }
.assurances p { color: var(--deep-muted); margin-top: 0.5rem; }

/* Closing */
.closing { padding-block: var(--section); }
.closing-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(2.5rem, 6vw, 6rem); align-items: start; }
.steps { counter-reset: step; display: grid; gap: 1.75rem; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 2.5rem 1fr; column-gap: 1rem;
  padding-top: 1.25rem; border-top: 1px solid var(--line);
}
.steps li::before {
  content: counter(step); grid-row: span 2;
  font-size: var(--step-1); line-height: 1.3; color: var(--teal); font-variant-numeric: tabular-nums;
}
.steps p { color: var(--ink-muted); margin-top: 0.25rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 2.5rem; font-size: 0.9375rem; }
.footer-grid { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1.25rem 2rem; }
.site-footer .brand { font-size: 1.0625rem; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem 1.75rem; }
.footer-links a { color: var(--ink-muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }
.legal { grid-column: 1 / -1; color: var(--ink-faint); font-size: 0.875rem; }

/* Legal pages */
.doc { padding-block: clamp(3rem, 7vw, 5.5rem) var(--section); }
.doc .wrap { max-width: 50rem; }
.doc h1 { font-size: clamp(2.25rem, 1.6rem + 3vw, 3.5rem); }
.doc .updated { color: var(--ink-faint); margin-top: 1rem; }
.doc h2 { font-size: 1.5rem; margin-top: 3rem; letter-spacing: -0.015em; }
.doc p, .doc ul { margin-top: 1rem; color: var(--ink-muted); max-width: 68ch; }
.doc ul { list-style: disc; padding-left: 1.25rem; }
.doc li + li { margin-top: 0.5rem; }
.doc a { color: var(--ink); text-underline-offset: 0.2em; }
.doc .summary {
  margin-top: 2.5rem; padding: 1.5rem 1.75rem; border-radius: 14px;
  background: var(--bg-tint); color: var(--ink);
}

/* Not found */
.not-found { min-height: 60vh; display: grid; align-content: center; padding-block: var(--section); }
.not-found p { color: var(--ink-muted); margin-top: 1rem; font-size: var(--step-1); }

/* Responsive */
@media (max-width: 960px) {
  .hero-grid, .security-grid, .closing-grid { grid-template-columns: 1fr; }
  .hero-copy h1 { max-width: 16ch; }
  .hero-visual { min-height: 0; padding-block: 2rem; }
  .lattice { width: 120%; }
  .points { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-link { display: none; }
  .assurances { grid-template-columns: 1fr; gap: 2rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
  .call { padding: 1.125rem 1.125rem 1rem; }
  .call-body { min-height: 16.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse { animation: none; }
  *, *::before, *::after { transition: none !important; }
}
[data-direction] { transition: opacity 0.3s ease; }
