/* Rhymewright showcase. Palette and type taken from the app itself:
   bg #171a20, panel #1d2129, sunk #14171c, ink #e7e9ee, muted #a0a7b4,
   line #2b303a, accent #9db2ff, mark #e6cf5c. No external requests. */

:root {
  --bg: 23 26 32;
  --panel: 29 33 41;
  --sunk: 20 23 28;
  --ink: 231 233 238;
  --muted: 170 177 190;
  --line: 43 48 58;
  --line-strong: 62 69 82;
  --accent: 157 178 255;
  --mark: 230 207 92;
  --sans: "Work Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --wrap: 1120px;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: rgb(var(--bg));
  color: rgb(var(--ink));
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

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

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5.2vw, 3.4rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.55rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.22rem; }

p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 720px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: rgb(var(--panel)); color: rgb(var(--ink));
  padding: .7em 1.1em; border-radius: 0 0 8px 0; z-index: 20;
}
.skip:focus { left: 0; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgb(var(--bg) / .92);
  border-bottom: 1px solid rgb(var(--line));
  backdrop-filter: blur(8px);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 62px;
}
.brand {
  font-family: var(--serif); font-size: 1.22rem; font-weight: 600;
  color: rgb(var(--ink)); text-decoration: none; white-space: nowrap;
}
.topbar nav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.topbar nav a {
  color: rgb(var(--muted)); text-decoration: none; font-size: .95rem;
  padding: .25em 0; border-bottom: 1px solid transparent;
}
.topbar nav a:hover, .topbar nav a:focus-visible {
  color: rgb(var(--ink)); border-bottom-color: rgb(var(--accent));
}
.nav-open { color: rgb(var(--accent)) !important; }

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

.hero { padding: clamp(2.2rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero-inner {
  display: grid; grid-template-columns: 1fr 1.05fr;
  gap: clamp(1.5rem, 4vw, 3.2rem); align-items: center;
}
.eyebrow {
  text-transform: uppercase; letter-spacing: .16em; font-size: .74rem;
  color: rgb(var(--mark)); margin-bottom: 1em;
}
.lead { font-size: clamp(1rem, 1.5vw, 1.12rem); color: rgb(var(--muted)); }
.note { font-size: .9rem; color: rgb(var(--muted)); margin-top: 1.1em; }

.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6em; }
.btn {
  display: inline-block; padding: .72em 1.35em; border-radius: 999px;
  font-size: .97rem; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; transition: transform .16s ease, background-color .16s ease, border-color .16s ease;
}
.btn-primary { background: rgb(var(--accent)); color: #10131a; }
.btn-primary:hover { background: rgb(var(--accent) / .88); }
.btn-ghost { border-color: rgb(var(--line-strong)); color: rgb(var(--ink)); }
.btn-ghost:hover { border-color: rgb(var(--accent)); color: rgb(var(--accent)); }
.btn:focus-visible { outline: 2px solid rgb(var(--mark)); outline-offset: 3px; }

.hero-shot { margin: 0; }
.hero-shot img {
  border: 1px solid rgb(var(--line-strong));
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px rgb(var(--accent) / .12), 0 24px 60px -30px rgb(0 0 0 / .9);
}

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

.section { padding: clamp(2.4rem, 6vw, 4.2rem) 0; border-top: 1px solid rgb(var(--line)); }
.section-lead { color: rgb(var(--muted)); margin-top: -.35em; }
.section p { color: rgb(var(--muted)); }
.section h2 + p { margin-top: .6em; }

.cards {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.1rem, 2.6vw, 1.9rem); margin-top: 2rem;
}
.card {
  background: rgb(var(--panel)); border: 1px solid rgb(var(--line));
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
}
.card img { border-bottom: 1px solid rgb(var(--line)); width: 100%; }
.card-body { padding: 1.15rem 1.3rem 1.4rem; }
.card-body h3 { margin-bottom: .4em; }
.card-body p { margin: 0; color: rgb(var(--muted)); font-size: .98rem; }

.mini {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem 1.6rem; margin-top: 2rem;
  padding-top: 2rem; border-top: 1px solid rgb(var(--line));
}
.mini h3 { font-size: 1.05rem; margin-bottom: .3em; }
.mini p { margin: 0; color: rgb(var(--muted)); font-size: .94rem; }
.mini-head { margin: 2.8rem 0 0; font-size: 1.15rem; color: rgb(var(--ink)); }

/* ---------- look inside: the panels ---------- */

.panels {
  column-count: 2; column-gap: 1.9rem; margin-top: 2.2rem;
}
.panels article {
  break-inside: avoid; -webkit-column-break-inside: avoid;
  display: block; margin: 0 0 2.2rem;
}
.panels .shot {
  border: 1px solid rgb(var(--line-strong)); border-radius: 10px;
  background: rgb(var(--panel));
}
.panels h3 { margin: 1rem 0 .35em; font-size: 1.08rem; }
.panels p { margin: 0; color: rgb(var(--muted)); font-size: .94rem; }

/* ---------- the controls ---------- */

.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(.8rem, 1.8vw, 1.2rem); margin: 2rem 0 2.6rem;
}
.stat {
  background: rgb(var(--panel)); border: 1px solid rgb(var(--line));
  border-radius: var(--radius); padding: 1.1rem 1.2rem 1.2rem;
}
.stat b {
  display: block; font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.7rem, 3.2vw, 2.3rem); line-height: 1; color: rgb(var(--accent));
}
.stat span { display: block; margin-top: .5rem; font-size: .9rem; color: rgb(var(--muted)); line-height: 1.45; }

