/* Stacked website: Glass look (matches GlassColors in the app). */

@font-face {
  font-family: "Roboto";
  src: url("fonts/roboto-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #08090D;
  --glow-green: rgba(16, 185, 129, 0.25);
  --glow-red: rgba(239, 68, 68, 0.25);
  --glow-purple: rgba(139, 92, 246, 0.25);

  --card-fill: linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08)), rgba(8, 9, 13, 0.6);
  --card-border: rgba(255, 255, 255, 0.18);
  --card-blur: blur(20px) saturate(140%);
  --input-fill: rgba(255, 255, 255, 0.06);

  --r-card: 20px;
  --r-panel: 26px;
  --r-control: 16px;

  --text: #FFFFFF;
  --text-2: #C7CBD4;
  --hint: #B0B5C0;
  --link: #C4B5FD;
  --accent: #8B5CF6;
  /* Button fill: #8B5CF6 with white text is 4.2:1, this shade is 5.7:1. */
  --accent-fill: #7C3AED;
  --success: #6EE7B7;
  --error: #F87171;

  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

/* Reduce look: solid cards, no blur, no animation. Same glows and corners. */
@media (prefers-reduced-transparency: reduce), (prefers-reduced-motion: reduce) {
  :root {
    --card-fill: #1C1F2A;
    --card-border: rgba(255, 255, 255, 0.14);
    --card-blur: none;
    --input-fill: #252938;
  }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Three big blurred glows, fixed behind everything. */
.glows { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.glows span {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  filter: blur(60px);
  animation: drift 26s ease-in-out infinite alternate;
}
.glows .g1 { background: radial-gradient(circle, var(--glow-green) 0%, transparent 65%); top: -30vmax; left: -25vmax; }
.glows .g2 { background: radial-gradient(circle, var(--glow-red) 0%, transparent 65%); top: 25vh; right: -35vmax; animation-delay: -9s; }
.glows .g3 { background: radial-gradient(circle, var(--glow-purple) 0%, transparent 65%); bottom: -35vmax; left: 5vw; animation-delay: -17s; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(4vmax, 3vmax) scale(1.08); }
}

a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--accent-fill); color: #fff; padding: 8px 14px; border-radius: var(--r-control); z-index: 10; }

/* Glass surfaces */
.glass {
  background: var(--card-fill);
  border: 1px solid var(--card-border);
  border-radius: var(--r-card);
  -webkit-backdrop-filter: var(--card-blur);
  backdrop-filter: var(--card-blur);
}
.panel { border-radius: var(--r-panel); }
.card { padding: 22px 20px; }

/* Header */
.site-header { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 19px; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }

/* Hero: one left column. The right side stays free for the tour phone (site.js tilts it there).
   The hero sits above the phone but lets clicks on its empty space through. */
.hero {
  position: relative; z-index: 2; pointer-events: none;
  display: flex; flex-direction: column; justify-content: center;
  min-height: calc(100svh - 72px); padding: 16px 0 40px;
}
.hero-copy { max-width: 580px; pointer-events: auto; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin: 0; }
.hero-actions .btn { width: auto; }
.hero h1 { font-size: clamp(42px, 11vw, 68px); line-height: 1.02; margin: 0 0 16px; letter-spacing: -0.025em; font-weight: 800; }
.hero .lede { color: var(--text-2); margin: 0 0 24px; max-width: 34em; font-size: 18px; }

