/* ============================================================
   Hail — landing page
   Design language inspired by Linear: near-black canvas, Inter
   with tight tracking, subtle grain, gradient glow, glass cards.
   ============================================================ */

:root {
  /* surfaces */
  --bg: #08090a;
  --bg-1: #0c0d0f;
  --bg-2: #111214;
  --surface: rgba(255, 255, 255, 0.024);
  --surface-2: rgba(255, 255, 255, 0.04);

  /* lines */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  /* text */
  --text: #f7f8f8;
  --text-dim: #b3b8c2;
  --text-mute: #8a8f98;
  --text-faint: #62666d;

  /* accent — Hail "signal" indigo → cyan */
  --accent: #7b8cff;
  --accent-2: #57e3d4;
  --accent-glow: rgba(108, 124, 255, 0.55);

  /* status */
  --live: #4ade80;
  --wait: #fbbf24;
  --done: #6b7280;

  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* subtle background field */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 500px at 50% -8%, rgba(108, 124, 255, 0.10), transparent 70%),
    radial-gradient(700px 500px at 85% 8%, rgba(87, 227, 212, 0.05), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* film grain */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; position: relative; z-index: 2; }

a { color: inherit; text-decoration: none; }
img, svg { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.01em;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s var(--ease);
  white-space: nowrap;
}
.btn--lg { padding: 13px 22px; font-size: 15px; }

.btn--primary {
  background: var(--text);
  color: #0a0a0b;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 6px 24px rgba(123, 140, 255, 0.18);
}
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 10px 34px rgba(123, 140, 255, 0.32); }

.btn--ghost {
  background: var(--surface);
  color: var(--text-dim);
  border-color: var(--border);
}
.btn--ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s var(--ease);
}
.nav.is-scrolled {
  background: rgba(8, 9, 10, 0.72);
  backdrop-filter: blur(14px) saturate(160%);
  border-bottom-color: var(--border);
}
.nav__inner { display: flex; align-items: center; gap: 32px; height: 64px; }
.nav__logo { height: 24px; width: auto; color: var(--text); }
.nav__brand { display: flex; align-items: center; }
.nav__links { display: flex; gap: 26px; margin-left: 8px; }
.nav__links a { font-size: 14px; color: var(--text-mute); transition: color 0.15s; }
.nav__links a:hover { color: var(--text); }
.nav__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 96px 0 40px; text-align: center; overflow: hidden; }
.hero__glow {
  position: absolute;
  top: -180px; left: 50%;
  width: 1100px; height: 720px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--accent-glow), transparent 72%);
  filter: blur(30px);
  opacity: 0.5;
  pointer-events: none;
}
.hero__inner { display: flex; flex-direction: column; align-items: center; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 30px;
  transition: all 0.18s var(--ease);
}
.pill:hover { background: var(--surface-2); border-color: var(--border-strong); }
.pill__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 0 rgba(87, 227, 212, 0.5); animation: ping 2.4s infinite; }
.pill__arrow { color: var(--text-mute); transition: transform 0.18s var(--ease); }
.pill:hover .pill__arrow { transform: translateX(3px); }

