/* Cat Reader: the app's Dusk theme (Themes.kt, ReaderTheme "dusk") on the web. */

@font-face {
  font-family: "Literata";
  src: url("/fonts/literata.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("/fonts/literata-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #211c18;
  --bar: #1a1613;
  --surface: #2b2622;
  --text: #e6dccb;
  --dim: #a79a89;
  --accent: #d9a866;
  --on-accent: #1f1710;
  --heading: #efc98c;
  --highlight: #4a3a22;
  --selection: #6a5230;
  --outline: #3f3832;
  --cream: #efe5d3;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 18px;
  --wrap: 68rem;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  /* a warm glow from the top, like lamplight on the page */
  background-image: radial-gradient(ellipse 90% 50% at 50% -10%, rgba(217, 168, 102, 0.10), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font: 1.0625rem/1.65 var(--sans);
  overflow-wrap: break-word;
}

::selection { background: var(--selection); color: var(--text); }

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

:focus-visible {
  outline: 3px solid var(--heading);
  outline-offset: 3px;
  border-radius: 6px;
}

img, svg { max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--heading);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.4rem, 7vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

.skip {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--accent); color: var(--on-accent);
  padding: 0.6rem 1rem; border-radius: 10px; font-weight: 600; text-decoration: none; z-index: 10;
}
.skip:focus { top: 1rem; }

/* ---------- Top bar ---------- */

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-top: 1.1rem; padding-bottom: 1.1rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--text); text-decoration: none;
  font: 600 1.15rem/1 var(--serif);
}
.brand img { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 0 0 1px var(--outline); }
.top nav { display: flex; gap: 1.1rem; font-size: 0.95rem; }
.top nav a { color: var(--dim); text-decoration: none; }
.top nav a:hover { color: var(--text); }

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

main { overflow-x: clip; }
.hero {
  display: grid; gap: 2.5rem; align-items: center;
  padding-top: 2rem; padding-bottom: 4rem;
}
/* The cat sits large and faded behind the text, like a watermark on the page; on wide screens it peeks out from
   between the text and the phone. The text keeps a soft halo of the page colour so it always reads cleanly. */
.hero-text { position: relative; isolation: isolate; padding-top: 8.5rem; }
.hero-text > :not(.hero-cat) { position: relative; z-index: 1; }
.hero-text h1, .hero-text .lede { text-shadow: 0 0 2px var(--bg), 0 0 12px var(--bg), 0 0 24px var(--bg); }
.hero-cat {
  position: absolute; z-index: 0; pointer-events: none;
  top: -1rem; right: -4rem;
  width: auto; height: 20rem;
  opacity: 0.42;
}
.lede {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 3.2vw, 1.45rem);
  line-height: 1.5;
  color: var(--text);
  max-width: 32rem;
  margin-bottom: 1.75rem;
}
.lede em { font-style: italic; color: var(--heading); }

.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

.button {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 48px; padding: 0.75rem 1.4rem;
  border-radius: 999px; border: 1px solid transparent;
  font: 600 1rem/1.2 var(--sans); text-decoration: none;
  background: var(--accent); color: var(--on-accent);
}
.button:hover { background: var(--heading); color: var(--on-accent); }
.button.quiet { background: transparent; color: var(--text); border-color: var(--outline); }
.button.quiet:hover { border-color: var(--accent); color: var(--heading); }

.soon {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-size: 0.9rem; color: var(--dim); margin-top: 1rem;
}
.soon::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px rgba(217, 168, 102, 0.18);
}

/* The phone: an illustration of the reading screen, drawn in HTML so it stays sharp and light. */
.phone {
  position: relative; z-index: 1;
  justify-self: center;
  width: min(100%, 330px);
  aspect-ratio: 9 / 19.5;
  border-radius: 42px;
  padding: 10px;
  background: #0d0b09;
  box-shadow: 0 0 0 1px #3a332c, 0 30px 60px rgba(0, 0, 0, 0.5);
  container-type: inline-size;
}
/* Everything on the screen is sized in em of the screen's width, so a smaller phone (short windows) is the same
   picture, scaled down. 16px at the full 310px-wide screen. */
