/* Librea website. Layout: one centred column; the live demo is the hero, then Free vs Pro, then Download. */
:root {
  --bg: #F2F4F7; --surface: #FFFFFF; --ink: #15171C; --muted: #5A6272; --line: #DCE1E8;
  --accent: #0067C0; --accent-ink: #FFFFFF; --accent-wash: #E3EEFA; --pro: #FF8A00; --pro-wash: #FFF1E0;
  --display: "Literata", Georgia, "Times New Roman", serif;
  --body: "Hanken Grotesk", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
  --radius: 12px;
  --hl: rgba(255, 226, 52, .55);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0D0F13; --surface: #161920; --ink: #ECEEF2; --muted: #9AA3B2; --line: #262B34; --accent: #5CA8F5; --accent-ink: #06121F; --accent-wash: #132A42; --pro: #FF9A1F; --pro-wash: #2E1D08; --hl: rgba(255, 190, 40, .32); color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #0D0F13; --surface: #161920; --ink: #ECEEF2; --muted: #9AA3B2; --line: #262B34; --accent: #5CA8F5; --accent-ink: #06121F; --accent-wash: #132A42; --pro: #FF9A1F; --pro-wash: #2E1D08; --hl: rgba(255, 190, 40, .32); color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--body);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 40px;
}
a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1240px; margin: 0 auto; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pro); flex: none; vertical-align: middle; }

/* top bar */
.top { display: flex; align-items: center; gap: 20px; padding-block: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand .mark { width: 32px; height: 32px; display: block; }
.top nav { display: flex; gap: 18px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.top nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; }
.top nav a:hover { color: var(--ink); }
.btn { display: inline-flex; align-items: center; gap: 8px; font: 600 15px/1 var(--body); padding: 12px 18px; border-radius: 10px; text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { color: var(--ink); border-color: var(--line); background: var(--surface); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.small { padding: 8px 12px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; }
@media (max-width: 640px) { .top nav a:not(.btn) { display: none; } }

/* hero */
.hero { display: grid; gap: 14px; padding-block: 34px 26px; }
.hero h1 { margin: 0; font: 600 clamp(36px, 6vw, 62px)/1.04 var(--display); letter-spacing: -0.025em; text-wrap: balance; max-width: 15ch; }
.hero .lead { margin: 0; color: var(--muted); font-size: clamp(17px, 2vw, 19px); max-width: 60ch; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.meta { font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.meta span + span::before { content: "·"; margin-right: 14px; color: var(--line); }

/* the demo */
.demo { display: grid; gap: 10px; }
.demo-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.demo-bar .label { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); min-width: 0; }
.live { display: inline-flex; align-items: center; gap: 6px; font: 700 11.5px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: var(--accent-wash); padding: 6px 9px; border-radius: 999px; }
.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.seg button { border: 0; background: transparent; color: var(--muted); font: 600 13.5px/1 var(--body); padding: 8px 12px; border-radius: 7px; cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--accent-wash); color: var(--accent); }
.switch { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 13.5px/1 var(--body); padding: 7px 12px 7px 10px; border-radius: 10px; cursor: pointer; }
.switch .track { width: 32px; height: 18px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.switch[aria-checked="true"] .track { background: var(--pro); }
.switch[aria-checked="true"] .track::after { transform: translateX(14px); }
.linkish { border: 0; background: none; color: var(--muted); font: 500 13.5px var(--body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 6px 4px; }
.frame { position: relative; width: 100%; max-width: 100%; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface) center / cover no-repeat; box-shadow: 0 24px 60px rgba(16, 32, 64, .14), 0 2px 6px rgba(16, 32, 64, .08); }
.frame iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; background: transparent; }
.frame .fallback { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 70%, transparent); }
.hint { font-size: 13.5px; color: var(--muted); margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.hint kbd { font: 500 12px var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; background: var(--surface); border-radius: 5px; padding: 1px 6px; color: var(--ink); }

/* points */
.points { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding-block: 44px 8px; }
@media (max-width: 900px) { .points { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .points { grid-template-columns: 1fr; } }
.point { display: grid; gap: 4px; align-content: start; }
.point svg { width: 22px; height: 22px; color: var(--accent); margin-bottom: 4px; }
.point b { font-size: 16px; }
.point span { font-size: 14.5px; color: var(--muted); }

/* sections */
section.block { padding-block: 52px 0; display: grid; gap: 20px; }
h2 { margin: 0; font: 600 clamp(26px, 3.4vw, 36px)/1.1 var(--display); letter-spacing: -0.02em; text-wrap: balance; }
.sub { margin: -8px 0 0; color: var(--muted); max-width: 62ch; }
.plans { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; }
@media (max-width: 820px) { .plans { grid-template-columns: 1fr; } }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 14px; align-content: start; min-width: 0; }
.plan.pro { border-color: color-mix(in srgb, var(--pro) 55%, var(--line)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pro) 25%, transparent); }
.plan header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.plan h3 { margin: 0; font: 600 22px/1.2 var(--display); display: flex; align-items: center; gap: 9px; }
.plan .price { font-size: 14px; color: var(--muted); }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px 18px; }
.plan.pro ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .plan.pro ul { grid-template-columns: 1fr; } }
.plan ul { gap: 11px 22px; }
.plan li { display: flex; gap: 10px; align-items: baseline; font-size: 15px; font-weight: 500; line-height: 1.35; min-width: 0; }
.plan li small { display: block; margin-top: 2px; font-size: 13.5px; font-weight: 400; color: var(--muted); }
.plan li .tick { color: var(--accent); flex: none; font-weight: 700; }
.plan li .dot { transform: translateY(-1px); }
.plan .foot { font-size: 13.5px; color: var(--muted); }

