/* FlowLinr public site (spec §17) — landing page and interactive demo.
   Deliberately self-contained and dependency-free: no fonts, trackers or
   frameworks are fetched from third parties. */

:root {
  --ink: #16202e;
  --ink-soft: #55627a;
  --line: #dde3ec;
  --paper: #ffffff;
  --wash: #f6f8fb;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --ok: #0f9d58;
  --warn: #b45309;
  --risk: #c2410c;
  --now: #b91c1c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18, 28, 45, .06), 0 8px 24px rgba(18, 28, 45, .07);
}

* { box-sizing: border-box; }

body.public {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }

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

.site-head {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 1rem; height: 4rem; }
.brand { font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; text-decoration: none; color: var(--ink); }
.brand span { color: var(--accent); }
.site-head nav { margin-left: auto; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: .55rem 1rem; border-radius: 10px;
  border: 1px solid transparent; background: var(--accent); color: #fff;
  font: inherit; font-weight: 600; font-size: .93rem; text-decoration: none;
  cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--accent-dark); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--wash); }
.btn.quiet { background: transparent; color: var(--ink); border-color: transparent; }
.btn.quiet:hover { background: var(--wash); }
.btn.big { padding: .8rem 1.5rem; font-size: 1rem; }

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

.hero { padding: 4.5rem 0 3rem; background:
  radial-gradient(60rem 30rem at 70% -10%, #eaf1ff 0%, rgba(255,255,255,0) 60%); }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.1; letter-spacing: -.025em;
  margin: 0 0 1rem; max-width: 20ch;
}
.hero p.lede { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--ink-soft); max-width: 58ch; margin: 0 0 1.75rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.hero-note { margin-top: 1rem; color: var(--ink-soft); font-size: .9rem; }

/* ---------- feature grid ---------- */

section { padding: 3.5rem 0; }
section.tint { background: var(--wash); border-block: 1px solid var(--line); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.02em; margin: 0 0 .5rem; }
.section-lede { color: var(--ink-soft); max-width: 60ch; margin: 0 0 2rem; }

.grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.card p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* ---------- pricing ---------- */

.plans { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); align-items: start; }
.plan { position: relative; }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.plan .badge {
  position: absolute; top: -.7rem; left: 1.4rem; background: var(--accent); color: #fff;
  font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: .2rem .55rem; border-radius: 999px;
}
.plan .price { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; margin: .3rem 0 0; }
.plan .price small { font-size: .85rem; font-weight: 500; color: var(--ink-soft); }
.plan ul { list-style: none; padding: 0; margin: 1rem 0 1.25rem; }
.plan li { padding: .3rem 0 .3rem 1.4rem; position: relative; font-size: .93rem; color: var(--ink-soft); }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }

/* ---------- demo embed ---------- */

.demo-frame {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--paper); box-shadow: var(--shadow);
}
.demo-bar {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .7rem .9rem; border-bottom: 1px solid var(--line); background: var(--wash);
}
.demo-bar .spacer { margin-left: auto; }
.demo-bar button, .demo-bar select {
  font: inherit; font-size: .85rem; padding: .35rem .7rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer;
}
.demo-bar button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.demo-bar label { font-size: .85rem; color: var(--ink-soft); display: inline-flex; align-items: center; gap: .35rem; }
.demo-body { display: grid; grid-template-columns: 1fr; }
@media (min-width: 60rem) { .demo-body.with-panel { grid-template-columns: 1fr 20rem; } }
.demo-canvas { padding: 1rem; min-height: 22rem; overflow-x: auto; }
.demo-panel { border-top: 1px solid var(--line); padding: 1rem; background: var(--wash); font-size: .9rem; }
@media (min-width: 60rem) { .demo-panel { border-top: 0; border-left: 1px solid var(--line); } }
.demo-note { font-size: .82rem; color: var(--ink-soft); padding: .6rem .9rem; border-top: 1px solid var(--line); }

