/* LibriSona site. Tokens follow Docs/DESIGN.md 1.2 (palette) and 1.3 (type). */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/Fraunces72ptSoft-SemiBold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --canvas: #F4F1EA;
  --surface: #FBFAF6;
  --raised: #FFFFFF;
  --text: #1C1A17;
  --text-2: #5F5951;
  --hairline: #DDD6C8;
  --accent: #9A4A0B;
  --on-accent: #FFFFFF;
  --pool-0: rgba(255, 197, 110, 0.38);
  --pool-1: rgba(255, 197, 110, 0.13);
  --device: #1C1A17;
  --shadow: 0 2px 4px rgba(28, 26, 23, 0.12), 0 14px 28px rgba(28, 26, 23, 0.22);
  /* Room tones (DESIGN 1.2) */
  --lamplit: #F1E6D3;
  --night: #E3E7EF;
  --greenhouse: #E6ECE2;
  --studio: #ECEBF1;

  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1080px;
  --gutter: clamp(16px, 5vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #121214;
    --surface: #1B1B1E;
    --raised: #242428;
    --text: #EEEAE2;
    --text-2: #A8A297;
    --hairline: #34332F;
    --accent: #F0B15A;
    --on-accent: #1C1A17;
    --pool-0: rgba(255, 181, 77, 0.55);
    --pool-1: rgba(255, 181, 77, 0.18);
    --device: #000000;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 14px 28px rgba(0, 0, 0, 0.55);
    --lamplit: #1A140E;
    --night: #0F141D;
    --greenhouse: #111712;
    --studio: #151519;
  }
}

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

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

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--ui);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-wrap: break-word;
}

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

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  background: var(--raised);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  z-index: 10;
}
.skip:focus { top: 8px; }

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.35rem;
}
.brand svg { width: 34px; height: 34px; flex: none; }
.top nav { display: flex; gap: 4px 18px; flex-wrap: wrap; justify-content: flex-end; }
.top nav a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 10px 2px;
}
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--text); text-decoration: underline; }

/* Small uppercase label, like the app's "CONTINUE READING" (DESIGN micro) */
.eyebrow {
  font-family: var(--ui);
  font-size: 0.78rem;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.8em;
}

.lede { font-size: clamp(1.1rem, 2.4vw, 1.25rem); color: var(--text-2); max-width: 34em; }

.soon, .copy .soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 0;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 1rem;
}
.soon-note { margin-top: 12px; font-size: 0.95rem; color: var(--text-2); }

/* Sections as rooms: each one sits in its own room tone and ends on a ledge. */
.room {
  overflow: hidden;
  padding: clamp(48px, 9vw, 96px) 0;
  border-bottom: 1px solid var(--hairline);
}
.room-lamplit { background: var(--lamplit); }
.room-night { background: var(--night); }
.room-greenhouse { background: var(--greenhouse); }
.room-studio { background: var(--studio); }

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}
@media (min-width: 860px) {
  .split { grid-template-columns: 1.1fr 0.9fr; gap: 64px; }
  .split.flip > :first-child { order: 2; }
}

.copy p, .copy li { color: var(--text-2); }
.copy, .meta { max-width: 42em; }
.copy strong { color: var(--text); font-weight: 600; }

.hero { padding-top: clamp(24px, 6vw, 64px); }
.hero h1 { max-width: 13em; }

/* The lamp pool under a device, standing on a ledge line (DESIGN 1.1). */
.stage {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 8px 0 28px;
  isolation: isolate;
}
.stage::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 28px;
  width: min(560px, 100%);
  height: 220px;
  transform: translate(-50%, 50%);
  background: radial-gradient(closest-side, var(--pool-0) 0%, var(--pool-1) 45%, rgba(255, 197, 110, 0) 100%);
  z-index: -1;
  pointer-events: none;
}
.stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  height: 1px;
  background: var(--hairline);
  z-index: -1;
}
.hero .stage::before { animation: lamp-on 1.8s ease-out both; }
@keyframes lamp-on {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .hero .stage::before { animation: none; }
  html { scroll-behavior: auto; }
}

/* Device frame in CSS (no image of a real phone). */
.device {
  width: min(300px, 76vw);
  padding: 9px;
  border-radius: 46px;
  background: var(--device);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.device img {
  width: 100%;
  border-radius: 38px;
  background: var(--surface);
}

/* Sound panel tiles, drawn like the app's four tiles. */
.tiles {
  list-style: none;
  padding: 0;
  margin: 24px 0 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.tiles li {
  background: var(--raised);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 12px 12px 14px;
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--text-2);
}
.tiles b {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 4px;
}

.points { list-style: none; padding: 0; margin: 20px 0 0; }
.points li {
  position: relative;
  padding: 0 0 0 22px;
  margin: 0 0 10px;
}
.points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.tag {
  display: inline-block;
  vertical-align: middle;
  font-family: var(--ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 3px 9px;
  margin-left: 8px;
  position: relative;
  top: -0.2em;
}

.modes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 560px) {
  .modes { grid-template-columns: 1fr 1fr; }
}
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 20px 20px 6px;
}
.card h3 { margin-bottom: 0.35em; }
.card p { color: var(--text-2); }

