/* =============================================================
   CORE — tokens, reset, layout, chrome
   ============================================================= */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Surfaces */
  --bg:            #04060d;
  --bg-2:          #070b16;
  --surface:       #0b1120;
  --surface-2:     #101830;
  --surface-3:     #16203c;

  /* Lines */
  --line:          rgba(125, 160, 220, 0.13);
  --line-strong:   rgba(125, 160, 220, 0.26);

  /* Text */
  --text:          #e8eefb;
  --text-2:        #a9b8d4;
  --text-3:        #6f809f;

  /* Signal colors */
  --accent:        #2de2c5;
  --accent-soft:   rgba(45, 226, 197, 0.12);
  --accent-line:   rgba(45, 226, 197, 0.38);
  --blue:          #5b8cff;
  --blue-soft:     rgba(91, 140, 255, 0.12);
  --violet:        #a97bff;
  --amber:         #ffab4a;
  --rose:          #ff6b8b;

  /* Typography */
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body:    "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", "SFMono-Regular", ui-monospace, Consolas, monospace;

  /* Rhythm */
  --nav-h:      72px;
  --radius:     14px;
  --radius-lg:  22px;
  --maxw:       1200px;
  --gutter:     clamp(1.25rem, 4vw, 3rem);
  --section-y:  clamp(5rem, 12vh, 9rem);

  /* Motion */
  --ease:       cubic-bezier(0.22, 1, 0.36, 1);
  --ease-sharp: cubic-bezier(0.65, 0, 0.35, 1);

  /* Effects */
  --shadow:     0 24px 60px -24px rgba(0, 0, 0, 0.85);
  --glow:       0 0 0 1px var(--accent-line), 0 0 34px -6px rgba(45, 226, 197, 0.35);
}

/* Light mode — same structure, inverted surfaces. */
:root[data-theme="light"] {
  --bg:          #f6f8fc;
  --bg-2:        #eef2f9;
  --surface:     #ffffff;
  --surface-2:   #f2f5fb;
  --surface-3:   #e6ecf7;
  --line:        rgba(20, 40, 80, 0.11);
  --line-strong: rgba(20, 40, 80, 0.22);
  --text:        #0c1428;
  --text-2:      #40506e;
  --text-3:      #6b7b98;
  --accent:      #0d9c85;
  --accent-soft: rgba(13, 156, 133, 0.1);
  --accent-line: rgba(13, 156, 133, 0.4);
  --blue:        #2f5fe0;
  --violet:      #7b4de0;
  --amber:       #c97a10;
  --shadow:      0 20px 50px -26px rgba(20, 40, 80, 0.4);
  --glow:        0 0 0 1px var(--accent-line), 0 0 30px -8px rgba(13, 156, 133, 0.3);
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* Use the background-color longhand, not the `background` shorthand:
     the shorthand does not re-resolve when the underlying custom
     property changes, so theme switching silently stalls. */
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

body.is-locked { overflow: hidden; }

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

::selection { background: var(--accent); color: #04060d; }

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

/* Scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 99px;
  border: 3px solid var(--bg-2);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-line); }

/* ---------- 3. Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: clamp(3rem, 7vh, 5rem); }

main { position: relative; z-index: 1; }

/* ---------- 4. Ambient background layers ---------- */
#mesh-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 12% -8%,  rgba(45, 226, 197, 0.13), transparent 60%),
    radial-gradient(52rem 38rem at 92% 6%,   rgba(91, 140, 255, 0.13), transparent 62%),
    radial-gradient(48rem 40rem at 50% 110%, rgba(169, 123, 255, 0.10), transparent 65%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
  opacity: 0.5;
}

.bg-noise {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.028;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 5. Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent), var(--blue), var(--violet));
  z-index: 1000;
  will-change: transform;
}

