/* ============================================================
   ECOMLINK — shared design system
   Used by the landing page (index.html) and the funnel (book.html).
   Fonts are self-hosted (no requests to Google — GDPR).
   ============================================================ */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.woff2") format("woff2-variations"), url("../fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-var.woff2") format("woff2-variations"), url("../fonts/jetbrains-mono-var.woff2") format("woff2");
  font-weight: 100 800; font-style: normal; font-display: swap;
}

:root {
  /* brand */
  --violet:      #A950FC;
  --violet-600:  #9536EE;
  --violet-700:  #7B22D4;
  --violet-50:   #F8F2FF;
  --violet-100:  #F0E4FF;
  --violet-200:  #E1C8FF;

  /* ink & text */
  --ink:     #0F0B1A;
  --ink-2:   #231D30;
  --text:    #3D3849;
  --muted:   #6C6679;
  --muted-2: #9B96A7;
  --faint:   #C8C4D1;

  /* surfaces */
  --bg:        #FFFFFF;
  --surface:   #F7F6FA;
  --surface-2: #EFEDF4;
  --border:    rgba(23, 14, 46, .08);
  --border-2:  rgba(23, 14, 46, .14);

  /* status */
  --green: #15A04A;  --green-bg: #E8F7EE;
  --amber: #C76A04;  --amber-bg: #FDF2E1;
  --blue:  #2A62E4;  --blue-bg:  #EAF0FE;
  --red:   #D92D3A;  --red-bg:   #FDECEE;

  /* elevation */
  --shadow-xs: 0 1px 2px rgba(18, 10, 38, .06);
  --shadow-sm: 0 1px 2px rgba(18, 10, 38, .05), 0 2px 8px -2px rgba(18, 10, 38, .08);
  --shadow-md: 0 1px 2px rgba(18, 10, 38, .04), 0 10px 28px -10px rgba(18, 10, 38, .16);
  --shadow-lg: 0 2px 4px rgba(18, 10, 38, .04), 0 24px 60px -18px rgba(40, 14, 80, .26);
  --shadow-xl: 0 2px 6px rgba(18, 10, 38, .05), 0 50px 110px -30px rgba(52, 14, 104, .42);

  /* shape & layout */
  --r-xs: 6px;
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --container: 1200px;
  --gutter: 24px;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--violet-200); color: var(--ink); }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 6px; }

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 650;
  letter-spacing: -0.028em;
  line-height: 1.08;
  text-wrap: balance;
}

.i { width: 16px; height: 16px; flex: none; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; transition: top .2s;
}
.skip:focus { top: 16px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
@media (max-width: 640px) { :root { --gutter: 16px; } }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); }
.logo-mk { width: 28px; height: 28px; flex: none; display: block; filter: drop-shadow(0 4px 10px rgba(132, 41, 230, .35)); }
.logo-w { font-size: 21px; font-weight: 700; letter-spacing: -0.05em; line-height: 1; padding-bottom: 2px; }