.privacy-line {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.privacy-line p { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(1.25rem, 3vw, 1.6rem); flex: 1 1 18em; }

/* Text pages: privacy, support, credits */
.page { padding-top: clamp(24px, 6vw, 56px); padding-bottom: 72px; max-width: 760px; }
.page h2 { font-size: clamp(1.35rem, 3vw, 1.65rem); margin-top: 1.8em; }
.page h3 { margin-top: 1.4em; }
.page p, .page li { color: var(--text-2); }
.page strong { color: var(--text); }
.page ul { padding-left: 1.2em; }
.page li { margin-bottom: 0.5em; }
.meta { font-size: 0.95rem; color: var(--text-2); }

.credit {
  border-top: 1px solid var(--hairline);
  padding: 18px 0 6px;
}
.credit h3 { margin: 0 0 0.4em; }
.credit pre {
  margin: 0 0 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
}
.credit p { font-size: 0.95rem; }
.cc0 li { font-size: 0.95rem; overflow-wrap: anywhere; }

/* Footer */
.foot {
  padding-top: 32px;
  padding-bottom: 40px;
  font-size: 0.92rem;
  color: var(--text-2);
}
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 10px; }
.foot nav a { padding: 8px 0; }
.foot p { margin: 0 0 4px; }

.center { text-align: center; }
.notfound { padding-top: 12vh; padding-bottom: 14vh; }
.notfound .stage { max-width: 360px; margin: 0 auto 28px; }
.notfound svg { width: 96px; height: 96px; }

/* A row of spines on the ledge (decorative), one of them lit. */
.shelf { min-height: 300px; align-items: flex-end; }
.spines {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 240px;
}
.spines span {
  display: block;
  width: 30px;
  height: 200px;
  border-radius: 2px;
  background: #3E5C7A;
  box-shadow: 0 1px 0 rgba(28, 26, 23, 0.18), inset -3px 0 0 rgba(0, 0, 0, 0.12), inset 0 14px 0 -10px rgba(255, 255, 255, 0.18);
}
.spines span:nth-child(1) { height: 196px; width: 26px; background: #6B4E3D; }
.spines span:nth-child(2) { height: 222px; width: 34px; background: #2F5A47; }
.spines span:nth-child(3) { height: 184px; width: 24px; background: #8C6A2E; margin-right: 12px; }
.spines span:nth-child(4) { height: 230px; width: 38px; background: #1F6B5A; box-shadow: 0 -1px 0 rgba(255, 197, 110, 0.4), 0 1px 0 rgba(28, 26, 23, 0.18), inset -3px 0 0 rgba(0, 0, 0, 0.12); }
.spines span:nth-child(5) { height: 204px; width: 28px; background: #7A3B32; margin-left: 12px; }
.spines span:nth-child(6) { height: 204px; width: 28px; background: #7A3B32; }
.spines span:nth-child(7) { height: 204px; width: 28px; background: #7A3B32; }
.spines span:nth-child(8) { height: 176px; width: 32px; background: #5A5470; }
@media (max-width: 380px) {
  .spines span { transform-origin: bottom; }
  .spines { transform: scale(0.85); transform-origin: bottom center; }
}
.notfound-lede { margin-left: auto; margin-right: auto; }

/* iPad in a CSS frame: thin even bezel, no notch. */
.ipad-wrap { margin-top: clamp(40px, 7vw, 72px); margin-bottom: 0; }
.ipad {
  width: min(540px, 100%);
  padding: clamp(8px, 1.6vw, 14px);
  border-radius: clamp(22px, 4vw, 36px);
  background: var(--device);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.ipad img {
  width: 100%;
  border-radius: clamp(14px, 2.6vw, 24px);
  background: var(--surface);
}
.ipad-wrap figcaption {
  text-align: center;
  color: var(--text-2);
  font-size: 0.95rem;
  margin-top: 4px;
}

/* Apple Watch in CSS frames: rounded case, crown nub on the right, black screen. */
.watches {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px 32px;
  margin-top: 36px;
}
.watch {
  position: relative;
  width: min(208px, calc(50% - 16px));
  padding: clamp(10px, 2.4vw, 14px);
  border-radius: clamp(34px, 8vw, 50px);
  background: #2A2A2D;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.watch::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 26%;
  width: 7px;
  height: 18%;
  border-radius: 0 4px 4px 0;
  background: #3A3A3E;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.12);
}
.watch img {
  width: 100%;
  border-radius: clamp(24px, 6vw, 38px);
  background: #000;
}
