/*
 * NextUp website. Mirrors the app's onboarding: the deep-purple wallpaper ground, frosted glass
 * panels, Poppins ExtraBold headlines and the rose→magenta→amber brand gradient. Colours come
 * from src/theme/brandMark.json and src/theme/theme.ts (onWallpaper) — keep them in step.
 */
@font-face {
  font-family: 'Poppins';
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/poppins-800.woff2') format('woff2');
}

:root {
  --ground: #241041;
  --ground-to: #3d1a6b;
  --ink: #ffffff;
  --ink-body: rgba(255, 255, 255, 0.84);
  --ink-muted: rgba(255, 255, 255, 0.72);
  --ink-subtle: rgba(255, 255, 255, 0.62);
  --hairline: rgba(255, 255, 255, 0.16);
  --panel-from: rgba(28, 11, 52, 0.68);
  --panel-to: rgba(18, 7, 36, 0.72);
  --panel-edge: rgba(255, 255, 255, 0.28);
  --accent: #f472d0;
  --rose: #f0356e;
  --magenta: #e035be;
  --amber: #fbbf24;
  --blue: #3b82f6;
  --sky: #38bdf8;
  --violet: #8b5cf6;
  --purple: #a855f7;
  --brand-gradient: linear-gradient(90deg, var(--rose), var(--magenta) 55%, var(--amber));
  --radius-panel: 22px;
  --radius-card: 14px;
  --display: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --max: 1080px;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-body);
  background-color: var(--ground);
  /* The icon's ground: a 40° ramp with three soft blooms (brandMark.json → ground). */
  background-image:
    radial-gradient(60vmax 60vmax at 82% 8%, rgba(109, 31, 191, 0.55), transparent 62%),
    radial-gradient(46vmax 46vmax at 92% 92%, rgba(224, 53, 190, 0.22), transparent 62%),
    radial-gradient(40vmax 40vmax at 6% 4%, rgba(77, 122, 199, 0.24), transparent 62%),
    linear-gradient(140deg, var(--ground), var(--ground-to));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

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

/* Avoid a lone word on the last line of short copy blocks. */
p,
li {
  text-wrap: pretty;
}
h1,
h2,
h3 {
  text-wrap: balance;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover {
  color: #ff9ae3;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--ground);
  border-radius: 999px;
  z-index: 10;
}
.skip-link:focus {
  left: 12px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header ───────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: rgba(22, 9, 42, 0.55);
  border-bottom: 1px solid var(--hairline);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.lockup img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 21px;
  line-height: 1;
  letter-spacing: -0.023em;
  color: var(--ink);
}
.wordmark span {
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}
.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--ink);
}

/* ── Buttons ──────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: #fff;
  white-space: nowrap;
}
.btn-primary {
  background: var(--brand-gradient);
  box-shadow: 0 8px 28px rgba(224, 53, 190, 0.42);
}
.btn-primary:hover {
  color: #fff;
  filter: brightness(1.06);
}
.btn-ghost {
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}
.btn-ghost:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
}
.btn[aria-disabled='true'] {
  cursor: default;
}

/* ── Glass ────────────────────────────────────────────────────────── */

.glass {
  position: relative;
  border-radius: var(--radius-panel);
  background: linear-gradient(160deg, var(--panel-from), var(--panel-to));
  overflow: hidden;
}
.glass::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: var(--panel-edge);
  pointer-events: none;
}
.glass.blur {
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

/* ── Hero ─────────────────────────────────────────────────────────── */

.hero {
  padding: 72px 0 40px;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 48px;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 18px;
}
.kicker::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.8);
}

h1,
h2,
h3 {
  color: var(--ink);
  margin: 0;
}
.display {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.022em;
  line-height: 1.1;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 64px);
}
.hero h1 .accent {
  color: var(--accent);
}
.lede {
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--ink-muted);
  max-width: 34em;
  margin: 22px 0 32px;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.fine {
  font-size: 14px;
  color: var(--ink-subtle);
  margin-top: 18px;
}

