/* ModelMesa landing page. Light sand palette, terracotta accent. No external fonts or assets. */
:root {
  --bg: #FAF7F2;          /* warm sand */
  --bg-alt: #F3EEE5;
  --card: #FFFFFF;
  --border: #E6DED1;
  --border-hi: #D6CBBA;
  --text: #1F2933;        /* ink: 13.8:1 on --bg */
  --muted: #52606D;       /* 6.0:1 on --bg */
  --accent: #C2410C;      /* terracotta: white text 5.2:1, as text on --bg 4.9:1 */
  --accent-hover: #9A3412;
  --accent-soft: #FBEADF;
  --teal: #2F6B66;        /* dusty teal: 5.8:1 on --bg */
  --teal-soft: #E5EFEC;
  --danger: #B42318;
  --slate: #14181F;
  --radius: 14px;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.9em; color: var(--text); background: var(--bg-alt); border: 1px solid var(--border); padding: 0.05em 0.35em; border-radius: 6px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; color: var(--text); }

.container { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--card); padding: 0.5rem 1rem; border-radius: 8px; }
.muted { color: var(--muted); }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 6px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: rgba(250, 247, 242, 0.88);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.nav nav { display: flex; align-items: center; gap: 1.5rem; }
.nav-link { color: var(--muted); font-size: 0.95rem; }
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-link[aria-current=page] { color: var(--text); font-weight: 600; }

