/* spondeo.app — the whole site's styles. Lifted from product/website/. */

/* --- Fonts ---------------------------------------------------------------- */

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Tokens --------------------------------------------------------------- */

:root {
  --color-text: #1f2126;
  --color-muted: #70757f;
  --color-border: #e0e1e4;
  --color-card-bg: #ffffff;
  --color-screen-bg: #fbfbfc;
  --color-icon-stroke: #5f6368;
  --color-placeholder-text: #a0a4ad;
  --color-disabled-bg: #edeef2;
  --color-disabled-fg: #a0a4ad;
  --color-success: #2e7d4f;
  /* The only red on the site besides the failed row's amount, which is baked
     into hero-rows.webp. */
  --color-error: #b3261e;

  --font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;

  --type-display-size: 64px;
  --type-display-ls: -1.6px;
  --type-display-lh: 1.04;

  --type-h1-size: 48px;
  --type-h1-ls: -1.1px;
  --type-h1-lh: 1.1;

  --type-h2-size: 34px;
  --type-h2-ls: -0.6px;
  --type-h2-lh: 1.2;

  --type-h3-size: 19px;
  --type-h3-ls: -0.1px;
  --type-h3-lh: 1.4;

  --type-lead-size: 18px;
  --type-lead-ls: -0.1px;
  --type-lead-lh: 1.55;

  --type-body-size: 16px;
  --type-body-lh: 1.65;

  --type-small-size: 14px;
  --type-small-lh: 1.55;

  --type-micro-size: 12px;
  --type-micro-ls: 0.08em;

  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-64: 64px;
  --space-80: 80px;
  --space-96: 96px;

  --page-max: 1000px;
  --gutter: 20px;
  --measure: 54ch;
  --heading-col: 220px;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;

  --focus-ring: 2px solid var(--color-text);
  --focus-offset: 2px;
}

@media (max-width: 767px) {
  :root {
    --type-display-size: 42px;
    --type-display-ls: -1.05px;

    --type-h1-size: 36px;
    --type-h1-ls: -0.8px;

    --type-h2-size: 28px;
    --type-h2-ls: -0.5px;

    --type-h3-size: 18px;

    --type-lead-size: 17px;
  }
}

@media (min-width: 768px) {
  :root { --gutter: var(--space-40); }
}

/* --- Page shell ----------------------------------------------------------- */

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--color-screen-bg);
  color: var(--color-text);
  font-family: var(--font-stack);
  font-size: var(--type-body-size);
  line-height: var(--type-body-lh);
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

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

/* Short pages still put the footer on the bottom edge, not mid-screen. */
body > main { flex: 1 0 auto; }

.wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: var(--space-64) 0; }

.section-ruled { border-top: 1px solid var(--color-border); }

@media (min-width: 768px) {
  .section { padding: var(--space-96) 0; }
}

h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;
}

h1 {
  font-size: var(--type-h1-size);
  letter-spacing: var(--type-h1-ls);
  line-height: var(--type-h1-lh);
}

h2 {
  font-size: var(--type-h2-size);
  letter-spacing: var(--type-h2-ls);
  line-height: var(--type-h2-lh);
}

h3 {
  font-family: var(--font-stack);
  font-weight: 600;
  font-size: var(--type-h3-size);
  letter-spacing: var(--type-h3-ls);
  line-height: var(--type-h3-lh);
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--type-display-size);
  letter-spacing: var(--type-display-ls);
  line-height: var(--type-display-lh);
}

.lede {
  font-size: var(--type-lead-size);
  letter-spacing: var(--type-lead-ls);
  line-height: var(--type-lead-lh);
  color: var(--color-muted);
  max-width: var(--measure);
}

.eyebrow {
  font-size: var(--type-micro-size);
  letter-spacing: var(--type-micro-ls);
  text-transform: uppercase;
  font-weight: 500;
  color: var(--color-muted);
}

.small {
  font-size: var(--type-small-size);
  line-height: var(--type-small-lh);
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--color-border);
  text-underline-offset: 3px;
}

a:hover { text-decoration-color: var(--color-muted); }

.stack-16 { display: flex; flex-direction: column; gap: var(--space-16); }
.stack-32 { display: flex; flex-direction: column; gap: var(--space-32); }

.skip-link { position: absolute; left: -9999px; }

.skip-link:focus {
  left: var(--gutter);
  top: var(--space-8);
  z-index: 10;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-12);
  font-size: var(--type-small-size);
  text-decoration: none;
}

/* --- Header --------------------------------------------------------------- */

.site-header {
  position: relative;
  border-bottom: 1px solid var(--color-border);
}

.site-header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-24);
}

.wordmark {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.4px;
  line-height: 1;
  text-decoration: none;
}

.site-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-32);
}

.site-nav {
  display: flex;
  gap: var(--space-24);
  font-size: var(--type-small-size);
}

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

.site-nav a:hover { color: var(--color-muted); }

.site-auth {
  display: flex;
  align-items: center;
  gap: var(--space-12);
}

