/* Paper and ink. The page uses the panel's own four greys, plus one
   sticky-note yellow that is spent on marks: link underlines and tags. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url(fonts/bricolage.woff2) format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url(fonts/atkinson.woff2) format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: #ecede8;      /* page: the panel's white, seen in a kitchen */
  --paper-2: #dfe0da;    /* the panel's light grey */
  --graphite: #4f5155;   /* the panel's dark grey */
  --ink: #1f2023;        /* the panel's black */
  --rule: #c4c5bf;
  --mark: #f2cf3a;       /* sticky-note yellow */
  --mark-ink: #1f2023;
  --bezel: #f6f5f1;      /* the board's white plastic */
  --bezel-edge: #cfcec8;
  --bezel-shade: #e4e3dd;
  --screen: #e9e9e3;

  --display: "Bricolage Grotesque", "Avenir Next Condensed", "Arial Narrow", sans-serif;
  --text: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;

  --step-0: 1.0625rem;
  --step-1: 1.33rem;
  --step-2: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem);
  --step-3: clamp(2.2rem, 1.4rem + 3vw, 3.4rem);
  --step-4: clamp(2.8rem, 1.6rem + 5vw, 5.4rem);
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --wide: 72rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1d1e20;
    --paper-2: #26282a;
    --graphite: #a9aba6;
    --ink: #e7e8e3;
    --rule: #3a3c3f;
    --mark: #d6b941;
    --mark-ink: #1d1e20;
    --bezel: #f1f0ec;    /* the board is white whatever the page does */
    --bezel-edge: #bdbcb6;
    --bezel-shade: #dad9d3;
    --screen: #dcdcd5;   /* the panel stays paper; it is lit by the room */
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--text);
}

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

a { color: inherit; text-decoration-line: underline; text-decoration-color: var(--mark);
    text-decoration-thickness: .28em; text-underline-offset: -.08em; text-decoration-skip-ink: none; }
a:hover { text-decoration-thickness: .5em; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.08; margin: 0; letter-spacing: -.01em; }
h2 { font-size: var(--step-3); font-stretch: 82%; max-width: 18ch; }
h3 { font-size: var(--step-2); font-stretch: 88%; }
p { margin: 0 0 1em; max-width: 64ch; }

.skip { position: absolute; left: -999px; top: .5rem; background: var(--ink); color: var(--paper);
        padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: .5rem; }

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

/* Header */
.top { position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 2px solid var(--ink); }
.top .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 3.5rem; }
.brand { font: 800 1.25rem/1 var(--display); font-stretch: 80%; text-decoration: none; white-space: nowrap; }
.brand svg { vertical-align: -3px; margin-right: .4rem; }
.top nav { overflow-x: auto; margin-left: auto; scrollbar-width: none; }
.top nav ul { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: .25rem 0; }
.top nav a { text-decoration: none; white-space: nowrap; font-size: .95rem; }
.top nav a:hover { text-decoration: underline; text-decoration-color: var(--mark); text-decoration-thickness: .3em; }
@media (max-width: 40rem) { .top .wrap { gap: .75rem; } .top nav ul { gap: .9rem; } }

