/* InkToday promo page. Black and white, like an E Ink panel. */

@font-face { font-family: "InkToday Sans"; src: url("../fonts/inktoday-sans-light.woff") format("woff"); font-weight: 300; font-display: swap; }
@font-face { font-family: "InkToday Sans"; src: url("../fonts/inktoday-sans-regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "InkToday Sans"; src: url("../fonts/inktoday-sans-bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "InkToday Sans"; src: url("../fonts/inktoday-sans-black.woff") format("woff"); font-weight: 900; font-display: swap; }

:root {
  --bg: #efefec;
  --fg: #000;
  --soft: #ddd;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --ease: cubic-bezier(.7, 0, .2, 1);
  --pad: 6vw;
  --dev-h: min(80vh, 900px, 52vw);
}
.dark { --bg: #000; --fg: #fff; --soft: #333; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 18px/1.5 "InkToday Sans", "Segoe UI", Roboto, system-ui, sans-serif;
       -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--grain); opacity: .7; pointer-events: none; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--fg); outline-offset: 3px; }

/* ---------- top line ---------- */
.topline { position: fixed; top: 0; left: 0; right: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; padding: 16px var(--pad); pointer-events: none; }
.topline a { pointer-events: auto; }
.topline .brand img { height: 38px; width: auto; display: block; }
.topline .brand { transition: opacity .3s; }
.at-top .topline .brand { opacity: 0; pointer-events: none; }
.dark .topline .brand img { filter: invert(1); }
.topline .gh { font-weight: 700; font-size: 15px; text-decoration: none; border: 2px solid var(--fg); border-radius: 8px; padding: 7px 14px; background: var(--bg); }

/* ---------- background: E Ink ghosting ----------
   The panel never quite forgets: headings of the sections you left stay behind, faint, and fade.
   Under them the microcapsule grain of the screen. */
.caps { position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: .5;
        background-image: radial-gradient(circle at 1px 1px, rgba(0, 0, 0, .09) .8px, transparent 1.2px); background-size: 4px 4px; }
