/* InstaDesk — the homepage. One viewport, full-bleed liquid light behind a
   pill nav, a dot-matrix headline, one button and four true numbers.
   No framework, no build. The motion is drawn on a canvas in main.js so the
   page loads nothing it does not own. */
:root {
  --bg: #000000;
  --text: #ffffff;
  --muted: #8e8e8e;
  --nav-text: #2e2e2e;
  --pill-dark: #28282a;
  --sign-in-text: #c8c8c8;
  --nav-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  --trust-bg: #28282a;
  --trust-border: rgba(255, 255, 255, 0.4);
  --trust-text: #c4c2c3;
  --font-sans: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: "Handjet", "Silkscreen", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------- background ---------- */
.bg { position: absolute; inset: 0; background: #000; overflow: hidden; }
.bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.bg::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5; z-index: 0;
  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.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

/* ---------- page ---------- */
.page {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  height: 100vh; height: 100dvh; overflow: hidden;
  padding: clamp(16px, 2.4vh, 28px) clamp(14px, 3vw, 32px);
}
.header, .hero, .stats, .menu-overlay { z-index: 1; }

/* ---------- header ---------- */
.header {
  flex-shrink: 0; width: 100%; max-width: 720px;
  display: flex; align-items: center; justify-content: center; gap: clamp(18px, 2.8vw, 28px);
  animation: slideDown 0.7s var(--ease) both;
}
.logo {
  width: clamp(40px, 4.4vw, 46px); height: clamp(40px, 4.4vw, 46px); border-radius: 50%;
  background: #fff; box-shadow: var(--nav-shadow); border: 0; padding: 0; cursor: pointer;
  display: grid; place-items: center; flex-shrink: 0;
  transition: transform 0.25s var(--ease);
}
.logo:hover { transform: scale(1.04); }
.logo svg { width: 72%; height: 72%; }
.logo path { fill: none; stroke: #0e1013; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav {
  flex: 1; max-width: 430px; height: clamp(44px, 5.2vw, 48px);
  background: #fff; border-radius: 999px; padding: 4px 8px; box-shadow: var(--nav-shadow);
  display: flex; align-items: center; justify-content: space-around;
}
.nav a {
  position: relative; padding: 8px 10px; font-weight: 500; font-size: clamp(13px, 1.4vw, 15px);
  letter-spacing: -0.01em; color: var(--nav-text); opacity: 0.5; transition: opacity 0.2s;
}
.nav a:hover { opacity: 0.75; }
.nav a.active { opacity: 1; }
.nav a.active::after {
  content: ""; position: absolute; left: 50%; bottom: 5px; width: 3px; height: 3px; margin-left: -1.5px;
  border-radius: 50%; background: #000; box-shadow: -5px 0 0 #000, 5px 0 0 #000;
}
.pill-dark {
  height: clamp(44px, 5.2vw, 48px); padding: 0 18px; border-radius: 999px; border: 0;
  background: var(--pill-dark); color: var(--sign-in-text); font-weight: 500; font-size: clamp(13px, 1.4vw, 14.5px);
  display: inline-flex; align-items: center; white-space: nowrap; box-shadow: var(--nav-shadow); cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease);
}
.pill-dark:hover { background: #323234; color: #fff; transform: translateY(-1px); }
.burger { display: none; }

/* ---------- hero ---------- */
.hero {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; max-width: 900px; width: 100%;
}
.trust {
  --trust-size: clamp(36px, 4.5vw, 42px);
  display: inline-flex; align-items: center; margin-bottom: clamp(16px, 2.5vh, 26px);
}
.ring {
  width: var(--trust-size); height: var(--trust-size); border-radius: 50%; padding: 5px;
  background: var(--trust-bg); border: 1px solid var(--trust-border); position: relative;
  transition: transform 0.35s var(--ease);
}
.ring + .ring { margin-left: calc(var(--trust-size) * -0.42); }
.ring:nth-child(1) { z-index: 1; }
.ring:nth-child(2) { z-index: 2; }
.ring:nth-child(3) { z-index: 4; }
.trust:hover .ring:nth-child(1) { transform: translateY(-2px); }
.trust:hover .ring:nth-child(2) { transform: translateY(-4px); }
.trust:hover .ring:nth-child(3) { transform: translateY(-2px); }
.ring i {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: #fff;
}
.ring svg { width: 52%; height: 52%; }
.ring path { fill: none; stroke: #111; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.trust-pill {
  height: var(--trust-size); margin-left: calc(var(--trust-size) * -0.42);
  padding: 0 16px 0 calc(var(--trust-size) * 0.58);
  border-radius: 999px; background: var(--trust-bg); border: 1px solid var(--trust-border);
  display: inline-flex; align-items: center; font-weight: 500; color: var(--trust-text);
  font-size: clamp(12px, 1.4vw, 13.5px); white-space: nowrap;
}
.headline {
  margin: 0; font-family: var(--font-display); font-weight: 400; color: #fff;
  font-size: clamp(28px, 6.2vw, 80px); line-height: 1.12; letter-spacing: -0.04em;
  white-space: nowrap; overflow: hidden;
  font-variation-settings: "ELGR" 1, "ELSH" 2, "wght" 500;
}
.headline span { display: block; opacity: 0; transform: translateY(14px); animation: headlineFade 0.85s var(--ease) forwards; }
.headline span:nth-child(1) { animation-delay: 0.12s; }
.headline span:nth-child(2) { animation-delay: 0.3s; }
.sub {
  max-width: min(500px, 92%); margin: clamp(14px, 2vh, 20px) 0 0;
  font-size: clamp(calc(13.5px + 2pt), calc(1.55vw + 2pt), calc(16.5px + 2pt));
  line-height: 1.55; font-weight: 400; color: #d0d0d0; opacity: 0.8;
}
.cta {
  margin-top: clamp(18px, 3vh, 28px);
  display: inline-flex; align-items: center; gap: 10px;
  padding: clamp(11px, 1.6vh, 13px) clamp(22px, 3vw, 28px); border-radius: 999px; border: 0;
  background: #fff; color: #000; font-weight: 600; font-size: clamp(13.5px, 1.5vw, 14.5px); cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15), 0 0 22px rgba(255,255,255,0.32), 0 0 44px rgba(255,255,255,0.12);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.cta:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.25), 0 0 30px rgba(255,255,255,0.5), 0 0 60px rgba(255,255,255,0.2);
}
.cta svg { width: 16px; height: 16px; }
.cta path { fill: none; stroke: #000; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.small { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.small a { color: #c4c2c3; border-bottom: 1px solid rgba(255,255,255,0.18); }

/* ---------- stats ---------- */
.stats {
  flex-shrink: 0; width: 100%; max-width: 920px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(10px, 2vw, 22px);
}
.stat { text-align: center; }
.stat .glyph {
  font-family: var(--font-display); font-size: clamp(22px, 3vw, 33px); line-height: 1; color: #fff;
  font-variation-settings: "ELGR" 1, "ELSH" 2, "wght" 600;
}
.stat .value {
  margin-top: 6px; font-size: clamp(18px, 2.2vw, 26px); font-weight: 600; letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}
.stat .label { margin-top: 3px; color: var(--muted); font-size: clamp(11px, 1.2vw, 12.5px); }
.foot {
  flex-shrink: 0; margin-top: clamp(10px, 1.6vh, 16px); display: flex; gap: 18px; flex-wrap: wrap; justify-content: center;
  font-size: 11.5px; color: #6f747c;
}
.foot a:hover { color: #c4c2c3; }

/* ---------- entrance ---------- */
.anim {
  opacity: 0; transform: translateY(22px) scale(0.98); filter: blur(6px);
  animation: reveal 0.85s var(--ease) forwards; animation-delay: var(--d, 0s);
}
.anim.pulse { animation-name: revealPulse; }
@keyframes reveal {
  to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes revealPulse {
  0% { opacity: 0; transform: translateY(22px) scale(0.98); filter: blur(6px); }
  70% { opacity: 1; transform: translateY(-2px) scale(1.03); filter: blur(0); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes headlineFade { to { opacity: 1; transform: none; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }

/* ---------- mobile ---------- */
.menu-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: overlayIn 0.28s var(--ease) both;
}
.menu-overlay[hidden] { display: none; }
.sheet {
  position: absolute; left: 14px; right: 14px; top: 84px; background: #fff; color: #111;
  border-radius: 28px; padding: 22px 18px 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  animation: menuIn 0.38s var(--ease) both; display: flex; flex-direction: column; gap: 4px;
}
.sheet a {
  position: relative; padding: 12px 10px; border-radius: 12px; font-weight: 500; font-size: 16px; color: #2e2e2e;
  opacity: 0; animation: linkIn 0.4s var(--ease) forwards;
}
.sheet a:nth-child(1) { animation-delay: 0.05s; }
.sheet a:nth-child(2) { animation-delay: 0.1s; }
.sheet a:nth-child(3) { animation-delay: 0.15s; }
.sheet a:nth-child(4) { animation-delay: 0.2s; }
.sheet a:nth-child(5) { animation-delay: 0.25s; }
.sheet a.active::after {
  content: ""; position: absolute; left: 10px; bottom: 8px; width: 3px; height: 3px;
  border-radius: 50%; background: #000; box-shadow: 5px 0 0 #000, 10px 0 0 #000;
}
.sheet a.pill-dark { justify-content: center; margin-top: 8px; height: 48px; width: 100%; color: #fff; background: #111; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes menuIn { from { opacity: 0; transform: translateY(-10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes linkIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 720px) {
  .header { justify-content: space-between; max-width: none; }
  .nav, .header .pill-dark { display: none; }
  .logo { width: 48px; height: 48px; }
  .burger {
    display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 0;
    background: var(--pill-dark); cursor: pointer; box-shadow: var(--nav-shadow); position: relative;
    transition: background 0.25s;
  }
  .burger span { display: block; width: 18px; height: 1.5px; background: #fff; margin: 2.5px 0; transition: transform 0.3s var(--ease), background 0.25s, opacity 0.2s; }
  .burger[aria-expanded="true"] { background: #fff; }
  .burger[aria-expanded="true"] span { background: #000; }
  .burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
  .headline { letter-spacing: -0.08em; line-height: 1.05; }
  .stats { grid-template-columns: 1fr 1fr; }
  .trust-pill { font-size: 12px; }
  .burger { box-shadow: var(--nav-shadow), 0 0 0 1px rgba(255, 255, 255, 0.22); }
}
@media (max-width: 420px) {
  .trust { --trust-size: 34px; }
  .trust-pill .long { display: none; }
  .headline { letter-spacing: -0.09em; line-height: 1.04; }
}
@media (max-height: 700px) {
  .trust { margin-bottom: 10px; }
  .sub { margin-top: 10px; }
  .cta { margin-top: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .header, .anim, .headline span, .menu-overlay, .sheet, .sheet a { animation: none !important; opacity: 1 !important; transform: none !important; filter: none !important; }
}