/* One cluster shows at a time: .session on <html> is set pre-paint from the
   session-hint cookie, so the swap never flashes. */
.site-auth-session { display: none; }
.session .site-auth-out { display: none; }
.session .site-auth-session { display: flex; }

.site-auth-login {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 var(--space-12);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: var(--type-small-size);
  font-weight: 500;
  text-decoration: none;
}

.site-auth-login:hover { background: rgba(31, 33, 38, 0.06); }

/* The filled treatment — the same ink as the primary button — carried by
   whichever action the state shows: Sign up logged out, Open app in session. */
.site-auth-signup,
.site-auth-open {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 var(--space-16);
  border-radius: var(--radius-sm);
  font-size: var(--type-small-size);
  font-weight: 500;
  text-decoration: none;
  background: var(--color-text);
  color: var(--color-card-bg);
}

.site-auth-signup:hover,
.site-auth-open:hover { background: rgba(31, 33, 38, 0.88); }

.site-auth-signup:active,
.site-auth-open:active { background: rgba(31, 33, 38, 0.8); }

.site-menu { display: none; }

.site-menu-button {
  list-style: none;
  position: relative;
  display: block;
  width: 36px;
  height: 36px;
  color: var(--color-text);
  cursor: pointer;
}

.site-menu-button::-webkit-details-marker { display: none; }

.site-menu-bar {
  position: absolute;
  left: 9px;
  top: 17px;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 200ms ease;
}

.site-menu-bar:first-child { transform: translateY(-3.5px); }
.site-menu-bar:last-child { transform: translateY(3.5px); }
.site-menu[open] .site-menu-bar:first-child { transform: rotate(45deg); }
.site-menu[open] .site-menu-bar:last-child { transform: rotate(-45deg); }

@media (prefers-reduced-motion: reduce) {
  .site-menu-bar { transition: none; }
}

.site-menu-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding: var(--space-8) var(--gutter) var(--space-16);
  background: var(--color-screen-bg);
  border-bottom: 1px solid var(--color-border);
}

.site-menu-panel a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--color-text);
  font-size: var(--type-body-size);
  text-decoration: none;
}

.site-menu-panel a:hover { color: var(--color-muted); }

@media (max-width: 599px) {
  .site-nav { display: none; }
  .site-menu { display: block; }
  .site-header-right { gap: var(--space-8); }
  .site-auth { gap: var(--space-4); }
}

/* --- Footer --------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-48) 0 var(--space-64);
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-12) var(--space-24);
  font-size: var(--type-small-size);
}

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

.site-footer-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

.site-footer-identity {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  max-width: 52ch;
}

.site-footer-identity .wordmark { font-size: 22px; }

.site-footer-legal {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  font-size: var(--type-small-size);
  line-height: var(--type-small-lh);
  color: var(--color-muted);
}

/* --- Hero ----------------------------------------------------------------- */

.hero { padding: var(--space-64) 0 var(--space-80); }

@media (min-width: 900px) {
  .hero { padding: var(--space-96) 0; }
}

.hero-grid {
  display: grid;
  gap: var(--space-48);
  align-items: start;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 361px;
    gap: var(--space-64);
  }
}

.hero-statement {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

.hero-lede { max-width: 44ch; }

.hero-specimen {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.hero-caption {
  font-size: var(--type-micro-size);
  letter-spacing: var(--type-micro-ls);
  text-transform: uppercase;
  font-weight: 500;
  color: var(--color-muted);
}

.hero-rows {
  width: 361px;
  max-width: 100%;
  height: auto;
}

/* --- Sections ------------------------------------------------------------- */

.section-grid {
  display: grid;
  gap: var(--space-24);
}

@media (min-width: 900px) {
  .section-grid {
    grid-template-columns: var(--heading-col) minmax(0, 1fr);
    gap: var(--space-64);
    align-items: start;
  }
}

.section-rail h2 { text-wrap: balance; }

.section-main {
  min-width: 0;
  max-width: var(--measure);
}

.section-main > .lede + .section-body { margin-top: var(--space-32); }

/* --- Steps ---------------------------------------------------------------- */

.step-list {
  list-style: none;
  max-width: var(--measure);
}

.step-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: var(--space-16);
  padding: var(--space-24) 0;
  border-top: 1px solid var(--color-border);
}

.step-item:first-child { border-top: 0; padding-top: 0; }
.step-item:last-child { padding-bottom: 0; }

.step-figure {
  font-size: var(--type-small-size);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--type-micro-ls);
  color: var(--color-muted);
  line-height: 1.6;
}

.step-content { min-width: 0; }
.step-content h3 { margin-bottom: var(--space-8); }

/* --- Email capture -------------------------------------------------------- */

.email-capture {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  max-width: 460px;
}

.email-label {
  font-size: var(--type-small-size);
  font-weight: 500;
}

.email-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

@media (min-width: 480px) {
  .email-row { flex-direction: row; }
  .email-submit { flex: 0 0 auto; min-width: 120px; }
}

