/* Tokens from DESIGN.md / apps/ios/Surveil/DesignSystem/Tokens/Colors.swift.
   Dark-first: the brand lives in the dark. Inter + JetBrains Mono are the
   web substitutes for SF Pro / SF Mono (DESIGN.md § Typography). */

:root {
  --color-background: #0A0A0F;
  --color-surface: #16161E;
  --color-surface-2: #1E1E2A;
  --color-border: #2A2A3A;
  --color-text-primary: #F0F0F5;
  --color-text-secondary: #8888A0;
  --color-accent: #9B6CFF;
  --color-cta-top: #7340F0;
  --color-cta-bottom: #5B27D6;
  --color-glow: #21134A;
  --color-eye: #ECE3FD;
  --color-delta-positive: #34CC72;
  --spacing-s4: 4px;
  --spacing-s8: 8px;
  --spacing-s12: 12px;
  --spacing-s16: 16px;
  --spacing-s20: 20px;
  --spacing-s24: 24px;
  --spacing-s32: 32px;
  --radius-small: 6px;
  --radius-medium: 10px;
  --radius-card: 12px;
  --radius-large: 16px;
  /* Apple's 44 pt minimum touch target; the web has no tighter control
     sizes to match. */
  --hit-min: 44px;
  --hit-primary: 52px;
  --motion: 200ms cubic-bezier(0.2, 0, 0, 1);
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --content: 1080px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text-primary);
}

html {
  /* Keep iOS from enlarging text when the phone turns sideways. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* The hero's eye watermark is wider than the screen on phones; clip it at
   the screen edge so the page never scrolls sideways. */
main {
  overflow-x: clip;
}

body {
  /* The app icon's dark gradient (#21134A into the background), as a glow
     behind the top of the page. */
  background:
    radial-gradient(1100px 640px at 50% -12%, color-mix(in srgb, var(--color-cta-bottom) 45%, transparent), transparent 70%),
    linear-gradient(180deg, var(--color-glow) 0, var(--color-background) 720px);
  background-repeat: no-repeat;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--color-accent) 70%, transparent);
  outline-offset: 2px;
  border-radius: var(--radius-small);
}

.skip-link {
  position: absolute;
  left: var(--spacing-s16);
  top: -48px;
  z-index: 20;
  padding: var(--spacing-s8) var(--spacing-s12);
  background: var(--color-surface);
  color: var(--color-text-primary);
  border-radius: var(--radius-medium);
}

.skip-link:focus {
  top: var(--spacing-s16);
}

.site-header,
.hero,
.section,
.site-footer {
  width: min(var(--content), calc(100% - 2 * var(--spacing-s16)));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding-top: var(--spacing-s12);
  padding-bottom: var(--spacing-s12);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: var(--hit-min);
  gap: var(--spacing-s8);
  color: var(--color-text-primary);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
  color: var(--color-text-primary);
}

/* The app icon's eye without its tile: wide, so it reads as a mark beside
   the name rather than a tiny square icon. */
.brand-mark {
  width: 42px;
  height: 24px;
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-by {
  margin-left: var(--spacing-s4);
  font-weight: 400;
  color: var(--color-text-secondary);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--hit-min);
  padding: 0 var(--spacing-s16);
  border-radius: 999px;
  /* The app's primary button: the purple CTA gradient. */
  border: 1px solid color-mix(in srgb, var(--color-accent) 55%, transparent);
  background: linear-gradient(180deg, var(--color-cta-top), var(--color-cta-bottom));
  box-shadow: 0 6px 24px color-mix(in srgb, var(--color-cta-bottom) 45%, transparent);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
}

.header-cta:hover {
  text-decoration: none;
  filter: brightness(1.1);
}

.hero {
  position: relative;
  display: grid;
  gap: var(--spacing-s32);
  padding: var(--spacing-s32) 0 var(--spacing-s24);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -80px 10% auto;
  height: 360px;
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--color-accent) 28%, transparent),
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
}

