/* ============================================================
   The front door: sign in, sign up, invitations, resets.

   Wide screens: the story on the left (headline, the app itself,
   what is inside, how it works) and the form held in view on the
   right. Phones: a hero with the real app on two phones, the form
   as a card rising out of it, then swipeable feature cards. Pages
   reached from a link (invitation, reset, confirmation) put the
   form first on a phone: the visitor already has a job to do.
   The app's own palette, so stepping inside feels like one product.
   ============================================================ */

:root {
  --bg: #f4f1ea;
  --panel: #ffffff;
  --ink: #1f2328;
  --muted: #5f6672;
  --line: #e3e0d8;
  --accent: #4a7c3f;
  --accent-hover: #3d6934;
  --accent-ink: #ffffff;
  --accent-soft: #e6efe2;
  --square: rgba(74, 124, 63, 0.07);
  --glow: rgba(74, 124, 63, 0.22);
  --danger: #b42318;
  --danger-bg: #fdecea;
  --focus: #2f6fdd;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 12px 32px rgba(0,0,0,.10);
  --lift: 0 2px 6px rgba(0,0,0,.06), 0 24px 60px rgba(0,0,0,.16);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16181d; --panel: #1e2128; --ink: #e8eaed; --muted: #9aa1ac; --line: #2c3038;
    --accent: #5f9a52; --accent-hover: #6da25e; --accent-ink: #0f1410; --accent-soft: #1f2d1f;
    --square: rgba(255, 255, 255, 0.035); --glow: rgba(95, 154, 82, 0.30);
    --danger: #ff8a80; --danger-bg: #3a1f1f; --focus: #8ab4ff;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 12px 32px rgba(0,0,0,.40);
    --lift: 0 2px 8px rgba(0,0,0,.4), 0 28px 70px rgba(0,0,0,.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16181d; --panel: #1e2128; --ink: #e8eaed; --muted: #9aa1ac; --line: #2c3038;
  --accent: #5f9a52; --accent-hover: #6da25e; --accent-ink: #0f1410; --accent-soft: #1f2d1f;
  --square: rgba(255, 255, 255, 0.035); --glow: rgba(95, 154, 82, 0.30);
  --danger: #ff8a80; --danger-bg: #3a1f1f; --focus: #8ab4ff;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 12px 32px rgba(0,0,0,.40);
  --lift: 0 2px 8px rgba(0,0,0,.4), 0 28px 70px rgba(0,0,0,.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* The hidden attribute must win over any display a class sets. */
[hidden] { display: none !important; }
html, body { margin: 0; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- layout ---------- */

.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 460px);
  grid-template-areas: "top side" "more side";
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}
.story-top { grid-area: top; }
.panel-side { grid-area: side; }
.story-more { grid-area: more; }

.story-top, .story-more {
  width: 100%;
  max-width: 900px;
  justify-self: center;
  padding-inline: clamp(24px, 5vw, 72px);
}
.story-top { padding-top: 40px; display: grid; gap: 32px; align-content: start; }
.story-more { padding-top: 44px; padding-bottom: 72px; display: grid; gap: 22px; align-content: start; }

/* ---------- the story ---------- */

.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-row img { border-radius: 8px; }
.brand-row b { font-size: 17px; letter-spacing: -0.01em; }

.intro { display: grid; gap: 16px; max-width: 640px; }
.hero {
  margin: 0;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
  text-wrap: balance;
}
.hero em { font-style: normal; color: var(--accent); }
.pitch { margin: 0; font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 58ch; }

.proof { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.proof li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.proof li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(45deg);
}

.shot {
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.shot img { display: block; width: 100%; height: auto; }
.hero-phones { display: none; }

.section-title {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.features li {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 10px 10px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.features .shot { border-radius: 10px; box-shadow: none; }
.features li > div { padding: 0 4px; }
.features h3 { margin: 0 0 4px; font-size: 15px; letter-spacing: -0.005em; }
.features p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); }

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
  font-size: 14px;
  color: var(--muted);
}
.steps li::before {
  content: counter(step);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
}
.steps b { color: var(--ink); }
.cta, .story-footer { display: none; }

/* ---------- the form ---------- */

.panel-side { background: var(--panel); border-left: 1px solid var(--line); }
main {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding: 48px 44px;
}
main .brand { display: none; }
.brand { align-items: center; gap: 12px; }
.brand img { border-radius: 9px; }
.brand b { display: block; font-size: 18px; letter-spacing: -0.01em; }
.brand small { display: block; color: var(--muted); font-size: 13px; }

h1 { margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.lede { margin: 6px 0 0; color: var(--muted); }
.lede strong, .sent strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }

.card { display: grid; gap: 14px; }
form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
label .hint { font-weight: 400; color: var(--muted); }
input[type="email"], input[type="password"], input[type="text"] {
  font: inherit;
  font-size: 16px;               /* 16px or iOS zooms the page on focus */
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  width: 100%;
}
input[type="email"]:focus, input[type="password"]:focus, input[type="text"]:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.form-row a { font-size: 13px; }
.show { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--muted); }

button {
  font: inherit;
  font-weight: 600;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.primary { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); }
.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.secondary:hover { border-color: var(--muted); }
.linkish { display: inline; padding: 0; border: 0; background: none; color: var(--accent); font-size: inherit; }
button[disabled] { opacity: .6; cursor: default; }

.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin-top: 2px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.error { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--danger-bg); color: var(--danger); font-size: 14px; }
.sent { display: grid; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); }
.sent p { margin: 0; }
.sent button, .sent a { justify-self: start; }
.note { margin: 0; color: var(--muted); font-size: 13px; }
footer { color: var(--muted); font-size: 12px; }

