/* Perch — black and white, like the notch it lives in. */
:root {
  --black: #000000;
  --white: #ffffff;
  --text-2: #a1a1a6;
  --text-3: #6e6e73;
  --hairline: rgba(255, 255, 255, 0.12);
  --glass: rgba(30, 30, 32, 0.62);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --measure: 34rem;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--black); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
  border-radius: 6px;
}

img, video { display: block; max-width: 100%; }

.wrap { width: min(100% - 32px, 72rem); margin-inline: auto; }

/* ---------- The notch: the site's navigation ---------- */

.notch {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Only the notch itself (and the menu once it's open) reacts to the
     pointer, so the page underneath stays clickable. */
  pointer-events: none;
}
.notch-body { pointer-events: auto; }

.notch-body {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0 14px;
  font: inherit;
  color: var(--white);
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 190px;
  height: 34px;
  background: var(--black);
  border-radius: 0 0 13px 13px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07);
  transition: width 0.42s var(--ease), height 0.42s var(--ease), border-radius 0.42s var(--ease);
}

/* Flared top corners that melt into the top edge, like the real notch. */
.notch-body::before, .notch-body::after {
  content: "";
  position: absolute;
  top: 0;
  width: 8px;
  height: 8px;
  background: radial-gradient(circle at 0 100%, transparent 7.5px, var(--black) 8px);
}
.notch-body::before { left: -8px; }
.notch-body::after { right: -8px; transform: scaleX(-1); }