/* Phone mock: the onboarding's own wallpaper, scrimmed, with the widget panel on it. */
.phone {
  position: relative;
  width: min(340px, 100%);
  aspect-ratio: 9 / 18.5;
  margin: 0 auto;
  border-radius: 44px;
  padding: 10px;
  background: #0d0619;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 40px 80px rgba(8, 2, 20, 0.6);
}
.phone-screen {
  position: relative;
  height: 100%;
  border-radius: 34px;
  overflow: hidden;
  background: #1a1030 url('/assets/wallpaper.svg') center / cover no-repeat;
}
.phone-screen::after {
  /* WALLPAPER_SCRIM in WidgetPreviewFrame.tsx, lightened slightly for the smaller canvas. */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(20, 8, 38, 0.44) 0%,
    rgba(20, 8, 38, 0.18) 16%,
    rgba(18, 7, 34, 0.22) 58%,
    rgba(16, 6, 32, 0.55) 82%,
    rgba(13, 5, 26, 0.75) 100%
  );
}
.phone-status {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  padding: 14px 24px 0;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.phone-widget {
  position: relative;
  z-index: 1;
  margin: 34px 14px 0;
}
.phone-dock {
  position: absolute;
  z-index: 1;
  left: 22px;
  right: 22px;
  bottom: 22px;
  display: flex;
  justify-content: space-between;
}
.phone-dock i {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.phone-dock i:nth-child(2) {
  background: url('/assets/icon.svg') center / cover;
}

/* ── Agenda card (MockAgendaCard.tsx) ─────────────────────────────── */

.agenda {
  padding: 16px 16px 14px;
}
.agenda-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.agenda-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
}
.agenda-date {
  font-size: 12px;
  color: var(--ink-subtle);
}
.agenda-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
}
.row.next {
  margin: 0 -9px;
  padding: 0 9px;
  border-radius: 10px;
  background: rgba(240, 53, 110, 0.14);
}
.bar {
  flex: none;
  width: 3px;
  height: 32px;
  border-radius: 2px;
}
.bar.c0 {
  background: linear-gradient(180deg, var(--blue), var(--sky));
}
.bar.c1 {
  background: linear-gradient(180deg, var(--violet), var(--purple));
}
.bar.c2 {
  background: linear-gradient(180deg, var(--rose), var(--magenta), var(--amber));
}
.box {
  flex: none;
  width: 17px;
  height: 17px;
  margin-left: -3px;
  border-radius: 5px;
  border: 1.5px solid var(--hairline);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.box.done {
  background: var(--rose);
  border-color: var(--rose);
}
.warn {
  flex: none;
  width: 17px;
  height: 17px;
  color: var(--rose);
}
.lines {
  flex: 1;
  min-width: 0;
}
.title {
  display: block;
  font-size: 14px;
  line-height: 18px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.title.done {
  color: var(--ink-subtle);
  text-decoration: line-through;
}
.meta {
  display: block;
  font-size: 11.5px;
  line-height: 15px;
  color: var(--ink-muted);
}
.meta.now {
  color: var(--amber);
}
.live {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}
.pro-badge {
  flex: none;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--brand-gradient);
}

/* ── Sections ─────────────────────────────────────────────────────── */

section {
  padding: 56px 0;
}
.section-head {
  max-width: 760px;
  margin-bottom: 36px;
}
.section-head h2 {
  font-size: clamp(30px, 3.6vw, 40px);
}
.section-head p {
  color: var(--ink-muted);
  margin: 14px 0 0;
  font-size: 17px;
}

/* The onboarding rail, used as a section divider for the three steps. */
.rail {
  display: flex;
  gap: 8px;
  height: 4px;
  max-width: 220px;
  margin-bottom: 22px;
}
.rail i {
  flex: 1;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
}
.rail i.past {
  background: rgba(255, 255, 255, 0.55);
}
.rail i.active {
  flex: 3;
  background: var(--brand-gradient);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.step {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.step .agenda {
  padding: 14px;
  border-radius: 16px;
  background: rgba(8, 2, 20, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.step-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}
.step h3 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 23px;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-top: 6px;
}
.step p {
  margin: 10px 0 0;
  color: var(--ink-muted);
  font-size: 15.5px;
}

.pro {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 36px;
  padding: 36px;
  align-items: center;
}
.pro h2 {
  font-size: clamp(30px, 3.4vw, 38px);
}
.price-note {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  font-size: 14px;
  color: var(--ink-muted);
}
.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}
.features li {
  display: grid;
  grid-template-columns: 3px 1fr;
  gap: 14px;
}
.features .bar {
  height: auto;
}
.features strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
}
.features span {
  display: block;
  color: var(--ink-muted);
  font-size: 15px;
}

.privacy-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.fact {
  padding: 20px;
}
.fact svg {
  width: 26px;
  height: 26px;
  color: var(--accent);
}
.fact strong {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-size: 16px;
}
.fact span {
  display: block;
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 14.5px;
  line-height: 1.5;
}
.band-foot {
  margin-top: 22px;
}

/* ── Footer ───────────────────────────────────────────────────────── */

.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--hairline);
  padding: 28px 0 40px;
  font-size: 14px;
  color: var(--ink-subtle);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.site-footer a {
  color: var(--ink-muted);
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--ink);
}

