@import url("./fonts/inter.css");

/* ==========================================================================
   Keelwell — public site
   Tokens mirrored from ui/app/app.css. That file is the source of truth; if a
   value changes there, change it here. See README.md ("Token sync").

   Ink is the settled palette: warm paper, cool ink, warm signals. The light
   accent clears 10.47:1 on --bg; dark accent clears 5.89:1 on --bg and 5.30:1
   on --surface. Dark primary actions use the separate --accent-solid fill so
   white labels clear 4.96:1 without making the action brighter than overdue.
   Computed 2026-08-05; re-compute, don't eyeball, if any value moves.
   ========================================================================== */

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-sunk: #f1f1ee;
  --text: #1f2328;
  --text-muted: #6b7178;
  --border: #e6e6e2;

  --accent: #2b3a5e;
  --accent-hover: #1f2c4a;
  --accent-wash: #e8ebf3;

  /* Link/text and fill share Ink in light mode, but remain distinct roles so
     dark mode can preserve the intended attention hierarchy. */
  --accent-solid: #2b3a5e;
  --accent-solid-hover: #1f2c4a;
  --accent-solid-edge: transparent;
  --accent-solid-edge-hover: transparent;
  --on-accent-solid: #ffffff;

  --secondary: #7d7468;
  --secondary-wash: #efece7;

  --focus-ring: rgba(43, 58, 94, 0.35);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(20, 23, 26, 0.05);
  --shadow-md: 0 4px 12px rgba(20, 23, 26, 0.08);

  --ease-standard: cubic-bezier(0.2, 0, 0.2, 1);

  --measure: 34rem; /* prose */
  --wide: 62rem; /* full content column */
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --rhythm: clamp(4.5rem, 11vw, 8rem); /* space between sections */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1e2125;
    --surface-sunk: #191c1f;
    --text: #eceef1;
    --text-muted: #9aa1aa;
    --border: #2b2f34;

    --accent: #7b93cc;
    --accent-hover: #92a6d6;
    --accent-wash: #232a3d;

    --accent-solid: #4a6dbf;
    --accent-solid-hover: #4e70c1;
    --accent-solid-edge: #7b93cc;
    --accent-solid-edge-hover: #92a6d6;
    --on-accent-solid: #ffffff;

    --secondary: #9c9386;
    --secondary-wash: #262320;

    --focus-ring: rgba(146, 166, 214, 0.5);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
  }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-feature-settings: "cv05" 1; /* Inter's single-storey l — cleaner at text sizes */
  -webkit-font-smoothing: antialiased;
}

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

.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;
  background: var(--surface);
  color: var(--text);
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  z-index: 10;
}

.skip:focus {
  left: var(--gutter);
  top: 0.75rem;
}

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Prose is a measure-limited column INSIDE .wrap, never a replacement for it —
   so every section's text shares one left edge down the whole page. Combining
   the two classes on one element makes .prose's max-width inherit .wrap's
   auto margins and silently centres that section. Don't. */
.prose {
  max-width: var(--measure);
}

/* Doubled class is deliberate. The type resets below (.p, .h2, .lead …) all set
   `margin: 0` at (0,1,0) and are declared later in this file, so a plain
   `.prose > * + *` loses the cascade and every paragraph collapses together.
   (0,2,0) settles it without depending on source order. */
.prose.prose > * + * {
  margin-block-start: 1.25rem;
}

.section {
  padding-block: var(--rhythm);
}

/* --------------------------------------------------------------------------
   Type
   -------------------------------------------------------------------------- */

.label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}

.h1 {
  font-size: clamp(2.25rem, 7.2vw, 3.75rem);
  font-weight: 600;
  letter-spacing: -0.032em;
  line-height: 1.04;
  margin: 0;
  text-wrap: balance;
}

.h2 {
  font-size: clamp(1.625rem, 4.4vw, 2.375rem);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

.h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.006em;
  margin: 0;
}

.lead {
  font-size: clamp(1.0625rem, 2.3vw, 1.3125rem);
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}

.p {
  margin: 0;
}