.downloads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 720px) { .downloads { grid-template-columns: 1fr; } }
.dl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.dl h3 { margin: 0; font: 600 20px/1.2 var(--display); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tag { font: 700 11px/1 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: var(--accent-wash); padding: 5px 8px; border-radius: 999px; }
.dl p { margin: 0; color: var(--muted); font-size: 14.5px; }
.file { font: 500 13.5px var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.dl .btn { justify-self: start; margin-top: 4px; }
.notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; font-size: 14px; color: var(--muted); }
@media (max-width: 820px) { .notes { grid-template-columns: 1fr; } }
.notes b { color: var(--ink); display: block; margin-bottom: 2px; }

footer { margin-top: 64px; padding-block: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; font-size: 14px; color: var(--muted); }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--ink); text-decoration: underline; }
footer .sp { flex: 1; }

/* full screen demo: the Fullscreen API when the browser allows it, otherwise a fixed layer over the page */
.frame.is-full { position: fixed; inset: 0; z-index: 1000; width: auto; height: auto !important; border: 0; border-radius: 0; box-shadow: none; background: #000; }
.frame:fullscreen { width: 100vw; height: 100vh !important; border-radius: 0; }
html.demo-full, html.demo-full body { overflow: hidden; }
.exit-full { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 2; display: inline-flex; align-items: center; gap: 8px; padding: 9px 10px 9px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); background: rgba(20, 22, 28, .86); color: #fff; font: 600 13.5px/1 var(--body); cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.exit-full svg { width: 16px; height: 16px; }
.exit-full kbd { font: 500 11.5px var(--mono); border: 1px solid rgba(255,255,255,.3); border-radius: 5px; padding: 2px 6px; color: rgba(255,255,255,.85); }
.exit-full:hover { background: rgba(0, 0, 0, .92); }
@media (pointer: coarse) { .exit-full kbd { display: none; } .exit-full { padding-right: 14px; } }
.motion .exit-full:not([hidden]) { animation: pop .35s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 12px) scale(.94); } }

/* hero: the headline rises word by word, then a highlighter runs over "read like a book" */
.hl { -webkit-box-decoration-break: clone; box-decoration-break: clone; background: linear-gradient(var(--hl), var(--hl)) 0 88% / 100% 42% no-repeat; color: inherit; padding: 0 .06em; margin: 0 -.06em; border-radius: 3px; }
.motion .hl { background-size: 0% 42%; animation: sweep .9s cubic-bezier(.6, .1, .2, 1) 1.05s forwards; }
@keyframes sweep { to { background-size: 100% 42%; } }
.split .w { display: inline-block; }
.motion .split .w { opacity: 0; transform: translateY(.45em); filter: blur(4px); transition: opacity .6s ease, transform .7s cubic-bezier(.2, .8, .2, 1), filter .6s ease; transition-delay: calc(var(--i) * 55ms); }
.motion .split.in .w { opacity: 1; transform: none; filter: none; }
.motion .hero .lead, .motion .hero .cta, .motion .hero .meta { animation: rise .8s cubic-bezier(.2, .8, .2, 1) both; }
.motion .hero .lead { animation-delay: .45s; } .motion .hero .cta { animation-delay: .6s; } .motion .hero .meta { animation-delay: .72s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* things that fade up as they come into view */
.motion .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .8s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i, 0) * 90ms); }
.motion .reveal.in { opacity: 1; transform: none; }

