/* ==========================================================================
   Spectra — landing page styles
   Palette note: accents use blue and amber only — a pair that stays distinct
   for red–green color vision deficiency. No meaning relies on hue alone.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --line: #d2d2d7;
  --accent: #0066cc;
  --accent-hover: #0058b0;
  --blue: #2f6fd6;
  --amber: #d9952f;

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 32px;

  --container: 1120px;
  --gutter: clamp(20px, 5vw, 40px);
  --section-y: clamp(88px, 13vw, 160px);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, p, figure, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--text);
  color: #fff;
  border-radius: 10px;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text-2);
  margin-bottom: 14px;
}

.section { padding-block: var(--section-y); }

.section-title {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.section-head { max-width: 640px; }
.section-sub {
  margin-top: 16px;
  color: var(--text-2);
  font-size: 19px;
}

/* ---------- Brand mark ---------- */
.brand__mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber) 50%, var(--blue) 50%);
  flex-shrink: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: rgba(0, 0, 0, .08); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  font-size: 14px;
}
.nav__links a { color: var(--text-2); transition: color .2s; }
.nav__links a:hover { color: var(--text); }
.nav__links .nav__cta {
  color: #fff;
  background: var(--text);
  padding: 7px 14px;
  border-radius: 999px;
}
.nav__links .nav__cta:hover { color: #fff; background: #3a3a3c; }

@media (max-width: 560px) {
  .nav__links li:not(:last-child) { display: none; }
}

/* ---------- Store buttons ---------- */
.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.store-buttons--center { justify-content: center; }

.store-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 210px;
  min-height: 56px;
  padding: 10px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.store-btn:active { transform: scale(.98); }

.store-btn__label { font-size: 17px; font-weight: 600; line-height: 1.2; }
.store-btn__sub { font-size: 12px; line-height: 1.3; opacity: .75; }

.store-btn--primary { background: var(--accent); color: #fff; }
.store-btn--primary:hover { background: var(--accent-hover); }

.store-btn--secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.store-btn--secondary:hover { border-color: var(--text); }

@media (max-width: 480px) {
  .store-buttons { flex-direction: column; }
  .store-btn { width: 100%; }
}

/* ---------- Hero ---------- */
/* Distance from the content edge to the viewport edge — used to let the
   photo bleed off the right side of the screen. */
.hero {
  --bleed: max(var(--gutter), (100vw - var(--container)) / 2);
  padding-top: clamp(24px, 4vw, 48px);
  overflow: hidden;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(32px, 4vw, 64px);
}

.hero__copy {
  align-self: center;
  padding-bottom: clamp(40px, 6vw, 80px);
}

.hero__title {
  font-size: clamp(36px, 4.8vw, 58px);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.035em;
}
.hero__title-muted { color: var(--text-2); }

.hero__lead {
  margin: 24px 0 36px;
  max-width: 520px;
  font-size: clamp(18px, 1.8vw, 21px);
  line-height: 1.45;
  color: var(--text-2);
}

.hero__caption {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-2);
}

/* Photo: sits on the bottom edge of the hero and bleeds off the right side */
.hero__visual {
  align-self: end;
  display: flex;
  justify-content: flex-end;
  margin-right: calc(-1 * var(--bleed));
}

.hero__media {
  position: relative;
  width: clamp(360px, calc((100vh - 110px) * .8), 680px);
  width: clamp(360px, calc((100svh - 110px) * .8), 680px);
  max-width: 100%;
}
/* soft halo behind the photo */
.hero__media::before {
  content: "";
  position: absolute;
  inset: 10% 0 0 0;
  z-index: -1;
  background:
    radial-gradient(closest-side at 30% 65%, rgba(47, 111, 214, .12), transparent),
    radial-gradient(closest-side at 70% 30%, rgba(217, 149, 47, .12), transparent);
  filter: blur(30px);
}

.hero__photo {
  display: block;
  width: 100%;
  height: auto;
  /* soften the cropped left edge of the photo */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16%);
  mask-image: linear-gradient(to right, transparent 0, #000 16%);
}

@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; gap: 8px; text-align: center; }
  .hero__copy { padding-bottom: 0; }
  .hero__lead { margin-inline: auto; }
  .hero__copy .store-buttons { justify-content: center; }
  .hero__visual {
    justify-content: center;
    margin-inline: calc(-1 * var(--gutter));
  }
  .hero__media { width: min(100%, 520px); }
}

