/* Rovyn marketing site — editorial, serif-led, quiet.
   Serif is the editor's voice; the system sans is the app's.

   Colour comes from one place: assets/rovyn-logo.png. The ribbon's stops were
   sampled from the actual pixels; the page ground in dark mode is the tile's
   own indigo-navy. The ribbon is the single brand moment and is rationed —
   it is allowed on the mark itself, the nav's current/hover tick, the primary
   CTA's ring, the edition card's spine, and one blurred ambient wash behind
   the hero card. It never sits under text and never carries text: no single
   text colour clears AA across the whole ramp (white fails on the ember and
   cyan ends, ink fails on the violet), so anything legible sits on a solid. */

:root {
  /* --- the ribbon, sampled from assets/rovyn-logo.png --- */
  --brand-ember: #fbad60;
  --brand-coral: #fb5e78;
  --brand-magenta: #ff29b7;
  --brand-violet: #722af0;
  --brand-blue: #2e83fd;
  --brand-cyan: #04b3ff;
  --brand-navy: #0a0f3a; /* the tile ground */

  --ribbon: linear-gradient(
    100deg,
    var(--brand-ember) 0%,
    var(--brand-coral) 20%,
    var(--brand-magenta) 40%,
    var(--brand-violet) 62%,
    var(--brand-blue) 83%,
    var(--brand-cyan) 100%
  );

  /* --- surfaces + ink (light) --- */
  --paper: #faf8f4; /* warm paper */
  --paper-tint: #f4f1ea; /* the one alternate band */
  --ink: #15162e; /* near-black, pulled toward the tile's navy */
  --ink-secondary: #575a70;
  --hairline: rgba(21, 22, 46, 0.13);
  --card: #ffffff;
  --card-ghost: rgba(21, 22, 46, 0.035);
  --card-shadow: 0 14px 36px rgba(10, 15, 58, 0.09);

  /* --- accent: the app's Relay Cyan, one shade deeper for paper --- */
  --accent: #056373;
  --accent-strong: #04505c;

  --btn-fill: #14163a;
  --btn-ink: #faf8f4;
  --glow-opacity: 0.5;

  --serif: "Iowan Old Style", "Palatino Nova", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0a0b26; /* the tile's own ground */
    --paper-tint: #0e1030;
    --ink: #eceaf6;
    --ink-secondary: #a3a5c0;
    --hairline: rgba(236, 234, 246, 0.15);
    --card: #14163a;
    --card-ghost: rgba(236, 234, 246, 0.045);
    --card-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);

    --accent: #4cd9e4; /* exactly the app's dark Relay Cyan */
    --accent-strong: #7fe6ee;

    --btn-fill: #232659;
    --btn-ink: #ffffff;
    --glow-opacity: 0.42;
  }
}

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

html {
  scroll-behavior: smooth;
}

/* The tilted ghost cards and the hero wash reach past the container on
   purpose; nothing should be able to scroll sideways because of them.
   Must stay `hidden`, not `clip`: overflow clip on the root makes the
   whole viewport unscrollable in Chrome. */
html,
body {
  overflow-x: hidden;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

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

/* ---------- the mark ---------- */

/* The asset is the full uncropped tile, whose squircle corners sit on white.
   Clipping at 25% — a hair wider than Apple's 0.2237 icon ratio — trims into
   the navy so no white survives at any size (same trick as RovynMark.swift). */
.mark {
  display: block;
  border-radius: 25%;
  flex-shrink: 0;
}

/* ---------- nav ---------- */

nav {
  border-bottom: 1px solid var(--hairline);
}

nav .container.wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 15px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark .mark {
  width: 28px;
  height: 28px;
}

nav .links {
  display: inline-flex;
  align-items: center;
  gap: 22px;
}

nav .links a {
  position: relative;
  color: var(--ink-secondary);
  text-decoration: none;
  font-size: 14.5px;
  padding-bottom: 2px;
}

/* The ribbon marks where you are. */
nav .links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--ribbon);
  opacity: 0;
  transition: opacity 0.15s ease;
}

nav .links a:hover,
nav .links a[aria-current="page"] {
  color: var(--ink);
}

nav .links a:hover::after,
nav .links a[aria-current="page"]::after {
  opacity: 1;
}

