@import url("./theme.css");

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

html {
  scroll-behavior: smooth;
  background: var(--color-bg);
}

body {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.6;
  background: var(--color-bg);
  background-image: var(--gradient-aurora);
  background-attachment: fixed;
}

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

a {
  color: var(--color-accent-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--color-accent);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-shell {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--color-bg-warm) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 4.35rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  font-size: var(--text-md);
  letter-spacing: -0.02em;
}

.brand__logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 9px;
  box-shadow: var(--shadow-mark);
  object-fit: cover;
}

.brand__name {
  color: var(--color-text);
}

.site-nav {
  display: none;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2rem);
  font-size: var(--text-sm);
  font-weight: 600;
}

.site-nav a {
  color: var(--color-text);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--color-accent-deep);
}

.site-header__cta {
  display: none;
  flex-shrink: 0;
}

.nav-drawer {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-drawer > summary {
  list-style: none;
  cursor: pointer;
}

.nav-drawer > summary::-webkit-details-marker {
  display: none;
}

.nav-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
}

.nav-menu-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.nav-drawer[open] .nav-menu-btn {
  border-color: var(--color-accent-line);
  box-shadow: var(--shadow-ring);
}

.nav-drawer-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 15rem;
  max-height: min(70vh, 24rem);
  overflow-y: auto;
  padding: var(--space-4);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-menu);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.nav-drawer-panel a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 550;
  padding: 0.35rem 0;
}

.nav-drawer-panel .btn {
  margin-top: var(--space-2);
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-pill);
  font-weight: 650;
  font-size: var(--text-sm);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-ring);
}

.btn-primary {
  background: var(--color-accent-deep);
  color: var(--color-on-accent);
  box-shadow: var(--shadow-float);
}

.btn-primary:hover {
  color: var(--color-on-accent);
  transform: translateY(-1px);
}

.btn-secondary {
  background: color-mix(in srgb, var(--color-accent-mint) 38%, var(--color-surface));
  color: var(--color-accent-deep);
  border-color: color-mix(in srgb, var(--color-accent-mint) 65%, transparent);
}

.btn-secondary:hover {
  background: color-mix(in srgb, var(--color-accent-mint) 50%, var(--color-surface));
  color: var(--color-text);
}

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

.btn-ghost:hover {
  border-color: var(--color-accent-line);
  color: var(--color-accent-deep);
}

.btn-nav {
  padding: 0.5rem 1rem;
  font-size: var(--text-xs);
  white-space: nowrap;
}

.site-main {
  padding: clamp(1.25rem, 4vw, 2rem) 0 var(--space-6);
}

.site-footer {
  border-top: 1px solid var(--color-line);
  padding: var(--space-6) 0 var(--space-7);
  text-align: center;
  color: var(--color-text-dim);
  font-size: var(--text-sm);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4) var(--space-5);
  margin-bottom: var(--space-3);
}

.site-footer a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 550;
}

.site-footer a:hover {
  color: var(--color-accent-deep);
}

.site-footer .contact {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--color-text-soft);
}

/* —— Homepage —— */

.hero {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: center;
  margin-bottom: clamp(1.5rem, 4vw, 2rem);
}

.hero-copy h1 {
  margin: 0 0 var(--space-4);
  font-size: clamp(2rem, 5.2vw, var(--text-2xl));
  line-height: 1.12;
  letter-spacing: -0.04em;
  font-weight: 800;
  color: var(--color-text);
}

.hero-copy h1 .hero-heading__line {
  display: block;
}

@media (min-width: 720px) {
  .hero-copy h1 {
    max-width: 12em;
  }

  .hero-copy h1 .hero-heading__line + .hero-heading__line {
    margin-top: 0.06em;
  }
}

