/* ==========================================================================
   EveryBox design system — shared by everybox.io and dev.everybox.io
   Brand: lime #C6FF3D, blue #4F8BFF, violet #9B6BFF (from the cube logo).
   Two schemes: dark (default) and light, by system setting or the nav toggle.
   ========================================================================== */

:root {
  --lime: #c6ff3d;
  --lime-rgb: 198, 255, 61;
  --blue: #4f8bff;
  --blue-rgb: 79, 139, 255;
  --violet: #9b6bff;
  --violet-rgb: 155, 107, 255;
  --ink-on-lime: #0b1000;
  --brand-grad: linear-gradient(100deg, var(--lime) 0%, #7aa2ff 55%, var(--violet) 100%);

  /* dark scheme */
  --bg: #07070a;
  --bg-rgb: 7, 7, 10;
  --fg-rgb: 255, 255, 255;
  --surface: #0e0e13;
  --surface-2: #17171e;
  --line: rgba(var(--fg-rgb), 0.08);
  --line-2: rgba(var(--fg-rgb), 0.15);
  --text: #f4f4f1;
  --muted: #a4a4ae;
  --dim: #6d6d78;
  --accent: var(--lime);            /* accent for text and thin marks */
  --accent-rgb: var(--lime-rgb);
  --text-grad: var(--brand-grad);
  --shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.9);

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --radius: 22px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1200px;
  color-scheme: dark;
}