@media (max-width: 420px) {
  nav .links {
    gap: 16px;
  }
  nav .links a {
    font-size: 14px;
  }
  .wordmark {
    font-size: 20px;
    gap: 8px;
  }
  .wordmark .mark {
    width: 25px;
    height: 25px;
  }
}

/* ---------- typography ---------- */

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.18;
}

h1 {
  font-size: clamp(34px, 6vw, 52px);
  letter-spacing: -0.01em;
}
h2 {
  font-size: 26px;
  margin-bottom: 14px;
}
h3 {
  font-size: 19px;
  margin-bottom: 8px;
}

p {
  margin-bottom: 1em;
}

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

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

.secondary {
  color: var(--ink-secondary);
}
.small {
  font-size: 14.5px;
}

em.editorial {
  font-family: var(--serif);
  font-style: italic;
}

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

.hero {
  padding: 76px 0 68px;
}

.hero .container.wide {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 56px;
  align-items: center;
}

@media (max-width: 800px) {
  .hero {
    padding: 52px 0 56px;
  }
  .hero .container.wide {
    grid-template-columns: 1fr;
    gap: 52px;
  }
}

.hero p.lede {
  font-size: 19px;
  color: var(--ink-secondary);
  margin-top: 20px;
  max-width: 34em;
}

.hero .cta-row {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.btn {
  display: inline-block;
  font-size: 15.5px;
  font-weight: 500;
  text-decoration: none;
  padding: 11px 20px;
  border-radius: 11px;
  border: 1.5px solid transparent;
}

/* The live CTA wears the ribbon — as a ring, never as a text ground. */
.btn.primary {
  background: linear-gradient(var(--btn-fill), var(--btn-fill)) padding-box, var(--ribbon)
    border-box;
  color: var(--btn-ink);
  box-shadow: 0 10px 24px -14px rgba(114, 42, 240, 0.75);
}

.btn.primary:hover {
  color: var(--btn-ink);
  box-shadow: 0 12px 28px -12px rgba(114, 42, 240, 0.85);
}

.btn.quiet {
  color: var(--ink);
  border: 1px solid var(--hairline);
}

.btn.quiet:hover {
  color: var(--ink);
  border-color: var(--ink-secondary);
}

.cta-note {
  font-size: 13.5px;
  color: var(--ink-secondary);
  width: 100%;
}

/* ---------- the edition card ---------- */

.shelf {
  position: relative;
}

/* The card is the hero's product demonstration; the caption is the one line
   of copy that names what you're looking at. */
.card-caption {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15.5px;
  line-height: 1.45;
  color: var(--ink-secondary);
  text-align: center;
  margin: 22px auto 0;
  max-width: 26em;
}

/* The one ambient use of the ribbon: a soft wash behind the card, never
   behind text. Softness comes from the gradients' own falloff — a filter
   blur here creates a huge composited layer that hangs Chrome on scroll. */
.shelf .glow {
  position: absolute;
  inset: -16% -10%;
  z-index: 0;
  pointer-events: none;
  opacity: var(--glow-opacity);
  background: radial-gradient(58% 52% at 26% 22%, rgba(251, 173, 96, 0.4), transparent 62%),
    radial-gradient(52% 48% at 78% 26%, rgba(255, 41, 183, 0.32), transparent 62%),
    radial-gradient(54% 52% at 60% 88%, rgba(4, 179, 255, 0.36), transparent 62%);
}

.ghost-card {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 16px;
  background: var(--card-ghost);
  border: 1px solid var(--hairline);
}

.ghost-card.g1 {
  transform: rotate(-2.2deg) translate(-10px, 14px);
}
.ghost-card.g2 {
  transform: rotate(1.6deg) translate(12px, -10px);
}

.edition {
  position: relative;
  z-index: 2;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 24px 22px 18px;
  box-shadow: var(--card-shadow);
}

/* The issue's spine. */
.edition::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--ribbon);
}

.edition .goal {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.25;
}