.hero__title {
  font-size: clamp(40px, 7vw, 76px);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.035em;
  background: linear-gradient(180deg, #fff 35%, #b9bec8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 26px;
}
.hero__sub { max-width: 620px; font-size: clamp(16px, 2vw, 19px); color: var(--text-mute); margin-bottom: 34px; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 72px; }

/* ---------- Hero visual: device + hail card ---------- */
.hero__visual { width: 100%; display: flex; justify-content: center; perspective: 1600px; }
.device {
  position: relative;
  width: 360px;
  max-width: 92vw;
  background: linear-gradient(180deg, #16181c, #0b0c0e);
  border: 1px solid var(--border-strong);
  border-radius: 34px;
  padding: 14px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 40px 120px -30px rgba(108, 124, 255, 0.4),
    0 30px 80px -40px rgba(0, 0, 0, 0.9);
  transform: rotateX(8deg);
  transform-style: preserve-3d;
}
.device__notch { width: 110px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); margin: 4px auto 14px; }
.device__screen {
  background: radial-gradient(120% 100% at 50% 0%, #131519, #0a0b0d 70%);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 320px;
  justify-content: space-between;
}

.hailcard {
  background: linear-gradient(180deg, rgba(123, 140, 255, 0.12), rgba(123, 140, 255, 0.02));
  border: 1px solid rgba(123, 140, 255, 0.28);
  border-radius: 16px;
  padding: 14px;
  text-align: left;
  box-shadow: 0 10px 40px -16px rgba(108, 124, 255, 0.55);
}
.hailcard__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.hailcard__avatar { width: 22px; height: 22px; border-radius: 7px; background: #0a0b0d; border: 1px solid var(--border); padding: 3px; }
.hailcard__from { font-size: 13px; font-weight: 600; color: var(--text); }
.hailcard__time { margin-left: auto; font-size: 11px; color: var(--text-faint); }
.hailcard__msg { font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.hailcard__msg strong { color: var(--text); font-weight: 600; }
.hailcard__msg code { font-family: "JetBrains Mono", monospace; font-size: 12px; background: rgba(255, 255, 255, 0.07); padding: 1px 5px; border-radius: 5px; color: var(--accent-2); }
.hailcard__actions { display: flex; gap: 7px; margin-top: 14px; flex-wrap: wrap; }
.chip {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 11px;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.chip:hover { background: rgba(255, 255, 255, 0.09); color: var(--text); }
.chip--approve { background: var(--text); color: #0a0a0b; border-color: transparent; }
.chip--approve:hover { transform: translateY(-1px); }

.crewbar { display: flex; align-items: center; gap: 12px; font-size: 11.5px; color: var(--text-mute); border-top: 1px solid var(--border); padding-top: 12px; flex-wrap: wrap; }
.crewbar__label { color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; }
.crewbar__stat { display: inline-flex; align-items: center; gap: 6px; }
.crewbar__freq { margin-left: auto; color: var(--accent-2); }

/* signal animation */
.signal { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.signal span { width: 3px; background: var(--accent-2); border-radius: 2px; animation: bars 1.1s ease-in-out infinite; }
.signal span:nth-child(1) { height: 4px; animation-delay: 0s; }
.signal span:nth-child(2) { height: 8px; animation-delay: 0.15s; }
.signal span:nth-child(3) { height: 12px; animation-delay: 0.3s; }
.signal--h { transform: none; }

/* status dots */
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot--live { background: var(--live); box-shadow: 0 0 8px rgba(74, 222, 128, 0.6); }
.dot--wait { background: var(--wait); box-shadow: 0 0 8px rgba(251, 191, 36, 0.5); }
.dot--done { background: var(--done); }

/* ---------- Strip ---------- */
.strip { padding: 30px 0 10px; }
.strip__label { text-align: center; font-size: 13px; color: var(--text-faint); margin-bottom: 22px; }
.strip__row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 44px; }
.strip__row span { font-size: 17px; font-weight: 600; color: var(--text-mute); letter-spacing: -0.01em; opacity: 0.65; transition: opacity 0.2s; }
.strip__row span:hover { opacity: 1; }

/* ---------- Sections ---------- */
.section { padding: 100px 0; position: relative; }
.section--alt { background: linear-gradient(180deg, transparent, var(--bg-1) 12%, var(--bg-1) 88%, transparent); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section__head { max-width: 680px; margin: 0 auto 56px; text-align: center; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 500; letter-spacing: 0.02em; color: var(--accent); margin-bottom: 14px; }
h2 { font-size: clamp(28px, 4.2vw, 44px); line-height: 1.08; font-weight: 600; letter-spacing: -0.03em; margin-bottom: 16px; }
.section__head p { color: var(--text-mute); font-size: 17px; }
.lead { color: var(--text-mute); font-size: 17px; margin-bottom: 24px; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; transition: all 0.25s var(--ease); }
.step:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-3px); }
.step__num { font-family: "JetBrains Mono", monospace; font-size: 13px; color: var(--accent); display: block; margin-bottom: 16px; }
.step h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 8px; }
.step p { color: var(--text-mute); font-size: 15px; }

/* two-column */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.grid-2--flip .reveal:first-child { order: 0; }
.ticks { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.ticks li { position: relative; padding-left: 28px; color: var(--text-dim); font-size: 15px; }
.ticks li::before {
  content: "";
  position: absolute; left: 0; top: 7px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text);
}
.ticks li::after { content: "✓"; position: absolute; left: 3px; top: 6px; font-size: 10px; color: #0a0a0b; font-weight: 700; }

/* cards */
.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(6px);
}

/* orchestrator card */
.orchestrator { box-shadow: 0 30px 80px -50px rgba(108, 124, 255, 0.7); }
.orch__lead { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.orch__lead span { color: var(--text-faint); font-weight: 400; }
.orch__tree { display: flex; flex-direction: column; gap: 4px; }
.orch__row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-dim); padding: 9px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.018); transition: background 0.15s; }
.orch__row:hover { background: rgba(255, 255, 255, 0.05); }
.orch__row em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--wait); background: rgba(251, 191, 36, 0.12); padding: 2px 8px; border-radius: 6px; }
.orch__row--more { color: var(--text-faint); font-size: 13px; justify-content: center; background: none; }

