@font-face {
  font-family: Figtree;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/figtree-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: Figtree;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/figtree-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: Figtree;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/figtree-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: Figtree;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/figtree-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/eb-garamond-latin-400-italic.woff2") format("woff2");
}

:root {
  color-scheme: light;
  /* Du2 + Du17 — same desktop stone / vast tokens as the shared renderer. */
  --lumen: #f6f4f2;
  --lumen-dark: #eeebe3;
  --vast: #1a1a1a;
  --bg: var(--lumen);
  --panel: #ffffff;
  --panel-soft: #f3f1ed;
  --border: #e6e3dc;
  --border-strong: #d4d0c8;
  --text: var(--vast);
  --muted: #6f6c67;
  --accent: var(--vast);
  --accent-soft: #eeebe3;
  --accent-border: rgba(26, 26, 26, 0.18);
  --accent-hover: #000000;
  --error: #9a2840;
  --error-soft: rgba(127, 28, 52, 0.1);
  --radius: 20px;
  --radius-pill: 999px;
  --font-ui: Figtree, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "EB Garamond", "Times New Roman", Times, serif;
  font-family: var(--font-ui);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  max-width: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
}

body {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--vv-offset-top, 0px);
  left: 0;
  right: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: var(--vv-height, 100dvh);
  height: var(--vv-height, 100%);
  max-height: var(--vv-height, 100dvh);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
}

.gate {
  flex: 1 0 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: var(--vv-height, 100dvh);
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  align-items: center;
  padding: clamp(1.25rem, 6vh, 3.5rem) 1.25rem;
  padding-top: max(clamp(1.25rem, 6vh, 3.5rem), env(safe-area-inset-top, 0px));
  padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
  padding-bottom: max(
    clamp(1.25rem, 6vh, 3.5rem),
    env(safe-area-inset-bottom, 0px)
  );
  padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
  background: var(--bg);
}

.gate-body {
  width: min(40rem, 100%);
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

#landing,
#tour,
.gate-header {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

#sign-in,
#signed-in,
#tour-actions {
  width: 100%;
  max-width: 18.5rem;
  margin-inline: auto;
}

.gate-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.wordmark {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text);
}

h1 {
  margin: 0 0 0.45rem;
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lead,
.help,
.status,
.identity {
  margin: 0 auto 0.75rem;
  width: 100%;
  max-width: 18.5rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.lead,
.help,
.status,
.muted {
  color: var(--muted);
  font-size: 0.88rem;
}

.identity {
  color: var(--text);
  font-size: 0.95rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  font-size: 0.82rem;
}

/* Du4 — same capsule fields as the shared renderer.
   Analogs: form1 Invite email stack; text_field1–3 white pill + muted
   placeholder. Sign in stays the black primary below (form1 Continue). */
input {
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.55rem 1.05rem;
  box-shadow: none;
}

input:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder {
  color: color-mix(in srgb, var(--muted) 68%, #ffffff);
  opacity: 1;
}

/* Du3 — same primary / cream-secondary pills as the shared renderer.
   Analogs: button4 Continue, buttons1 Explore / Manage, form1 Continue.
   Public Get started / Log in / Next / Register are the same pills as
   <a> so the addressable views stay ordinary links. */
button,
a.btn-primary,
a.btn-secondary {
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.55rem 1.15rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

button:hover,
a.btn-primary:hover {
  background: var(--accent-hover);
}

a.btn-primary:link,
a.btn-primary:visited {
  color: #fff;
}

a.btn-secondary:link,
a.btn-secondary:visited {
  color: var(--text);
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* Du3 — same keyboard ring as the shared renderer. Analogs: button4 /
   buttons1 Explore / form1 Continue. Mouse click stays ring-less. */
button:focus-visible,
a.btn-primary:focus-visible,
a.btn-secondary:focus-visible {
  outline: 2px solid var(--accent-border);
  outline-offset: 1px;
}

#sign-in-submit,
#consume-submit {
  display: block;
  width: auto;
  min-width: 8.5rem;
  margin: 0.35rem auto 0;
}

#consume-form {
  width: 100%;
  text-align: center;
}

#consume-error {
  text-align: left;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

#sign-out-form {
  width: 100%;
  text-align: center;
}

#sign-out {
  background: var(--lumen-dark);
  color: var(--text);
  font-weight: 500;
}

#sign-out:hover {
  background: color-mix(in srgb, var(--lumen-dark), var(--vast) 8%);
}

/* Public landing / tour.
   Analogs: buttons1 Explore (vast primary) + Manage (cream secondary);
   button4 Continue; button2 Get the app. Page fill stays desktop stone
   (Du17), not website yellow Lumen. */
#landing {
  width: 100%;
}

.landing-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  width: 100%;
}

#get-started,
#log-in {
  width: min(16rem, 100%);
}

#get-started {
  font-size: 1rem;
  padding: 0.8rem 1.4rem;
}

#log-in {
  font-size: 0.95rem;
  padding: 0.7rem 1.4rem;
}

