/* Shelf — shelfreader.app
   Night library: the icon's navy ground and amber pages. The hero is always
   night; the rest of the page follows the reader's light or dark setting. */

:root {
  color-scheme: light dark;
  --night: #0b1020;
  --night-2: #111a33;
  --night-3: #1a2440;
  --amber: #e9b465;
  --amber-deep: #b9741f;
  --cream: #f4ead8;

  --bg: #f7f3ec;
  --bg-2: #efe8dc;
  --ink: #1a1c22;
  --muted: #62666f;
  --rule: rgba(26, 28, 34, .1);
  --card: #ffffff;
  --card-warm: #f3e7d2;
  --card-cool: #e6e9f2;
  --accent: var(--amber-deep);
  --shadow-soft: 0 1px 2px rgba(11, 16, 32, .06), 0 24px 48px -24px rgba(11, 16, 32, .28);

  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  --wrap: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --bg-2: #0f1529;
    --ink: #f1ede5;
    --muted: #a2a8b6;
    --rule: rgba(241, 237, 229, .1);
    --card: #131b31;
    --card-warm: #241d14;
    --card-cool: #151f3a;
    --accent: var(--amber);
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, .4), 0 28px 56px -28px rgba(0, 0, 0, .8);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -.012em; margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  display: inline-block; font: 600 13px/1 var(--sans); letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}

/* ───────── Top bar (text pages) ───────── */
.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font: 700 19px/1 var(--serif); }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 22.4%; }
.top nav { display: flex; gap: 22px; font-size: 15px; }
.top nav a { color: var(--muted); }

/* ───────── Hero ───────── */
/* On the landing page the page itself is night, so Safari tints its bars to
   match the hero; everything after the hero sits on paper. */
body.landing { background: var(--night); }
body.landing .hero-tail, body.landing section:not(.night-band), body.landing footer { background: var(--bg); }
.hero {
  position: relative; isolation: isolate; z-index: 2;
  background: var(--night); color: #f4efe6;
  padding-bottom: 0;
}
.hero .top .brand, .hero .top nav a { color: rgba(244, 239, 230, .86); }
.hero .top nav a:hover { color: #fff; }

/* The cover wall, as on Shelf's first screen. Clipped on its own so the
   phones can hang over the hero's bottom edge. */
.wall-clip { position: absolute; inset: 0; overflow: hidden; z-index: -2; }
.wall {
  position: absolute; inset: -20% -10% 0;
  display: flex; gap: 18px; justify-content: center;
  transform: rotate(-9deg) scale(1.08);
  opacity: .9;
}
.wall .col { display: flex; flex-direction: column; gap: 18px; width: 150px; flex: none; animation: drift 90s linear infinite; }
.wall .col:nth-child(even) { animation-direction: reverse; animation-duration: 110s; margin-top: -90px; }
.wall img { width: 150px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .7); }
@keyframes drift { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@media (prefers-reduced-motion: reduce) { .wall .col { animation: none; } }

.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 46% at 50% 34%, rgba(11, 16, 32, .5) 0%, rgba(11, 16, 32, .9) 70%, var(--night) 100%),
    linear-gradient(to bottom, rgba(11, 16, 32, .55) 0%, rgba(11, 16, 32, .2) 30%, var(--night) 78%);
}
.hero::after {
  content: ""; position: absolute; left: 50%; top: 58%; z-index: -1;
  width: 900px; height: 520px; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(233, 180, 101, .22), transparent);
  pointer-events: none;
}