.edition .byline {
  font-size: 13px;
  color: var(--ink-secondary);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* Monochrome, like the app's AssistantMonogram — this is the assistant's
   letter, not Rovyn's mark. */
.monogram {
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 3px 6px;
}

.edition .episodes {
  margin-top: 16px;
  border-top: 1px solid var(--hairline);
}

.edition .ep {
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
}

.edition .ep:last-child {
  border-bottom: none;
}

.edition .ep .title {
  font-size: 14.5px;
  font-weight: 600;
}

.edition .ep .meta {
  font-size: 12.5px;
  color: var(--ink-secondary);
}

/* The quote bar stays monochrome — the app's accent constitution keeps it so. */
.edition .ep .why {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink);
  margin-top: 5px;
  padding-left: 10px;
  border-left: 2px solid var(--hairline);
}

/* ---------- scenarios: prompt → edition → outcome ---------- */

/* The same edition component, scaled down to sit inside a scenario. It keeps
   the spine (the one rationed ribbon moment) and loses the shadow, so the
   hero card stays the only object that appears to float. */
.edition.mini {
  padding: 16px 16px 14px;
  border-radius: 14px;
  box-shadow: none;
}

/* Thinner spine than the hero card's: same object, quieter, so several of
   them on one screen never out-shout the one they're derived from. */
.edition.mini::before {
  height: 2px;
}

.edition.mini .goal {
  font-size: 17px;
}

.edition.mini .byline {
  font-size: 12px;
  margin-top: 5px;
}

.edition.mini .episodes {
  margin-top: 12px;
}

.edition.mini .ep {
  padding: 10px 0;
}

.edition.mini .ep .title {
  font-size: 13.5px;
}

.edition.mini .ep .meta {
  font-size: 12px;
}

.edition.mini .ep .why {
  font-size: 13.5px;
  line-height: 1.45;
}

/* A card that opens straight into episodes has nothing above to divide from. */
.edition .episodes.bare {
  margin-top: 0;
  border-top: none;
}

.edition .more {
  font-size: 12.5px;
  color: var(--ink-secondary);
  padding-top: 10px;
  border-top: 1px solid var(--hairline);
}

/* The user's own words: a filled block, not the hairline-ruled quote the
   assistant's `why` uses — so the two voices never read as the same voice. */
.edition .note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--card-ghost);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 12px;
}

.scenarios {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 44px 32px;
  margin-top: 30px;
}

/* Rows: label, ask, connector, edition, outcome. Sharing the parent's row
   tracks lines the two side-by-side scenarios up part for part, so the edition
   cards start on the same line even when one question runs a line longer.
   Own row-gap, or the parent's 44px band gap would open between every part.
   Browsers without subgrid just stagger — nothing breaks. */
.scenarios .scenario:not(.loop) {
  display: grid;
  grid-row: span 5;
  grid-template-rows: subgrid;
  row-gap: 0;
}

.scenario .num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 10px;
}

/* The ask, in the shape it's actually made in. */
.prompt {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--card-ghost);
  border: 1px solid var(--hairline);
  border-radius: 14px 14px 14px 4px;
  padding: 12px 14px;
}

.prompt .who {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  margin-bottom: 4px;
}

.prompt .said {
  display: block;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
}

/* The hairline that carries the eye from the ask to what came back. */
.flow {
  width: 1px;
  height: 24px;
  margin: 10px auto;
  background: var(--hairline);
}

.scenario .outcome {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-secondary);
  margin: 14px 0 0;
}

/* Scenario three runs the full width: note in, corrected edition out. */
.scenario.loop {
  grid-column: 1 / -1;
}

.loop-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.loop-step .cap {
  font-size: 13px;
  color: var(--ink-secondary);
  margin-bottom: 10px;
}

.loop-arrow {
  align-self: center;
  color: var(--ink-secondary);
  font-size: 20px;
  line-height: 1;
}

.loop-arrow::before {
  content: "→";
}

@media (max-width: 760px) {
  .scenarios {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .loop-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .loop-arrow {
    justify-self: center;
  }
  .loop-arrow::before {
    content: "↓";
  }
}

/* ---------- sections ---------- */

section.band {
  border-top: 1px solid var(--hairline);
  padding: 60px 0;
}

section.band.tint {
  background: var(--paper-tint);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 28px;
}

@media (max-width: 700px) {
  .steps {
    grid-template-columns: 1fr;
  }
  section.band {
    padding: 48px 0;
  }
}

.step .num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 6px;
}

.step p {
  font-size: 15px;
  color: var(--ink-secondary);
  margin-bottom: 0;
}

.section-lede {
  font-size: 16px;
  color: var(--ink-secondary);
  max-width: 34em;
  margin-bottom: 0;
}

