/* Vailo — design system */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300;1,9..40,400&family=DM+Serif+Display:ital@0;1&display=swap');

:root {
  --ink: #0f0f0d;
  --paper: #f5f0e8;
  --cream: #ede8dc;
  --red: #d63f2e;
  --muted: #7a756a;
  --border: #d5cfc4;
  --white: #ffffff;
}

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

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Typography --- */

h1, h2, h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.35rem); }

em { font-family: 'DM Serif Display', Georgia, serif; font-style: italic; }

.mono, code, pre {
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: 0.875rem;
}

.eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

p { margin-bottom: 1.25rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--border); }
a:hover { text-decoration-color: var(--ink); }

strong { font-weight: 600; }

/* --- Layout --- */

.container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--wide {
  max-width: 860px;
}

main {
  flex: 1;
  padding: 3rem 0 4rem;
}

/* --- Site header --- */

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header .logo {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--ink);
}

.site-header .logo span {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* --- Site footer --- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: auto;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
}

.site-footer a {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.03em;
}

.site-footer a:hover { color: var(--ink); }

.site-footer .footer-sep {
  color: var(--border);
  font-size: 0.75rem;
}

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.btn:hover {
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}

.btn--red {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

.btn--red:hover {
  background: var(--paper);
  color: var(--red);
  border-color: var(--red);
}

.btn--outline {
  background: transparent;
  color: var(--ink);
}

.btn--outline:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn--large {
  padding: 1rem 2rem;
  font-size: 1.05rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn svg {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
}

/* --- Google sign-in button --- */

.btn--google {
  background: var(--white);
  color: var(--ink);
  border-color: var(--border);
}

.btn--google:hover {
  background: var(--cream);
  border-color: var(--ink);
}

/* --- Forms --- */

.form-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.form-row input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  border-radius: 3px;
  outline: none;
  transition: border-color 0.15s;
}

.form-row input[type="email"]:focus {
  border-color: var(--ink);
}

.form-row input[type="email"]::placeholder {
  color: var(--muted);
}

.signup-status {
  margin-top: 0.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  min-height: 1.2em;
}

.signup-status.ok { color: #2d7a3a; }
.signup-status.err { color: var(--red); }

/* --- Progress bar --- */

.progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: 1.25rem 0 0.75rem;
}

.progress-fill {
  height: 100%;
  background: var(--ink);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--muted);
}

/* --- Divider --- */

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* --- Callout / aside --- */

.callout {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
}

/* --- Venmo block --- */

.venmo-block {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
}

.venmo-block p {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

/* --- Inline link --- */

a.underline {
  text-decoration: underline;
  text-decoration-color: var(--border);
}

a.underline:hover {
  text-decoration-color: var(--ink);
}

/* --- Page hero --- */

.page-hero {
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.page-hero .eyebrow {
  margin-bottom: 0.75rem;
}

/* --- Prose --- */

.prose h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.prose h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.prose p {
  margin-bottom: 1.25rem;
}

.prose ol, .prose ul {
  margin: 0 0 1.25rem 1.5rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose code {
  background: var(--cream);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  word-break: break-all;
}

.prose pre {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.55;
}

.prose pre code {
  background: none;
  padding: 0;
}

/* --- Number callout --- */

.big-number {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  line-height: 1;
  color: var(--ink);
}

/* --- Screens (main page states) --- */

[hidden] { display: none !important; }

/* --- Tool page specific --- */

.tool-headline {
  margin-bottom: 0.5rem;
}

.tool-lede {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 2rem;
  max-width: 520px;
}

.tool-note {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

.tool-note a {
  color: var(--muted);
}

.connected-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.connected-label::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #2d7a3a;
  border-radius: 50%;
}

.status-text {
  font-family: 'DM Mono', monospace;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.success-stat {
  margin-bottom: 2rem;
}

.success-stat .label {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}

.success-copy {
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

/* --- Ghost budget --- */

.budget-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.budget-line:first-child {
  border-top: 1px solid var(--border);
}

.budget-line .amount {
  font-family: 'DM Mono', monospace;
  font-size: 0.875rem;
}

/* --- Manual steps --- */

.step {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.step-num {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.5rem;
  color: var(--muted);
  flex-shrink: 0;
  width: 1.75rem;
  padding-top: 0.05rem;
}

.step-body h3 {
  margin-bottom: 0.4rem;
}

/* --- FAQ --- */

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
}

.faq-item:first-child {
  border-top: 1px solid var(--border);
}

.faq-q {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
}

/* --- Changelog --- */

.changelog-entry {
  border-bottom: 1px solid var(--border);
  padding: 1.75rem 0;
}

.changelog-entry:first-child {
  border-top: 1px solid var(--border);
}

.changelog-date {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.changelog-tag {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  padding: 0.15em 0.5em;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--muted);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --- Transparency numbers --- */

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.stat-row:first-child { border-top: 1px solid var(--border); }

.stat-label {
  font-size: 0.95rem;
  color: var(--muted);
}

.stat-value {
  font-family: 'DM Mono', monospace;
  font-size: 0.9rem;
}

/* --- Share modal --- */

.share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 13, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}

.share-dialog {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  position: relative;
}

.share-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--muted);
  line-height: 1;
  padding: 0.25rem;
}

.share-close:hover { color: var(--ink); }

.share-preview {
  width: 100%;
  border-radius: 4px;
  display: block;
  margin-bottom: 1.25rem;
}

.share-text {
  font-size: 0.9rem;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

.share-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.share-actions .btn {
  flex: 1;
  justify-content: center;
  font-size: 0.9rem;
  padding: 0.65rem 1rem;
}

/* --- Responsive --- */

@media (max-width: 600px) {
  main { padding: 2rem 0 3rem; }

  .site-footer .container {
    gap: 0.6rem 1rem;
  }

  .form-row {
    flex-direction: column;
  }

  .form-row input[type="email"] {
    width: 100%;
  }

  .step { gap: 1rem; }

  .budget-line { flex-direction: column; gap: 0.15rem; }
}
