/* 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 p.lede strong {
  color: var(--ink);
  font-weight: 600;
}

.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);
}

/* Not shipped yet, so it does not get the brand moment. */
.btn.coming {
  color: var(--ink-secondary);
  border: 1px dashed var(--hairline);
  cursor: default;
}

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

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

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

.shelf {
  position: relative;
}

/* 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);
}

/* ---------- 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;
}

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;
}

/* An editorial two-column: heading in the left rail, argument on the right. */
.container.wide.split {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: 20px 48px;
  align-items: start;
}

.split-head h2 {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .container.wide.split {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.prose {
  max-width: 38em;
}

.prose p {
  color: var(--ink-secondary);
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose p.small {
  margin-top: 1.4em;
}

.prose p em.editorial {
  color: var(--ink);
}

/* ---------- 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);
}

.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;
  }
}