.hero-copy { text-align: center; padding: 72px 0 8px; max-width: 760px; margin: 0 auto; }
.hero-copy .icon {
  width: 104px; height: 104px; margin: 0 auto 28px; border-radius: 22.4%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 20px 50px -12px rgba(0, 0, 0, .8), 0 0 80px -10px rgba(233, 180, 101, .35);
}
.hero h1 { font-size: clamp(42px, 7.2vw, 78px); line-height: 1.02; color: #fbf6ec; }
.hero h1 em { font-style: italic; color: var(--amber); }
.hero .lede { font-size: clamp(18px, 2.2vw, 21px); color: rgba(244, 239, 230, .74); max-width: 33em; margin: 22px auto 30px; }

.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 24px;
  border-radius: 999px; font: 600 16px/1 var(--sans); white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: #f8f2e7; color: var(--night); box-shadow: 0 10px 30px -10px rgba(233, 180, 101, .55); }
.btn-primary svg { width: 18px; height: 18px; }
.btn-ghost { color: #f4efe6; box-shadow: inset 0 0 0 1px rgba(244, 239, 230, .28); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px rgba(244, 239, 230, .55); }
.works { margin-top: 26px; font-size: 14px; color: rgba(244, 239, 230, .55); }
.works b { color: rgba(244, 239, 230, .85); font-weight: 600; }

/* Three phones, the middle one raised */
.devices {
  display: flex; justify-content: center; align-items: flex-end; gap: clamp(14px, 3vw, 40px);
  padding: 56px 0 0; margin-bottom: -150px; position: relative; z-index: 1;
}
.devices .phone { width: min(27vw, 280px); }
.devices .phone.mid { width: min(31vw, 320px); transform: translateY(-34px); }
.devices .phone.l { transform: rotate(-5deg) translateY(12px); }
.devices .phone.r { transform: rotate(5deg) translateY(12px); }
.hero-tail { height: 150px; background: var(--bg); }

/* ───────── Screens ─────────
   No device frames: each screenshot is shown as the screen itself, with the
   real screen's corner radius (iPhone ≈ 12.5% of the width, iPad Pro ≈ 2.6%,
   iPhone Duo inner ≈ 5.5%), a hairline edge and a soft shadow. The
   screenshots already carry the status bar and the Dynamic Island. */
.phone, .tablet, .fold { position: relative; }
.phone img, .tablet img, .fold img {
  width: 100%; height: auto; display: block; background: #000; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(11, 16, 32, .12), 0 30px 60px -24px rgba(11, 16, 32, .55), 0 10px 20px -10px rgba(11, 16, 32, .3);
}
.hero .phone img, .night-band .phone img {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .14), 0 40px 80px -24px rgba(0, 0, 0, .8), 0 12px 24px -12px rgba(0, 0, 0, .5);
}
@media (prefers-color-scheme: dark) {
  .phone img, .tablet img, .fold img {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 30px 60px -24px rgba(0, 0, 0, .8), 0 10px 20px -10px rgba(0, 0, 0, .5);
  }
}

/* iPhone 6.9" (1320 × 2868) */
.phone img { aspect-ratio: 1320 / 2868; border-radius: 12.5% / 5.75%; }
/* iPhone Duo outer screen (1398 × 2034) */
.phone.duo-outer img { aspect-ratio: 1398 / 2034; border-radius: 12.5% / 8.6%; }
/* iPad Pro 13" (2064 × 2752) */
.tablet img { aspect-ratio: 2064 / 2752; border-radius: 2.6% / 1.95%; }
/* iPhone Duo inner screen, open (2853 × 2007) */
.fold img { aspect-ratio: 2853 / 2007; border-radius: 4.6% / 6.5%; }

/* ───────── Sections ───────── */
section { padding: 96px 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(32px, 4.6vw, 50px); line-height: 1.06; }
.section-head p { color: var(--muted); font-size: 19px; margin: 16px 0 0; }

/* Feature cards */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.card {
  position: relative; overflow: hidden; border-radius: 28px;
  background: var(--card); box-shadow: var(--shadow-soft);
  padding: 36px 36px 0; display: flex; flex-direction: column; min-height: 420px;
}
.card.warm { background: var(--card-warm); }
.card.cool { background: var(--card-cool); }
.card h3 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.1; }
.card p { color: var(--muted); margin: 12px 0 0; max-width: 30em; }
.card .shot { margin-top: auto; padding-top: 32px; display: flex; justify-content: center; gap: 18px; }
.card .shot .phone { width: min(62%, 270px); margin-bottom: -38%; }
.card .shot .phone.small { width: min(46%, 220px); }
.span-4 > .shot .phone { width: min(46%, 330px); margin-bottom: -46%; }
.span-2 > .shot .phone { width: min(80%, 270px); margin-bottom: -60%; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }
.span-2 { grid-column: span 2; }
.span-6 { grid-column: span 6; }

.card.split { display: grid; grid-template-columns: 1fr 1.25fr; gap: 36px; align-items: center; padding: 44px; min-height: 0; }
.card.split .shot { margin: 0; padding: 0; }

.card.duo { padding: 44px; min-height: 0; }
.card.duo .duo-stage { display: flex; align-items: center; justify-content: center; gap: 40px; margin-top: 40px; }
.card.duo .fold { width: min(66%, 640px); }
.card.duo .phone { width: min(24%, 230px); }