/* ---------- Phone mockup ----------
   Sized from its own width (container query units), so it scales cleanly
   wherever it is placed. 1cqw = 1% of the phone width. */
.phone {
  position: absolute;
  left: -12%;
  bottom: 7%;
  width: 31%;
  aspect-ratio: 300 / 620;
  container-type: inline-size;
  z-index: 1;
}

@media (max-width: 880px) {
  .phone { left: auto; right: 5%; width: 34%; }
}

.phone__frame {
  position: relative;
  height: 100%;
  padding: 3.8cqw;
  border-radius: 17.5cqw;
  background: linear-gradient(145deg, #2c2c2e, #1c1c1e);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .25),
    inset 0 0 0 1.5px rgba(255, 255, 255, .12),
    0 40px 80px -20px rgba(0, 0, 0, .35),
    0 18px 36px -18px rgba(0, 0, 0, .3);
}

.phone__island {
  position: absolute;
  top: 7.5cqw;
  left: 50%;
  translate: -50% 0;
  width: 30%;
  height: 8.8cqw;
  border-radius: 6cqw;
  background: #000;
  z-index: 2;
}

.phone__screen {
  height: 100%;
  border-radius: 14cqw;
  background: var(--bg-alt);
  overflow: hidden;
}

.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 5.4cqw 5.6cqw 7cqw;
  font-size: 4.2cqw;
  line-height: 1.3;
  color: var(--text);
  text-align: left;
}

.app__status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6cqw 3.4cqw 0;
  font-weight: 600;
}
.app__status-icons { display: inline-flex; gap: 1cqw; }
.app__status-icons i {
  width: 4.8cqw; height: 2.8cqw; border-radius: .7cqw; background: var(--text);
}
.app__status-icons i:nth-child(1) { width: 4cqw; }
.app__status-icons i:nth-child(2) { width: 3.4cqw; }

.app__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8.6cqw .6cqw 4.4cqw;
}
.app__title { font-size: 7.4cqw; font-weight: 700; letter-spacing: -0.02em; }
.app__badge {
  font-size: 3.4cqw;
  font-weight: 600;
  padding: 1.3cqw 3cqw;
  border-radius: 999px;
  background: rgba(0, 0, 0, .06);
  color: var(--text-2);
}

/* camera viewfinder: original scene, corrected scene revealed by a scan line */
.viewfinder {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8cqw;
  overflow: hidden;
  background: #efe9df;
}
.viewfinder__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.viewfinder__layer--adjusted {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.6s var(--ease);
}
.viewfinder__scan {
  position: absolute;
  left: 0; right: 0;
  top: 0;
  height: 2px;
  background: #fff;
  box-shadow: 0 0 10px 3px rgba(255, 255, 255, .85);
  opacity: 0;
  transition: top 1.6s var(--ease), opacity .3s;
}
.viewfinder__corners {
  position: absolute;
  inset: 6%;
  pointer-events: none;
  --c: rgba(255, 255, 255, .95);
  background:
    linear-gradient(var(--c), var(--c)) top left / 14% 2px,
    linear-gradient(var(--c), var(--c)) top left / 2px 14%,
    linear-gradient(var(--c), var(--c)) top right / 14% 2px,
    linear-gradient(var(--c), var(--c)) top right / 2px 14%,
    linear-gradient(var(--c), var(--c)) bottom left / 14% 2px,
    linear-gradient(var(--c), var(--c)) bottom left / 2px 14%,
    linear-gradient(var(--c), var(--c)) bottom right / 14% 2px,
    linear-gradient(var(--c), var(--c)) bottom right / 2px 14%;
  background-repeat: no-repeat;
}
.is-adjusted .viewfinder__layer--adjusted { clip-path: inset(0 0 0 0); }
.is-scanning .viewfinder__scan { opacity: 1; }
.is-adjusted .viewfinder__scan { top: calc(100% - 2px); }