.dark .caps { background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .08) .8px, transparent 1.2px); }
.ghosts { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.ghost-h { position: absolute; font-size: 15vh; font-weight: 900; line-height: .9; letter-spacing: -.03em; white-space: nowrap; color: var(--fg);
           transition: opacity 3s ease-out, translate 1.2s var(--ease); }
.ghost-h span { display: block; }
.ghost-h .t { font-weight: 300; }

/* ---------- sections ---------- */
.page { position: relative; min-height: 100vh; display: flex; align-items: center; padding: 100px var(--pad); perspective: 1600px; }
.page.right { justify-content: flex-end; }
.copy { width: min(44vw, 580px); }
.spot { display: none; }

/* text turns like a page when its section is left behind */
.js .copy { transform-origin: 0 50%; transition: transform .9s var(--ease), opacity .9s var(--ease); }
.js .page.past .copy { transform: rotateY(-75deg) translateX(-8vw); opacity: 0; }
.js .page.next .copy { transform: rotateY(55deg) translateX(14vw); opacity: 0; }
.js .page.on .copy { transition-delay: .2s; }

h1, h2 { margin: 0 0 24px; font-size: clamp(40px, 4.8vw, 76px); line-height: .98; letter-spacing: -.02em; font-weight: 900; }
h1 span, h2 span { display: block; }
.t { font-weight: 300; }
.lead { font-size: 20px; max-width: 30em; margin: 0 0 30px; }
.small { font-size: 15px; margin: 20px 0 0; }
.hero-logo { width: 220px; height: auto; display: block; margin: 0 0 32px; }
p { margin: 0 0 14px; }

.acts { display: flex; flex-wrap: wrap; gap: 12px; }
.cta { display: inline-flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 26px; border: 2.5px solid var(--fg); border-radius: 8px;
       font-weight: 700; font-size: 17px; text-decoration: none; background: var(--bg); color: var(--fg); transition: background .15s, color .15s; }
.cta.solid, .cta:hover { background: var(--fg); color: var(--bg); }
.cta.solid:hover { background: var(--bg); color: var(--fg); }
.cta svg { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* feature list: each line switches the reader's screen */
.feats { list-style: none; margin: 0; padding: 0; border-top: 2.5px solid var(--fg); }
.feats button { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; width: 100%; padding: 14px 6px; border-bottom: 1px solid var(--fg); cursor: pointer; }
.feats b { font-size: 20px; }
.feats span { grid-column: 1; font-size: 15.5px; }
.feats i { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-style: normal; font-size: 24px; opacity: 0; }
.feats button[aria-pressed="true"] { background: var(--fg); color: var(--bg); padding-left: 16px; padding-right: 16px; }
.feats button[aria-pressed="true"] i { opacity: 1; }
.feats button:focus-visible { outline-offset: -4px; outline-color: var(--bg); }

.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 2px solid var(--fg); border-radius: 6px; font-weight: 700; font-size: 15px; }
.chip.dash { border-style: dashed; font-weight: 400; }
.chip svg { width: 15px; height: 15px; fill: currentColor; }

.grid6 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.grid6 > div { border-top: 2.5px solid var(--fg); padding: 14px 0 20px; }
.grid6 svg { width: 26px; height: 26px; fill: var(--fg); display: block; margin-bottom: 10px; }
.grid6 b { display: block; font-size: 18px; line-height: 1.2; margin-bottom: 4px; }
.grid6 p { margin: 0; font-size: 15px; line-height: 1.4; }

ol.steps { margin: 0 0 26px; padding: 0; list-style: none; counter-reset: s; }
ol.steps li { counter-increment: s; display: grid; grid-template-columns: 50px 1fr; gap: 12px; padding: 12px 0; border-top: 2.5px solid var(--fg); }
ol.steps li::before { content: counter(s); font-weight: 900; font-size: 38px; line-height: .9; }
ol.steps b { display: block; font-size: 19px; }
code { font: 700 14.5px/1.3 "InkToday Sans", monospace; background: var(--soft); padding: 1px 6px; border-radius: 3px; }
.note { font-size: 15.5px; }

.get { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; margin: 6px 0 30px; }
.qrbox { width: 190px; padding: 12px; border-radius: 10px; background: #fff; box-shadow: 0 0 0 2.5px #000; }
.qrbox img { width: 100%; display: block; }
.get p { margin: 0; font-size: 16px; }

/* ---------- the reader that flies between sections ---------- */
.flyer { position: fixed; left: 0; top: 0; z-index: 10; width: calc(var(--dev-h) * 173 / 236.2); pointer-events: none;
         transition: transform 1.05s var(--ease); will-change: transform; }
.flyer { transform-style: preserve-3d; }
.flyer .device { --w: calc(var(--dev-h) * 173 / 236.2); }
.flyer .pb { pointer-events: auto; }
.flyer.ghost { z-index: 9; opacity: 0; transition: transform 1.05s var(--ease), opacity .3s; }
.flying .flyer.ghost { opacity: .13; }
.flying .flyer.ghost.g2 { opacity: .06; }
.dark .flyer .back { box-shadow: 0 0 0 1px #444, 0 40px 80px -30px rgba(255, 255, 255, .14); }
.dark .flyer .pb { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.refresh { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0; }
.refresh.go { animation: refresh .36s steps(1) both; }
@keyframes refresh { 0% { opacity: 1; background: #000; } 40% { opacity: 1; background: #fff; } 70% { opacity: .5; background: #000; } 100% { opacity: 0; } }

/* full-window E Ink refresh when the page turns black or white */
.flash { position: fixed; inset: 0; z-index: 30; pointer-events: none; opacity: 0; }
.flash.go { animation: flash .5s steps(1) both; }
@keyframes flash { 0% { opacity: 1; background: #000; } 30% { opacity: 1; background: #fff; } 55% { opacity: 1; background: #000; } 75% { opacity: .6; background: #fff; } 100% { opacity: 0; } }

/* e-reader pager */
.rpager { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 40; display: flex; align-items: center;
         background: var(--bg); color: var(--fg); border: 2px solid var(--fg); border-radius: 8px; font-size: 15px; }
.rpager a { text-decoration: none; padding: 8px 15px; }
.rpager output { min-width: 80px; text-align: center; font-variant-numeric: tabular-nums; }

/* footer: on the last page, under the download block */
#download { flex-direction: column; align-items: flex-start; justify-content: center; padding-top: 84px; padding-bottom: 76px; }
#download h2 { font-size: clamp(36px, 4vw, 60px); margin-bottom: 18px; }
#download .get { margin-bottom: 22px; }
#download .qrbox { width: 150px; padding: 10px; }
.foot { width: min(44vw, 580px); margin-top: 24px; padding-top: 14px; border-top: 1.5px solid var(--fg); font-size: 12.5px; line-height: 1.45; }
.foot p { margin: 0 0 6px; }
.foot .fine { opacity: .75; }

/* ---------- phones: no flying reader, each section shows its own ---------- */
@media (max-width: 860px) {
  :root { --pad: 22px; }
  body { font-size: 16.5px; }
  .flyer, .rpager, .ghosts { display: none; }
  .topline { position: absolute; }
  .page, .page.right { display: block; min-height: 0; padding: 90px var(--pad) 40px; }
  .copy { width: auto; }
  .spot { display: block; width: min(76vw, 360px); margin: 34px auto 0; }
  .js .page.past .copy, .js .page.next .copy { transform: rotateY(35deg) translateX(10vw); opacity: 0; }
  h1, h2 { font-size: 40px; }
  .lead { font-size: 17px; }
  .hero-logo { width: 170px; margin-bottom: 24px; }
  .topline .brand img { height: 32px; }
  .get { grid-template-columns: 1fr; justify-items: start; }
  .foot { width: auto; }
  #download { display: flex; }
  #download .spot { order: 1; align-self: center; }
  #download .foot { order: 2; margin-top: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .copy, .flyer, .js .page.past .copy, .js .page.next .copy { transition: none; transform: none; opacity: 1; }
  .refresh.go, .flash.go { animation: none; }
  .flying .flyer.ghost { opacity: 0; }
}
.og .rpager, .og .topline { display: none; }