.card.small { min-height: 0; padding: 30px; }
.card.small h3 { font-size: 22px; }
.card.small p { font-size: 16px; }
.glyph {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--card-warm); color: var(--accent); margin-bottom: 18px;
}
.card.warm .glyph { background: rgba(185, 116, 31, .14); }
.glyph svg { width: 22px; height: 22px; }

/* Sources */
.sources { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.source { background: var(--card); border-radius: 22px; padding: 28px; box-shadow: var(--shadow-soft); }
.source .tag { font: 600 12px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.source h3 { font-size: 24px; margin: 10px 0 8px; }
.source p { margin: 0; color: var(--muted); font-size: 16px; }
.note { text-align: center; color: var(--muted); margin: 28px auto 0; max-width: 40em; font-size: 16px; }

/* Privacy band */
.night-band { background: var(--night); color: #f1ece3; }
.night-band .section-head p { color: rgba(241, 236, 227, .7); }
.night-band .eyebrow { color: var(--amber); }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pillar { border-radius: 22px; padding: 28px; background: var(--night-2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.pillar .glyph { background: rgba(233, 180, 101, .12); color: var(--amber); }
.pillar h3 { font-size: 22px; color: #fbf6ec; }
.pillar p { margin: 8px 0 0; color: rgba(241, 236, 227, .68); font-size: 16px; }
.night-band a { color: var(--amber); }

/* Closing */
.closing { text-align: center; padding: 110px 0 120px; overflow: hidden; }
.closing h2 { font-size: clamp(34px, 5vw, 56px); line-height: 1.05; }
.closing p { color: var(--muted); font-size: 19px; margin: 16px auto 30px; max-width: 32em; }
.closing .btn-primary { background: var(--night); color: #f8f2e7; box-shadow: var(--shadow-soft); }
@media (prefers-color-scheme: dark) { .closing .btn-primary { background: #f8f2e7; color: var(--night); } }
.strip { display: flex; gap: 14px; width: max-content; margin: 0 auto 56px; animation: slide 80s linear infinite; }
.strip img { width: 96px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 5px; box-shadow: var(--shadow-soft); }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .strip { animation: none; } }

/* Footer */
footer { border-top: 1px solid var(--rule); padding: 36px 0 56px; font-size: 14px; color: var(--muted); }
footer .row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; }
footer nav { display: flex; gap: 20px; }
footer nav a { color: var(--muted); }
footer .credit { margin-top: 14px; font-size: 13px; }
footer .credit a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

/* Text pages (privacy, support) */
.page { max-width: 680px; margin: 0 auto; padding: 24px 24px 80px; }
.page h1 { font-size: clamp(34px, 5vw, 46px); line-height: 1.08; margin: 28px 0 8px; }
.page h2 { font-size: 23px; line-height: 1.25; margin: 38px 0 10px; }
.page p, .page li { margin: 0 0 14px; }
.page ul { padding-left: 22px; }
.page .muted { color: var(--muted); }

/* ───────── Narrow screens ───────── */
@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .span-4, .span-6, .span-3 { grid-column: span 2; }
  .span-2 { grid-column: span 1; }
  .card.split { grid-template-columns: 1fr; }
  .card.duo .phone { display: none; }
  .card.duo .fold { width: 100%; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .top nav { gap: 16px; }
  section { padding: 64px 0; }
  .hero-copy { padding-top: 40px; }
  .wall { gap: 12px; }
  .wall .col { width: 104px; gap: 12px; }
  .wall img { width: 104px; }
  .devices { gap: 8px; padding-top: 40px; margin-bottom: -90px; }
  .devices .phone { width: 30vw; }
  .devices .phone.mid { width: 36vw; transform: translateY(-18px); }
  .hero-tail { height: 90px; }
  .bento { grid-template-columns: 1fr; gap: 16px; }
  .span-2, .span-3, .span-4, .span-6 { grid-column: span 1; }
  .card { padding: 28px 24px 0; min-height: 0; border-radius: 24px; }
  .card.split, .card.duo { padding: 28px 24px; }
  .card .shot .phone, .span-4 > .shot .phone, .span-2 > .shot .phone { width: 66%; margin-bottom: -50%; }
  .sources, .pillars { grid-template-columns: 1fr; }
  .page { padding: 16px 16px 64px; }
}