.notch-lens {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: radial-gradient(circle, #1c2033 0%, #050507 70%);
}

.notch-wing {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}
.notch-wing svg { width: 15px; height: 15px; }
.notch-glyphs { display: flex; gap: 2px; }

.notch-panel {
  position: relative;
  margin-top: 8px;
  width: 300px;
  padding: 6px;
  border-radius: 20px;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 0 1px var(--hairline), 0 24px 60px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: scale(0.96) translateY(-6px);
  transform-origin: top center;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
/* Bridges the gap under the notch so moving down into the menu keeps it open. */
.notch-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.notch-panel a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  text-decoration: none;
  font-size: 15px;
}
.notch-panel a:hover { background: rgba(255, 255, 255, 0.1); }
.notch-panel a span { color: var(--text-2); font-size: 13px; }
.notch-panel .primary { background: var(--white); color: var(--black); font-weight: 600; margin-bottom: 4px; }
.notch-panel .primary:hover { background: #e8e8ed; }
.notch-panel .primary span { color: #48484a; }

/* Opening waits a beat (like Perch's own hover delay) so a pointer passing
   by doesn't set it off; closing is immediate. */
.notch:hover .notch-body, .notch.open .notch-body, .notch:focus-within .notch-body {
  width: 300px;
  height: 38px;
  border-radius: 0 0 16px 16px;
}
.notch:hover .notch-body { transition-delay: 0.18s; }
.notch:hover .notch-wing, .notch.open .notch-wing, .notch:focus-within .notch-wing { opacity: 1; transition-delay: 0.3s; }
.notch.open .notch-wing, .notch:focus-within .notch-wing { transition-delay: 0.12s; }
.notch:hover .notch-panel, .notch.open .notch-panel, .notch:focus-within .notch-panel {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.notch:hover .notch-panel { transition-delay: 0.18s; }

/* The one orchestrated moment: on load the notch opens its wings once, so
   it's clear it does something. */
.notch.intro .notch-body { width: 300px; height: 38px; border-radius: 0 0 16px 16px; }
.notch.intro .notch-wing { opacity: 1; transition-delay: 0.12s; }

/* ---------- Hero ---------- */

.hero { padding: 132px 0 56px; text-align: center; }

.hero h1 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: clamp(2.6rem, 7.2vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 700;
  margin: 0 auto;
  max-width: 13ch;
}

.hero .lede {
  margin: 24px auto 0;
  max-width: 36rem;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--text-2);
}

.actions { margin-top: 36px; display: flex; flex-direction: column; align-items: center; gap: 12px; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 26px;
  height: 52px;
  border-radius: 999px;
  background: var(--white);
  color: var(--black);
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  transition: transform 0.2s var(--ease), background 0.2s ease;
}
.button:hover { background: #e8e8ed; }
.button:active { transform: scale(0.97); }
.button svg { width: 18px; height: 18px; }

.fineprint { font-size: 14px; color: var(--text-3); margin: 0; }

.demo { margin: 64px auto 0; width: min(100%, 64rem); }
.demo video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  background: #0d0d10;
  box-shadow: 0 0 0 1px var(--hairline), 0 40px 120px rgba(80, 60, 200, 0.18);
}

/* ---------- Sections ---------- */

section { padding: 112px 0 0; }

h2 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  margin: 0;
  max-width: 18ch;
}

.intro { max-width: var(--measure); color: var(--text-2); font-size: 19px; margin: 18px 0 0; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 56px;
  align-items: start;
}

/* The sign-in list mirrors Perch's own "Connect your agents" window. */
.connect {
  margin: 0;
  padding: 8px;
  list-style: none;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 1px var(--hairline);
}
.connect li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
}
.connect li + li { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.connect .mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
}
.connect .mark svg { width: 21px; height: 21px; }
.connect h3 { margin: 0; font-size: 17px; }
.connect p { margin: 2px 0 0; color: var(--text-2); font-size: 15px; }
.connect .how { display: block; color: var(--white); font-size: 13px; font-weight: 600; margin-top: 8px; }
.note { color: var(--text-3); font-size: 15px; margin: 18px 4px 0; }

.features {
  margin: 48px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 56px;
  row-gap: 36px;
  max-width: 60rem;
}
.features dt { font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.features dd { margin: 6px 0 0; color: var(--text-2); max-width: 30rem; }

.privacy-line {
  margin-top: 28px;
  display: inline-block;
  color: var(--white);
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.steps { margin: 40px 0 0; padding: 0; list-style: none; counter-reset: step; max-width: 44rem; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  padding: 22px 0;
  border-top: 1px solid var(--hairline);
}
.steps li::before {
  content: counter(step);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 600;
  background: var(--white);
  color: var(--black);
}
.steps strong { display: block; font-size: 18px; }
.steps p { margin: 4px 0 0; color: var(--text-2); }
.path { color: var(--white); font-weight: 600; }

.faq { margin-top: 36px; max-width: 44rem; }
.faq details { border-top: 1px solid var(--hairline); padding: 18px 0; }
.faq details:last-child { border-bottom: 1px solid var(--hairline); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 18px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-2); font-weight: 400; transition: transform 0.25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 10px 0 0; color: var(--text-2); }

.closing { text-align: center; padding-bottom: 40px; }
.closing h2 { margin-inline: auto; }

footer {
  margin-top: 120px;
  border-top: 1px solid var(--hairline);
  padding: 32px 0 48px;
  color: var(--text-3);
  font-size: 14px;
}
footer nav { display: flex; gap: 22px; margin-bottom: 14px; }
footer nav a { color: var(--text-2); text-decoration: none; }
footer nav a:hover { color: var(--white); }
footer p { margin: 6px 0 0; max-width: 46rem; }

/* ---------- Legal pages ---------- */

.legal { padding: 120px 0 0; max-width: 42rem; }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3rem); letter-spacing: -0.035em; line-height: 1.05; margin: 0; }
.legal .updated { color: var(--text-3); margin: 10px 0 40px; font-size: 15px; }
.legal h2 { font-size: 22px; letter-spacing: -0.015em; margin: 40px 0 0; max-width: none; }
.legal p, .legal li { color: #d1d1d6; }
.legal ul { padding-left: 1.2em; }
.legal li { margin: 6px 0; }

/* ---------- Small screens and motion ---------- */

@media (max-width: 800px) {
  body { font-size: 16px; }
  .split, .features { grid-template-columns: 1fr; gap: 32px; }
  section { padding-top: 88px; }
  .hero { padding-top: 112px; }
  .notch-panel { width: min(300px, calc(100vw - 32px)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