/* ---------- 6. Navigation ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 900;
  display: flex;
  align-items: center;
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease),
              backdrop-filter 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.is-stuck {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom-color: var(--line);
}

.nav__inner {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.02rem;
  margin-right: auto;
}

.brand__mark {
  width: 34px; height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--accent), var(--blue));
  color: #04060d;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: -0.04em;
  box-shadow: 0 0 22px -4px rgba(45, 226, 197, 0.6);
  position: relative;
  overflow: hidden;
}

.brand__mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.55) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease);
}
.brand:hover .brand__mark::after { transform: translateX(120%); }

.brand__sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 1px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.nav__link {
  position: relative;
  padding: 0.5rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  border-radius: 8px;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
}

.nav__link:hover { color: var(--text); background: var(--surface-2); }

.nav__link.is-active { color: var(--accent); }
.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 0.85rem; right: 0.85rem; bottom: 0.15rem;
  height: 1.5px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--accent);
}

.nav__tools { display: flex; align-items: center; gap: 0.5rem; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--text-2);
  background: var(--surface);
  transition: color 0.22s var(--ease), border-color 0.22s var(--ease),
              background-color 0.22s var(--ease), transform 0.22s var(--ease);
}
.icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.icon-btn svg { width: 17px; height: 17px; }

.kbd-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 38px;
  padding-inline: 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  transition: all 0.22s var(--ease);
}
.kbd-hint:hover { color: var(--accent); border-color: var(--accent-line); }
.kbd-hint kbd {
  font: inherit;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  background: var(--surface-3);
  border: 1px solid var(--line);
}
.kbd-hint__icon { display: none; }
.kbd-hint__icon svg { width: 17px; height: 17px; }

.nav__burger { display: none; }

/* Mobile nav */
@media (max-width: 880px) {
  .nav__links { display: none; }
  .nav__burger { display: grid; }

  /* Search collapses to an icon button instead of disappearing — there is
     no Ctrl+K on a phone, so hiding it would strip the feature entirely. */
  .kbd-hint {
    width: 44px;
    padding: 0;
    justify-content: center;
  }
  .kbd-hint__label,
  .kbd-hint kbd { display: none; }
  .kbd-hint__icon { display: grid; place-items: center; }

  .nav__links.is-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    padding: 1rem var(--gutter) 1.75rem;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
    animation: navDrop 0.3s var(--ease);
  }
  .nav__links.is-open .nav__link {
    padding: 0.85rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--line);
    background: var(--surface);
  }
}

@keyframes navDrop {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 7. Buttons ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.8rem 1.4rem;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 0.9rem;
  font-weight: 550;
  letter-spacing: 0.005em;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease),
              box-shadow 0.22s var(--ease), color 0.22s var(--ease);
}

.btn svg { width: 16px; height: 16px; flex: none; }

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  opacity: 0;
  transition: opacity 0.28s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent-line);
  box-shadow: 0 12px 30px -12px rgba(45, 226, 197, 0.5);
}

.btn--primary {
  border-color: transparent;
  color: #04060d;
  font-weight: 600;
}
.btn--primary::before { opacity: 1; }
.btn--primary:hover::before { filter: brightness(1.12); }

.btn--ghost { background: transparent; transition: background-color 0.22s var(--ease); }
.btn--ghost:hover { color: var(--accent); background: var(--accent-soft); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---------- 8. Section headers ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
}

.section__head { max-width: 62ch; margin-bottom: clamp(2.5rem, 5vw, 4rem); }

.section__title {
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  margin-bottom: 1rem;
}

.section__lede {
  color: var(--text-2);
  font-size: clamp(0.98rem, 1.6vw, 1.1rem);
  max-width: 58ch;
}

.grad-text {
  background: linear-gradient(100deg, var(--accent), var(--blue) 55%, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 9. Chips / tags ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.66rem;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  /* Never let a long label push past its container. Some capability
     strings run to ~310px, which overflows the card at phone width —
     body{overflow-x:hidden} hid that rather than preventing it. */
  max-width: 100%;
}

.chip--accent {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

/* Status pill with pulsing dot */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.7rem 0.3rem 0.6rem;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.status__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  flex: none;
}

.status--active { color: var(--accent); border-color: var(--accent-line); }
.status--active .status__dot {
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.2s infinite;
}
.status--shipped { color: var(--blue); border-color: rgba(91,140,255,0.35); }
.status--shipped .status__dot { background: var(--blue); }
.status--ongoing { color: var(--amber); border-color: rgba(255,171,74,0.35); }
.status--ongoing .status__dot { background: var(--amber); }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(45, 226, 197, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(45, 226, 197, 0); }
  100% { box-shadow: 0 0 0 0 rgba(45, 226, 197, 0); }
}