/* ---------- phones and small tablets ---------- */

@media (max-width: 900px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "top" "side" "more";
    grid-template-rows: auto;
  }
  body:not([data-page="login"]):not([data-page="signup"]) .page { grid-template-areas: "side" "top" "more"; }

  /* The hero: a faint board behind a glow, and the app on two phones. */
  .story-top {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    max-width: none;
    padding: calc(env(safe-area-inset-top, 0px) + 18px) 22px 0;
    gap: 22px;
  }
  .story-top::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
      radial-gradient(70% 38% at 62% 78%, var(--glow), transparent 72%),
      conic-gradient(var(--square) 25%, transparent 0 50%, var(--square) 0 75%, transparent 0) 0 0 / 64px 64px;
    -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 96%);
    mask-image: linear-gradient(to bottom, #000 30%, transparent 96%);
  }
  .hero { font-size: clamp(42px, 12.5vw, 56px); }
  .pitch { font-size: 16px; }
  .hero-shot { display: none; }

  .hero-phones {
    display: block;
    position: relative;
    height: 300px;
    margin: -6px -22px 0;
    overflow: hidden;
  }
  .phone {
    position: absolute;
    left: 50%;
    width: min(196px, 50vw);
    padding: 7px;
    border-radius: 32px;
    background: #0b0d10;
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: var(--lift);
  }
  .phone img { display: block; width: 100%; height: auto; border-radius: 25px; }
  .phone.front { top: 10px; z-index: 2; transform: translateX(-22%) rotate(4deg); }
  .phone.back { top: 50px; transform: translateX(-92%) rotate(-8deg); filter: saturate(.85) brightness(.9); }
  .hero-phones::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 120px;
    z-index: 3;
    background: linear-gradient(to bottom, transparent, var(--bg));
  }

  /* The form: a card rising out of the hero. */
  .panel-side { background: transparent; border: 0; padding: 0 14px; position: relative; z-index: 4; }
  main {
    position: relative;
    min-height: auto;
    max-width: 520px;
    margin: -84px auto 0;
    padding: 24px 20px 22px;
    gap: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--lift);
  }
  body:not([data-page="login"]):not([data-page="signup"]) main { margin-top: calc(env(safe-area-inset-top, 0px) + 16px); }
  body:not([data-page="login"]):not([data-page="signup"]) main .brand { display: flex; }
  body:not([data-page="login"]):not([data-page="signup"]) .brand-row { display: none; }
  body:not([data-page="login"]):not([data-page="signup"]) .story-top { padding-top: 36px; }
  body:not([data-page="login"]):not([data-page="signup"]) .panel-side { padding-top: 0; }
  h1 { font-size: 24px; }
  .main-footer { display: none; }

  /* What is inside: cards to swipe, the next one peeking in. */
  .story-more { max-width: none; padding: 40px 0 calc(env(safe-area-inset-bottom, 0px) + 40px); gap: 18px; }
  .section-title { padding-inline: 22px; }
  .features {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(78%, 320px);
    gap: 14px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 22px;
    padding: 2px 22px 12px;
    scrollbar-width: none;
  }
  .features::-webkit-scrollbar { display: none; }
  .features li { scroll-snap-align: start; border-radius: 22px; padding: 10px 10px 18px; }
  .features .shot { border-radius: 15px; }
  .features .shot img { aspect-ratio: 4 / 5; object-fit: cover; object-position: top; }
  .features h3 { font-size: 16px; }
  .features p { font-size: 14px; }

  .steps { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-inline: 22px; }
  .steps li { font-size: 15px; }

  .cta {
    display: flex;
    justify-content: center;
    margin: 10px 22px 0;
    padding: 15px;
    border-radius: 14px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 16px;
    font-weight: 700;
    box-shadow: var(--shadow);
  }
  .cta:hover { text-decoration: none; background: var(--accent-hover); }
  .story-footer { display: block; padding: 8px 22px 0; text-align: center; }
}

@media (max-width: 900px) and (prefers-reduced-motion: no-preference) {
  .phone.front { animation: float 7s ease-in-out infinite alternate; }
  .phone.back { animation: float 8s ease-in-out -3s infinite alternate; }
  @keyframes float { from { translate: 0 0; } to { translate: 0 -8px; } }
}

@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .features .shot img { transition: transform .4s ease; }
  .features li:hover .shot img { transform: scale(1.02); }
}

/* ---------- links to the public pages ---------- */
.brand-row { flex-wrap: wrap; }
.site-links { margin-left: auto; display: flex; flex-wrap: wrap; gap: 16px; }
.site-links a { color: var(--muted); font-size: 14.5px; font-weight: 600; }
.site-links a:hover { color: var(--ink); text-decoration: none; }
.learn-more { display: flex; flex-wrap: wrap; gap: 10px; }
.button-link {
  display: inline-flex; align-items: center; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 14px; font-weight: 600;
}
.button-link:hover { border-color: var(--muted); text-decoration: none; }
@media (max-width: 900px) {
  .site-links { margin-left: 0; width: 100%; }
  .learn-more { padding-inline: 22px; }
}