/* continuity card */
.continuity { display: flex; flex-direction: column; gap: 14px; box-shadow: 0 30px 80px -50px rgba(87, 227, 212, 0.55); }
.cont__device { border: 1px solid var(--border); border-radius: 14px; padding: 18px; background: rgba(255, 255, 255, 0.018); }
.cont__device--phone { background: linear-gradient(180deg, rgba(123, 140, 255, 0.08), transparent); }
.cont__tag { font-size: 12px; color: var(--accent); font-weight: 500; display: block; margin-bottom: 6px; }
.cont__device p { font-size: 14px; color: var(--text-dim); }
.cont__link { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 12px; color: var(--text-mute); }

/* features grid */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { transition: all 0.25s var(--ease); }
.feature:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.feature h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 8px; }
.feature p { color: var(--text-mute); font-size: 14.5px; }

/* ---------- CTA ---------- */
.cta { position: relative; padding: 120px 0; text-align: center; overflow: hidden; }
.cta__glow {
  position: absolute; bottom: -260px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 600px;
  background: radial-gradient(closest-side, var(--accent-glow), transparent 70%);
  filter: blur(20px); opacity: 0.5; pointer-events: none;
}
.cta__inner { max-width: 600px; margin: 0 auto; }
.cta h2 { font-size: clamp(32px, 5vw, 52px); }
.cta p { color: var(--text-mute); font-size: 18px; margin-bottom: 30px; }
.cta__form { display: flex; gap: 10px; max-width: 460px; margin: 0 auto 14px; flex-wrap: wrap; }
.cta__form input {
  flex: 1; min-width: 200px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 13px 16px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.15s;
}
.cta__form input::placeholder { color: var(--text-faint); }
.cta__form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(123, 140, 255, 0.18); }
.cta__note { font-size: 13px; color: var(--text-faint); }
.cta__note.is-success { color: var(--live); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 64px 0 32px; background: var(--bg-1); }
.footer__inner { display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap; margin-bottom: 40px; }
.footer__logo { height: 22px; width: auto; color: var(--text); margin-bottom: 14px; }
.footer__brand p { color: var(--text-mute); font-size: 14px; max-width: 240px; }
.footer__cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer__cols h4 { font-size: 13px; color: var(--text); margin-bottom: 14px; font-weight: 600; }
.footer__cols a { display: block; font-size: 14px; color: var(--text-mute); margin-bottom: 10px; transition: color 0.15s; }
.footer__cols a:hover { color: var(--text); }
.footer__base { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-faint); flex-wrap: wrap; gap: 12px; }
.footer__freq { display: inline-flex; align-items: center; gap: 7px; color: var(--accent-2); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Keyframes ---------- */
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(87, 227, 212, 0.45); }
  70% { box-shadow: 0 0 0 9px rgba(87, 227, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(87, 227, 212, 0); }
}
@keyframes bars {
  0%, 100% { transform: scaleY(0.5); opacity: 0.6; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* ============================================================
   Aceternity-inspired effects — recreated in vanilla CSS/JS
   (Spotlight, Card Spotlight, Moving Border, Meteors, Glare)
   ============================================================ */

/* --- Spotlight (New): dual light shafts sweeping the hero --- */
.spotlight { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.spotlight__beam {
  position: absolute;
  top: -30%;
  width: 46vw; height: 140vh;
  border-radius: 50%;
  filter: blur(44px);
  mix-blend-mode: screen;
  opacity: 0;
  animation: spotlight-in 2.6s var(--ease) 0.2s forwards;
}
.spotlight__beam--left {
  left: -14%;
  background: radial-gradient(ellipse 42% 56% at 50% 0%, rgba(123, 140, 255, 0.26), transparent 70%);
  transform: rotate(-26deg) translateY(-8%);
}
.spotlight__beam--right {
  right: -14%;
  background: radial-gradient(ellipse 42% 56% at 50% 0%, rgba(87, 227, 212, 0.18), transparent 70%);
  transform: rotate(26deg) translateY(-8%);
  animation-delay: 0.5s;
}
@keyframes spotlight-in { to { opacity: 1; } }

/* --- Card Spotlight: radial glow follows the cursor --- */
.card-spotlight { position: relative; overflow: hidden; }
.card-spotlight::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(123, 140, 255, 0.16), transparent 62%);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
  z-index: 0;
}
.card-spotlight:hover::before { opacity: 1; }
.card-spotlight > * { position: relative; z-index: 1; }

/* --- Moving Border: gradient that travels the button edge --- */
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.btn--glow { position: relative; isolation: isolate; }
.btn--glow::before {
  content: "";
  position: absolute; inset: -1.5px;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--a), transparent 50%, var(--accent), var(--accent-2), transparent 92%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: border-spin 4s linear infinite;
  z-index: -1;
}
@keyframes border-spin { to { --a: 360deg; } }

/* --- Meteors: streaks through the CTA --- */
.meteors { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.meteor {
  position: absolute;
  top: -5%;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: #cdd3ff;
  box-shadow: 0 0 6px 1px rgba(123, 140, 255, 0.7);
  transform: rotate(215deg);
  animation: meteor linear infinite;
}
.meteor::after {
  content: "";
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 60px; height: 1px;
  background: linear-gradient(90deg, rgba(123, 140, 255, 0.7), transparent);
}
@keyframes meteor {
  0% { transform: rotate(215deg) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: rotate(215deg) translateX(-680px); opacity: 0; }
}

/* --- Glare card (as seen on Linear): sheen tracks the cursor --- */
.glare { position: relative; }
.glare__sheen {
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(380px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.16), transparent 55%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
  z-index: 4;
  mix-blend-mode: overlay;
}
.glare:hover .glare__sheen { opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav__links { display: none; }
  .steps, .features { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; gap: 36px; }
  .grid-2--flip .reveal:first-child { order: 1; }
  .hero { padding-top: 64px; }
  .section { padding: 72px 0; }
}
@media (max-width: 520px) {
  .nav__actions .btn--ghost { display: none; }
  .footer__inner { flex-direction: column; gap: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