/* ---------- 10. Reveal-on-scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal="left"]  { transform: translateX(-30px); }
[data-reveal="right"] { transform: translateX(30px); }
[data-reveal="scale"] { transform: scale(0.94); }
[data-reveal].is-in   { opacity: 1; transform: none; }

/* On narrow screens the horizontal variants start 30px outside the viewport,
   which body{overflow-x:hidden} then has to clip. Reveal vertically instead —
   a sideways slide reads badly at phone width regardless. */
@media (max-width: 700px) {
  [data-reveal="left"],
  [data-reveal="right"] { transform: translateY(26px); }
}

/* ---------- 11. Command palette ---------- */
.cmdk {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  padding-top: 14vh;
  justify-content: center;
  background: rgba(2, 4, 10, 0.72);
  backdrop-filter: blur(8px);
}
.cmdk.is-open { display: flex; animation: fade 0.2s var(--ease); }

.cmdk__panel {
  width: min(620px, 92vw);
  max-height: 62vh;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow), 0 0 80px -30px rgba(45, 226, 197, 0.35);
  overflow: hidden;
  animation: cmdkIn 0.28s var(--ease);
}

@keyframes cmdkIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.cmdk__search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
}
.cmdk__search svg { width: 17px; height: 17px; color: var(--text-3); flex: none; }
.cmdk__input {
  flex: 1;
  border: 0;
  background: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.98rem;
  outline: none;
}
.cmdk__input::placeholder { color: var(--text-3); }

.cmdk__list { overflow-y: auto; padding: 0.5rem; }

.cmdk__group {
  padding: 0.65rem 0.75rem 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}

.cmdk__item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 9px;
  text-align: left;
  color: var(--text-2);
  font-size: 0.9rem;
  transition: background-color 0.15s, color 0.15s;
}
.cmdk__item .cmdk__ico {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  flex: none;
}
.cmdk__item svg { width: 14px; height: 14px; }
.cmdk__item.is-sel { background: var(--accent-soft); color: var(--accent); }
.cmdk__item.is-sel .cmdk__ico { border-color: var(--accent-line); }
.cmdk__meta { margin-left: auto; font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-3); }