.hero-copy .lede {
  margin: 0 0 var(--space-5);
  font-size: clamp(var(--text-md), 2.5vw, var(--text-lg));
  color: var(--color-accent-deep);
  font-weight: 500;
  max-width: 36rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

/* Nav "Download" → /#download: land on install CTAs, clear sticky header */
#download.hero-actions--install {
  scroll-margin-top: 5.25rem;
}

.hero-note {
  margin: var(--space-4) 0 0;
  max-width: 40rem;
  font-size: var(--text-xs);
  line-height: 1.55;
  color: var(--color-text-soft);
}

.hero-visual {
  position: relative;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-visual__glow {
  position: absolute;
  inset: 10% 5% 5%;
  background: radial-gradient(
    ellipse at 50% 45%,
    color-mix(in srgb, var(--color-accent-mint) 55%, transparent) 0%,
    transparent 68%
  );
  filter: blur(2px);
  pointer-events: none;
  z-index: 0;
}

.hero-devices {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  max-width: min(100%, 380px);
  margin-inline: auto;
}

.hero-laptop {
  width: min(100%, 100%);
  max-width: 340px;
  position: relative;
}

.hero-laptop__lid {
  height: 8px;
  border-radius: 10px 10px 2px 2px;
  background: linear-gradient(180deg, #2a3f38, #1c2b27);
  margin: 0 10%;
}

.hero-laptop__screen {
  position: relative;
  padding: 0.5rem 0.5rem 0.35rem;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(145deg, #243a33, #1a2824);
  border: 1px solid color-mix(in srgb, var(--color-line-strong) 70%, #1c2b27);
  border-bottom: none;
  box-shadow: var(--shadow-pop);
}

.hero-laptop__base {
  height: 10px;
  margin: 0 4%;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(180deg, #3a4f48, #2a3833);
  box-shadow: 0 6px 14px -6px rgba(28, 43, 39, 0.5);
}

.demo-chrome {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.45rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-surface) 94%, #1c2b27);
}

.demo-chrome__dots {
  display: flex;
  gap: 5px;
}

.demo-chrome__dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-text-soft) 45%, transparent);
}

.demo-chrome__bar {
  flex: 1;
  height: 18px;
  border-radius: 6px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-line);
}

.demo-preview {
  padding: 0.6rem 0.65rem 0.75rem;
  border-radius: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  min-height: 118px;
}

.demo-preview__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.55rem;
}

.demo-chip {
  font-size: 10px;
  font-weight: 650;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  color: var(--color-text-dim);
  background: var(--color-bg-warm);
  border: 1px solid var(--color-line);
}

.demo-chip--active {
  background: var(--color-accent-deep);
  color: var(--color-on-accent);
  border-color: transparent;
}

.demo-preview__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.demo-preview__list li {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.4rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--color-bg-warm);
  border: 1px solid var(--color-line);
}

.demo-preview__title {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text);
}

.demo-preview__sub {
  font-size: 10px;
  color: var(--color-text-soft);
}

.hero-popup-thumb {
  position: absolute;
  right: 2%;
  bottom: 12%;
  width: min(38%, 150px);
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--color-line);
  box-shadow: 0 12px 28px -12px rgba(28, 43, 39, 0.45);
  background: var(--color-surface);
  line-height: 0;
}

.hero-popup-thumb img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-phone {
  margin: 0;
  width: fit-content;
}

.hero-phone .phone-frame {
  margin: 0;
  padding: 0.45rem;
  border-radius: 1.65rem;
  background: linear-gradient(145deg, #1c2b27, #0f1916);
  box-shadow: var(--shadow-pop);
  width: fit-content;
}

.hero-phone .phone-screen {
  overflow: hidden;
  border-radius: 1.3rem;
  line-height: 0;
  max-width: 180px;
}

.hero-phone .phone-screen img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-highlights {
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.hero-highlights__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}

.hero-highlight {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-line);
  background: color-mix(in srgb, var(--color-surface) 92%, var(--color-bg-warm));
  box-shadow: var(--shadow-card);
  font-weight: 650;
  font-size: var(--text-md);
  color: var(--color-text);
}