.uses {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.7rem 2.6rem;
}
.uses article { border-top: 1px solid rgb(var(--line)); padding-top: 1.1rem; }
.uses h3 { font-size: 1.1rem; margin-bottom: .45em; }
.uses p { color: rgb(var(--muted)); font-size: .97rem; margin-bottom: 1em; }
.uses p.use {
  margin: 0; font-size: .92rem; color: rgb(var(--ink));
  border-left: 2px solid rgb(var(--mark)); padding-left: .85rem;
}

/* ---------- phone strip ---------- */

.section-phone { background: rgb(var(--sunk)); }
.phones {
  display: flex; justify-content: center; align-items: flex-start;
  gap: clamp(.8rem, 2.4vw, 1.6rem); margin-top: 2rem;
}
.phones .shot {
  flex: 1 1 230px; max-width: 230px; border-radius: 22px;
  border: 1px solid rgb(var(--line-strong));
  box-shadow: 0 18px 40px -24px rgb(0 0 0 / .9);
}
.phones .shot img { width: 100%; border: 0; border-radius: 0; }

/* ---------- steps ---------- */

.steps { list-style: none; counter-reset: step; padding: 0; margin: 1.8rem 0 0; }
.steps li {
  counter-increment: step; position: relative;
  padding: 0 0 1.5rem 3.2rem; border-left: 1px solid rgb(var(--line));
  margin-left: .95rem;
}
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before {
  content: counter(step); position: absolute; left: -.95rem; top: -.1rem;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: rgb(var(--panel)); border: 1px solid rgb(var(--line-strong));
  color: rgb(var(--accent)); font-size: .9rem; font-weight: 600;
  display: grid; place-items: center;
}
.steps h3 { font-size: 1.1rem; margin-bottom: .25em; }
.steps p { margin: 0; color: rgb(var(--muted)); }

/* ---------- cta + footer ---------- */

.cta {
  padding: clamp(2.6rem, 7vw, 4.5rem) 0;
  border-top: 1px solid rgb(var(--line));
  background: linear-gradient(180deg, rgb(var(--sunk)) 0%, rgb(var(--bg)) 100%);
}
.cta p { color: rgb(var(--muted)); }
.cta .buttons { margin-top: 1.4rem; }

.footer {
  border-top: 1px solid rgb(var(--line)); padding: 1.6rem 0 2.4rem;
  font-size: .9rem; color: rgb(var(--muted));
}
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer p { margin: 0; }
.footer a { color: rgb(var(--muted)); }
.footer a:hover { color: rgb(var(--accent)); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-shot { order: -1; }
  .cards { grid-template-columns: 1fr; }
  .mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .uses { grid-template-columns: 1fr; }
  .panels { column-count: 1; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .topbar-inner { min-height: 56px; }
  .topbar nav { gap: 12px; }
  .topbar nav a:not(.nav-open) { display: none; }
  /* the hero swaps to the phone screenshot here; keep it to a readable band */
  .hero-shot img { max-height: 470px; width: 100%; object-fit: cover; object-position: top center; }
  /* panels: show a readable band on phones, tap for the full view */
  .panels .shot img { max-height: 430px; width: 100%; object-fit: cover; object-position: top center; }
  .mini { grid-template-columns: 1fr; }
  .phones { flex-wrap: wrap; }
  .phones .shot { flex: 1 1 44%; max-width: 47%; }
  .buttons .btn { width: 100%; text-align: center; }
  .steps li { padding-left: 2.6rem; }
}

/* ---------- click a screenshot for full screen ---------- */

.shot {
  display: block; position: relative;
  text-decoration: none; cursor: zoom-in;
  border-radius: var(--radius); overflow: hidden;
}
.shot:focus-visible { outline: 2px solid rgb(var(--mark)); outline-offset: 3px; }
.shot::after {
  content: "Click to view full screen";
  position: absolute; right: 10px; bottom: 10px;
  padding: .4em .7em; border-radius: 999px;
  background: rgb(12 14 19 / .82); color: rgb(var(--ink));
  font-size: .78rem; letter-spacing: .01em;
  opacity: 0; transition: opacity .16s ease; pointer-events: none;
}
.shot:hover::after, .shot:focus-visible::after { opacity: 1; }

.lb {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 18px; background: rgb(8 10 14 / .96);
}
.lb[hidden] { display: none; }
.lb-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100%; max-height: 100%; }
.lb-img {
  max-width: calc(100vw - 36px); max-height: calc(100vh - 120px);
  width: auto; height: auto; border-radius: 8px;
  border: 1px solid rgb(var(--line-strong));
}
.lb-cap {
  margin: 0; max-width: min(70ch, calc(100vw - 36px));
  color: rgb(var(--muted)); font-size: .85rem; text-align: center;
}
.lb-close {
  position: fixed; top: 12px; right: 14px;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgb(var(--line-strong));
  background: rgb(24 27 34 / .94); color: rgb(var(--ink));
  font-size: 1.7rem; line-height: 1; cursor: pointer;
}
.lb-close:hover { border-color: rgb(var(--accent)); color: rgb(var(--accent)); }
.lb-close:focus-visible { outline: 2px solid rgb(var(--mark)); outline-offset: 3px; }
html.lb-open, html.lb-open body { overflow: hidden; }

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .card, .mini article { transition: border-color .18s ease; }
  .card:hover { border-color: rgb(var(--line-strong)); }
}

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