/* ProseWeave — site styles
   No build step, no dependencies. Design tokens live in :root. */

/* ---------- Tokens ---------- */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-elev: #ffffff;
  --text: #14161a;
  --text-muted: #5b6270;
  --border: #e4e7ec;
  --accent: #4f46e5;
  --accent-contrast: #ffffff;   /* text that sits on --accent */
  --accent-soft: #eef2ff;
  --accent-text: #4338ca;
  --shadow: 0 1px 2px rgba(16, 18, 24, .04), 0 12px 32px rgba(16, 18, 24, .06);

  --maxw: 1080px;
  --radius: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f13;
    --bg-soft: #12151b;
    --bg-elev: #151920;
    --text: #eef1f6;
    --text-muted: #9aa3b2;
    --border: #232833;
    --accent: #8b87ff;
    --accent-contrast: #12131c;  /* white on this accent fails contrast */
    --accent-soft: #1b1c33;
    --accent-text: #b3b0ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px rgba(0, 0, 0, .35);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

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

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1rem; }

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; height: auto; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--accent-contrast);
  padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

.eyebrow {
  display: inline-block;
  font-size: .78rem; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--accent-text);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  padding: 5px 12px; border-radius: 999px;
  margin-bottom: 20px;
}

.lede { font-size: 1.15rem; color: var(--text-muted); max-width: 62ch; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 68px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 650; letter-spacing: -.02em; font-size: 1.05rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand svg { width: 28px; height: 28px; display: block; }

.nav { display: flex; align-items: center; gap: 26px; }
.nav a { color: var(--text-muted); font-size: .95rem; font-weight: 500; }
.nav a:hover { color: var(--text); text-decoration: none; }
/* The .nav a rule above outranks .btn-primary on specificity — restate it. */
.nav a.btn-primary, .nav a.btn-primary:hover { color: var(--accent-contrast); }
.nav a.btn-ghost, .nav a.btn-ghost:hover { color: var(--text); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px; cursor: pointer; color: var(--text);
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 8px 24px 18px;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 0; border-top: 1px solid var(--border); }
  .nav .btn { margin-top: 14px; text-align: center; border-top: 0; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: .96rem; font-weight: 600;
  padding: 11px 20px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, background-color .12s ease, border-color .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--accent-contrast)); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-soft); }

/* ---------- Sections ---------- */
section { padding: 92px 0; }
section + section { border-top: 1px solid var(--border); }
.section-head { max-width: 60ch; margin-bottom: 44px; }

/* ---------- Hero ---------- */
.hero {
  padding: 104px 0 96px;
  background:
    radial-gradient(1100px 460px at 15% -10%, var(--accent-soft), transparent 65%),
    radial-gradient(900px 380px at 92% 0%, var(--accent-soft), transparent 60%);
}
.hero p.lede { font-size: 1.22rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .35em; }
.card p:last-child { margin-bottom: 0; }
.card p { color: var(--text-muted); font-size: .97rem; }

.card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; margin-bottom: 16px;
  background: var(--accent-soft); color: var(--accent-text);
}
.card-icon svg { width: 20px; height: 20px; }

/* ---------- Apps ---------- */
.app-card { display: flex; gap: 22px; align-items: flex-start; }
.app-icon {
  flex: 0 0 auto; width: 66px; height: 66px; border-radius: 16px;
  border: 1px solid var(--border); display: grid; place-items: center;
  background: linear-gradient(160deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #0b1020));
  color: #fff; font-weight: 700; font-size: 1.45rem; letter-spacing: -.03em;
}
.app-body { min-width: 0; }
.badge {
  display: inline-block; font-size: .72rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; margin-left: 8px;
  vertical-align: 3px; border: 1px solid var(--border);
  color: var(--text-muted); background: var(--bg-soft);
}
.badge-live { color: #0a7c46; background: #e7f7ee; border-color: #bfe6d1; }
@media (prefers-color-scheme: dark) {
  .badge-live { color: #6ee7a8; background: #0f2a1c; border-color: #1e4d34; }
}
.platforms { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.platforms span {
  font-size: .82rem; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 11px;
}

/* ---------- Contact ---------- */
.contact { background: var(--bg-soft); }
.contact-layout { display: grid; gap: 40px; grid-template-columns: 1fr 1.15fr; align-items: start; }
@media (max-width: 860px) { .contact-layout { grid-template-columns: 1fr; } }

.contact-list { list-style: none; margin: 24px 0 0; padding: 0; }
.contact-list li { display: flex; gap: 14px; margin-bottom: 20px; }
.contact-list svg { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 3px; color: var(--accent-text); }
.contact-list strong { display: block; font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); font-weight: 600; }

form { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 7px; }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; font-size: .97rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 13px;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: .86rem; color: var(--text-muted); margin: 14px 0 0; }
.form-status { font-size: .93rem; margin: 16px 0 0; padding: 12px 14px; border-radius: 10px; display: none; }
.form-status.is-visible { display: block; }
.form-status.is-error { background: var(--accent-soft); border: 1px solid var(--border); }
.form-status.is-ok { background: var(--accent-soft); border: 1px solid var(--border); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 44px 0; font-size: .92rem; color: var(--text-muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: center; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

/* ---------- Legal pages ---------- */
.legal { padding: 72px 0 88px; }
.legal .wrap { max-width: 760px; }
.legal h2 { margin-top: 2.2em; font-size: 1.35rem; }
.legal h2:first-of-type { margin-top: 1.4em; }
.legal ul { padding-left: 1.2em; color: var(--text-muted); }
.legal li { margin-bottom: .5em; }
.legal .updated { color: var(--text-muted); font-size: .92rem; }