/* segmented control */
.segmented {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 5cqw;
  padding: 1cqw;
  border-radius: 3.8cqw;
  background: rgba(118, 118, 128, .14);
  font-weight: 600;
}
.segmented__thumb {
  position: absolute;
  top: 1cqw; bottom: 1cqw; left: 1cqw;
  width: calc(50% - 1cqw);
  border-radius: 2.8cqw;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
  transition: transform .6s var(--ease);
}
.segmented__option {
  position: relative;
  text-align: center;
  padding: 2cqw 0;
  color: var(--text-2);
  transition: color .4s;
}
.segmented__option.is-active { color: var(--text); }
.is-adjusted .segmented__thumb { transform: translateX(100%); }

/* slider */
.app__control {
  margin-top: 4.4cqw;
  padding: 4cqw 4.6cqw;
  border-radius: 4.6cqw;
  background: #fff;
}
.app__control-row {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 3.4cqw;
}
.app__control-value { color: var(--text-2); font-variant-numeric: tabular-nums; }

.slider {
  position: relative;
  height: 1.4cqw;
  border-radius: 1.4cqw;
  background: rgba(118, 118, 128, .2);
}
.slider__fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 1.6s var(--ease);
}
.slider__knob {
  position: absolute;
  top: 50%; left: 0;
  width: 6cqw; height: 6cqw;
  translate: -50% -50%;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
  transition: left 1.6s var(--ease);
}
.is-adjusted .slider__fill { width: 72%; }
.is-adjusted .slider__knob { left: 72%; }

.app__profile {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.6cqw;
  color: var(--text-2);
  font-size: 3.6cqw;
}
.app__profile-dot {
  width: 2.8cqw; height: 2.8cqw; border-radius: 50%;
  background: linear-gradient(135deg, var(--amber) 50%, var(--blue) 50%);
}

/* ---------- About ---------- */
.about { background: var(--bg-alt); }

.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

.about__body > p:not(.note) {
  font-size: clamp(18px, 1.7vw, 21px);
  line-height: 1.5;
  color: var(--text-2);
}
.about__body > p + p { margin-top: 20px; }
.about__body strong { color: var(--text); font-weight: 600; }

.swatch-demo {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 40px 0;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .7);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.swatch-demo__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.swatch-demo__label {
  width: 100%;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.swatch {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--c);
}
.swatch-demo__arrow {
  flex: 1;
  height: 1px;
  min-width: 24px;
  margin-top: 22px;
  background: var(--line);
  position: relative;
}
.swatch-demo__arrow::after {
  content: "";
  position: absolute;
  right: 0; top: 50%;
  width: 8px; height: 8px;
  border-top: 1px solid var(--text-2);
  border-right: 1px solid var(--text-2);
  transform: translateY(-50%) rotate(45deg);
}

.note {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
  padding-left: 14px;
  border-left: 2px solid var(--line);
}

@media (max-width: 880px) {
  .about__grid { grid-template-columns: 1fr; }
}

/* ---------- How it works ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(40px, 5vw, 72px);
  margin-top: clamp(56px, 7vw, 88px);
  counter-reset: step;
}

.step {
  position: relative;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.step__num {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.step__icon {
  width: 44px;
  height: 44px;
  margin: 28px 0 20px;
  color: var(--text);
}
.step__title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.step__text { color: var(--text-2); }

.how__tech {
  margin-top: clamp(56px, 7vw, 88px);
  max-width: 680px;
  font-size: 15px;
  color: var(--text-2);
}

@media (max-width: 880px) {
  .steps { grid-template-columns: 1fr; gap: 40px; }
  .step__icon { margin: 20px 0 16px; }
}

/* ---------- Download ---------- */
.download {
  background: var(--bg-alt);
  text-align: center;
}
.download__inner { display: flex; flex-direction: column; align-items: center; }

.pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(0, 0, 0, .06);
}

.download__title {
  margin-top: 24px;
  font-size: clamp(44px, 7vw, 80px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.download__lead {
  margin: 18px 0 40px;
  max-width: 480px;
  font-size: clamp(18px, 1.8vw, 21px);
  color: var(--text-2);
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 32px 40px;
  font-size: 13px;
  color: var(--text-2);
  border-top: 1px solid rgba(0, 0, 0, .06);
  background: var(--bg-alt);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
}
.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}
.footer__brand .brand__mark { width: 16px; height: 16px; }
.footer__note { flex: 1; min-width: 220px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 14px;
  background: rgba(29, 29, 31, .88);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #fff;
  font-size: 14px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast:empty { padding: 0; }

/* ---------- Reveal on scroll (only when JS is running) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

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