.muted {
  color: var(--text-muted);
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

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

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

.head {
  padding-block: 1.5rem;
}

.lockup {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: inherit;
  width: fit-content;
}

.lockup-mark {
  color: var(--accent);
  flex: none;
}

.lockup-name {
  font-weight: 600;
  letter-spacing: -0.015em;
  font-size: 1.0625rem;
}

.lockup-desc {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.lockup-desc::before {
  content: "·";
  margin-inline: 0.5rem;
  color: var(--border);
}

@media (max-width: 26rem) {
  .lockup-desc {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   The keel spine — this page's signature.

   Each divider is a hairline with a balance ring on it. Down the page they run
   from tilted-and-off-centre to level-and-centred: the structure performs the
   brand line instead of describing it. The abstract level/ring geometry is
   lifted from ui/app/components/even-keel-mark.tsx — never nautical imagery.

   Static default is the SETTLED state, so no-JS and reduced-motion readers get
   the correct picture. keel.js sets the pre-roll tilt and releases it on scroll.
   -------------------------------------------------------------------------- */

.keel {
  --tilt: 0deg;
  --ring: 50%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
  height: 2.5rem;
  position: relative;
  overflow: hidden;
}

.keel-bar {
  position: absolute;
  inset: 0 var(--gutter);
  transform: rotate(var(--tilt));
  transform-origin: 50% 50%;
  transition: transform 1100ms var(--ease-standard);
  will-change: transform;
}

.keel-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.keel-ring {
  position: absolute;
  top: 50%;
  left: var(--ring);
  width: 9px;
  height: 9px;
  margin: -5px 0 0 -5px;
  border: 1.5px solid var(--secondary);
  border-radius: 50%;
  background: var(--bg);
  transition: left 1100ms var(--ease-standard);
}

@media (prefers-reduced-motion: reduce) {
  .keel-bar,
  .keel-ring {
    transition: none;
  }
}

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

.hero {
  padding-block: clamp(3rem, 9vw, 6rem) clamp(2rem, 5vw, 3rem);
}

.hero-title {
  margin-block: 0.75rem 0;
}

.hero-lead {
  margin-block-start: 1.5rem;
  max-width: 30rem;
}

.hero-cta {
  margin-block-start: 2.25rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-solid);
  color: var(--on-accent-solid);
  font: inherit;
  font-weight: 600;
  letter-spacing: -0.005em;
  padding: 0.8125rem 1.375rem;
  border: 1px solid var(--accent-solid-edge);
  border-radius: var(--radius-md);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition:
    background-color var(--duration, 180ms) var(--ease-standard),
    transform 120ms var(--ease-standard);
}

.btn:hover {
  background: var(--accent-solid-hover);
  border-color: var(--accent-solid-edge-hover);
  color: var(--on-accent-solid);
}

.btn:active {
  transform: translateY(1px);
}

.btn-note {
  margin-block-start: 1rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  max-width: 30rem;
}

/* --------------------------------------------------------------------------
   Screenshot previews
   -------------------------------------------------------------------------- */

.shot-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.shot {
  display: grid;
  place-items: center;
  background: var(--surface-sunk);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

img.shot {
  display: block;
  width: 100%;
  padding: 0;
  border-style: solid;
  object-fit: contain;
}

.shot-phone {
  aspect-ratio: 390 / 844;
  max-width: 19rem;
  margin-inline: auto;
}

.shot-wide {
  aspect-ratio: 16 / 10;
}

.shot-tile {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  padding: 1rem;
}

.shot-slug {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-block-end: 0.375rem;
}

.figure {
  margin: 2.5rem 0 0;
}

.caption {
  margin-block-start: 0.875rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  text-align: center;
}

#screenshot-dialog {
  max-width: min(100% - 2rem, 90rem);
  margin: auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
}

#screenshot-dialog::backdrop {
  background: rgba(20, 23, 26, 0.65);
}

#screenshot-dialog-image {
  display: block;
  max-inline-size: min(100%, 1440px);
  max-block-size: calc(100dvh - 5rem);
  object-fit: contain;
  margin-inline: auto;
}

#screenshot-dialog [data-close-dialog] {
  display: block;
  margin: 1rem 0 0 auto;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

#screenshot-dialog [data-close-dialog]:hover {
  background: var(--surface-sunk);
}

/* --------------------------------------------------------------------------
   Feature grid
   -------------------------------------------------------------------------- */

.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  margin-block-start: 2.5rem;
}

@media (min-width: 44rem) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.card > * + * {
  margin-block-start: 0.75rem;
}