/* Join form */
.join { padding: 22px 20px; }
.join h2 { margin: 0 0 4px; font-size: 21px; }
.join .sub { margin: 0 0 16px; color: var(--text-2); font-size: 15px; }
label, legend { font-weight: 500; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
input[type="email"] {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  font: inherit;
  color: var(--text);
  background: var(--input-fill);
  border: 1px solid var(--card-border);
  border-radius: var(--r-control);
}
input[type="email"]::placeholder { color: var(--hint); opacity: 1; }
input[type="email"]:focus { outline: 2px solid var(--link); outline-offset: 1px; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { padding: 0; margin-bottom: 4px; }
.hint { color: var(--hint); font-size: 14px; margin: 0 0 10px; }
.ticks { display: grid; gap: 8px; }
.tick {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--card-border);
  border-radius: var(--r-control);
  background: var(--input-fill);
  cursor: pointer; font-weight: 400; font-size: 15px;
}
.tick input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; flex: none; }
.tick:has(input:checked) { border-color: var(--link); }
.turnstile { min-height: 65px; margin-bottom: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; min-height: 52px; padding: 12px 20px;
  font: inherit; font-weight: 700; font-size: 17px;
  color: #fff;
  background: var(--accent-fill);
  border: 1px solid var(--accent);
  border-radius: var(--r-control);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.35);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5); }
.btn[disabled] { cursor: progress; opacity: 0.85; transform: none; }
.btn.secondary { background: transparent; border-color: var(--card-border); box-shadow: none; }

.status { margin: 12px 0 0; min-height: 1.4em; font-size: 15px; }
.status.error { color: var(--error); }
.status.ok { color: var(--success); }
.done { text-align: center; padding: 10px 0; }
.done h2 { color: var(--success); font-size: 24px; margin: 0 0 6px; }
.done p { color: var(--text-2); margin: 0; }

/* Sections */
section { padding: 20px 0; }
.section-title { font-size: 26px; margin: 0 0 14px; }

/* ---- App tour ----
   Default (no JS, or the Reduce look): a plain list, one card per scene.
   .tour-live (added by site.js): sticky phone, crossfading screen, dots. */
.tour { --shot-h: 90vh; }
.tour .section-title { position: relative; z-index: 2; }
.join-section { max-width: 640px; margin: 0 auto; }
.tour-scenes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.tour-scene { min-width: 0; }
.tour-scene h3 { font-size: 21px; line-height: 1.25; }
.tour-shots { display: flex; gap: 12px; margin-top: 16px; }
.tour-shots img {
  display: block; flex: 0 1 220px; min-width: 0; width: 220px; height: auto;
  border-radius: var(--r-card); border: 1px solid var(--card-border); background: #000;
}
.tour-stage, .tour-caption { display: none; }

