/* ============ SideTerminal landing — premium dark ============ */
:root {
  --bg: #08080c;
  --bg-2: #0e0e14;
  --panel: #13131b;
  --panel-2: #191926;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4f4f6;
  --muted: #9c9cab;
  --faint: #63636f;
  --teal: #4fd6c8;
  --teal-soft: rgba(79, 214, 200, 0.14);
  --cream: #e8d9b8;
  --violet: #b8a2f2;
  --r-lg: 22px;
  --r-md: 14px;
  --font-d: "Space Grotesk", system-ui, sans-serif;
  --font-b: "Inter", system-ui, sans-serif;
  --font-m: "JetBrains Mono", ui-monospace, monospace;
  --spring: cubic-bezier(0.22, 1.4, 0.32, 1);
  --ease: cubic-bezier(0.22, 0.8, 0.28, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(79, 214, 200, 0.3); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* Ambient glows */
.glow {
  position: fixed; border-radius: 50%; filter: blur(140px);
  pointer-events: none; z-index: 0; opacity: 0.55;
}
.glow-a { width: 560px; height: 560px; top: -220px; right: -140px; background: radial-gradient(closest-side, rgba(79,214,200,0.16), transparent); }
.glow-b { width: 640px; height: 640px; top: 42%; left: -280px; background: radial-gradient(closest-side, rgba(184,162,242,0.10), transparent); }

/* ============ Nav ============ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  padding: 14px 20px;
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease), padding 0.35s var(--ease);
}
.nav.scrolled {
  padding: 8px 20px;
  background: rgba(10, 10, 15, 0.72);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  backdrop-filter: saturate(1.4) blur(18px);
  box-shadow: 0 1px 0 var(--line);
}
.nav-inner {
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; gap: 28px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-d); font-weight: 700; font-size: 17px; letter-spacing: -0.01em;
}
.brand img { border-radius: 7px; }
.nav-links { display: flex; gap: 26px; margin-left: 14px; }
.nav-links a {
  font-size: 14px; color: var(--muted); font-weight: 500;
  transition: color 0.25s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-cta { margin-left: auto; display: flex; gap: 10px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-d); font-weight: 600; letter-spacing: 0.01em;
  border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: transform 0.35s var(--spring), box-shadow 0.35s var(--ease),
              background 0.25s var(--ease), border-color 0.25s var(--ease);
  will-change: transform;
}
.btn:hover { transform: translateY(-2px) scale(1.02); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-sm { font-size: 13.5px; padding: 8px 16px; }
.btn-lg { font-size: 15.5px; padding: 14px 26px; }
.btn-primary {
  color: #06231f;
  background: linear-gradient(180deg, #66e2d5, #3ec6b8);
  box-shadow: 0 8px 24px rgba(79, 214, 200, 0.28), inset 0 1px 0 rgba(255,255,255,0.35);
}
.btn-primary:hover { box-shadow: 0 14px 34px rgba(79, 214, 200, 0.4), inset 0 1px 0 rgba(255,255,255,0.35); }
.btn-ghost {
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.16); }
.gh { width: 16px; height: 16px; fill: currentColor; }

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 8px 24px rgba(79,214,200,0.28), 0 0 0 0 rgba(79,214,200,0.32), inset 0 1px 0 rgba(255,255,255,0.35); }
  50%      { box-shadow: 0 8px 24px rgba(79,214,200,0.28), 0 0 0 12px rgba(79,214,200,0), inset 0 1px 0 rgba(255,255,255,0.35); }
}
.pulse { animation: pulseGlow 2.6s var(--ease) infinite; }

/* ============ Hero ============ */
.hero {
  position: relative; z-index: 1;
  max-width: 1120px; margin: 0 auto;
  padding: 150px 20px 60px;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px;
  align-items: center; min-height: min(92vh, 880px);
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--teal); background: var(--teal-soft);
  border: 1px solid rgba(79,214,200,0.25);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 26px;
}
.pill-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 10px var(--teal);
  animation: blinkDot 2.2s ease infinite;
}
@keyframes blinkDot { 50% { opacity: 0.4; } }