/* Device frame: the board drawn around a capture */
.device {
  --r: 1.25rem;
  --bez: clamp(10px, 1.5vw, 20px);
  position: relative;
  margin: 0;
  background: linear-gradient(160deg, #fff 0%, var(--bezel) 38%, var(--bezel-shade) 100%);
  border-radius: var(--r);
  padding: var(--bez);
  box-shadow:
    inset 0 0 0 1px var(--bezel-edge),
    inset 0 1px 0 1px rgba(255,255,255,.9),
    0 1px 2px rgba(0,0,0,.12),
    0 22px 40px -18px rgba(0,0,0,.38);
}
.device::before, .device::after { /* the three buttons on the top edge: OK, then UP and DOWN */
  content: ""; position: absolute; top: -5px; height: 5px; width: 9%; border-radius: 3px 3px 0 0;
  background: var(--bezel-shade);
  box-shadow: inset 0 0 0 1px var(--bezel-edge);
}
.device::before { left: 14%; }
.device::after { right: 14%; width: 20%; background: linear-gradient(90deg, var(--bezel-shade) calc(50% - 3px), transparent calc(50% - 3px) calc(50% + 3px), var(--bezel-shade) calc(50% + 3px)); box-shadow: none; }
.portrait::before { width: 14%; } .portrait::after { width: 30%; }
.screen {
  position: relative; overflow: hidden;
  aspect-ratio: 800 / 480;
  background: var(--screen);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18), inset 0 2px 4px rgba(0,0,0,.08);
}
.portrait .screen { aspect-ratio: 480 / 800; }
.screen img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  mix-blend-mode: multiply;   /* the capture's white becomes the panel's paper */
}
@media (min-resolution: 1.5dppx) { .screen img { image-rendering: pixelated; } }
.screen .slot {            /* shows until the capture is added */
  position: absolute; inset: 0; display: grid; place-content: center; gap: .3rem; padding: 1rem;
  text-align: center; color: #45474b; font-size: .9rem; line-height: 1.3;
  background:
    repeating-linear-gradient(135deg, transparent 0 9px, rgba(0,0,0,.06) 9px 10px);
}
.screen .slot strong { font: 700 1.05rem/1.2 var(--display); color: #1f2023; }
.device figcaption { position: absolute; left: 0; right: 0; top: 100%; padding-top: .7rem;
  color: var(--graphite); font-size: .9rem; line-height: 1.35; }

/* Hero */
.hero { padding: clamp(2.5rem, 7vw, 6rem) 0 clamp(3rem, 8vw, 6.5rem); }
.hero .wrap { display: grid; gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center; }
@media (min-width: 60rem) { .hero .wrap { grid-template-columns: 1fr 1.15fr; } }
.hero h1 { font-size: var(--step-4); font-stretch: 78%; font-weight: 800; letter-spacing: -.02em; max-width: 12ch; }
.hero .lede { font-size: var(--step-1); line-height: 1.5; margin-top: 1.5rem; max-width: 34ch; }
.hero .note { color: var(--graphite); font-size: .95rem; margin-top: 1.5rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; margin-top: 2rem; }
.button { display: inline-block; background: var(--ink); color: var(--paper); text-decoration: none;
  font-weight: 700; padding: .8rem 1.4rem; border-radius: .7rem; }
.button:hover { background: var(--graphite); }
.hero .device { --r: 1.7rem; --bez: clamp(14px, 2vw, 26px); }

/* The one moment: on load, the hero screen does an e-paper full refresh */
@media (prefers-reduced-motion: no-preference) {
  .hero .screen::after {
    content: ""; position: absolute; inset: 0; background: var(--screen); pointer-events: none;
    animation: refresh 1.1s steps(1, end) .35s both;
  }
  @keyframes refresh {
    0%   { background: var(--screen); opacity: 1; }
    25%  { background: #1f2023; }
    50%  { background: var(--screen); }
    75%  { background: #1f2023; }
    100% { opacity: 0; }
  }
}

/* Sections */
section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; border-top: 2px solid var(--ink); }
.split { display: grid; gap: 1.5rem 4rem; }
@media (min-width: 56rem) { .split { grid-template-columns: 1fr 1.4fr; } }
.intro { font-size: var(--step-1); line-height: 1.5; max-width: 40ch; }
.intro-gap { margin-top: 1.5rem; }

/* Tour */
.feature { display: grid; gap: 2.5rem 4rem; align-items: center; padding: clamp(3rem, 6vw, 5rem) 0;
  border-top: 1px solid var(--rule); }
.feature:first-of-type { border-top: 0; padding-top: 2rem; }
@media (min-width: 56rem) {
  .feature { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
  .feature.flip .copy { order: 2; }
}
.feature h3 { margin-bottom: 1rem; }
.feature ul { padding-left: 1.1rem; margin: 0 0 1em; max-width: 60ch; }
.feature li { margin-bottom: .35rem; }
.feature li::marker { color: var(--graphite); }
.shots { display: flex; gap: clamp(1rem, 3vw, 2rem); align-items: flex-start; padding-bottom: 3.2rem; }
.shots .device { flex: 1 1 0; min-width: 0; }
.shots .device.portrait { flex: .62 1 0; }
.shots.two-portrait { justify-content: center; }
.shots.two-portrait .device.portrait { flex: 0 1 15rem; }
@media (max-width: 34rem) {
  .shots { flex-direction: column; align-items: stretch; }
  .shots .device.portrait, .shots.two-portrait .device.portrait { flex: none; width: 72%; align-self: center; }
  .shots .device + .device { margin-top: 2.5rem; }
}

/* A page of the setup app, shown in a plain browser-like frame */
.browser { margin: 0; position: relative; flex: .62 1 0; min-width: 0; border: 2px solid var(--ink); border-radius: .7rem;
  padding-top: 1.3rem; background: var(--paper-2) radial-gradient(circle, var(--graphite) 0 3px, transparent 3.5px) .6rem .35rem / .95rem .6rem repeat-x;
  overflow: visible; }
.browser img { border-top: 2px solid var(--ink); border-radius: 0 0 .5rem .5rem; background: #ecede8; }
.browser figcaption { position: absolute; left: 0; right: 0; top: 100%; padding-top: .7rem;
  color: var(--graphite); font-size: .9rem; line-height: 1.35; }
@media (max-width: 34rem) { .shots .browser { flex: none; width: 88%; align-self: center; margin-top: 2.5rem; } }

/* The rest of a feature, full width under it: a credit line, or a row of games */
.feature .credit { color: var(--graphite); font-size: .9rem; }
.gallery { grid-column: 1 / -1; order: 3; display: grid; gap: 3.6rem clamp(1rem, 3vw, 2rem); padding-bottom: 2.4rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
@media (min-width: 56rem) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.gallery .device { --r: .9rem; --bez: clamp(8px, 1vw, 12px); }

.tag { display: inline-block; vertical-align: .35em; margin-left: .5rem; font: 700 .8rem/1 var(--text);
  letter-spacing: .02em; background: var(--mark); color: var(--mark-ink); padding: .35rem .55rem .3rem;
  border-radius: .3rem; transform: rotate(-2deg); }

/* Getting around */
.ways { width: 100%; border-collapse: collapse; margin-top: 2.5rem; font-size: 1rem; }
.ways caption { text-align: left; color: var(--graphite); padding-bottom: .75rem; }
.ways th, .ways td { text-align: left; vertical-align: top; padding: .9rem 1.25rem .9rem 0; border-top: 1px solid var(--rule); }
.ways thead th { font: 700 1rem/1.2 var(--display); font-stretch: 90%; border-top: 0; color: var(--graphite); }
.ways tbody th { font-weight: 700; width: 26%; }
kbd { font: 700 .78rem/1 var(--text); display: inline-block; min-width: 2.3em; text-align: center;
  padding: .3rem .45rem; border: 1.5px solid currentColor; border-radius: .45rem; box-shadow: 0 2px 0 currentColor;
  margin: 0 .1rem; }
@media (max-width: 44rem) {
  .ways thead { position: absolute; left: -999px; }
  .ways tr { display: block; padding: 1rem 0; border-top: 1px solid var(--rule); }
  .ways th, .ways td { display: block; border: 0; padding: .15rem 0; width: auto !important; }
  .ways td::before { content: attr(data-l) ": "; color: var(--graphite); }
}

/* Apps: laid out like the board's home screen */
.apps { list-style: none; padding: 0; margin: 3rem 0 0; display: grid; gap: 2.5rem 2rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.apps li { display: grid; grid-template-columns: 3.5rem 1fr; grid-template-rows: auto 1fr; gap: .25rem 1rem; align-items: start; }
.icon { grid-row: 1 / 3; width: 3.5rem; height: 3.5rem; border: 2px solid var(--ink); border-radius: .9rem;
  display: grid; place-items: center; }
.icon svg { width: 2rem; height: 2rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.apps h3 { font-size: 1.25rem; font-stretch: 90%; line-height: 1.2; padding-top: .15rem; }
.apps h3 .tag { font-size: .7rem; margin-left: .35rem; vertical-align: .15em; }
.apps p { font-size: .98rem; color: var(--graphite); margin: 0; }

/* Hardware */
.spec { margin: 0; display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr; }
.spec dt, .spec dd { padding: .7rem 0; border-top: 1px solid var(--rule); margin: 0; }
.spec dt { font-weight: 700; padding-right: 1rem; }
.spec dd { color: var(--graphite); }

/* Privacy */
.points { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.6rem; }
.points li { max-width: 60ch; }
.points strong { display: block; font: 700 1.2rem/1.25 var(--display); font-stretch: 90%; margin-bottom: .25rem; }

/* Install: three sticky notes, the only place the yellow fills an area */
.stickies { list-style: none; padding: 0; margin: 3rem 0 0; display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.stickies li { background: var(--mark); color: var(--mark-ink); padding: 1.6rem 1.5rem 1.8rem; border-radius: 2px;
  box-shadow: 0 10px 18px -12px rgba(0,0,0,.5); }
.stickies li:nth-child(1) { transform: rotate(-1.2deg); }
.stickies li:nth-child(2) { transform: rotate(.8deg); }
.stickies li:nth-child(3) { transform: rotate(-.5deg); }
.stickies h3 { font-size: 1.5rem; margin-bottom: .6rem; }
.stickies p { margin: 0; }
.stickies p.sticky-link { margin-top: .9rem; font-weight: 700; }
.stickies a { text-decoration-color: currentColor; text-decoration-thickness: 1px; text-underline-offset: .15em; }
.aside { color: var(--graphite); margin-top: 2.25rem; font-size: .98rem; }
code { font: 600 .9em/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow-wrap: anywhere; }

/* Footer */
footer { border-top: 2px solid var(--ink); padding: 2.5rem 0 3.5rem; color: var(--graphite); font-size: .95rem; }
footer .wrap { display: grid; gap: 1rem 3rem; }
@media (min-width: 50rem) { footer .wrap { grid-template-columns: auto 1fr; } }
footer .brand { color: var(--ink); }
footer p { margin: 0 0 .5rem; }

/* Contribute: four plain link cards */
.links { list-style: none; padding: 0; margin: 2.5rem 0 0; display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.links a { display: block; height: 100%; padding: 1.3rem 1.3rem 1.5rem; border: 2px solid var(--ink);
  border-radius: 4px; color: var(--ink); text-decoration: none; background: var(--paper); }
.links a:hover, .links a:focus-visible { background: var(--paper-2); }
.links strong { display: block; font: 700 1.3rem/1.2 var(--display); margin-bottom: .45rem; }
.links strong::after { content: " →"; }
.links span { display: block; color: var(--graphite); font-size: .98rem; line-height: 1.45; }
.top nav a.gh { font-weight: 700; }

/* Blog: one narrow column of article type, the same device frames */
.narrow { max-width: 46rem; }
.post-head { padding-top: clamp(2.5rem, 6vw, 5rem); padding-bottom: 2rem; }
.post-head h1 { font-size: clamp(2.4rem, 1.4rem + 3.6vw, 4rem); font-stretch: 78%; font-weight: 800; letter-spacing: -.02em; max-width: 20ch; }
.post-head .lede { font-size: var(--step-1); line-height: 1.5; margin-top: 1.25rem; }
.kicker { color: var(--graphite); font-size: .95rem; margin-bottom: 1rem; }
.post-body { padding-bottom: clamp(3rem, 7vw, 5rem); font-size: 1.1rem; line-height: 1.7; }
.post-body > p, .post-body li { max-width: none; }
.post-body h2 { font-size: var(--step-2); font-stretch: 85%; max-width: none; margin: 3.2rem 0 1rem; padding-top: 1.6rem; border-top: 2px solid var(--ink); }
.post-body h3 { font-size: 1.4rem; font-stretch: 90%; margin: 2.2rem 0 .6rem; }
.post-body ul, .post-body ol { padding-left: 1.3rem; margin: 0 0 1.2em; }
.post-body li { margin-bottom: .45rem; }
.post-body li::marker { color: var(--graphite); }
.post-body .shots { margin: 2.2rem 0 1.4rem; }
.post-body .shots.single { margin-top: .5rem; }
.post-body .credit { color: var(--graphite); font-size: .9rem; line-height: 1.45; }
.disclaimer { border-left: 6px solid var(--mark); padding: .2rem 0 .2rem 1rem; color: var(--graphite); font-size: 1rem; }
.post-end { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; margin-top: 2.5rem; }
.top nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--mark); text-decoration-thickness: .3em; }

.post-list { list-style: none; padding: 0; margin: 0 0 clamp(3rem, 7vw, 5rem); display: grid; gap: 1.5rem; }
.post-card { display: grid; gap: 1.25rem 1.75rem; padding: 1.4rem; border: 2px solid var(--ink); border-radius: 4px;
  text-decoration: none; color: var(--ink); background: var(--paper); align-items: center; }
.post-card:hover, .post-card:focus-visible { background: var(--paper-2); }
@media (min-width: 40rem) { .post-card { grid-template-columns: 15rem 1fr; } }
.post-card .device { display: block; --r: .9rem; --bez: 10px; }
.post-card .screen { display: block; }
.post-card-text { display: block; }
.post-card time { display: block; color: var(--graphite); font-size: .9rem; margin-bottom: .3rem; }
.post-card strong { display: block; font: 700 1.5rem/1.15 var(--display); font-stretch: 88%; margin-bottom: .5rem; }
.post-card strong::after { content: " →"; }
.post-card-text > span { display: block; color: var(--graphite); font-size: .98rem; line-height: 1.5; }
@media (min-width: 34.01rem) { .post-body .shots:not(.two-portrait) { align-items: center; } }

/* Videos: a poster that links to YouTube. Nothing is embedded, so nothing loads
   from YouTube until you choose to watch (and the CSP allows no frames). */
.video { margin: 0; }
.video a { position: relative; display: block; overflow: hidden; text-decoration: none; color: inherit;
  border: 2px solid var(--ink); border-radius: .7rem; background: #f3f2ee;
  box-shadow: 0 22px 40px -22px rgba(0,0,0,.4); }
.video img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.video-play { position: absolute; left: 50%; top: 50%; width: clamp(3.4rem, 8vw, 5.2rem); aspect-ratio: 1;
  transform: translate(-50%, -50%); border-radius: 50%; background: #1f2023;
  box-shadow: 0 0 0 4px rgba(255,255,255,.85), 0 10px 26px rgba(0,0,0,.35); }
.video-play::after { content: ""; position: absolute; inset: 30% 26% 30% 36%; background: #f2cf3a;
  clip-path: polygon(0 0, 100% 50%, 0 100%); }
.video-time { position: absolute; right: .6rem; bottom: .6rem; padding: .2rem .5rem; border-radius: .35rem;
  background: #1f2023; color: #fff; font: 700 .85rem/1.2 var(--text); font-variant-numeric: tabular-nums; }
.video a:hover .video-play, .video a:focus-visible .video-play { background: #f2cf3a; }
.video a:hover .video-play::after, .video a:focus-visible .video-play::after { background: #1f2023; }
@media (prefers-reduced-motion: no-preference) {
  .video-play { transition: transform .2s, background-color .2s; }
  .video a:hover .video-play { transform: translate(-50%, -50%) scale(1.08); }
}
.video figcaption { padding-top: .7rem; color: var(--graphite); font-size: .9rem; line-height: 1.35; }
.video figcaption strong { color: var(--ink); }

/* The tour, under the hero */
.watch { padding-bottom: clamp(3rem, 7vw, 5.5rem); }
.watch .wrap { display: grid; gap: 1.5rem clamp(2rem, 5vw, 4.5rem); align-items: center; }
@media (min-width: 56rem) { .watch .wrap { grid-template-columns: 1fr 1.6fr; } }
.watch h2 { font-size: var(--step-2); font-stretch: 85%; margin-bottom: .8rem; }
.watch p { color: var(--graphite); }

/* A short video in a tour feature, under its words */
.feature .copy .video { max-width: 26rem; margin-top: 1.6rem; }

/* In the blog post */
.post-body .video { margin: .5rem 0 2rem; }
.post-body .videos { display: grid; gap: 1.5rem; margin: 2rem 0 1.4rem; }
.post-body .videos .video { margin: 0; }
@media (min-width: 34.01rem) { .post-body .videos { grid-template-columns: 1fr 1fr; } }
