/* LibrePad — the public landing page (apps/library/welcome/), shown at
   librepad.app/ to a browser that has never signed in to the Library
   (apps/shelf/src/worker.js). Styled from the LibrePad brand identity (the
   "LibrePad" design system): warm paper, one teal, a spark of marigold.
   Daylight by default, Night when the visitor's system is dark. The type is
   self-hosted (Fraunces and Atkinson Hyperlegible, SIL Open Font License).
   The build guide adds build.css. The Library app keeps its own look
   (apps/library/style.css). */

@font-face { font-family: 'Fraunces'; src: url('/welcome/fonts/Fraunces-Variable.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('/welcome/fonts/AtkinsonHyperlegible-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('/welcome/fonts/AtkinsonHyperlegible-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  /* brand colour, Daylight */
  --paper: #fffaf0;
  --surface: #ffffff;
  --line: #e6dcc8;
  --ink: #1b2a2c;
  --ink-muted: #52625e;
  --teal: #0b6b66;
  --teal-strong: #084f4b;
  --teal-tint: #d9efe9;
  --on-teal: #ffffff;
  --marigold: #f5a524;
  --marigold-tint: #fdecc8;
  --on-marigold: #1b2a2c;
  --coral: #e8664e;
  --coral-text: #b73d2b;
  --focus: #0b6b66;
  --shadow-card: 0 1px 2px rgba(27, 42, 44, .08), 0 4px 12px rgba(27, 42, 44, .06);
  /* brand shape */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --tap-min: 48px;
  /* brand type */
  --display: Fraunces, Georgia, serif;
  --body: 'Atkinson Hyperlegible', Verdana, system-ui, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', 'SF Mono', Menlo, Consolas, monospace;
  /* this page */
  --mark: var(--marigold);               /* the highlighter under a word */
  --spark: var(--marigold-tint);         /* the soft circle behind the Reader */
  --join-bg: var(--teal);                /* the closing band */
  --join-ink: var(--on-teal);
  --screen-paper: #e9e8e1;               /* the Reader's e-paper, as drawn */
  --bezel: #1f231f;
  --device: #2a2a28;                     /* the Reader is Ash Black */
  --device-edge: #121211;
  --device-button: #3b3b38;
  --wrap: 1180px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    /* brand colour, Night */
    --paper: #12201f;
    --surface: #1b2c2a;
    --line: #2f4541;
    --ink: #edf3ef;
    --ink-muted: #a6b7b2;
    --teal: #5ec7bb;
    --teal-strong: #86d8ce;
    --teal-tint: #1f3f3b;
    --on-teal: #0b1a19;
    --marigold: #f7b547;
    --marigold-tint: #3a2f14;
    --on-marigold: #1b1405;
    --coral: #f07a62;
    --coral-text: #ff9a84;
    --focus: #f7b547;
    --shadow-card: none;
    --spark: var(--teal-tint);
    --join-bg: var(--teal-tint);
    --join-ink: var(--ink);
    --screen-paper: #d9d8d0;
    --device-edge: #5a5a55;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 18px/1.55 var(--body); }
img, svg { max-width: 100%; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--teal-strong); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
code, kbd, .mono { font-family: var(--mono); font-size: .88em; }
code { background: var(--teal-tint); padding: .08em .35em; border-radius: var(--radius-sm); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 12px 16px; border-radius: var(--radius-md); z-index: 50; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

h1, h2, h3 { font-family: var(--display); font-weight: 640; font-variation-settings: "SOFT" 100; color: var(--ink); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(40px, 5.2vw, 58px); line-height: 1.06; letter-spacing: -.01em; font-variation-settings: "SOFT" 100, "opsz" 144; }
h2 { font-size: clamp(30px, 3.6vw, 40px); line-height: 1.12; }
h3 { font-size: 24px; line-height: 1.25; font-weight: 600; }
mark { background: none; color: inherit; box-shadow: inset 0 -.3em 0 var(--mark); padding: 0 .06em; }
/* At night a strip behind the letters would put pale type on marigold, so the word is underlined instead. */
@media (prefers-color-scheme: dark) {
  mark { box-shadow: none; padding: 0; text-decoration: underline .12em var(--marigold); text-underline-offset: .1em; text-decoration-skip-ink: none; }
}

/* ---- icons (outline, 2px stroke, always beside a word) ---------------- */
.ico { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.badge { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--teal-tint); color: var(--teal); margin-bottom: 16px; }

/* ---- buttons ----------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--tap-min); padding: 12px 22px;
  border: 2px solid var(--teal); border-radius: var(--radius-md); background: var(--teal); color: var(--on-teal);
  font: 700 16px/1.2 var(--body); text-decoration: none; cursor: pointer; text-align: center; }
.btn:hover { background: var(--teal-strong); border-color: var(--teal-strong); color: var(--on-teal); }
.btn.ghost { background: transparent; color: var(--teal); }
.btn.ghost:hover { background: var(--teal-tint); color: var(--teal-strong); border-color: var(--teal-strong); }
.btn.big { min-height: 56px; padding: 14px 26px; font-size: 18px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.textlink { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap-min); font-weight: 700; }

/* ---- announcement bar + header ---------------------------------------- */
.announce { background: var(--teal); color: var(--on-teal); font-size: 15px; }
.announce .wrap { display: flex; gap: 6px 14px; align-items: center; justify-content: center; padding-top: 10px; padding-bottom: 10px; text-align: center; flex-wrap: wrap; }
.announce a { display: inline-flex; align-items: center; gap: 6px; color: inherit; font-weight: 700; }
.announce a:hover { color: inherit; }
.announce .ico { width: 18px; height: 18px; }
.site-head { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
@supports (background: color-mix(in srgb, red, blue)) {
  .site-head { background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: saturate(1.2) blur(10px); }
}
.site-head .wrap { display: flex; align-items: center; gap: 20px; min-height: 72px; }
.brand { display: block; flex: none; line-height: 0; border-radius: var(--radius-sm); }
.brand img { height: 34px; width: auto; display: block; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a, .signin { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: var(--radius-md);
  color: var(--ink); font: 700 15px/1.2 var(--body); text-decoration: none; }
.nav a:hover, .signin:hover { background: var(--teal-tint); color: var(--teal-strong); }
.head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.head-cta .short { display: none; }
@media (max-width: 1000px) { .nav { display: none; } }
/* On a phone the header keeps Sign in (the Library is used on phones) and the button shortens. */
@media (max-width: 520px) {
  .site-head .wrap { gap: 10px; min-height: 64px; }
  .brand img { height: 28px; }
  .btn.head-cta { min-height: 44px; padding: 8px 14px; font-size: 15px; }
  .btn.head-cta .long { display: none; }
  .btn.head-cta .short { display: inline; }
}

/* ---- hero -------------------------------------------------------------- */
section.hero { padding: 0; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 48px; align-items: center; padding-top: 56px; padding-bottom: 72px; }
.eyebrow { display: inline-block; font: 700 14px/1.3 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--teal-strong);
  background: var(--teal-tint); padding: 6px 14px; border-radius: 999px; margin-bottom: 20px; }
.lede { font-size: 21px; line-height: 1.5; color: var(--ink); margin: 20px 0 28px; max-width: 32em; }
.hero-ctas { display: flex; gap: 12px 14px; flex-wrap: wrap; align-items: center; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 28px 0 0; padding: 0; list-style: none; color: var(--ink-muted); font-size: 16px; }
.facts li { display: inline-flex; align-items: center; gap: 8px; }
.facts li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--marigold); flex: none; }
/* The Reader, rendered from the case's Onshape model (a transparent WebP with its own soft shadow), on a marigold spark. */
.hero-art { position: relative; }
.hero-art::before { content: ""; position: absolute; inset: 8% 2% 6% 16%; border-radius: 50%; background: var(--spark); }
.product { position: relative; width: 100%; height: auto; display: block; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; gap: 32px; padding-top: 36px; padding-bottom: 48px; } }

/* ---- sections ---------------------------------------------------------- */
section { padding: 80px 0; }
section.band { background: var(--teal-tint); }
.section-head { max-width: 760px; margin-bottom: 40px; }
.section-head p { font-size: 20px; line-height: 1.5; margin: 16px 0 0; }
.kicker { font: 700 14px/1.3 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--teal-strong); margin: 0 0 12px; }
@media (max-width: 700px) { section { padding: 56px 0; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-card); }
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; font-size: 17px; line-height: 1.5; color: var(--ink); }
.card p + p { margin-top: 10px; }
.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.features h3 { font-size: 22px; }
@media (max-width: 1000px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

/* ---- choose, read, answer, talk --------------------------------------- */
.routine { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.routine li { counter-increment: step; }
.routine li::before { content: counter(step); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--teal); color: var(--on-teal); font: 640 22px/1 var(--display); margin-bottom: 16px; }
.where { display: inline-block; margin: 0 0 10px; padding: 3px 10px; border-radius: 999px; background: var(--teal-tint); color: var(--teal-strong);
  font: 700 13px/1.4 var(--body); letter-spacing: .06em; text-transform: uppercase; }
.routine-note { margin: 28px 0 0; font-size: 18px; max-width: 46em; }
@media (max-width: 1000px) { .routine { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .routine { grid-template-columns: 1fr; } }

/* ---- the reader you can press ----------------------------------------- */
.try { display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; align-items: center; }
.try-say { font-size: 20px; line-height: 1.5; margin: 0 0 16px; min-height: 4.5em; }
.try-help { font-size: 16px; color: var(--ink-muted); margin: 0 0 12px; }
/* The front render with its screen blank; the page and the press targets are
   placed where the renderer measured them (percentages in index.html). */
.product-demo { position: relative; width: 100%; aspect-ratio: 1285 / 848; }
.product-demo > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.product-demo .screen { position: absolute; background: var(--screen-paper); overflow: hidden; border-radius: 2px;
  isolation: isolate; box-shadow: inset 0 2px 5px rgba(0, 0, 0, .22); }
.product-demo .screen img { width: 100%; height: 100%; display: block; mix-blend-mode: multiply; }
.product-demo .key { position: absolute; width: 7%; aspect-ratio: 1; transform: translate(-50%, -50%); padding: 0;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.product-demo .key:hover, .product-demo .key:focus-visible { background: rgba(255, 255, 255, .22); box-shadow: 0 0 0 3px var(--marigold); outline: none; }
.product-demo .key:active { background: rgba(0, 0, 0, .15); }
@media (max-width: 860px) { .try { grid-template-columns: 1fr; gap: 24px; } .try-say { min-height: 0; } }

/* ---- the shelf --------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; margin: 0 0 12px; padding: 0; list-style: none; }
.tile { margin: 0; }
.cover { aspect-ratio: 2 / 3; border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 16px 14px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.cover::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: currentColor; opacity: .85; }
.cover b { font: 600 clamp(17px, 1.6vw, 21px)/1.2 var(--display); font-variation-settings: "SOFT" 100; overflow-wrap: break-word; }
.cover.c1 { background: var(--teal); color: var(--on-teal); }
.cover.c2 { background: var(--marigold); color: var(--on-marigold); }
.cover.c3 { background: var(--ink); color: var(--paper); }
.cover.c4 { background: var(--teal-tint); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.cover.c5 { background: var(--marigold-tint); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.cover.c6 { background: var(--teal-strong); color: var(--on-teal); }
.tile figcaption { font-size: 13px; line-height: 1.4; color: var(--ink-muted); margin-top: 8px; }
.nw { white-space: nowrap; }
.shelf-more { margin: 16px 0 48px; color: var(--ink); }
@media (max-width: 1000px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }

.made-head { margin: 0 0 20px; }
.made { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; counter-reset: made; margin: 0; padding: 0; list-style: none; }
.made li { counter-increment: made; }
.made li::before { content: counter(made); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--teal); color: var(--on-teal); font: 700 16px/1 var(--body); margin-bottom: 12px; }
.made b { display: block; margin-bottom: 4px; font-size: 18px; }
.made span { font-size: 16px; line-height: 1.45; }
@media (max-width: 1000px) { .made { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .made { grid-template-columns: 1fr; } }

/* ---- questions --------------------------------------------------------- */
.faq { max-width: 820px; display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--tap-min); padding: 12px 20px;
  font: 700 18px/1.35 var(--body); cursor: pointer; list-style: none; border-radius: var(--radius-md); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 10px; height: 10px; margin-right: 4px; border-right: 2px solid var(--teal); border-bottom: 2px solid var(--teal);
  transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq details p { margin: 0; padding: 0 20px 18px; font-size: 17px; line-height: 1.55; max-width: 44em; }
@media (prefers-reduced-motion: reduce) { .faq summary::after { transition: none; } }

/* ---- open source ------------------------------------------------------- */
.open { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.soon { display: inline-block; margin-top: 14px; font: 700 13px/1.4 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted);
  border: 1px solid var(--ink-muted); border-radius: 999px; padding: 3px 12px; }
@media (max-width: 900px) { .open { grid-template-columns: 1fr; } }

/* ---- three ways to join in ------------------------------------------------ */
section.join { background: var(--join-bg); color: var(--join-ink); }
.join h2, .join .kicker, .join .section-head p { color: var(--join-ink); }
.join .kicker { opacity: .9; }
.ways { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; align-items: start; }
.way { display: flex; flex-direction: column; color: var(--ink); }
.way h3 { font-size: 26px; }
.way .push { margin-top: 20px; }
.way .small { font-size: 15px; color: var(--ink-muted); margin-top: 14px; }
.way a:not(.btn) { color: var(--teal); }
@media (max-width: 1000px) { .ways { grid-template-columns: 1fr; } }

/* forms. They stay hidden until the script runs, so a form can never be sent
   the plain way, which would put the address in the page's own web address. */
form[hidden] { display: none; }
.field { margin: 0 0 14px; }
.field label, .checks legend { display: block; font: 700 15px/1.3 var(--body); margin: 0 0 6px; padding: 0; }
.field input[type=email] { width: 100%; min-height: var(--tap-min); font: 400 18px/1.2 var(--body); padding: 10px 14px;
  border-radius: var(--radius-sm); border: 2px solid var(--ink-muted); background: var(--paper); color: var(--ink); }
.field input[type=email]::placeholder { color: var(--ink-muted); opacity: .85; }
.checks { border: 0; margin: 0 0 14px; padding: 0; min-width: 0; }
.checks label { display: flex; gap: 12px; align-items: center; min-height: 44px; font: 400 16px/1.3 var(--body); cursor: pointer; }
.checks input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--teal); }
.privacy, .card .privacy { font-size: 14px; line-height: 1.45; color: var(--ink-muted); margin: 12px 0 0; }
/* The status line is in the page from the start, empty, so a screen reader announces what the script puts in it. */
.status { display: flex; align-items: flex-start; gap: 10px; margin: 0; border-radius: var(--radius-md); font: 700 15px/1.4 var(--body); }
.status .ico { display: none; width: 20px; height: 20px; margin-top: 1px; }
.status.ok, .status.err, .status.busy { margin: 14px 0 0; padding: 10px 12px; }
.status.ok { background: var(--teal-tint); color: var(--ink); }
.status.ok .ico-ok { display: block; color: var(--teal); }
.status.err { background: var(--marigold-tint); color: var(--coral-text); }
.status.err .ico-err { display: block; }
.status.busy { padding-left: 0; color: var(--ink-muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- footer ------------------------------------------------------------ */
.site-foot { padding: 48px 0 64px; color: var(--ink-muted); font-size: 15px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; }
.site-foot .brand img { height: 30px; }
.site-foot p { margin: 12px 0 0; }
.site-foot a { color: var(--ink); }
.site-foot .links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; }
.site-foot .links a { display: inline-flex; align-items: center; min-height: 44px; }
.site-foot .credits { max-width: 40em; font-size: 14px; }

/* ---- reveal as you scroll ------------------------------------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in, .shot .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