.card-body {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

/* --------------------------------------------------------------------------
   Plain lists (AI section, "what it isn't")
   -------------------------------------------------------------------------- */

.list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}

.list > li {
  padding-block: 0.875rem;
  border-block-start: 1px solid var(--border);
}

.list > li:last-child {
  border-block-end: 1px solid var(--border);
}

.list-lead {
  font-weight: 600;
}

.list-note {
  color: var(--text-muted);
}

/* Bulleted variant for the three AI reads — a sequence of equals, not a
   ranked list, so no numbering. */
.reads {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.625rem;
}

.reads > li {
  position: relative;
  padding-inline-start: 1.5rem;
  color: var(--text-muted);
}

.reads > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--secondary);
  border-radius: 50%;
}

/* --------------------------------------------------------------------------
   Status block ("where it's up to")
   -------------------------------------------------------------------------- */

.facts {
  display: grid;
  gap: 1.75rem;
  margin-block-start: 2.5rem;
}

@media (min-width: 44rem) {
  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 3rem;
  }
}

.fact > * + * {
  margin-block-start: 0.5rem;
}

.fact-body {
  margin: 0;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Closing CTA
   -------------------------------------------------------------------------- */

.close {
  padding-block: var(--rhythm);
}

.close .btn-note {
  max-width: var(--measure);
}

/* The opt-out page's prose lives directly in .wrap (--wide), so it needs the
   same measure limit the rest of the site's text columns get. */
.close #optout-confirm,
.close #optout-status {
  max-width: var(--measure);
}

.interest-layout {
  display: grid;
  gap: 2rem;
  max-width: var(--measure);
  margin-block-start: 2rem;
}

#interest-form {
  display: grid;
  gap: 1.25rem;
}

.form-field {
  display: grid;
  gap: 0.5rem;
}

.form-field label,
.form-checkbox {
  font-weight: 500;
}

.form-field label span {
  color: var(--text-muted);
  font-weight: 400;
}

.form-field input,
.form-field textarea {
  width: 100%;
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  line-height: 1.4;
}

.form-field textarea {
  min-height: 8rem;
  resize: vertical;
}

.form-checkbox {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
}

.form-checkbox input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.25rem 0 0;
  accent-color: var(--accent);
  flex: none;
}

.field-error,
#interest-status,
#optout-status {
  min-height: 1.65em;
  margin: 0;
  color: var(--accent);
}

.field-error:empty,
#interest-status:empty,
#optout-status:empty {
  display: none;
}

.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.btn:disabled {
  cursor: wait;
  opacity: 0.7;
}

.interest-details {
  display: grid;
  gap: 1rem;
  color: var(--text-muted);
}

.interest-details p,
.interest-success p {
  margin: 0;
}

.interest-disclosure {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-sunk);
}

/* Doubled class, same reason as `.prose.prose` above: `.interest-details p`
   (0,1,1) sets `margin: 0` and this section is a descendant of that grid, so a
   plain `.interest-disclosure > * + *` (0,1,0) loses and every paragraph
   collapses together. (0,2,0) settles it. */
.interest-disclosure.interest-disclosure > * + * {
  margin-block-start: 0.5rem;
}

.interest-success {
  display: grid;
  gap: 0.5rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

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

.foot {
  border-block-start: 1px solid var(--border);
  padding-block: 2rem 3rem;
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.foot-note {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.875rem;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Privacy policy
   -------------------------------------------------------------------------- */

/* Thirteen sections spaced at --rhythm would put a screen of nothing between
   each claim and the next. The policy keeps the site's measure and type but
   sets its own, tighter vertical rhythm inside a single .section. */
.policy > * + * {
  margin-block-start: 3rem;
}

/* Doubled class for the same cascade reason as `.prose.prose`: the type resets
   (.h2, .h3, .p) all set `margin: 0` at (0,1,0) and are declared earlier. */
.policy-section.policy-section > * + * {
  margin-block-start: 1rem;
}

.policy-section h3 {
  margin-block-start: 1.75rem;
}

.policy-date {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

/* The summary layer is the one most readers will actually read, so unlike
   .reads it stays at full text contrast rather than muted. */
.summary {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.summary > li {
  position: relative;
  padding-inline-start: 1.5rem;
}

.summary > li::before {
  content: "";
  position: absolute;
  inset-block-start: 0.6em;
  inset-inline-start: 0.25rem;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--accent);
}