/* light scheme: by system preference unless the visitor chose dark, or chosen explicitly */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f7f7f3;
    --bg-rgb: 247, 247, 243;
    --fg-rgb: 11, 11, 16;
    --surface: #ffffff;
    --surface-2: #efefea;
    --text: #0b0b10;
    --muted: #55555f;
    --dim: #8b8b94;
    --accent: #6a3dff;
    --accent-rgb: 106, 61, 255;
    --text-grad: linear-gradient(100deg, #2f6bff 0%, #6a3dff 100%);
    --shadow: 0 40px 80px -40px rgba(30, 30, 60, 0.35);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f7f7f3;
  --bg-rgb: 247, 247, 243;
  --fg-rgb: 11, 11, 16;
  --surface: #ffffff;
  --surface-2: #efefea;
  --text: #0b0b10;
  --muted: #55555f;
  --dim: #8b8b94;
  --accent: #6a3dff;
  --accent-rgb: 106, 61, 255;
  --text-grad: linear-gradient(100deg, #2f6bff 0%, #6a3dff 100%);
  --shadow: 0 40px 80px -40px rgba(30, 30, 60, 0.35);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.55 var(--font); letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  transition: background-color .4s, color .4s;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 500; letter-spacing: -0.035em; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: var(--mono); font-size: .88em; letter-spacing: 0; }
::selection { background: var(--lime); color: var(--ink-on-lime); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--lime); color: var(--ink-on-lime); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Type ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--brand-grad); }
.h2 { font-size: clamp(38px, 5.4vw, 76px); line-height: 1; letter-spacing: -0.045em; }
h1 em, .h2 em, .final-title em, .grad {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  background: var(--text-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: .06em;
}
.lede { color: var(--muted); font-size: clamp(16px, 1.3vw, 19px); line-height: 1.55; max-width: 580px; }
.kicker { font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin-bottom: 18px; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 500 15px/1 var(--font); letter-spacing: -0.01em; padding: 13px 20px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap; overflow: hidden; isolation: isolate;
  transition: transform .5s var(--ease), background-color .3s, border-color .3s, color .3s, box-shadow .4s;
}
.btn:active { transform: scale(.97); }
.btn .arr { display: inline-block; transition: transform .5s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-sm { padding: 10px 16px; font-size: 14px; }
.btn-lg { padding: 17px 26px; font-size: 16px; }
.btn-primary { background: var(--lime); color: var(--ink-on-lime); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.btn-primary:hover { box-shadow: 0 12px 36px -10px rgba(var(--blue-rgb), .55), inset 0 0 0 1px rgba(0, 0, 0, .06); }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .6) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .9s var(--ease);
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-ghost, .btn-glass { color: var(--text); border-color: var(--line-2); background: rgba(var(--fg-rgb), .03); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.btn-ghost:hover, .btn-glass:hover { border-color: rgba(var(--fg-rgb), .3); background: rgba(var(--fg-rgb), .07); }
.live:not(.badge), .live-dot, .pulse-dot, .pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); flex: none; display: inline-block; box-shadow: 0 0 0 0 rgba(var(--lime-rgb), .6); animation: ping 2s infinite; }
@keyframes ping { 70%, 100% { box-shadow: 0 0 0 9px rgba(var(--lime-rgb), 0); } }
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 12px; border-radius: 999px; font-size: 13px; color: var(--muted); border: 1px solid var(--line-2); background: rgba(var(--fg-rgb), .03); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; z-index: 60; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 16px var(--gutter);
  transition: background-color .4s, border-color .4s, padding .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgba(var(--bg-rgb), .7); border-color: var(--line); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 30px; height: 30px; transition: transform .7s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-word { font: 600 20px/1 var(--font); letter-spacing: -0.05em; }
.nav-links { display: flex; gap: 2px; padding: 4px; border-radius: 999px; border: 1px solid var(--line); background: rgba(var(--fg-rgb), .02); }
.nav-links a { color: var(--muted); font-size: 14px; padding: 7px 14px; border-radius: 999px; transition: color .25s, background-color .25s; }
.nav-links a:hover { color: var(--text); background: rgba(var(--fg-rgb), .07); }
.nav-cta { display: flex; gap: 8px; align-items: center; }
.nav-right { display: flex; gap: 8px; align-items: center; }
.theme-toggle {
  position: relative; width: 40px; height: 40px; border-radius: 50%; flex: none; cursor: pointer;
  border: 1px solid var(--line-2); background: rgba(var(--fg-rgb), .03); color: var(--text);
  display: grid; place-items: center; transition: border-color .3s, background-color .3s;
}
.theme-toggle:hover { border-color: rgba(var(--fg-rgb), .3); }
.theme-toggle svg { position: absolute; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; transition: transform .6s var(--ease), opacity .4s; }
.theme-toggle .sun { opacity: 0; transform: rotate(-90deg) scale(.5); }
.theme-toggle[data-mode="light"] .sun { opacity: 1; transform: none; }
.theme-toggle[data-mode="light"] .moon { opacity: 0; transform: rotate(90deg) scale(.5); }
.nav-toggle { display: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(var(--fg-rgb), .03); cursor: pointer; position: relative; }
.nav-toggle span { position: absolute; left: 12px; right: 12px; height: 1.5px; background: var(--text); transition: transform .4s var(--ease); }
.nav-toggle span:first-child { top: 16px; } .nav-toggle span:last-child { top: 23px; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
.mobile-menu { position: fixed; z-index: 59; inset: 0; padding: 96px var(--gutter) 32px; background: rgba(var(--bg-rgb), .97); backdrop-filter: blur(20px); display: flex; flex-direction: column; gap: 4px; }
.mobile-menu[hidden] { display: none; }
.mobile-menu a:not(.btn) { font-size: 32px; letter-spacing: -0.04em; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mobile-menu .btn { margin-top: 24px; }

/* ---------- Checkbox ---------- */
.cb {
  position: relative; width: 22px; height: 22px; border-radius: 7px; flex: none;
  border: 1.5px solid var(--line-2);
  transition: background-color .4s var(--ease), border-color .4s, box-shadow .5s, transform .5s var(--ease);
}
.cb::after {
  content: ""; position: absolute; left: 50%; top: 45%; width: 5.5px; height: 10px;
  border: solid var(--ink-on-lime); border-width: 0 2.2px 2.2px 0;
  transform: translate(-50%, -50%) rotate(45deg) scale(0);
  transition: transform .45s .05s cubic-bezier(.34, 1.8, .64, 1);
}
.done > .cb, .on > .cb, .checked > .cb, .cb.checked-static {
  background: var(--lime); border-color: var(--lime);
  box-shadow: 0 0 0 4px rgba(var(--lime-rgb), .14), 0 0 20px rgba(var(--lime-rgb), .4);
}
.done > .cb::after, .on > .cb::after, .checked > .cb::after, .cb.checked-static::after { transform: translate(-50%, -50%) rotate(45deg) scale(1); }
.active > .cb { border-color: var(--accent); animation: cbPulse 1s ease-in-out infinite; }
@keyframes cbPulse { 50% { box-shadow: 0 0 0 5px rgba(var(--accent-rgb), .18); } }

/* ---------- Badges ---------- */
.badge { display: inline-block; font: 500 10.5px/1 var(--mono); letter-spacing: .1em; padding: 5px 8px; border-radius: 6px; color: var(--muted); border: 1px solid var(--line-2); text-align: center; flex: none; }
.badge.live { color: var(--ink-on-lime); background: var(--lime); border-color: var(--lime); }
.badge.beta { color: #fff; background: var(--blue); border-color: var(--blue); }
.badge.soon { color: #fff; background: var(--violet); border-color: var(--violet); }

/* ---------- Panes / code ---------- */
.pane { position: relative; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; }
.pane-head { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); color: var(--dim); }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(var(--fg-rgb), .14); }
.code { margin: 0; padding: 18px 20px; font: 400 13px/1.75 var(--mono); color: var(--muted); white-space: pre-wrap; word-break: break-word; }
.code .h { color: var(--text); font-weight: 500; }
.code .k { color: var(--blue); }
.code .s { color: var(--accent); }
.code .c { color: var(--dim); }
.code .typing::after { content: ""; display: inline-block; width: 7px; height: 1.1em; vertical-align: -3px; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center; padding: 10px 6px; color: var(--dim); transition: color .4s; }
.checklist li.done { color: var(--text); }
@keyframes logIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Ambient glow ---------- */
.aurora { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(90px); }
.aurora i:nth-child(1) { width: 50vw; height: 50vw; left: -10vw; top: -25vw; background: rgba(var(--lime-rgb), .12); }
.aurora i:nth-child(2) { width: 40vw; height: 40vw; right: -10vw; top: -10vw; background: rgba(var(--violet-rgb), .14); }
.aurora i:nth-child(3) { width: 30vw; height: 30vw; left: 35vw; top: -12vw; background: rgba(var(--blue-rgb), .1); }

/* ---------- Footer ---------- */
.footer { position: relative; border-top: 1px solid var(--line); padding: 48px var(--gutter) 32px; }
.foot-inner { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px 40px; }
.foot-tag { color: var(--muted); font-size: 14px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 24px; }
.foot-links a { color: var(--muted); font-size: 14px; transition: color .25s; }
.foot-links a:hover { color: var(--accent); }
.copy { max-width: var(--max); margin: 28px auto 0; color: var(--dim); font-size: 13px; }

@media (max-width: 900px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: block; }
  .foot-inner { grid-template-columns: 1fr; }
}

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