/* format banners: two rows drifting in opposite directions, nudged by the scroll */
.marquee { display: grid; gap: 10px; padding-block: 40px 0; overflow: hidden; margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee .row { overflow: hidden; }
.marquee .track { display: flex; gap: 10px; width: max-content; will-change: transform; }
.chip { display: inline-flex; align-items: center; gap: 9px; padding: 9px 14px 9px 9px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font: 600 15px/1 var(--body); white-space: nowrap; }
.chip i { font: 700 10.5px/1 var(--body); font-style: normal; color: #fff; background: var(--c); min-width: 26px; height: 26px; padding: 0 5px; border-radius: 7px; display: grid; place-items: center; letter-spacing: .02em; }
.chip.quiet { padding: 10px 16px; font-weight: 500; color: var(--muted); background: transparent; border-style: dashed; }
.chip .dot { width: 7px; height: 7px; }
.chip.pro { border-color: color-mix(in srgb, var(--pro) 45%, var(--line)); }
html:not(.motion) .marquee .track { flex-wrap: wrap; width: auto; justify-content: center; padding-inline: 16px; }
html:not(.motion) .marquee .track [data-copy] { display: none; }

/* the story: the words light up as you scroll while the book moves folders and keeps its notes */
.story { padding-block: 56px 0; }
.motion .story { height: calc(min(100svh, 760px) * 2.3); padding: 0; margin-top: -40px; }
.pin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; align-items: center; }
.motion .pin { position: sticky; top: max(0px, calc((100vh - 760px) / 2)); top: max(0px, calc((100svh - 760px) / 2)); height: min(100vh, 760px); height: min(100svh, 760px); }
.kicker { margin: 0 0 10px; font: 700 12px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.story h2 { font-size: clamp(28px, 3.6vw, 44px); line-height: 1.12; }
.story h2 .w { transition: color .25s ease, opacity .25s ease; }
.motion .story h2 .w { opacity: .16; }
.motion .story h2 .w.lit { opacity: 1; }
.story-foot { margin: 18px 0 0; color: var(--muted); max-width: 46ch; font-size: 15.5px; }
.stage { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(16, 32, 64, .12); }
.pane { border-radius: 12px; background: var(--bg); border: 1px solid var(--line); padding: 12px 12px 30px; display: grid; grid-template-rows: auto 1fr; gap: 12px; }
.pane-head { display: flex; align-items: center; gap: 7px; font: 600 13px/1.2 var(--body); color: var(--muted); }
.pane-head svg { width: 16px; height: 16px; color: #E8B04A; flex: none; }
.pane.to .pane-head svg { color: var(--accent); }
.files { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-content: start; }
.files .book, .files .ghost, .files .slot { aspect-ratio: 2 / 3; border-radius: 6px; width: 100%; }
.files .book { object-fit: cover; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.files .ghost { background: repeating-linear-gradient(180deg, var(--line) 0 3px, transparent 3px 9px) 18% 20% / 64% 46% no-repeat, var(--surface); border: 1px solid var(--line); }
.files .slot { border: 1.5px dashed var(--line); }
.card { position: absolute; left: 0; top: 0; z-index: 2; will-change: transform; }
.card img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 10px 26px rgba(0,0,0,.28); }
.badge { position: absolute; top: 10%; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font: 700 11px/1 var(--body); color: #1B1C1F; background: #fff; padding: 6px 8px; border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,.22); }
.badge .sw { width: 8px; height: 8px; border-radius: 3px; background: var(--c); }
.fname { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 6px; font: 500 11.5px/1.2 var(--mono); color: var(--ink); white-space: nowrap; height: 1.2em; }
.fname span { display: block; text-align: center; transition: opacity .3s ease, transform .3s ease; }
.fname .new { position: absolute; left: 50%; top: 0; transform: translate(-50%, 6px); opacity: 0; }
.card.renamed .old { opacity: 0; transform: translateY(-6px); }
.card.renamed .new { opacity: 1; transform: translate(-50%, 0); }
.found { position: absolute; left: 50%; top: 100%; margin-top: 16px; display: inline-flex; align-items: center; gap: 6px; font: 700 12.5px/1 var(--body); color: #0B6B2E; background: #DFF5E6; padding: 8px 11px; border-radius: 999px; opacity: 0; transform: translate(-50%, 8px) scale(.96); transition: opacity .35s ease, transform .35s cubic-bezier(.2, .9, .3, 1.3); }
.found svg { width: 15px; height: 15px; }
.found.on { opacity: 1; transform: translate(-50%, 0); }
html:not(.motion) .found { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 860px) {
  .pin { grid-template-columns: 1fr; gap: 22px; align-content: center; }
  .stage { padding: 12px; gap: 10px; }
  .pane { padding: 10px 8px 26px; }
  .files { gap: 6px; }
  .badge { font-size: 9.5px; padding: 4px 6px; gap: 3px; } .badge .sw { width: 6px; height: 6px; }
  .fname { font-size: 9.5px; }
}

/* themes band: tiles slide in from the side as the band scrolls into view */
.themes { padding-block: 40px 0; display: grid; gap: 14px; }
.themes .sub { margin: 0; }
.theme-rail { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .theme-rail { grid-template-columns: repeat(5, 220px); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding-inline: max(16px, env(safe-area-inset-left, 0px)); } .theme { scroll-snap-align: start; } }
.theme { display: grid; gap: 4px; text-align: left; padding: 10px 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; transition: border-color .2s, box-shadow .2s, transform .2s; will-change: transform; }
.theme:hover { border-color: var(--muted); }
.theme[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.theme b { font-size: 15px; margin: 6px 2px 0; }
.theme .line { font-size: 13px; color: var(--muted); margin: 0 2px; }
.mini { display: grid; grid-template-columns: 26% 1fr; aspect-ratio: 16 / 10; border-radius: 9px; overflow: hidden; background: var(--t-bg); border: 1px solid rgba(0,0,0,.08); }
.m-side { background: var(--t-side); border-right: 1px solid color-mix(in srgb, var(--t-ink) 10%, transparent); background-image: linear-gradient(var(--t-acc), var(--t-acc)), repeating-linear-gradient(180deg, color-mix(in srgb, var(--t-ink) 22%, transparent) 0 3px, transparent 3px 11px); background-size: 50% 4px, 64% 60%; background-position: 20% 16%, 20% 34%; background-repeat: no-repeat; }
.m-main { display: grid; grid-template-rows: 18% 1fr; background: var(--t-surf); }
.m-bar { border-bottom: 1px solid color-mix(in srgb, var(--t-ink) 10%, transparent); background: linear-gradient(var(--t-acc), var(--t-acc)) 10% 50% / 22% 30% no-repeat; }
.m-covers { display: flex; gap: 8%; padding: 10% 10%; align-items: start; }
.m-covers i { flex: 1; aspect-ratio: 2 / 3; border-radius: 3px; background: color-mix(in srgb, var(--t-ink) 16%, var(--t-surf)); }
.m-covers i:first-child { background: var(--t-acc); }
.theme.frost .mini { background: url("demo/demo/wallpaper.jpg") center / cover; }
.theme.frost .m-side, .theme.frost .m-main { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* legal pages */
.legal { max-width: 760px; margin: 0 auto; padding-block: 20px 0; }
.legal h1 { font: 600 clamp(32px, 5vw, 44px)/1.1 var(--display); letter-spacing: -0.02em; margin: 10px 0 6px; }
.legal .date { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.legal h2 { font-size: 22px; margin: 34px 0 8px; }
.legal p, .legal li { font-size: 16px; line-height: 1.65; }
.legal ul { padding-left: 22px; display: grid; gap: 6px; }
.legal .summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.legal .summary p { margin: 0; }
.legal table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 9px 10px; border-top: 1px solid var(--line); }
.legal th { font-weight: 600; }
.legal .table { overflow-x: auto; }
.legal code { font: 500 13.5px var(--mono); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; overflow-wrap: anywhere; }