h1 {
  font-family: var(--font-d);
  font-size: clamp(42px, 6.2vw, 72px);
  line-height: 1.03; letter-spacing: -0.035em; font-weight: 700;
}
.grad {
  background: linear-gradient(92deg, var(--teal) 10%, var(--cream) 55%, var(--violet) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradShift 7s ease-in-out infinite alternate;
}
@keyframes gradShift { to { background-position: 100% 0; } }

.lede {
  margin-top: 24px; font-size: clamp(16px, 1.6vw, 19px);
  color: var(--muted); max-width: 46ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.hero-meta { margin-top: 22px; font-size: 13px; color: var(--faint); letter-spacing: 0.02em; }

/* ============ Demo (edge-reveal animation) ============ */
.demo { position: relative; perspective: 1400px; }
.screen {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 10.4;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  /* macOS-style flowing wallpaper */
  background:
    radial-gradient(90% 80% at 12% 8%, rgba(94, 90, 219, 0.5), transparent 60%),
    radial-gradient(80% 90% at 88% 18%, rgba(41, 121, 168, 0.45), transparent 58%),
    radial-gradient(90% 90% at 70% 100%, rgba(37, 128, 112, 0.5), transparent 60%),
    radial-gradient(70% 60% at 30% 90%, rgba(140, 74, 150, 0.35), transparent 60%),
    linear-gradient(160deg, #14142a 0%, #0b0f1c 100%);
  box-shadow: 0 40px 90px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.06);
  transform: rotateY(-7deg) rotateX(3deg);
  transform-style: preserve-3d;
  transition: transform 0.7s var(--spring);
}
.demo:hover .screen { transform: rotateY(-2deg) rotateX(1deg); }

/* --- Menu bar --- */
.screen-menubar {
  position: relative; z-index: 3;
  display: flex; align-items: center; gap: 11px;
  padding: 5px 12px; font-size: 9.5px; color: rgba(255,255,255,0.85);
  background: rgba(20, 22, 34, 0.55);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mb-apple { width: 10px; height: 10px; fill: rgba(255,255,255,0.9); flex: none; }
.mb-app { font-weight: 700; }
.mb-menu { color: rgba(255,255,255,0.62); }
.mb-status { margin-left: auto; display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,0.8); }
.mb-ic { width: 11px; height: 11px; fill: currentColor; }
.mb-batt { width: 17px; }
.mb-time { font-size: 9px; letter-spacing: 0.02em; }

.screen-desktop { position: absolute; inset: 22px 0 0 0; }

/* --- Finder-style window --- */
.finder-win {
  position: absolute; left: 5.5%; top: 10%; width: 52%; height: 58%;
  display: flex; overflow: hidden;
  border-radius: 11px; border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 22px 44px rgba(0,0,0,0.45);
  background: rgba(28, 29, 40, 0.9);
}
.fw-side {
  width: 32%; padding: 9px 10px;
  background: rgba(255,255,255,0.05);
  border-right: 1px solid rgba(255,255,255,0.06);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.fw-lights { display: flex; gap: 5px; margin-bottom: 12px; }
.fw-lights i { width: 8px; height: 8px; border-radius: 50%; }
.fw-lights i:nth-child(1) { background: #ff5f57; }
.fw-lights i:nth-child(2) { background: #febc2e; }
.fw-lights i:nth-child(3) { background: #28c840; }
.fw-side-label {
  display: block; font-size: 7px; font-weight: 700; letter-spacing: 0.06em;
  color: rgba(255,255,255,0.35); margin: 2px 0 6px 2px;
}
.fw-item {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 6px; border-radius: 6px; margin-bottom: 2px;
}
.fw-item.on { background: rgba(255,255,255,0.10); }
.fw-ico { width: 9px; height: 9px; border-radius: 3px; background: var(--c); flex: none; }
.fw-item b { height: 5px; border-radius: 3px; background: rgba(255,255,255,0.22); }

.fw-main { flex: 1; display: flex; flex-direction: column; }
.fw-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.fw-title { font-size: 9px; font-weight: 700; color: rgba(255,255,255,0.8); }
.fw-seg { margin-left: auto; width: 34px; height: 9px; border-radius: 5px; background: rgba(255,255,255,0.10); }
.fw-grid {
  flex: 1; padding: 12px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 8px;
  align-content: start;
}
.fw-folder { display: grid; justify-items: center; gap: 5px; }
.fw-folder i {
  width: 26px; height: 19px; border-radius: 3.5px; position: relative;
  background: linear-gradient(180deg, #7ec3f7, #4aa3e8);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}
.fw-folder i::before {
  content: ""; position: absolute; top: -3px; left: 0;
  width: 11px; height: 4px; border-radius: 2.5px 2.5px 0 0;
  background: #5eaeec;
}
.fw-folder b { height: 4.5px; border-radius: 3px; background: rgba(255,255,255,0.3); }

/* --- Dock --- */
.dock {
  position: absolute; left: 50%; bottom: 3.2%; transform: translateX(-50%);
  z-index: 3;
  display: flex; align-items: center; gap: 7px;
  padding: 6px 9px; border-radius: 14px;
  background: rgba(30, 32, 46, 0.5);
  border: 1px solid rgba(255,255,255,0.12);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}
.dk {
  width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--a), var(--b));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 3px 7px rgba(0,0,0,0.3);
  transition: transform 0.3s var(--spring);
}
.dk svg { width: 78%; height: 78%; }
.dk:hover { transform: translateY(-4px) scale(1.14); }
.dk-app { background: none; box-shadow: 0 3px 7px rgba(0,0,0,0.3); overflow: hidden; }
.dk-app img { width: 100%; height: 100%; }
.dk-trash {
  background: linear-gradient(180deg, rgba(255,255,255,0.28), rgba(255,255,255,0.10));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.dk-sep { width: 1px; height: 20px; background: rgba(255,255,255,0.18); }

/* Fake cursor that acts out the story */
.cursor-dot {
  position: absolute; left: 34%; top: 44%; z-index: 6;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.6));
  transition: left 1.1s var(--ease), top 1.1s var(--ease);
}
.screen.stage-approach .cursor-dot { left: 93%; top: 48%; }
.screen.stage-open .cursor-dot     { left: 74%; top: 46%; }
/* While typing, the pointer stays INSIDE the terminal — leaving it would
   auto-hide the sidebar in the real app, and the demo must tell the truth. */
.screen.stage-work .cursor-dot     { left: 80%; top: 58%; }
.screen.stage-leave .cursor-dot    { left: 26%; top: 38%; }

/* Edge hint that lights up when the pointer arrives */
.edge-hint {
  position: absolute; right: 0; top: 8%; bottom: 8%; width: 3px; z-index: 4;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(180deg, transparent, var(--teal), transparent);
  opacity: 0; transition: opacity 0.5s var(--ease);
}
.screen.stage-approach .edge-hint { opacity: 0.9; }

/* The sidebar terminal card */
.sidebar-card {
  position: absolute; z-index: 5;
  top: 5%; bottom: 5%; right: 1.6%; width: 46%;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(16, 18, 24, 0.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  transform: translateX(118%);
  opacity: 0;
  transition: transform 0.85s var(--spring), opacity 0.45s var(--ease);
  display: flex; flex-direction: column; overflow: hidden;
}
.screen.stage-open .sidebar-card,
.screen.stage-work .sidebar-card { transform: translateX(0); opacity: 1; }
.screen.stage-leave .sidebar-card { transform: translateX(118%); opacity: 0; transition: transform 0.6s var(--ease), opacity 0.4s var(--ease); }

.term-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-bottom: 1px solid rgba(255,255,255,0.07);
}
.term-light { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.term-title { font-family: var(--font-m); font-size: 9.5px; color: var(--faint); letter-spacing: 0.03em; }

.term-body {
  flex: 1; padding: 12px 14px;
  font-family: var(--font-m); font-size: clamp(8.5px, 1.05vw, 12px);
  line-height: 1.9; color: #cdd3d0;
}
.term-line { white-space: pre-wrap; word-break: break-all; }
.term-line .p { color: var(--teal); font-weight: 700; }
.term-line .d { color: var(--violet); }
.term-line .ok { color: #7ee2a0; }
.term-line .cm { color: #8b93a5; }
.caret {
  display: inline-block; width: 7px; height: 13px; vertical-align: -2px;
  background: var(--teal); animation: caretBlink 1s steps(1) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }

.demo-caption {
  margin-top: 18px; text-align: center;
  font-family: var(--font-m); font-size: 12.5px; color: var(--faint);
  letter-spacing: 0.06em; transition: color 0.4s var(--ease);
}

/* ============ Strip ============ */
.strip {
  position: relative; z-index: 1;
  max-width: 1120px; margin: 30px auto 0;
  padding: 26px 20px;
  display: flex; align-items: center; justify-content: center;
  gap: clamp(18px, 4vw, 44px); flex-wrap: wrap;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.strip-item { display: flex; align-items: baseline; gap: 10px; }
.strip-item b { font-family: var(--font-d); font-size: clamp(20px, 2.4vw, 28px); color: var(--teal); letter-spacing: -0.02em; }
.strip-item span { font-size: 13px; color: var(--muted); }
.strip-sep { width: 1px; height: 26px; background: var(--line); }

/* ============ Sections ============ */
.section {
  position: relative; z-index: 1;
  max-width: 1120px; margin: 0 auto; padding: 120px 20px 40px;
}
.section h2 {
  font-family: var(--font-d);
  font-size: clamp(30px, 4.4vw, 48px);
  line-height: 1.08; letter-spacing: -0.03em; font-weight: 700;
}
.section-lede { margin-top: 18px; color: var(--muted); max-width: 56ch; font-size: 17px; }

/* Feature grid */
.grid {
  margin-top: 56px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.card {
  position: relative; overflow: hidden;
  padding: 28px 26px 30px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, var(--panel-2), var(--panel));
  transition: transform 0.5s var(--spring), border-color 0.35s var(--ease), box-shadow 0.5s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(420px 200px at var(--mx, 50%) var(--my, 0%), rgba(79,214,200,0.09), transparent 65%);
  opacity: 0; transition: opacity 0.4s var(--ease);
}
.card:hover { transform: translateY(-6px); border-color: rgba(255,255,255,0.16); box-shadow: 0 26px 54px rgba(0,0,0,0.42); }
.card:hover::before { opacity: 1; }
.card-ic {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 18px;
  background: color-mix(in srgb, var(--tint) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--tint) 30%, transparent);
}
.card-ic svg { width: 21px; height: 21px; fill: var(--tint); }
.card h3 { font-family: var(--font-d); font-size: 18.5px; letter-spacing: -0.01em; margin-bottom: 9px; }
.card p { font-size: 14.5px; color: var(--muted); }

/* Steps */
.how h2 { text-align: center; }
.steps {
  margin-top: 60px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.step {
  padding: 30px 26px;
  border-radius: var(--r-lg);
  border: 1px dashed rgba(255,255,255,0.12);
  transition: border-color 0.35s var(--ease), background 0.35s var(--ease);
}
.step:hover { border-color: rgba(79,214,200,0.4); background: rgba(79,214,200,0.03); }
.step-n {
  font-family: var(--font-m); font-size: 13px; font-weight: 700;
  color: var(--teal); letter-spacing: 0.14em;
}
.step h3 { font-family: var(--font-d); font-size: 19px; margin: 14px 0 8px; }
.step p { font-size: 14.5px; color: var(--muted); }

/* Install */
.install { padding-bottom: 110px; }
.install-card {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 40px; align-items: center;
  padding: clamp(30px, 5vw, 54px);
  border-radius: 28px;
  border: 1px solid var(--line);
  background:
    radial-gradient(90% 130% at 100% 0%, rgba(79,214,200,0.08), transparent 55%),
    linear-gradient(160deg, var(--panel-2), var(--bg-2));
  box-shadow: 0 34px 80px rgba(0,0,0,0.4);
}
.install-copy h2 { font-size: clamp(26px, 3.4vw, 38px); }
.install-copy ol { margin: 22px 0 0 18px; color: var(--muted); display: grid; gap: 8px; font-size: 15px; }
.install-copy b { color: var(--text); }
.codeblock {
  margin-top: 18px; display: flex; align-items: center; gap: 10px;
  background: #0a0a0f; border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 13px 16px;
}
.codeblock code {
  font-family: var(--font-m); font-size: 12.5px; color: var(--cream);
  overflow-x: auto; white-space: nowrap; flex: 1; scrollbar-width: none;
  /* Flex items default to min-width:auto and refuse to shrink below their
     nowrap content, inflating the page on phones. Let it scroll instead. */
  min-width: 0;
}
.install-copy, .install-cta, .card, .step { min-width: 0; }
.copy {
  flex: none; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 9px;
  color: var(--muted); background: rgba(255,255,255,0.05);
  border: 1px solid var(--line); cursor: pointer;
  transition: all 0.25s var(--ease);
}
.copy:hover { color: var(--teal); border-color: rgba(79,214,200,0.4); }
.copy.done { color: #7ee2a0; border-color: rgba(126,226,160,0.5); }
.fine { margin-top: 14px; font-size: 12.5px; color: var(--faint); }
.install-cta { display: grid; gap: 16px; justify-items: center; }
.link { font-size: 14px; color: var(--muted); transition: color 0.25s; }
.link:hover { color: var(--teal); }

/* ============ Footer ============ */
.footer { position: relative; z-index: 1; border-top: 1px solid var(--line); }
.footer-inner {
  max-width: 1120px; margin: 0 auto; padding: 36px 20px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: center; gap: 9px; font-family: var(--font-d); font-weight: 700; }
.footer-brand img { border-radius: 6px; }
.footer p { font-size: 13.5px; color: var(--faint); }
.footer p a { color: var(--muted); border-bottom: 1px solid transparent; }
.footer p a:hover { color: var(--teal); }
.footer-links { margin-left: auto; display: flex; gap: 20px; }
.footer-links a { font-size: 13.5px; color: var(--muted); transition: color 0.25s; }
.footer-links a:hover { color: var(--text); }

/* ============ Scroll reveal ============ */
.reveal {
  opacity: 0; transform: translateY(34px) scale(0.985);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--spring);
  transition-delay: var(--rd, 0s);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }

/* ============ Responsive ============ */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 120px; min-height: 0; gap: 44px; }
  .hero-copy { text-align: center; }
  .lede { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .screen { transform: none; }
  .grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
  .install-card { grid-template-columns: 1fr; text-align: center; }
  .install-copy ol { text-align: left; }
  .nav-links { display: none; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .btn-lg { width: 100%; justify-content: center; }
  .hero-actions { flex-direction: column; }
  .strip-sep { display: none; }
  .nav-cta .btn-ghost { display: none; }
  .mb-hide-sm, .mb-time { display: none; }
}

/* Reduced motion: keep it calm */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