.hero-highlight__icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  background: var(--color-accent-soft);
  color: var(--color-accent-deep);
  display: grid;
  place-items: center;
}

.hero-highlight__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.feature-grid {
  display: grid;
  gap: var(--space-4);
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.feature-card {
  background: var(--gradient-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  align-items: start;
}

.feature-card__icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-sm);
  background: var(--gradient-brand);
  color: var(--color-on-accent);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-mark);
}

.feature-card__icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.feature-card h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
}

.feature-card p {
  margin: 0;
  grid-column: 1 / -1;
  color: var(--color-text-dim);
  font-size: var(--text-sm);
}

.section-heading {
  text-align: center;
  margin: 0 0 var(--space-6);
  font-size: clamp(1.5rem, 4vw, var(--text-xl));
  letter-spacing: -0.03em;
  color: var(--color-text);
}

.steps {
  display: grid;
  gap: var(--space-5);
  margin-bottom: var(--space-7);
}

.step {
  text-align: center;
  padding: var(--space-5);
}

.step__icon {
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-accent-soft);
  color: var(--color-accent-deep);
  display: grid;
  place-items: center;
}

.step__icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.step h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
}

.step p {
  margin: 0 auto;
  max-width: 18rem;
  color: var(--color-text-dim);
  font-size: var(--text-sm);
}

/* —— Legal / prose pages —— */

.page-content {
  max-width: 44rem;
  margin: 0 auto;
}

.page-content h1 {
  font-size: clamp(1.6rem, 4vw, 2rem);
  letter-spacing: -0.03em;
  margin: 0 0 var(--space-3);
}

.page-content h2 {
  font-size: var(--text-lg);
  margin: var(--space-6) 0 var(--space-3);
  letter-spacing: -0.02em;
}

.page-content p,
.page-content li {
  color: var(--color-text-dim);
}

.page-content li {
  margin: 0.35rem 0;
}

.updated {
  font-size: var(--text-xs);
  color: var(--color-text-soft);
}

@media (min-width: 640px) {
  .hero-highlights__list {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-highlight {
    flex-direction: column;
    text-align: center;
    gap: var(--space-3);
  }

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

@media (min-width: 900px) {
  .hero-devices {
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    max-width: none;
    gap: var(--space-4);
    padding-bottom: var(--space-2);
  }

  .hero-laptop {
    flex: 1 1 52%;
    max-width: 400px;
    margin-bottom: 0.25rem;
  }

  .hero-phone {
    flex: 0 0 auto;
    align-self: flex-end;
    transform: translateY(4px);
  }

  .hero-phone .phone-screen {
    max-width: none;
    width: 200px;
  }
}

@media (min-width: 720px) {
  .site-nav {
    display: flex;
  }

  .site-header__cta {
    display: block;
  }

  .nav-drawer {
    display: none;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: center;
    margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
  }

  .hero-visual {
    min-height: 380px;
    justify-content: flex-end;
  }

  .hero-devices {
    width: auto;
    margin-inline: 0;
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 719px) {
  /* Keep hero copy + note clear of device mockups: popup overlay must not paint into the text column */
  .hero {
    gap: var(--space-6);
  }

  .hero-copy .hero-note {
    margin-bottom: var(--space-5);
  }

  .hero-laptop {
    order: 1;
  }

  .hero-phone {
    order: 2;
  }

  .hero-devices {
    flex-direction: column;
  }

  .hero-laptop__screen {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .hero-popup-thumb {
    position: static;
    width: min(88%, 200px);
    max-width: 200px;
    margin: var(--space-3) auto 0;
    align-self: center;
    box-shadow: 0 12px 28px -12px rgba(28, 43, 39, 0.35);
  }
}
.btn-soon { cursor: default; opacity: .7; pointer-events: none; }