/* ---------- Eyebrow ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px 5px 10px; border-radius: 999px;
  background: var(--violet-50); color: var(--violet-700);
  font-size: 13px; font-weight: 600; letter-spacing: -0.005em; line-height: 1.4;
  box-shadow: inset 0 0 0 1px rgba(169, 80, 252, .14);
}
.eyebrow .i { width: 14px; height: 14px; }

/* ---------- Buttons ---------- */
.btn {
  --h: 44px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 18px;
  border: 0; border-radius: 11px;
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em; line-height: 1;
  white-space: nowrap; cursor: pointer; user-select: none;
  transition: background-color .2s var(--ease), color .2s, box-shadow .25s var(--ease), transform .2s var(--ease), opacity .2s;
}
.btn .i { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.btn:hover .i-move { transform: translateX(3px); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled], .btn.is-loading { pointer-events: none; }
.btn[disabled] { opacity: .5; }
.btn-sm { --h: 36px; padding: 0 14px; font-size: 14px; border-radius: 9px; }
.btn-lg { --h: 52px; padding: 0 24px; font-size: 16px; border-radius: 13px; }

.btn-primary {
  background: var(--ink); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 1px 2px rgba(15, 11, 26, .3), 0 6px 16px -6px rgba(15, 11, 26, .45);
}
.btn-primary:hover { background: #241c34; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(15, 11, 26, .3), 0 10px 24px -8px rgba(76, 24, 140, .55); }

.btn-violet {
  background: linear-gradient(180deg, #B466FF 0%, #9B3DF2 100%); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(80, 20, 160, .35), 0 8px 20px -8px rgba(149, 54, 238, .7);
}
.btn-violet:hover { filter: brightness(1.05); }

.btn-secondary {
  background: #fff; color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--border-2), 0 1px 2px rgba(18, 10, 38, .05);
}
.btn-secondary:hover { background: var(--surface); }

.btn-white {
  background: #fff; color: var(--ink);
  box-shadow: 0 1px 2px rgba(30, 6, 60, .25), 0 10px 28px -10px rgba(30, 6, 60, .55);
}
.btn-white:hover { background: #FBF8FF; }

.btn-ghost-light {
  background: rgba(255, 255, 255, .1); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .26);
  backdrop-filter: blur(6px);
}
.btn-ghost-light:hover { background: rgba(255, 255, 255, .18); }

.btn-text { background: none; color: var(--muted); padding: 0 10px; }
.btn-text:hover { color: var(--ink); }

/* spinner for loading state */
.btn .spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.is-loading .spin { display: block; }
.btn.is-loading .btn-label, .btn.is-loading .i { opacity: .0; width: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Status pills ---------- */
.st {
  display: inline-flex; align-items: center; gap: 6px;
  font-style: normal; font-size: 11.5px; font-weight: 600; line-height: 1;
  padding: 5px 8px 5px 7px; border-radius: 999px; white-space: nowrap;
}
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-ok      { color: var(--green);  background: var(--green-bg); }
.st-transit { color: var(--violet-700); background: var(--violet-50); }
.st-info    { color: var(--blue);   background: var(--blue-bg); }
.st-warn    { color: var(--amber);  background: var(--amber-bg); }
.st-bad     { color: var(--red);    background: var(--red-bg); }

.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.live-dot::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; background: var(--green); opacity: .35; animation: ping 2s var(--ease) infinite; }
@keyframes ping { 0% { transform: scale(.6); opacity: .45; } 80%, 100% { transform: scale(1.9); opacity: 0; } }

/* ---------- Cookie consent ---------- */
.cc {
  position: fixed; z-index: 90; left: 20px; bottom: 20px;
  width: min(440px, calc(100vw - 24px)); padding: 20px;
  border-radius: 18px; background: #fff; color: var(--text);
  box-shadow: 0 0 0 1px var(--border), 0 24px 60px -16px rgba(30, 10, 60, .35);
}
.cc.cc-in { animation: ccIn .45s var(--ease-out); }
@keyframes ccIn { from { opacity: 0; transform: translateY(12px); } }
.cc-t { display: block; font-size: 15px; color: var(--ink); font-weight: 650; letter-spacing: -0.01em; }
.cc p { margin-top: 6px; font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.cc a { color: var(--violet-700); text-decoration: underline; text-underline-offset: 2px; }
.cc-prefs { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.cc-row { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface); cursor: pointer; }
.cc-row > span:first-child { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cc-row b { font-size: 13.5px; color: var(--ink); font-weight: 600; }
.cc-row small { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.cc-row input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.cc-sw { position: relative; width: 36px; height: 22px; flex: none; border-radius: 22px; background: var(--faint); transition: background-color .2s; }
.cc-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .25s var(--ease-out); }
.cc-row input:checked + .cc-sw { background: var(--violet); }
.cc-row input:checked + .cc-sw::after { transform: translateX(14px); }
.cc-row input:disabled + .cc-sw { opacity: .5; }
.cc-row input:focus-visible + .cc-sw { outline: 2px solid var(--violet); outline-offset: 2px; }
.cc-actions { margin-top: 16px; display: flex; align-items: center; gap: 8px; }
.cc-actions .cc-custom { margin-right: auto; padding: 0 4px; }
@media (max-width: 520px) {
  .cc { left: 12px; right: 12px; bottom: 12px; width: auto; padding: 18px; }
  .cc-actions { flex-wrap: wrap; }
  .cc-actions [data-cc] { flex: 1; }
  .cc-actions .cc-custom { order: 3; width: 100%; margin: 0; }
}