.section-note {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-secondary);
  max-width: 40em;
  margin: 40px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
}

/* The quiet credibility band: protocol and privacy, near the footer, where
   the people who care about them are already looking. */
.colophon-band {
  padding: 40px 0 38px;
}

.colophon-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 48px;
}

.colophon-grid p {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-secondary);
  margin-bottom: 0;
}

@media (max-width: 700px) {
  .colophon-grid {
    grid-template-columns: 1fr;
  }
}

blockquote.thesis {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(20px, 3.2vw, 26px);
  line-height: 1.4;
  max-width: 26em;
}

blockquote.thesis footer {
  font-family: var(--sans);
  font-style: normal;
  font-size: 14px;
  color: var(--ink-secondary);
  margin-top: 14px;
}

/* ---------- article pages (privacy, connect, docs) ---------- */

main.article {
  padding: 56px 0 72px;
}

main.article header {
  margin-bottom: 36px;
}

main.article header p.dateline {
  font-size: 14px;
  color: var(--ink-secondary);
  margin-top: 10px;
}

main.article h2 {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--hairline);
}

main.article ul,
main.article ol {
  margin: 0 0 1em 1.3em;
}
main.article li {
  margin-bottom: 0.45em;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  margin-bottom: 1.2em;
}

th,
td {
  text-align: left;
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}

th {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--card-ghost);
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 1px 5px;
}

/* copy block on /connect */

.copyblock {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 10px 0 18px;
}

.copyblock code {
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  overflow-x: auto;
  white-space: nowrap;
  flex: 1;
}

.copyblock button {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: var(--card-ghost);
  border: 1px solid var(--hairline);
  border-radius: 7px;
  padding: 6px 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.copyblock button:hover {
  border-color: var(--ink-secondary);
}

/* the setup companion on /connect (ux-v1 §3.11 Amendment 15): the offer of a
   prompt that walks you through the steps in chat. Quiet and shut by default —
   the numbered steps above it stay the primary path. */

details.chatguide {
  margin: 0 0 18px;
}

details.chatguide summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-secondary);
  padding: 4px 0;
}

details.chatguide summary:hover {
  color: var(--ink);
}

details.chatguide > p {
  margin: 6px 0 0;
}

/* the companion prompt is a paragraph, not an address: it wraps rather than
   scrolling sideways like the URL blocks do, and the button sits at its top.
   (Modifier is `.companion`, not `.prompt` — `.prompt` is the home page's chat
   bubble and would drag its own flex column in here.) */
.copyblock.companion {
  align-items: flex-start;
}

.copyblock.companion code {
  white-space: normal;
  overflow-x: visible;
  line-height: 1.55;
}

/* the FAQ list (/faq): the same disclosure pattern as the setup companion
   above, opened up enough to hold a question. Every row arrives shut — the
   page is a list of questions, and which ones are yours is your business. */

details.faq {
  border-top: 1px solid var(--hairline);
}

details.faq:last-of-type {
  border-bottom: 1px solid var(--hairline);
}

details.faq summary {
  cursor: pointer;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
  padding: 16px 0;
}

details.faq summary:hover {
  color: var(--accent);
}

/* open: the question tightens against its answer rather than floating
   equidistant between two hairlines. */
details.faq[open] summary {
  padding-bottom: 8px;
}

details.faq > p {
  max-width: 36em;
  margin-bottom: 18px;
}

.faq-outro {
  margin-top: 28px;
}

.assistant {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--hairline);
}

/* `main.article h2` is (0,1,2), so this reset has to out-specify it — otherwise
   the block's own rule and the heading's rule both draw and you get a double
   hairline. */
main.article .assistant h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.todo {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
  border: 1px dashed var(--hairline);
  border-radius: 6px;
  padding: 2px 8px;
  vertical-align: 2px;
}

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

footer.site {
  border-top: 1px solid var(--hairline);
  padding: 36px 0 48px;
  font-size: 14px;
  color: var(--ink-secondary);
}

footer.site .container.wide {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  align-items: center;
  justify-content: space-between;
}

footer.site .colophon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

footer.site .colophon .mark {
  width: 22px;
  height: 22px;
}

footer.site a {
  color: var(--ink-secondary);
  text-decoration: none;
  margin-right: 20px;
}
footer.site a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}
