/* The home page (mangapoint.org). The colours, the fonts and the plain elements come from the app's own
   style sheets (base.css, fonts.css), so this page looks like the app; this file only lays it out. */

:root {
  --px: 4px;                 /* one pixel of the mascot's drawing */
  --page: 1120px;
  --gutter: 24px;
  --bar: 60px;               /* the height of the bar at the top */
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}
@media (max-width: 700px) { :root { --px: 3px; --gutter: 16px; } }
@media (prefers-reduced-motion: reduce) { :root { scroll-behavior: auto; } }

/* base.css holds the page to the window's height (the app never scrolls the page itself); this page scrolls. */
html, body { height: auto; }
body { min-height: 100%; overflow-x: hidden; font-size: 16px; line-height: 1.55; }
img { max-width: 100%; }
a { color: inherit; }
code { font: 500 0.92em ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--third); border-radius: 6px; padding: 1px 6px; color: var(--heading); white-space: nowrap; }
b { color: var(--heading); font-weight: 600; }
.i { width: 18px; height: 18px; flex: none; }
.pixel, .mascot-art { image-rendering: pixelated; }

/* ---- buttons: the app's pills ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 0 22px; border-radius: var(--radius-lg);
  background: var(--third); color: var(--icon); text-decoration: none; font-weight: 500;
  transition: background-color 0.15s, transform 0.15s;
}
.btn:hover { background: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--icon); color: var(--dark); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--heading); outline-offset: 3px; }

/* ---- the bar at the top ---- */
.top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 20px;
  height: var(--bar); padding: 0 max(var(--gutter), calc((100% - var(--page)) / 2));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color 0.2s;
}
.top.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--heading); font: 400 22px/1 var(--font-pixel); margin-right: auto; }
.brand .mark, .foot-brand .mark { width: 38px; height: 35px; image-rendering: pixelated; }
.top-links { display: flex; align-items: center; gap: 4px; }
.top-links a { text-decoration: none; padding: 8px 14px; border-radius: var(--radius); color: var(--icon); font-weight: 500; transition: background-color 0.15s, color 0.15s; }
.top-links a:hover { background: var(--sub); color: var(--heading); }
/* GitHub, with how many stars the repository has once GitHub says (on phones too). */
.top-links .gh { display: flex; align-items: center; gap: 8px; padding: 8px 9px; margin-left: 4px; background: var(--sub); border-radius: var(--radius-lg); }
.top-links .gh:has(.stars:not([hidden])) { padding: 8px 10px 8px 14px; }
.stars { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stars[hidden] { display: none; }
@media (max-width: 640px) { .top-links a:not(.gh):not([href="#download"]) { display: none; } }
/* On a phone the first screen's own Download button is just below; the name and GitHub keep the room. */
@media (max-width: 440px) { .top-links a[href="#download"] { display: none; } }

/* ---- the first screen: the app's Search page, and a picture of what the app does ---- */
/* It fills the window under the bar, so nothing below it shows until the page is scrolled; the words sit in the
   middle of the room above Rullo, who sits on the bottom edge. */
.hero {
  position: relative; isolation: isolate; text-align: center;
  min-height: calc(100vh - var(--bar)); min-height: calc(100svh - var(--bar));
  display: flex; flex-direction: column; align-items: center; padding: 0 var(--gutter);
}
.hero-words { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 32px 0 28px; }
.scenery { position: absolute; inset: -80px 0 0; z-index: -1; overflow: hidden; pointer-events: none; }
.scenery .bd { position: absolute; image-rendering: pixelated; }
/* As on the app's Search page: the clouds come in from their own sides and then drift in pixel steps, the rocks
   come up from below. */
.cloud-1 { top: 92px; right: 2%; width: min(22%, 320px); animation: cloud-in-r 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s both, cloud-drift 36s 2s infinite; }
.cloud-2 { top: 56px; left: 4%; width: min(20%, 288px); animation: cloud-in-l 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s both, cloud-drift-back 48s 2s infinite; }
.rock-1 { bottom: 0; right: 0; width: min(34%, 496px); animation: rock-in 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s both; }
.rock-2 { bottom: 0; left: 0; width: min(30%, 440px); animation: rock-in 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.4s both; }
@keyframes cloud-in-r { from { transform: translateX(60vw); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes cloud-in-l { from { transform: translateX(-60vw); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rock-in { from { transform: translateY(110%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes cloud-drift-back {
  0% { transform: translateX(0); animation-timing-function: steps(12); }
  25% { transform: translateX(-16px); animation-timing-function: steps(24); }
  75% { transform: translateX(16px); animation-timing-function: steps(12); }
  100% { transform: translateX(0); }
}
@keyframes cloud-drift {
  0% { transform: translateX(0); animation-timing-function: steps(12); }
  25% { transform: translateX(16px); animation-timing-function: steps(24); }
  75% { transform: translateX(-16px); animation-timing-function: steps(12); }
  100% { transform: translateX(0); }
}
.title { font: 400 clamp(48px, min(10vw, 12.5vh), 104px)/1 var(--font-pixel); color: var(--heading); margin: 0 0 22px; letter-spacing: 1px; }
/* The letters of the name come up one after another, as in the app; then the words under it, one line at a
   time, coming into focus. */
.letters span { display: inline-block; animation: letter-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) calc(0.25s + var(--i) * 0.055s) backwards; }
@keyframes letter-in { from { opacity: 0; transform: translateY(0.45em) scale(0.92); } to { opacity: 1; transform: none; } }
.lead { font-size: clamp(19px, 2.4vw, 23px); color: var(--heading); font-weight: 600; margin: 0 auto 10px; max-width: 640px; }
.sub { font-size: 17px; margin: 0 auto 30px; max-width: 600px; }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.cta .btn { min-height: 52px; padding: 0 26px; font-size: 16.5px; }
.fine { margin: 16px auto 0; font-size: 14px; color: var(--muted); }
.fine a { color: var(--icon); }
.lead, .sub, .cta, .hero .fine { animation: words-in 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.lead { animation-delay: 0.75s; }
.sub { animation-delay: 0.85s; }
.cta { animation-delay: 0.95s; }
.hero .fine { animation-delay: 1.05s; }
@keyframes words-in { from { opacity: 0; transform: translateY(12px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.top { animation: top-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
@keyframes top-in { from { opacity: 0; transform: translateY(-100%); } to { opacity: 1; transform: none; } }

/* The picture: the sites, the mascot and the reader come in by themselves (their motion is in the picture). */
/* Rullo comes up from below last. Pointed at (or tapped), he is delighted: the second drawing, the same size,
   lies on top of the first. */
.rullo { --rp: var(--px); position: relative; flex: none; width: calc(44 * var(--rp)); animation: rock-in 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 1.15s backwards; }
/* In a short window he is drawn a step smaller, so all of him still fits on the first screen. */
@media (max-height: 760px) { .rullo { --rp: 3px; } }
@media (max-height: 560px) { .rullo { --rp: 2px; } }
/* A short phone, where the words take more lines: smaller still, with less room around the words. */
@media (max-height: 720px) and (max-width: 700px) { .rullo { --rp: 2px; } .hero-words { padding: 16px 0 14px; } .hero .sub { margin-bottom: 22px; } }
.rullo img { display: block; width: 100%; height: auto; image-rendering: pixelated; -webkit-user-drag: none; user-select: none; }
.rullo-glad { position: absolute; inset: 0; opacity: 0; }
.rullo.glad .rullo-glad { opacity: 1; }
.rullo.glad .rullo-calm { opacity: 0; }
@media (hover: hover) {
  .rullo:hover .rullo-glad { opacity: 1; }
  .rullo:hover .rullo-calm { opacity: 0; }
}

/* His name, following the pointer just above it: the pixel font in a box with stepped pixel corners and a
   little stepped tail pointing down at the pointer. */
.name-tag {
  --s: 3px;
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  transform: translate(-50%, calc(-100% - 14px));
  font: 400 18px/1 var(--font-pixel); color: var(--dark); letter-spacing: 1px; white-space: nowrap;
  opacity: 0; transition: opacity 0.12s steps(2);
}
.name-tag.on { opacity: 1; }
.tag-box { display: block; padding: var(--s); background: #000; clip-path: polygon(0 var(--s), var(--s) var(--s), var(--s) 0, calc(100% - var(--s)) 0, calc(100% - var(--s)) var(--s), 100% var(--s), 100% calc(100% - var(--s)), calc(100% - var(--s)) calc(100% - var(--s)), calc(100% - var(--s)) 100%, var(--s) 100%, var(--s) calc(100% - var(--s)), 0 calc(100% - var(--s))); }
.tag-box span { display: block; padding: 5px 11px 6px; background: var(--icon); clip-path: polygon(0 var(--s), var(--s) var(--s), var(--s) 0, calc(100% - var(--s)) 0, calc(100% - var(--s)) var(--s), 100% var(--s), 100% calc(100% - var(--s)), calc(100% - var(--s)) calc(100% - var(--s)), calc(100% - var(--s)) 100%, var(--s) 100%, var(--s) calc(100% - var(--s)), 0 calc(100% - var(--s))); }
/* The tail: a stepped triangle of black pixels, with the box's colour inside its first row. */
.name-tag::after {
  content: ""; position: absolute; left: 50%; top: 100%; width: var(--s); height: var(--s); margin: calc(var(--s) * -1) 0 0 calc(var(--s) * -0.5);
  background: var(--icon);
  box-shadow: calc(var(--s) * -1) 0 #000, var(--s) 0 #000, 0 var(--s) #000, calc(var(--s) * -1) calc(var(--s) * -1) var(--icon), var(--s) calc(var(--s) * -1) var(--icon);
}

.frame { margin: 0; padding: 10px; background: var(--sub); border-radius: var(--radius-lg); box-shadow: 0 30px 80px -30px var(--dark), 0 0 0 1px var(--third) inset; }
.frame img { display: block; width: 100%; height: auto; border-radius: 16px; }

/* ---- the sections ---- */
.section { max-width: calc(var(--page) + 2 * var(--gutter)); margin: 0 auto; padding: 112px var(--gutter) 0; }
.heading { font: 400 clamp(28px, 4vw, 40px)/1.15 var(--font-pixel); color: var(--heading); margin: 0 0 14px; text-wrap: balance; }
.lead, .intro, .step h3 { text-wrap: balance; }
.section > .heading, .section > .intro { text-align: center; }
.intro { max-width: 680px; margin: 0 auto 40px; font-size: 17px; }
.muted { color: var(--muted); }

/* The four steps, each with the scene from the app that goes with it. */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.step { background: var(--sub); border-radius: var(--radius-lg); padding: 26px 22px 24px; display: flex; flex-direction: column; transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
.step:hover { transform: translateY(-4px); }
/* Two screen pixels for each of the drawing's, so they are all the same size; the shorter ones stand lower so
   the titles line up. */
.step img { max-width: 100%; height: auto; align-self: center; margin: 4px 0 18px; image-rendering: pixelated; }
.step img[src$="search.svg"], .step img[src$="waiting.svg"] { padding-top: 8px; }
.step img[src$="update.svg"] { padding-top: 16px; }
.step h3 { font: 400 22px/1.2 var(--font-pixel); color: var(--heading); margin: 0 0 8px; }
.step p { margin: 0; font-size: 15px; }
@media (max-width: 980px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* A feature: the words on one side and the app on the other, sides changing as they go down. */
.rows { display: grid; gap: 112px; }
.row-feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; }
.row-feature.flip .copy { order: 2; }
.copy p { font-size: 17px; }
.ticks { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; }
.ticks .i { margin-top: 3px; color: var(--icon); }
@media (max-width: 900px) {
  .rows { gap: 80px; }
  .row-feature { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .row-feature.flip .copy { order: 0; }
}

.readers { text-align: center; }
.chips { list-style: none; padding: 0; margin: 0 auto 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 820px; }
.chips li { background: var(--sub); border-radius: var(--radius-lg); padding: 9px 18px; font-weight: 500; }
.chips.formats li { background: var(--third); }
.chips b { margin-right: 6px; }

/* The website. */
.web-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 48px; align-items: center; background: var(--dark); border-radius: 32px; padding: 48px; }
.points { list-style: none; padding: 0; margin: 22px 0 28px; display: grid; gap: 14px; }
.points li { display: flex; gap: 14px; align-items: flex-start; }
.points .i { width: 22px; height: 22px; margin-top: 2px; color: var(--icon); }
.points b { display: block; }
.phones { margin: 0; }
.phones img { display: block; width: 100%; height: auto; border-radius: 20px; }
@media (max-width: 900px) {
  .web-card { grid-template-columns: minmax(0, 1fr); padding: 32px 22px; gap: 32px; }
}

/* No account. */
.privacy { display: flex; align-items: center; justify-content: center; gap: 40px; }
.privacy > div { max-width: 640px; }
.privacy img { width: calc(44 * var(--px)); height: auto; flex: none; image-rendering: pixelated; }
.privacy p { font-size: 17px; }
.link { display: inline-flex; align-items: center; gap: 8px; color: var(--heading); font-weight: 600; text-decoration: none; }
.link:hover .i { transform: translateX(3px); }
.link .i { transition: transform 0.15s; }
@media (max-width: 700px) { .privacy { flex-direction: column; text-align: center; gap: 20px; } }

/* Downloads. */
.downloads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.os { background: var(--sub); border-radius: var(--radius-lg); padding: 26px; display: flex; flex-direction: column; gap: 10px; border: 2px solid transparent; transition: border-color 0.2s; }
.os.yours { border-color: var(--icon); }
.os h3 { font: 400 26px/1.1 var(--font-pixel); color: var(--heading); margin: 0; }
.os .muted { margin: 0 0 6px; font-size: 14.5px; }
.os .btn { width: 100%; }
.os .note { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }
.os .note a { color: var(--icon); }
#download .fine { text-align: center; margin-top: 22px; }
@media (max-width: 900px) { .downloads { grid-template-columns: minmax(0, 1fr); max-width: 480px; margin: 0 auto; } }

/* ---- the bottom ---- */
.foot { max-width: calc(var(--page) + 2 * var(--gutter)); margin: 120px auto 0; padding: 32px var(--gutter) calc(40px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; gap: 14px 24px; align-items: center; }
.foot-brand { display: flex; align-items: center; gap: 10px; font: 400 20px/1 var(--font-pixel); color: var(--heading); }
.foot nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 20px; }
.foot nav a { text-decoration: none; color: var(--icon); }
.foot nav a:hover { color: var(--heading); }
.foot p { grid-column: 1 / -1; margin: 0; max-width: 820px; }
@media (max-width: 640px) { .foot { grid-template-columns: minmax(0, 1fr); } .foot nav { justify-content: flex-start; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