.tour-live .tour-body { display: grid; }
.tour-live .tour-scenes, .tour-live .tour-stage { grid-area: 1 / 1; }
.tour-live .tour-scenes { gap: 0; }
.tour-live .tour-scene {
  position: relative; display: block; height: calc(var(--shots, 1) * var(--shot-h));
  padding: 0; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none;
}
.tour-mark { position: absolute; left: 0; right: 0; height: var(--shot-h); pointer-events: none; }
.tour-live .tour-shots,
.tour-live .tour-text {
  position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.tour-live .tour-stage {
  position: sticky; top: 0; z-index: 1; align-self: start;
  height: 100vh; height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.tour-live .tour-caption { display: block; text-align: center; max-width: 30em; min-height: 7.2em; margin-top: 18px; padding: 0 8px; }
.tour-caption h3 { margin: 0 0 4px; font-size: 20px; line-height: 1.25; }
.tour-caption p { margin: 0; color: var(--text-2); font-size: 16px; }
.tour-caption.fade { animation: tour-fade 0.35s ease; }
@keyframes tour-fade { from { opacity: 0; transform: translateY(6px); } }

/* Phone frame in the style of a Pixel Pro: 44px outer / 37px screen corners at 320px wide. */
.tour {
  --pw: clamp(170px, min(64vw, calc((100svh - 240px) * 0.44)), 280px);
}
.tour-device { position: relative; }
.tour-live .phone { transform-origin: 50% 30%; }
/* While tilted, layers behind the phone give it real thickness. Each layer gets the phone's transform plus its own
   depth, so no preserve-3d is needed (that made Chrome draw the screenshots at low resolution). */
.phone-slabs {
  display: none; position: absolute; inset: 0; pointer-events: none;
  border-radius: calc(var(--pw) * 0.1375);
}
.phone-slabs.is-tilted { display: block; }
.phone-slab { position: absolute; inset: 0; border-radius: inherit; transform-origin: 50% 30%; }
/* Its own layer while tilted, so Chrome draws the screenshots at full resolution before the 3D turn. */
.phone.is-tilted .phone-screen { will-change: transform; }
.phone {
  position: relative; width: var(--pw);
  padding: calc(var(--pw) * 0.028);
  border-radius: calc(var(--pw) * 0.1375);
  /* Metal rim: lit edges, darker middle. Inside it a thin black bezel. */
  background:
    linear-gradient(#050507, #050507) padding-box,
    linear-gradient(145deg, #6B6E78 0%, #2A2C33 22%, #17181C 50%, #2A2C33 78%, #5A5D66 100%) border-box;
  border: calc(var(--pw) * 0.012) solid transparent;
  box-shadow:
    var(--edge, 0 0 0 0 transparent),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 40px 90px -20px rgba(0, 0, 0, 0.8),
    0 20px 120px -10px rgba(139, 92, 246, 0.28);
}
.phone::before, .phone::after {
  content: ""; position: absolute; right: calc(var(--pw) * -0.026); width: calc(var(--pw) * 0.014);
  background: linear-gradient(90deg, #2A2C33, #4A4D56); border-radius: 0 3px 3px 0;
}
.phone::before { top: 21%; height: 8%; }
.phone::after { top: 33%; height: 15%; }
.phone-screen {
  position: relative; aspect-ratio: 9 / 19.5; overflow: hidden;
  border-radius: calc(var(--pw) * 0.1156); background: #000;
}
.phone-screen img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 0.35s ease;
}
.phone-screen img.on { opacity: 1; }
.phone-screen::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
  /* Glare: stronger while the phone is tilted toward the light (--tilt runs 1 to 0 as it lands). */
  background: linear-gradient(115deg, rgba(255, 255, 255, calc(0.07 + 0.08 * var(--tilt, 0))) 0%,
    rgba(255, 255, 255, 0.02) 30%, transparent 45%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.phone-cam {
  position: absolute; z-index: 2; left: 50%; top: calc(var(--pw) * 0.06);
  width: calc(var(--pw) * 0.034); aspect-ratio: 1; transform: translateX(-50%);
  border-radius: 50%; background: #050507; box-shadow: 0 0 0 1px #24252B;
}

.tour-dots {
  position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
  margin-left: 10px; display: flex; flex-direction: column; gap: 2px;
}
.tour-dot {
  display: grid; place-items: center; width: 24px; height: 24px; padding: 0;
  background: none; border: 0; border-radius: 12px; cursor: pointer;
}
.tour-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.5); transition: height 0.2s ease, background-color 0.2s ease;
}
.tour-dot:hover::before { background: var(--text-2); }
.tour-dot[aria-current]::before { height: 20px; background: var(--link); }
.grid { display: grid; gap: 16px; }
.card h2, .card h3 { margin: 0 0 8px; }
.card p { margin: 0 0 10px; color: var(--text-2); }
.card p:last-child { margin-bottom: 0; }
.promise ul { margin: 0; padding-left: 20px; color: var(--text-2); }
.promise li { margin: 6px 0; }
.promise strong { color: var(--text); }

details { border-top: 1px solid var(--card-border); padding: 12px 0; }
details:first-of-type { border-top: 0; padding-top: 4px; }
summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
details p { margin: 8px 0 0; color: var(--text-2); }

/* Footer */
.site-footer { padding: 28px 0 40px; color: var(--text-2); font-size: 15px; }
.site-footer .row { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* Simple pages (privacy, confirm, remove, 404) */
.page { padding: 24px 0 20px; }
.page .card { padding: 26px 22px; }
.page h1 { font-size: clamp(30px, 8vw, 42px); margin: 0 0 12px; line-height: 1.1; }
.page h2 { font-size: 20px; margin: 26px 0 6px; }
.page p, .page li { color: var(--text-2); }
.page .center { text-align: center; }
.page .actions { display: grid; gap: 10px; margin-top: 20px; }
.muted { color: var(--hint); font-size: 14px; }

/* Phones: the tilted phone pokes out past the edge at the top, so clip sideways (clip keeps sticky working). */
@media (max-width: 759px) {
  .wrap { overflow-x: clip; }
  /* Text at the top; the tilted phone fills the space under it on the first screen. */
  .hero { justify-content: flex-start; padding-top: 24px; }
}
@media (min-width: 720px) {
  .card { padding: 28px; }
  .join { padding: 28px; }
  .ticks { grid-template-columns: 1fr 1fr; }
  .page .actions { grid-template-columns: auto auto; justify-content: center; }
  .page .actions .btn { width: auto; }
  .tour-scene { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; }
  .tour-shots { margin-top: 0; }
  .tour-shots img { flex-basis: 170px; width: 170px; }
}
@media (min-width: 960px) {
  .hero { padding: 48px 0 72px; }
  .grid.two { grid-template-columns: 1fr 1fr; }
  .tour-shots img { flex-basis: 220px; width: 220px; }

  /* Tour: captions on the left, the phone stays in the middle of the screen on the right. */
  .tour { --pw: clamp(260px, calc((100vh - 110px) * 0.45), 400px); }
  .tour-live .tour-body { grid-template-columns: minmax(0, 1fr) auto; column-gap: 96px; }
  .tour-live .tour-stage { grid-area: 1 / 2; padding-right: 40px; }
  .tour-live .tour-caption { display: none; }
  .tour-live .tour-scene { padding-top: calc(50vh - 90px); }
  .tour-live .tour-text {
    position: sticky; top: calc(50vh - 90px); width: auto; height: auto; overflow: visible;
    clip-path: none; white-space: normal;
    padding: 28px; border-radius: var(--r-card);
    background: var(--card-fill); border: 1px solid var(--card-border);
    -webkit-backdrop-filter: var(--card-blur); backdrop-filter: var(--card-blur);
    transition: border-color 0.3s ease;
  }
  .tour-live .tour-scene.is-active .tour-text { border-color: var(--link); }
  .tour-live .tour-text { padding: 36px 40px; }
  .tour-text h3 { font-size: clamp(28px, 2.6vw, 38px); line-height: 1.15; letter-spacing: -0.01em; margin-bottom: 12px; }
  .tour-live .tour-text p { font-size: 19px; line-height: 1.6; }
}

/* ---- Admin (/admin) ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.admin { max-width: 1120px; padding-bottom: 40px; }
.admin h2 { font-size: 19px; margin: 0 0 10px; }
.btn.small { width: auto; min-height: 44px; padding: 8px 16px; font-size: 15px; }
.btn.secondary:hover { box-shadow: none; border-color: var(--link); }
.btn.danger { background: transparent; color: var(--error); border-color: rgba(248, 113, 113, 0.5); box-shadow: none; }
.btn.danger:hover { border-color: var(--error); box-shadow: none; }
input[type="password"], input[type="search"], input[type="text"], input[type="url"], textarea, select {
  width: 100%; min-height: 50px; padding: 12px 16px;
  font: inherit; color: var(--text);
  background: var(--input-fill);
  border: 1px solid var(--card-border);
  border-radius: var(--r-control);
}
input[type="password"]:focus, input[type="search"]:focus, input[type="text"]:focus, input[type="url"]:focus, textarea:focus, select:focus { outline: 2px solid var(--link); outline-offset: 1px; }
select option { background: #1C1F2A; color: var(--text); }
textarea { resize: vertical; min-height: 160px; line-height: 1.5; }
input[type="url"]::placeholder { color: var(--hint); opacity: 1; }
input:disabled, textarea:disabled { opacity: 0.75; cursor: not-allowed; }

.emails .field .hint { margin: 0; }
.launch-progress { display: grid; gap: 10px; justify-items: start; padding: 14px 16px; margin: 0 0 16px;
  border: 1px solid var(--card-border); border-radius: var(--r-control); background: var(--input-fill); }
.launch-progress .progress-text { margin: 0; color: var(--text); font-weight: 500; }
.launch-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.login-view { max-width: 440px; margin: 24px auto 0; }
.login-view h1 { margin: 0 0 4px; font-size: 28px; }
.login-view .sub { margin: 0 0 18px; color: var(--text-2); }

.admin-title { font-size: clamp(28px, 7vw, 38px); margin: 4px 0 2px; }
#load-status { margin: 0 0 14px; }
.admin .panel { margin-bottom: 16px; }
.admin .grid.two { gap: 0 16px; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 0 16px; }
.stat { display: grid; gap: 2px; padding: 16px 18px; }
.stat-num { font-size: 30px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--text-2); font-size: 14px; }

.empty { text-align: center; }
.empty h2 { margin: 0 0 6px; }

.readout { margin: 0 0 10px; color: var(--text-2); font-size: 15px; min-height: 1.5em; }
.chart-svg { display: block; width: 100%; height: 160px; overflow: visible; touch-action: manipulation; }
.chart-svg:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; border-radius: 6px; }
.chart-svg .bar { fill: var(--accent); }
.chart-svg .bar.zero { fill: rgba(255, 255, 255, 0.18); }
.chart-svg .bar.on { fill: var(--link); }
.chart-svg .hit { fill: transparent; cursor: pointer; }
.chart-axis { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; color: var(--hint); font-size: 13px; }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bar-top { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; margin-bottom: 4px; }
.bar-label { min-width: 0; overflow-wrap: anywhere; }
.bar-count { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-track { display: block; width: 100%; height: 8px; }
.bar-track .track { fill: rgba(255, 255, 255, 0.08); }
.bar-track .bar { fill: var(--accent); }

.toolbar { display: grid; gap: 0 12px; margin-bottom: 4px; }
.toolbar .field { margin-bottom: 12px; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; align-self: end; }
#shown { margin: 0 0 8px; }

.people { width: 100%; border-collapse: collapse; font-size: 15px; }
.people th { text-align: left; font-weight: 500; color: var(--text-2); padding: 8px 10px; border-bottom: 1px solid var(--card-border); }
.people td { padding: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); vertical-align: middle; }
.people td.email { overflow-wrap: break-word; min-width: 15em; font-weight: 500; }
.people td.features { color: var(--text-2); }
.people td.actions { text-align: right; }
.tick-yes { color: var(--success); font-weight: 700; }
.tick-no { color: var(--hint); }
.more { display: flex; margin: 14px auto 0; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: var(--r-control);
  background: #1C1F2A; border: 1px solid var(--card-border); color: var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); font-size: 15px;
}

/* Phones: each row becomes a small card. */
@media (max-width: 599px) {
  .people thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .people, .people tbody { display: block; }
  .people tr {
    display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px;
    padding: 12px 14px; margin-bottom: 10px;
    border: 1px solid var(--card-border); border-radius: var(--r-control);
  }
  .people td { display: contents; }
  .people td::before { content: attr(data-label); color: var(--hint); font-size: 13px; align-self: center; }
  .people td.email { font-size: 16px; min-width: 0; overflow-wrap: anywhere; }
  .people td.email::before, .people td.actions::before { content: none; }
  .people td.email, .people td.actions { grid-column: 1 / -1; display: block; padding: 0 0 6px; border: 0; }
  .people td.actions { padding: 8px 0 0; text-align: left; }
}
@media (min-width: 720px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: minmax(0, 1fr) 200px auto; align-items: end; }
}