.cmdk__foot {
  display: flex;
  gap: 1rem;
  padding: 0.6rem 1.15rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-3);
}
.cmdk__foot kbd {
  padding: 0.08rem 0.32rem;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.cmdk__empty { padding: 2rem 1rem; text-align: center; color: var(--text-3); font-size: 0.9rem; }

/* ---------- 12. Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, var(--bg-2));
  padding-block: 4rem 2rem;
  margin-top: 4rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--line);
}

.footer__blurb { color: var(--text-3); font-size: 0.9rem; max-width: 36ch; margin-top: 0.9rem; }

.footer__h {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1rem;
}

.footer__list { display: flex; flex-direction: column; gap: 0.6rem; }
.footer__list a {
  color: var(--text-2);
  font-size: 0.9rem;
  transition: color 0.2s, transform 0.2s;
  display: inline-block;
}
.footer__list a:hover { color: var(--accent); transform: translateX(3px); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-3);
}

.footer__socials { display: flex; gap: 0.5rem; }

@media (max-width: 760px) {
  .footer__grid { grid-template-columns: 1fr; gap: 2.25rem; }
}

/* ---------- 13. Preloader ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.55s var(--ease), visibility 0.55s;
}
.boot.is-done { opacity: 0; visibility: hidden; }

.boot__inner {
  width: min(420px, 84vw);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.boot__line {
  display: flex;
  gap: 0.6rem;
  color: var(--text-3);
  opacity: 0;
  animation: bootLine 0.3s var(--ease) forwards;
  margin-bottom: 0.3rem;
}
.boot__line span:last-child { margin-left: auto; color: var(--accent); }
@keyframes bootLine { to { opacity: 1; } }

.boot__bar {
  height: 2px;
  margin-top: 1.1rem;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
}
.boot__bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  animation: bootFill 1.15s var(--ease) forwards;
}
@keyframes bootFill { to { width: 100%; } }

/* ---------- 14. Custom cursor (pointer devices only) ---------- */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
}
.cursor-dot {
  width: 5px; height: 5px;
  background: var(--accent);
  margin: -2.5px 0 0 -2.5px;
}
.cursor-ring {
  width: 30px; height: 30px;
  margin: -15px 0 0 -15px;
  border: 1px solid var(--accent-line);
  transition: opacity 0.3s, width 0.25s var(--ease), height 0.25s var(--ease),
              margin 0.25s var(--ease), background 0.25s var(--ease);
}
body.cursor-ready .cursor-dot, body.cursor-ready .cursor-ring { opacity: 1; }
body.cursor-hot .cursor-ring {
  width: 52px; height: 52px;
  margin: -26px 0 0 -26px;
  background: var(--accent-soft);
}
@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ---------- 15. Back to top ---------- */
.to-top {
  position: fixed;
  right: 1.5rem; bottom: 1.5rem;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(12px);
  color: var(--text-2);
  z-index: 890;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: all 0.3s var(--ease);
}
.to-top.is-vis { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { color: var(--accent); border-color: var(--accent-line); transform: translateY(-3px); }
.to-top svg { width: 17px; height: 17px; }

/* ---------- 15b. Mobile & touch refinements ---------- */

/* Kill the grey flash iOS/Android paint over tapped elements. */
* { -webkit-tap-highlight-color: transparent; }

/* Respect notches in landscape. */
.wrap,
.nav__inner {
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}
.to-top { bottom: max(1.5rem, env(safe-area-inset-bottom)); }

/* Touch targets: 44px is the accessibility floor, and these sit at 35–38px
   on the desktop scale. Keyed to pointer type, not width, so a touchscreen
   laptop gets them too. */
@media (hover: none), (pointer: coarse), (max-width: 880px) {
  .icon-btn { width: 44px; height: 44px; }
  .kbd-hint { height: 44px; }
  .cmdk__item { padding-block: 0.85rem; }
  .btn { min-height: 44px; }

  /* Footer links sit at 32px from line-height alone. */
  .footer__list a {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
  /* .modal__close is sized in sections.css, which loads after this file —
     its override lives there so it actually wins. */
}

@media (hover: none), (pointer: coarse), (max-width: 880px) {
  /* The input's own box is only ~20px tall; the surrounding padding belongs
     to the row, so a tap outside it doesn't focus the field. Shift the
     padding onto the input itself.

     16px is deliberate, not rounding: iOS Safari zooms the whole page when
     focusing an input under 16px, and the user has to pinch back out. */
  .cmdk__search { padding-block: 0.35rem; }
  .cmdk__input {
    min-height: 44px;
    font-size: 16px;
  }
}

/* Small mono labels drop under 10px at the phone and tablet scale, which is
   past legible. Keyed to 880px — the same breakpoint where the nav collapses —
   so tablets get the same floor. */
@media (max-width: 880px) {
  .brand__sub  { font-size: 0.68rem; }
  .chip        { font-size: 0.74rem; padding: 0.32rem 0.7rem; }
  .status      { font-size: 0.72rem; }
  .eyebrow     { font-size: 0.74rem; }
  .cmdk__foot  { font-size: 0.7rem; }
  .cmdk__group { font-size: 0.7rem; }
  .cmdk__meta  { font-size: 0.72rem; }
  .footer__bottom { font-size: 0.76rem; }
  .footer__h   { font-size: 0.7rem; }
}

/* Only let long labels wrap once there's genuinely no room for them —
   on a tablet they still fit on one line and read better that way. */
@media (max-width: 620px) {
  .chip { white-space: normal; }
}

/* ---------- 16. Accessibility ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  padding: 0.8rem 1.2rem;
  background: var(--accent);
  color: #04060d;
  font-weight: 600;
  border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  #mesh-canvas { display: none; }
  .cursor-dot, .cursor-ring { display: none; }
}

/* ---------- 17. Print ---------- */
@media print {
  .nav, .footer, .to-top, .cmdk, #mesh-canvas, .bg-aurora,
  .bg-grid, .bg-noise, .scroll-progress, .boot { display: none !important; }
  body { background: #fff; color: #000; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