.screen {
  font-size: calc(100cqw * 16 / 310);
  height: 100%; border-radius: 2.06em; overflow: hidden;
  background: var(--bg); display: flex; flex-direction: column;
  font-family: var(--serif);
}
.screen .bar {
  background: var(--bar); color: var(--dim);
  padding: 2.92em 1.53em 0.97em;
  font: 500 0.72em/1.3 var(--sans); letter-spacing: 0.02em;
  display: flex; justify-content: space-between;
}
.screen .bar b { color: var(--text); font-weight: 600; }
.screen .page {
  flex: 1; padding: 1.28em 1.34em 0; overflow: hidden;
  font-size: 0.86em; line-height: 1.62; color: var(--text);
  mask-image: linear-gradient(to bottom, #000 82%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent);
}
.screen .page h3 { font-size: 1.1em; text-align: center; margin: 0.21em 0 0.95em; color: var(--heading); }
.screen .page p { margin: 0 0 0.81em; text-indent: 1.2em; }
.screen .page p:first-of-type { text-indent: 0; }
.screen mark {
  background: var(--highlight); color: var(--text);
  border-radius: 3px; padding: 0.05em 0.1em;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.screen mark .word { background: var(--selection); border-radius: 3px; }
.player {
  background: var(--bar); padding: 1.04em 1.39em 1.53em;
  display: flex; align-items: center; gap: 1.11em;
  font: 500 0.72em/1.3 var(--sans); color: var(--dim);
}
.player .play {
  width: 3.47em; height: 3.47em; border-radius: 50%; flex: none;
  background: var(--accent); display: grid; place-items: center;
}
.player .play::before {
  content: ""; width: 1.04em; height: 1.22em;
  border-left: 0.35em solid var(--on-accent); border-right: 0.35em solid var(--on-accent);
}
.player .who { flex: 1; }
.player .who b { display: block; color: var(--text); font-weight: 600; font-size: 1.11em; }
.wave { display: flex; gap: 0.26em; align-items: center; height: 1.9em; }
.wave i { width: 0.26em; height: 40%; background: var(--accent); border-radius: 2px; animation: wave 1.1s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: -0.9s; }
.wave i:nth-child(3) { animation-delay: -0.6s; }
.wave i:nth-child(4) { animation-delay: -0.3s; }
.wave i:nth-child(5) { animation-delay: -0.75s; }
@keyframes wave { 0%, 100% { height: 30%; } 50% { height: 100%; } }

/* ---------- Sections ---------- */

section { padding: 2rem 0; }
.section-head { max-width: 40rem; margin-bottom: 2rem; }
.section-head p { color: var(--dim); font-size: 1.05rem; }

.features {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  list-style: none; margin: 0; padding: 0;
}
.features li {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  padding: 1.3rem 1.35rem 1.1rem;
}
.features h3 { display: flex; align-items: center; gap: 0.6rem; }
.features h3 svg { width: 22px; height: 22px; flex: none; color: var(--accent); }
.features p { color: var(--dim); margin: 0; font-size: 0.98rem; }
.features li.wide { grid-column: 1 / -1; }

.formats { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.9rem; padding: 0; list-style: none; }
.formats li {
  font: 600 0.8rem/1 var(--sans); letter-spacing: 0.04em;
  padding: 0.45rem 0.7rem; border-radius: 999px;
  background: var(--highlight); color: var(--heading);
}

/* screenshots: a row that scrolls sideways on phones, sits flat on wide screens */
.shots {
  display: flex; gap: 1.25rem; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0.5rem 1.25rem 1.5rem; margin: 0 -1.25rem;
  list-style: none;
}
.shots li { flex: 0 0 min(72%, 260px); scroll-snap-align: center; margin: 0; }
.shots figure { margin: 0; }
.shots img {
  display: block; width: 100%; height: auto;
  border-radius: 26px; border: 6px solid #0d0b09;
  box-shadow: 0 0 0 1px #3a332c, 0 18px 40px rgba(0, 0, 0, 0.45);
}
.shots figcaption { color: var(--dim); font-size: 0.9rem; margin-top: 0.8rem; text-align: center; }

.panel {
  background: var(--surface); border: 1px solid var(--outline); border-radius: calc(var(--radius) + 6px);
  padding: clamp(1.5rem, 5vw, 2.75rem);
}
.panel > :last-child { margin-bottom: 0; }

.price { display: grid; gap: 1rem; }
.price ul { margin: 0; padding-left: 1.2rem; color: var(--dim); }
.price li { margin-bottom: 0.4rem; }
.price li strong { color: var(--text); font-weight: 600; }

.get { text-align: center; }
.get .lede { margin-left: auto; margin-right: auto; }
.get .cta { justify-content: center; }
.play-badge {
  display: inline-flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 1.3rem; border-radius: 14px;
  border: 1px dashed var(--outline); color: var(--dim);
  font: 500 0.95rem/1.25 var(--sans); text-align: left;
  margin-bottom: 1.5rem;
}
.play-badge b { display: block; color: var(--text); font-size: 1.05rem; }
.play-badge svg { width: 28px; height: 28px; color: var(--accent); }
.fine { color: var(--dim); font-size: 0.92rem; }

.faq dl { margin: 0; display: grid; gap: 1.25rem; }
.faq dt { font: 600 1.1rem/1.35 var(--serif); color: var(--text); margin-bottom: 0.3rem; }
.faq dd { margin: 0; color: var(--dim); }

/* ---------- Long text pages (privacy, credits) ---------- */

.doc { max-width: 42rem; padding-top: 1.5rem; padding-bottom: 4rem; }
.doc h1 { font-size: clamp(2rem, 6vw, 2.8rem); }
.doc h2 { font-size: 1.45rem; margin-top: 2.2rem; }
.doc .updated { color: var(--dim); font-size: 0.95rem; }
.doc ul { padding-left: 1.25rem; }
.doc li { margin-bottom: 0.45rem; }
.doc table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.doc th, .doc td { text-align: left; padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--outline); vertical-align: top; }
.doc th { color: var(--dim); font-weight: 600; }
.doc td:first-child { color: var(--text); font-weight: 600; }
.table-scroll { overflow-x: auto; }
.doc details { margin-top: 0.5rem; }
.doc summary { cursor: pointer; color: var(--accent); }
.doc pre { white-space: pre-wrap; font-size: 0.8rem; color: var(--dim); background: var(--bar); padding: 1rem; border-radius: 12px; }

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

footer {
  border-top: 1px solid var(--outline);
  background: var(--bar);
  padding: 2.25rem 0 2.75rem;
  color: var(--dim); font-size: 0.93rem;
}
footer .wrap { display: grid; gap: 1rem; }
footer nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
footer p { margin: 0; }

/* ---------- Wider screens ---------- */

@media (min-width: 52rem) {
  /* The hero fits the window: the phone takes the height that's left under the top bar (laptops have short windows),
     and the cat scales with it. */
  .hero { grid-template-columns: 1.15fr 0.85fr; padding-top: 1rem; padding-bottom: 3.5rem; }
  .phone {
    width: clamp(190px, calc((100vh - 8.5rem) * 9 / 19.5), 330px);
    width: clamp(190px, calc((100svh - 8.5rem) * 9 / 19.5), 330px);
    border-radius: 13% / 6%;
  }
  .hero-text { padding-top: 2rem; }
  .hero-cat { height: clamp(22rem, calc(100vh - 9rem), 34rem); top: -2.5rem; right: -11rem; opacity: 0.5; }
  section { padding: 2.75rem 0; }
  .price { grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
  .shots { overflow: visible; justify-content: center; margin: 0; padding: 0.5rem 0 1rem; }
  .shots li { flex: 0 1 250px; }
}

@media (max-width: 30rem) {
  .top nav a.optional { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .wave i { height: 60%; }
}

@media (forced-colors: active) {
  .button, .play-badge, .features li, .panel { border: 1px solid CanvasText; }
}