.eyebrow {
  margin: 0 0 var(--spacing-s12);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.accent-text {
  display: block;
  color: var(--color-accent);
  background: linear-gradient(90deg, var(--color-accent), var(--color-eye));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero h1 {
  margin: 0 0 var(--spacing-s16);
  font-size: clamp(32px, 6vw, 52px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.lede {
  margin: 0 0 var(--spacing-s24);
  max-width: 36rem;
  color: var(--color-text-secondary);
  font-size: 17px;
  line-height: 1.4;
}

.app-store-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--hit-primary);
}

.app-store-link:hover {
  text-decoration: none;
}

.app-store-link img {
  height: 40px;
  width: auto;
}

.hero-visual {
  position: relative;
  justify-self: center;
  /* Phones: cropped short (see .device), so it can be fairly wide. */
  width: min(100%, 340px);
  filter: drop-shadow(0 32px 80px color-mix(in srgb, var(--color-cta-bottom) 45%, transparent));
}

/* The eye, large and faint, behind the phone. */
.hero-visual::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 42%;
  width: 170%;
  aspect-ratio: 792 / 456;
  transform: translate(-50%, -50%);
  background: url("/images/eye-mark.svg") center / contain no-repeat;
  opacity: 0.09;
  pointer-events: none;
  z-index: -1;
}

/* An iPhone drawn around a full-screen capture (720x1564; apps/www/README.md):
   dark bezel, a thin titanium edge, corners on the real curve (15.5% of
   the width outside, 12.5% for the screen), and the bottom fading into
   the page. Vertical radii are the same corners divided by the box's
   height, so they change whenever the box is cropped. The edge is an
   inset shadow because the fade mask clips anything outside the box. */
.device {
  position: relative;
  padding: 3.4%;
  background: #050507;
  border-radius: 15.5% / 7.4%;
  box-shadow:
    inset 0 0 0 1.5px #3A3550,
    inset 0 0 0 3px #15131D,
    inset 0 0 0 4px #24212F;
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}

.device img {
  width: 100%;
  border-radius: 12.5% / 5.75%;
}

/* Phones: show the top of each screen, not a column of tall screenshots.
   The box takes a shorter ratio and clips the rest, which fades out. */
@media (max-width: 839px) {
  .device {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 58%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 58%, transparent 100%);
  }

  .hero-visual .device {
    aspect-ratio: 5 / 6;
    border-radius: 15.5% 15.5% 0 0 / 12.9% 12.9% 0 0;
  }

  .shot-row .device {
    aspect-ratio: 2 / 3;
    border-radius: 15.5% 15.5% 0 0 / 10.3% 10.3% 0 0;
  }
}

.section {
  padding: var(--spacing-s32) 0;
}

.section-label {
  margin: 0 0 var(--spacing-s8);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.section-title {
  margin: 0 0 var(--spacing-s24);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.feature-grid {
  display: grid;
  gap: var(--spacing-s16);
  grid-template-columns: 1fr;
}

.feature {
  padding: var(--spacing-s20);
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-accent) 7%, var(--color-surface)), var(--color-surface));
  border: 1px solid var(--color-border);
  border-top-color: color-mix(in srgb, var(--color-accent) 45%, var(--color-border));
  border-radius: var(--radius-card);
}

.feature h3 {
  margin: 0 0 var(--spacing-s8);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.feature p:last-child {
  margin: 0;
  color: var(--color-text-secondary);
}

.feature-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-s8);
  margin: 0 0 var(--spacing-s8);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-accent);
}

.soon {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 var(--spacing-s8);
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-accent) 15%, transparent);
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.shot-row {
  display: grid;
  gap: var(--spacing-s16);
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  overflow-x: auto;
  /* Phones: the row runs to the screen edges so the next phone peeks in,
     and each snap lands on the page margin. */
  margin-inline: calc(-1 * var(--spacing-s16));
  padding: 0 var(--spacing-s16) var(--spacing-s8);
  scroll-padding-inline: var(--spacing-s16);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.shot-row figure {
  margin: 0;
  padding: 3px;
  scroll-snap-align: start;
}

.shot-row figcaption {
  margin-top: var(--spacing-s12);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.site-footer {
  padding: var(--spacing-s32) 0 calc(var(--spacing-s32) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--color-border);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-s16);
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-s16);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-s16) var(--spacing-s20);
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--hit-min);
  color: var(--color-text-secondary);
}

.disclaimer {
  margin: 0;
  max-width: 52rem;
  font-size: 12px;
  line-height: 1.4;
  color: var(--color-text-secondary);
}

@media (min-width: 840px) {
  .site-header,
  .hero,
  .section,
  .site-footer {
    width: min(var(--content), calc(100% - 2 * var(--spacing-s32)));
  }

  .hero {
    grid-template-columns: 1fr 0.9fr;
    align-items: center;
    gap: var(--spacing-s32);
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .hero-visual {
    width: min(100%, 400px);
    justify-self: end;
  }

  .feature-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .feature {
    grid-column: span 2;
  }

  .feature-soon {
    grid-column: span 3;
  }

  .shot-row {
    grid-auto-flow: unset;
    grid-template-columns: repeat(4, 1fr);
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
  }
}

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