.btn-secondary,
#log-in,
#download-desktop,
#download-extension,
#register {
  background: var(--lumen-dark);
  color: var(--text);
  font-weight: 500;
}

.btn-secondary:hover,
#log-in:hover,
#download-desktop:hover,
#download-extension:hover,
#register:hover {
  background: color-mix(in srgb, var(--lumen-dark), var(--vast) 8%);
}

/* Equal-weight finale pills stay cream even before a destination exists.
   No href is not a live link — keep the look, drop the pointer. */
a.btn-secondary:not([href]),
a.btn-primary:not([href]) {
  cursor: default;
}

a.btn-secondary:not([href]):hover,
#download-desktop:not([href]):hover,
#download-extension:not([href]):hover {
  background: var(--lumen-dark);
}

#tour {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: center;
}

.tour-screen {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.tour-illustration {
  display: block;
  margin: 0 auto 1.35rem;
  width: 100%;
  max-width: 20rem;
}

.tour-illustration img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}

.tour-screen h2 {
  margin: 0 auto 0.65rem;
  width: 100%;
  max-width: 18.5rem;
  padding-inline: 0.2em;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.3rem, 5.6vw, 2.05rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
  overflow-wrap: break-word;
  white-space: normal;
  text-wrap: balance;
}

.tour-sub {
  margin: 0 auto 1.5rem;
  width: 100%;
  max-width: 18.5rem;
  padding-inline: 0.75rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
  overflow-wrap: break-word;
  white-space: normal;
  text-wrap: pretty;
}

.tour-next {
  min-width: 8.5rem;
}

.tour-final-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.tour-final-actions button,
.tour-final-actions a {
  width: 100%;
}

#magic-link-sent {
  width: 100%;
  text-align: center;
}

#magic-link-reminder {
  max-width: 22rem;
  margin: 0 auto;
  font-size: 1rem;
  color: var(--text);
}

.error {
  margin: 0 0 0.75rem;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--error-soft);
  color: var(--error);
  font-size: 0.85rem;
}

[hidden] {
  display: none !important;
}

/* First paint of addressable public views. landing.js strips these classes
   after it applies [hidden], so later navigation is not stuck on the URL
   that was current when the document loaded. */
html.st-view-tour #landing,
html.st-view-choose #landing,
html.st-view-login #landing,
html.st-view-consume #landing,
html.st-view-check-email #landing,
html.st-view-desktop-signed-in #landing {
  display: none !important;
}

html.st-view-tour #tour {
  display: block !important;
}

html.st-view-tour #tour .tour-screen {
  display: none !important;
}

html.st-view-tour[data-st-step="1"] #tour .tour-screen[data-tour-step="1"],
html.st-view-tour[data-st-step="2"] #tour .tour-screen[data-tour-step="2"],
html.st-view-tour[data-st-step="3"] #tour .tour-screen[data-tour-step="3"],
html.st-view-tour[data-st-step="4"] #tour .tour-screen[data-tour-step="4"],
html.st-view-tour[data-st-step="5"] #tour .tour-screen[data-tour-step="5"],
html.st-view-tour[data-st-step="6"] #tour .tour-screen[data-tour-step="6"],
html.st-view-tour[data-st-step="7"] #tour .tour-screen[data-tour-step="7"] {
  display: block !important;
}

html.st-view-choose #tour-actions {
  display: block !important;
}

html.st-view-login #sign-in,
html.st-view-consume #sign-in,
html.st-view-check-email #sign-in,
html.st-view-login #gate-title,
html.st-view-login #gate-lead,
html.st-view-consume #gate-title,
html.st-view-check-email #gate-title,
html.st-view-check-email #gate-lead,
html.st-view-desktop-signed-in #gate-title,
html.st-view-desktop-signed-in #gate-lead {
  display: block !important;
}

html.st-view-consume #gate-lead,
html.st-view-consume #login-form,
html.st-view-consume #magic-link-sent,
html.st-view-check-email #login-form,
html.st-view-check-email #magic-link-sent,
html.st-view-login #consume-form,
html.st-view-check-email #consume-form {
  display: none !important;
}

html.st-view-consume #consume-form {
  display: block !important;
}

html.st-view-desktop-signed-in #sign-in,
html.st-view-desktop-signed-in #signed-in {
  display: none !important;
}

/* Leftover desktop cookie on `/` / login / check-email. GET / already
   rewrites those views; this class wins over a still-present view=
   bootstrap class until landing.js hydrates. */
html.st-leftover-desktop #landing,
html.st-leftover-desktop #tour,
html.st-leftover-desktop #tour-actions,
html.st-leftover-desktop #sign-in {
  display: none !important;
}

html.st-leftover-desktop #signed-in,
html.st-leftover-desktop #gate-title,
html.st-leftover-desktop #gate-lead {
  display: block !important;
}

/* Pairing is Sign out, not the B5 host / relay shell. */
html.st-leftover-desktop #host-status,
html.st-leftover-desktop #server-status {
  display: none !important;
}