/* timeline rendering inside the demo */
.tl-scale { display: flex; font-size: .72rem; color: var(--ink-soft); border-bottom: 1px solid var(--line); padding-bottom: .3rem; margin-bottom: .6rem; }
.tl-scale span { flex: 1; text-align: center; }
.tl-row { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; }
.tl-label { width: 12rem; flex: none; font-size: .9rem; font-weight: 600; }
.tl-track { position: relative; flex: 1; height: 1.9rem; background: linear-gradient(var(--wash), var(--wash)) center/100% 2px no-repeat; }
.tl-window { position: absolute; top: .35rem; height: 1.2rem; border-radius: 999px; background: #dbeafe; border: 1px solid #bfdbfe; }
.tl-marker {
  position: absolute; top: .1rem; transform: translateX(-50%);
  padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600;
  background: var(--paper); border: 1px solid var(--line); white-space: nowrap; cursor: pointer;
}
.tl-marker.status-act_now { background: #fee2e2; border-color: #fca5a5; color: var(--now); }
.tl-marker.status-at_risk, .tl-marker.status-time_running_out { background: #ffedd5; border-color: #fdba74; color: var(--risk); }
.tl-marker.status-recommended_action_due { background: #e0f2fe; border-color: #7dd3fc; color: #075985; }
.tl-marker.status-action_window_open { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
.tl-marker.status-overdue { background: #fee2e2; border-color: #ef4444; color: #7f1d1d; }
.tl-marker.status-completed { background: #dcfce7; border-color: #86efac; color: #14532d; }
.tl-today { position: absolute; top: -.2rem; bottom: -.2rem; width: 2px; background: var(--accent); opacity: .5; }

.demo-list { width: 100%; border-collapse: collapse; font-size: .9rem; }
.demo-list th, .demo-list td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.demo-list th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.demo-list tr { cursor: pointer; }
.demo-list tr:hover td { background: var(--wash); }

.pill { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--wash); border: 1px solid var(--line); }
.pill.act_now { background: #fee2e2; border-color: #fca5a5; color: var(--now); }
.pill.at_risk, .pill.time_running_out { background: #ffedd5; border-color: #fdba74; color: var(--risk); }
.pill.recommended_action_due { background: #e0f2fe; border-color: #7dd3fc; color: #075985; }
.pill.action_window_open { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
.pill.completed { background: #dcfce7; border-color: #86efac; color: #14532d; }

.demo-ai { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.demo-ai button { display: block; width: 100%; text-align: left; margin-bottom: .35rem; }
.demo-ai .answer { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: .7rem; margin-top: .5rem; }

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

.site-foot { border-top: 1px solid var(--line); padding: 2.5rem 0; color: var(--ink-soft); font-size: .9rem; background: var(--wash); }
.site-foot .cols { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.site-foot h4 { margin: 0 0 .5rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink); }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { padding: .15rem 0; }

/* ---------- cookie / analytics choice (spec §30.2) ---------- */

.cookie-bar {
  position: fixed; inset: auto 1rem 1rem 1rem; z-index: 40; max-width: 34rem; margin: 0 auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem; font-size: .9rem;
}
.cookie-bar p { margin: 0 0 .7rem; color: var(--ink-soft); }
.cookie-bar .row { display: flex; gap: .5rem; flex-wrap: wrap; }

.prose { max-width: 46rem; }
.prose h2 { margin-top: 2rem; }
.prose p, .prose li { color: var(--ink-soft); }

/* ---------- accessibility (spec §37) ---------- */

/* A visible focus ring everywhere, on the same token as the accent so it
   reads as intentional rather than as a browser default. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link: first tab stop, hidden until focused. */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--paper); color: var(--ink); padding: .7rem 1rem;
  border: 1px solid var(--accent); border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* Respect a stated preference for less motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Honour a high-contrast preference rather than fighting it. */
@media (prefers-contrast: more) {
  :root { --ink-soft: #33404f; --line: #8b96a8; }
}

[hidden] { display: none !important; }