.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em; }
.wordmark:hover { color: var(--text); text-decoration: none; }
.wordmark strong { font-weight: 800; color: var(--accent); }
.wordmark-small { font-size: 1.05rem; }
.logo { flex: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 600; font-size: 0.98rem;
  color: #FFFFFF;
  background: var(--accent);
  border: 1px solid var(--accent); border-radius: 10px;
  padding: 0.8rem 1.2rem;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(31, 41, 51, 0.12), 0 4px 14px rgba(194, 65, 12, 0.18);
  transition: background-color 0.12s ease, transform 0.12s ease;
}
.btn:hover { color: #FFFFFF; background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.7; cursor: progress; }
.btn-small { padding: 0.5rem 0.9rem; font-size: 0.9rem; border-radius: 9px; }

/* Hero */
.hero {
  position: relative;
  padding: 5.5rem 0 6.5rem;
  background:
    url("/horizon.svg") bottom center / 100% 220px no-repeat,
    radial-gradient(900px 420px at 80% 0%, rgba(194, 65, 12, 0.06), transparent 65%),
    var(--bg);
}
.hero-grid { display: grid; grid-template-columns: 1.08fr 0.92fr; gap: 3.5rem; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.55rem;
  margin: 0 0 1.25rem; padding: 0.3rem 0.8rem;
  font-size: 0.85rem; font-weight: 500; color: var(--teal);
  border: 1px solid #CFE0DB; border-radius: 999px; background: var(--teal-soft);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); font-weight: 800; }
.accent-text { color: var(--accent); }
.nowrap { white-space: nowrap; }
.lede { margin: 1.4rem 0 2rem; font-size: 1.14rem; color: #3E4C59; max-width: 38rem; }

/* Signup form */
.signup { max-width: 34rem; }
/* Desktop: email + button on one line, optional details on a compact second line.
   DOM order is email, details, button, so tab order and the mobile stack read naturally. */
.signup-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.6rem; }
.signup-row > input[type=email] { grid-column: 1; grid-row: 1; }
.signup-row > .btn { grid-column: 2; grid-row: 1; }
.signup-row > .signup-extra { grid-column: 1 / -1; grid-row: 2; }
.signup input[type=email] {
  min-width: 0;
  font: inherit; color: var(--text);
  background: var(--card); border: 1px solid var(--border-hi); border-radius: 10px;
  padding: 0.8rem 1rem;
}
.signup input[type=email]::placeholder { color: #66717C; }
.signup input[type=email]:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(47, 107, 102, 0.2); }
.signup input[aria-invalid=true] { border-color: var(--danger); }
/* Optional details: one quiet, compact row under the email so it reads as "skip me if you like". */
.signup-extra { display: flex; gap: 0.6rem; }
.signup-extra input, .signup-extra select {
  flex: 1 1 0; min-width: 0;
  font: inherit; font-size: 0.92rem; color: var(--text);
  background-color: rgba(255, 255, 255, 0.6); border: 1px solid var(--border); border-radius: 9px;
  padding: 0.55rem 0.8rem;
}
.signup-extra input::placeholder { color: #66717C; }
.signup-extra select {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2352606D' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.8rem center; background-size: 12px 8px;
  text-overflow: ellipsis;
}
.signup-extra select:has(option[value=""]:checked) { color: #66717C; }
.signup-extra select option { color: var(--text); }
.signup-extra input:focus, .signup-extra select:focus { outline: none; background-color: var(--card); border-color: var(--teal); box-shadow: 0 0 0 3px rgba(47, 107, 102, 0.2); }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.5em; margin: 0.7rem 0 0; font-size: 0.95rem; font-weight: 500; }
.form-status.is-success { color: var(--teal); }
.form-status.is-error { color: var(--danger); }
.form-status.is-pending { color: var(--muted); }
.fine { margin: 0.2rem 0 0; font-size: 0.85rem; color: var(--muted); }

/* Terminal (dark slate card) */
.hero-visual { min-width: 0; }
.terminal {
  background: var(--slate);
  border: 1px solid #252B36; border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(31, 41, 51, 0.18), 0 2px 6px rgba(31, 41, 51, 0.08);
  overflow: hidden;
}
.terminal-bar { display: flex; align-items: center; gap: 0.45rem; padding: 0.7rem 0.9rem; border-bottom: 1px solid #252B36; background: #191E27; }
.terminal-bar span { width: 11px; height: 11px; border-radius: 50%; background: #343B48; }
.terminal-bar em { margin-left: 0.5rem; font-style: normal; font-family: var(--mono); font-size: 0.78rem; color: #8A93A0; }
.terminal pre { margin: 0; padding: 1.1rem 1.2rem 1.3rem; overflow-x: auto; font-family: var(--mono); font-size: 0.84rem; line-height: 1.65; color: #E8DFD0; }
.terminal code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
.c-prompt { color: #E07A4A; }
.c-str { color: #A9C5A0; }
.c-key { color: #E9B48A; }
.c-num { color: #F2C879; }
.caption { margin: 0.75rem 0 0; font-size: 0.82rem; color: var(--muted); text-align: center; }

/* Sections */
.section { padding: 5rem 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.kicker { margin: 0 0 0.6rem; font-family: var(--mono); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal); }
h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 750; max-width: 40rem; }

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; margin-top: 2.5rem; }
.card {
  background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 1.4rem;
  box-shadow: 0 1px 2px rgba(31, 41, 51, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--border-hi); box-shadow: 0 8px 24px rgba(31, 41, 51, 0.08); transform: translateY(-2px); }
.card h3 { font-size: 1.08rem; margin: 1rem 0 0.55rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card .note { margin-top: 0.7rem; font-size: 0.82rem; font-style: italic; }
.icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; color: var(--accent); background: var(--accent-soft); border: 1px solid #F3D3BF; }

.pills { display: flex; flex-wrap: wrap; gap: 0.6rem; list-style: none; padding: 0; margin: 2rem 0 0; }
.pills li { font-size: 0.88rem; color: var(--text); padding: 0.4rem 0.85rem; border: 1px solid var(--border); border-radius: 999px; background: var(--card); }
.pills li::before { content: "✓"; color: var(--teal); margin-right: 0.45rem; font-weight: 700; }

.steps { list-style: none; padding: 0; margin: 2.5rem 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
.steps li { position: relative; padding: 1.5rem 1.4rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.step-num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-family: var(--mono); font-weight: 700; font-size: 0.9rem; color: #FFFFFF; background: var(--teal); }
.steps h3 { font-size: 1.05rem; margin: 0.9rem 0 0.45rem; }
.steps p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.cta-inner { text-align: center; max-width: 42rem; }
.cta h2 { margin-inline: auto; }
.cta-inner > p { color: var(--muted); margin: 0.9rem auto 1.8rem; }
.cta .signup { margin-inline: auto; text-align: left; }
.cta .form-status { text-align: center; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 2.5rem 0 3rem; font-size: 0.93rem; }
.footer-grid { display: grid; grid-template-columns: 1fr auto auto auto; gap: 2rem; align-items: start; }
.site-footer p { margin: 0.4rem 0 0; }
.contacts { list-style: none; padding: 0; margin: 0; color: var(--muted); }
.contacts li + li { margin-top: 0.3rem; }
.copyright { white-space: nowrap; }

/* Content pages (/security, /blog): Markdown rendered into .prose */
.page-hero {
  padding: 4rem 0 3rem;
  background:
    radial-gradient(900px 420px at 80% 0%, rgba(194, 65, 12, 0.06), transparent 65%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.page-narrow { max-width: 760px; }
.page-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.page-hero .lede { margin: 1.1rem 0 0; }
.page-hero .kicker a { color: inherit; }
.page-meta { margin: 0.8rem 0 0; font-family: var(--mono); font-size: 0.82rem; color: var(--muted); }
.page-body { padding: 3rem 0 5rem; }

.prose { font-size: 1.02rem; color: #3E4C59; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.45rem; font-weight: 750; margin: 2.6rem 0 0.8rem; padding-top: 0.2rem; }
.prose h3 { font-size: 1.12rem; margin: 1.8rem 0 0.5rem; }
.prose p { margin: 0 0 1rem; }
.prose strong { color: var(--text); }
.prose ul, .prose ol { margin: 0 0 1.1rem; padding-left: 1.3rem; }
.prose li { margin: 0.35rem 0; }
.prose li::marker { color: var(--accent); }
.prose blockquote {
  margin: 0 0 2rem; padding: 1rem 1.2rem;
  background: var(--teal-soft); border: 1px solid #CFE0DB; border-left: 4px solid var(--teal); border-radius: 10px;
  color: var(--text); font-size: 0.95rem;
}
.prose blockquote p { margin: 0; }
.prose table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 1.2rem 0 1.4rem; font-size: 0.94rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); }
.prose th { background: var(--bg-alt); color: var(--text); font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }
.prose td:first-child { color: var(--text); font-weight: 500; }
.prose pre {
  margin: 1.2rem 0 1.5rem; padding: 1rem 1.2rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--slate); border: 1px solid #252B36; border-radius: var(--radius);
  font-family: var(--mono); font-size: 0.84rem; line-height: 1.6; color: #E8DFD0; tab-size: 2;
}
.prose pre code { background: none; border: 0; padding: 0; border-radius: 0; font-size: inherit; color: inherit; white-space: pre; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.4rem 0 1.6rem; }
.prose em { color: var(--text); }
.post-list h2 a { color: var(--text); }
.post-list h2 a:hover { color: var(--accent); }

.tag { display: inline-block; margin: 0 0.15rem; padding: 0.05rem 0.5rem; border-radius: 999px; font-size: 0.76rem; font-weight: 600; line-height: 1.5; white-space: nowrap; vertical-align: 0.08em; border: 1px solid; }
.tag-launch { color: var(--teal); background: var(--teal-soft); border-color: #CFE0DB; }
.tag-planned { color: var(--accent-hover); background: var(--accent-soft); border-color: #F3D3BF; }
.tag-later { color: var(--muted); background: var(--bg-alt); border-color: var(--border-hi); }

.post-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.post-list h2 { font-size: 1.25rem; margin: 0.3rem 0 0.4rem; }
.post-list p { margin: 0; color: var(--muted); }
.empty-state { text-align: center; padding: 2.2rem 1.5rem; }
.empty-state:hover { transform: none; }
.empty-state p { margin: 0 0 1rem; color: var(--muted); }
.empty-state p:last-child { margin: 0; }
.empty-state .kicker { color: var(--teal); margin-bottom: 0.6rem; }

/* 404 */
.notfound { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 0.4rem; padding: 2rem; }
.notfound p { margin: 0.3rem 0; }

/* Responsive */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.75rem; }
  .features, .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .hero { padding: 3.25rem 0 5rem; background-size: 220% 160px, auto, auto; }
  .section { padding: 3.75rem 0; }
  .nav-link { display: none; }
  .signup-row { grid-template-columns: minmax(0, 1fr); }
  .signup-row > input[type=email], .signup-row > .btn, .signup-row > .signup-extra { grid-column: 1; grid-row: auto; }
  /* 16px stops iOS Safari from zooming in when an optional field gets focus. */
  .signup-extra input, .signup-extra select { font-size: 1rem; }
  .btn { width: 100%; }
  .btn-small { width: auto; }
  .features, .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .page-hero { padding: 2.75rem 0 2.25rem; }
  .prose table { font-size: 0.86rem; }
  .prose th, .prose td { padding: 0.55rem 0.6rem; }
  .prose pre { font-size: 0.74rem; padding: 0.9rem 1rem; margin-inline: -0.25rem; }
  .terminal pre { font-size: 0.72rem; padding: 1rem; }
  .lede { font-size: 1.05rem; }
}
@media (max-width: 480px) {
  /* Too narrow for two readable placeholders side by side: stack them, still compact. */
  .signup-extra { flex-direction: column; gap: 0.5rem; }
  .signup-extra input, .signup-extra select { flex: none; width: 100%; }
}
@media (max-width: 360px) {
  /* Keeps the header's "Get early access" button inside a 320px screen. */
  .btn-small { padding: 0.45rem 0.7rem; font-size: 0.86rem; }
}

/* Footer sits on --bg-alt; use the darker terracotta there for AA contrast (6.3:1). */
.site-footer a, .site-footer .wordmark strong { color: var(--accent-hover); }
.site-footer a:hover { color: #7C2D12; }