/* ── Legal document ───────────────────────────────────────────────── */

.doc-hero {
  padding: 56px 0 28px;
}
.doc-hero h1 {
  font-size: clamp(36px, 5vw, 52px);
}
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 18px;
  align-items: center;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.05);
  font-size: 13.5px;
  color: var(--ink-muted);
  text-decoration: none;
}
a.chip:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.09);
}
.chip.current::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
}

.notice {
  margin: 0 0 22px;
  padding: 14px 18px;
  border-radius: var(--radius-card);
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.1);
  color: var(--ink);
  font-size: 15px;
}
.notice a {
  color: var(--amber);
}

.doc-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}
.toc {
  position: sticky;
  top: 88px;
  font-size: 14px;
}
.toc p {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  border-left: 1px solid var(--hairline);
}
.toc a {
  display: block;
  padding: 5px 0 5px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--ink-muted);
  text-decoration: none;
  line-height: 1.35;
}
.toc a:hover {
  color: var(--ink);
  border-left-color: var(--accent);
}

.doc {
  padding: 40px clamp(22px, 4vw, 48px);
}
.doc h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin: 44px 0 12px;
  scroll-margin-top: 90px;
}
.doc h2:first-child {
  margin-top: 0;
}
.doc h3 {
  font-size: 17px;
  margin: 26px 0 8px;
  scroll-margin-top: 90px;
}
.doc p,
.doc li {
  color: var(--ink-body);
}
.doc p {
  margin: 0 0 14px;
}
.doc ul,
.doc ol {
  margin: 0 0 16px;
  padding-left: 22px;
}
.doc li {
  margin: 6px 0;
}
.doc li::marker {
  color: var(--accent);
}
.doc strong {
  color: var(--ink);
}
.doc code {
  font-size: 0.9em;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  word-break: break-word;
}

.summary {
  margin: 0 0 8px;
  padding: 22px 24px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hairline);
}
.summary h2 {
  margin-top: 0 !important;
  font-size: 20px;
}
.summary ul {
  margin-bottom: 0;
}

.table-scroll {
  overflow-x: auto;
  margin: 0 0 18px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  min-width: 620px;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
}
tr:last-child td {
  border-bottom: 0;
}
th {
  color: var(--ink);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
}
td {
  color: var(--ink-body);
}

.callout {
  margin: 0 0 16px;
  padding: 16px 18px;
  border-left: 3px solid;
  border-image: linear-gradient(180deg, var(--rose), var(--magenta), var(--amber)) 1;
  background: rgba(255, 255, 255, 0.04);
}
.callout p:last-child {
  margin-bottom: 0;
}

/* Version history */
.versions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.version {
  padding: 22px 24px;
}
.version-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.version h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 21px;
}
.version p {
  margin: 8px 0 0;
  color: var(--ink-muted);
}
.version ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--ink-body);
}

/* ── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .hero .wrap,
  .pro {
    grid-template-columns: 1fr;
  }
  .hero {
    padding-top: 44px;
  }
  .steps {
    grid-template-columns: 1fr;
  }
  .privacy-band {
    grid-template-columns: repeat(2, 1fr);
  }
  .doc-layout {
    grid-template-columns: 1fr;
  }
  .toc {
    position: static;
  }
}

@media (max-width: 560px) {
  .nav a.hide-sm {
    display: none;
  }
  .privacy-band {
    grid-template-columns: 1fr;
  }
  .pro {
    padding: 24px;
  }
  .cta-row .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .live {
    animation: none;
  }
}

@media print {
  body {
    background: #fff;
    color: #111;
  }
  .site-header,
  .site-footer,
  .toc,
  .skip-link {
    display: none;
  }
  .glass,
  .doc {
    background: none;
    padding: 0;
  }
  .doc h2,
  .doc h3,
  .doc strong,
  h1 {
    color: #111;
  }
  .doc p,
  .doc li,
  td,
  .chip {
    color: #222;
  }
}