.email-input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-stack);
  font-size: 16px;
  color: var(--color-text);
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  min-height: 44px;
  padding: var(--space-12) var(--space-16);
}

.email-input::placeholder { color: var(--color-placeholder-text); }

/* Focus and error thicken the border in place: the padding gives back the pixel. */
.email-input:focus,
.is-error .email-input {
  outline: none;
  border-width: 2px;
  padding: 11px 15px;
}

.email-input:focus { border-color: var(--color-text); }

.email-input:disabled { background: var(--color-disabled-bg); color: var(--color-disabled-fg); }

.email-submit-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  animation: spin 1s linear infinite;
}

.is-submitting .email-submit-label { display: none; }
.is-submitting .email-submit-spinner { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* An error is position, not colour: red elsewhere on this site means money lost. */
.is-error .email-input { border-color: var(--color-error); }

.email-done {
  font-size: var(--type-small-size);
  line-height: var(--type-small-lh);
  color: var(--color-success);
}

.modal .email-done { font-size: var(--type-body-size); }

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  font-family: var(--font-stack);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  min-height: 44px;
  padding: var(--space-12) var(--space-24);
}

.btn-primary {
  background: var(--color-text);
  color: var(--color-card-bg);
}

.btn-primary:hover { background: rgba(31, 33, 38, 0.88); }
.btn-primary:active { background: rgba(31, 33, 38, 0.8); }

.btn-primary:disabled {
  background: var(--color-disabled-bg);
  color: var(--color-disabled-fg);
  cursor: default;
}

/* In flight the button keeps its ink and shows the spinner instead of dimming. */
.is-submitting .btn-primary:disabled {
  background: var(--color-text);
  color: var(--color-card-bg);
}

/* --- Hero CTA ------------------------------------------------------------- */

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-12);
  margin-top: var(--space-8);
}

.cta-start {
  min-height: 48px;
  padding: 0 var(--space-32);
  font-size: 16px;
}

.cta-beta {
  font-family: var(--font-stack);
  font-size: var(--type-small-size);
  line-height: var(--type-small-lh);
  color: var(--color-muted);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--color-border);
  text-underline-offset: 3px;
}

.cta-beta:hover { text-decoration-color: var(--color-muted); }

/* --- Modal (mirrors the web app's dialogs) -------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  overflow-y: auto;
  background: rgba(31, 33, 38, 0.28);
  padding: var(--space-16) 0;
}

.modal-backdrop[hidden] { display: none; }

.modal {
  margin: auto;
  width: min(506px, calc(100vw - 32px));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-card-bg);
  padding: 20px 22px 16px;
  box-shadow: 0 16px 48px rgba(31, 33, 38, 0.18);
  outline: none;
}

.modal-title { margin-bottom: var(--space-8); }

.modal-text { margin-bottom: var(--space-16); text-wrap: pretty; }

.modal .email-submit { font-size: var(--type-body-size); }

.modal-footer { margin-top: var(--space-16); text-wrap: pretty; }

/* --- Prose and document pages --------------------------------------------- */

.prose { max-width: var(--measure); text-wrap: pretty; }

.prose p + p { margin-top: var(--space-16); }
.prose > * + h3 { margin-top: var(--space-32); }
.prose h3 + p { margin-top: var(--space-12); }
.prose ul { margin-top: var(--space-16); padding-left: var(--space-24); }
.prose li + li { margin-top: var(--space-8); }
.prose sup { font-size: 0.7em; line-height: 0; }
.prose-notes {
  margin-top: var(--space-32);
  padding-left: var(--space-24);
  font-size: var(--type-small-size);
  line-height: var(--type-small-lh);
  color: var(--color-muted);
}

.doc { padding: var(--space-64) 0 var(--space-96); }

.doc-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  max-width: var(--measure);
  padding-bottom: var(--space-32);
  border-bottom: 1px solid var(--color-border);
}

.about-head {
  flex-direction: row;
  align-items: center;
  gap: var(--space-24);
}

.about-portrait {
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}

.about-body { max-width: var(--measure); }

.doc-updated {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-size: var(--type-small-size);
  color: var(--color-muted);
}

.doc-layout {
  margin-top: var(--space-40);
  display: grid;
  gap: var(--space-40);
}

@media (min-width: 900px) {
  .doc-layout {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: var(--space-64);
    align-items: start;
  }
}

.doc-toc {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

@media (min-width: 900px) {
  .doc-toc {
    position: sticky;
    top: var(--space-32);
  }
}

/* On a phone the contents list is dropped, not collapsed. */
@media (max-width: 899px) {
  .doc-toc { display: none; }
}

.doc-toc ol {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  font-size: var(--type-small-size);
}

.doc-toc a {
  color: var(--color-muted);
  text-decoration: none;
}

.doc-toc a:hover { color: var(--color-text); }

.doc-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-48);
}

.doc-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  scroll-margin-top: var(--space-32);
}
