/* Developer website. Solid colours, system fonts, light and dark.
   No web fonts, cookies or third-party requests. All motion is switched off
   for people who ask their device to reduce motion. */
:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --fg: #101114;
  --muted: #5d626d;
  --line: #e2e0d8;
  --accent: #2f54eb;
  --accent-fg: #ffffff;
  --soft: #e6ebff;
  --ease: cubic-bezier(0.2, 0.75, 0.2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c0d10;
    --surface: #15171c;
    --fg: #f3f4f6;
    --muted: #a0a6b2;
    --line: #272a32;
    --accent: #8ea6ff;
    --accent-fg: #0c0d10;
    --soft: #1c2244;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0d10;
  --surface: #15171c;
  --fg: #f3f4f6;
  --muted: #a0a6b2;
  --line: #272a32;
  --accent: #8ea6ff;
  --accent-fg: #0c0d10;
  --soft: #1c2244;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.025em; margin: 0; text-wrap: balance; }
p { margin: 0; }
.serif { font-family: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif; font-style: italic; font-weight: 500; letter-spacing: -0.02em; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 40; background: var(--fg); color: var(--bg); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 12px; }

/* Page-to-page fade, where the browser supports it. */
@view-transition { navigation: auto; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid transparent; transition: border-color 0.3s; }
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--fg); text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--fg); color: var(--bg); font-size: 13px; font-weight: 700; letter-spacing: 0; transition: background-color 0.3s, rotate 0.5s var(--ease); }
.brand:hover .mark { background: var(--accent); color: var(--accent-fg); rotate: -8deg; }
.nav { display: flex; gap: 2px; }
.nav a { position: relative; color: var(--muted); text-decoration: none; font-size: 16px; padding: 8px 10px; transition: color 0.2s; }
.nav a::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 4px; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
@media (max-width: 480px) { .brand-name { display: none; } .nav a { padding-inline: 8px; } }

/* Reading progress on the text pages */
.progress { position: fixed; top: 0; left: 0; z-index: 35; width: 100%; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; }

/* Reveal on scroll. Only hidden when scripts run, so the site reads fine without them. */
.js [data-reveal] { opacity: 0; transform: translateY(22px); }
.js [data-reveal].in { opacity: 1; transform: none; transition: opacity 0.7s var(--ease) var(--d, 0ms), transform 0.7s var(--ease) var(--d, 0ms), translate 0.3s var(--ease), border-color 0.3s; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 22px; border-radius: 999px; font-weight: 600; font-size: 17px; text-decoration: none; border: 1.5px solid var(--fg); transition: background-color 0.25s, color 0.25s, border-color 0.25s, translate 0.25s var(--ease); }
.btn svg { width: 18px; height: 18px; transition: translate 0.25s var(--ease); }
.btn:hover { translate: 0 -2px; }
.btn:hover svg { translate: 4px 0; }
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-ghost { color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--fg); }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.55fr); align-items: center; gap: 40px; padding-block: 56px 72px; }
.status { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 600; color: var(--muted); }
.status i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.status i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); animation: ping 2.2s ease-out infinite; }
.hero h1 { font-size: clamp(36px, 10.2vw, 78px); line-height: 0.98; letter-spacing: -0.04em; margin-top: 22px; }
.line { display: block; overflow: hidden; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.line > span { display: inline-block; transform: translateY(115%); animation: rise 1s var(--ease) forwards; }
.line:nth-child(2) > span { animation-delay: 0.12s; }
.hero .lede { font-size: clamp(18px, 2.2vw, 21px); color: var(--muted); margin-top: 26px; max-width: 30em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.fade { opacity: 0; animation: fadeup 0.8s var(--ease) forwards; animation-delay: var(--d, 0.3s); }

/* The animated phone. Abstract shapes only. */
.stage { position: relative; justify-self: center; perspective: 1000px; }
.tilt { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.3s ease-out; transform-style: preserve-3d; }
.device { position: relative; z-index: 1; width: min(280px, 64vw); aspect-ratio: 9 / 18.6; padding: 10px; border-radius: 46px; background: var(--fg); animation: float 7s ease-in-out infinite; }
.screen { position: relative; height: 100%; padding: 48px 14px 14px; border-radius: 37px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.island { position: absolute; top: 12px; left: 50%; translate: -50% 0; width: 82px; height: 24px; border-radius: 999px; background: var(--fg); }
.d-title { width: 46%; height: 14px; border-radius: 999px; background: var(--fg); margin: 2px 2px 4px; }
.d-card { display: grid; gap: 8px; padding: 13px; border-radius: 16px; background: var(--bg); opacity: 0; animation: cardin 0.8s var(--ease) forwards; animation-delay: calc(0.5s + var(--i, 0) * 0.14s); }
.d-row { display: flex; align-items: center; gap: 10px; }
.d-icon { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--accent); }
.d-lines { flex: 1; display: grid; gap: 7px; }
.bar { height: 8px; border-radius: 999px; background: var(--line); }
.bar.s { width: 58%; }
.toggle { flex: none; position: relative; width: 40px; height: 24px; border-radius: 999px; background: var(--line); animation: toggle-bg 6s infinite; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); animation: toggle-knob 6s infinite; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 54px; }
.chart i { flex: 1; height: var(--h); border-radius: 6px 6px 2px 2px; background: var(--soft); transform-origin: bottom; animation: grow 6s var(--ease) infinite; animation-delay: calc(var(--n) * 0.12s); }
.chart i.on { background: var(--accent); }
.prog { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.prog i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transform-origin: left; animation: fill 6s ease-in-out infinite; }
.d-button { margin-top: auto; height: 42px; border-radius: 14px; background: var(--fg); opacity: 0; animation: cardin 0.8s var(--ease) 1.1s forwards, press 6s ease-in-out 2s infinite; }
.shape { position: absolute; z-index: 0; }
.shape.block { inset: 34px -22px -18px 26px; border-radius: 46px; background: var(--soft); }
.shape.ring { top: -26px; right: -44px; width: 108px; height: 108px; border-radius: 50%; border: 14px solid var(--accent); border-right-color: transparent; border-bottom-color: transparent; animation: spin 14s linear infinite; }
.shape.dot { bottom: 54px; left: -40px; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); animation: bob 5s ease-in-out infinite; }
.shape.square { bottom: -10px; right: -34px; z-index: 2; width: 46px; height: 46px; border-radius: 12px; border: 3px solid var(--fg); animation: spin 22s linear infinite reverse; }

@media (min-width: 861px) { .hero h1 { font-size: clamp(54px, 6.3vw, 78px); } }
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 56px; padding-block: 36px 60px; }
  .device { width: min(230px, 58vw); }
}

/* Moving strip */
.ticker { overflow: hidden; border-block: 1px solid var(--line); background: var(--surface); }
.ticker-track { display: flex; width: max-content; animation: slide 38s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker ul { display: flex; flex: none; list-style: none; margin: 0; padding: 0; }
.ticker li { display: flex; align-items: center; gap: 28px; padding: 16px 0 16px 28px; font-weight: 600; font-size: 16px; white-space: nowrap; }
.ticker li::after { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); rotate: 45deg; }

/* Sections */
.section { padding-block: 88px 24px; }
.label { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.label::before { content: ""; width: 22px; height: 2px; background: var(--accent); }
.section h2 { font-size: clamp(32px, 5.4vw, 56px); letter-spacing: -0.035em; margin-top: 14px; max-width: 16em; }
.section .sub { color: var(--muted); font-size: 19px; margin-top: 14px; max-width: 34em; }

.cards { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card { position: relative; height: 100%; padding: 26px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); transition: translate 0.3s var(--ease), border-color 0.3s; }
.card:hover { translate: 0 -5px; border-color: var(--accent); }
.card .num { font: 600 13px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--accent); }
.card .icon { position: absolute; top: 22px; right: 22px; width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--soft); color: var(--accent); transition: background-color 0.3s, color 0.3s, rotate 0.5s var(--ease); }
.card:hover .icon { background: var(--accent); color: var(--accent-fg); rotate: -8deg; }
.card .icon svg { display: block; width: 100%; height: 100%; }
.card h3 { font-size: 23px; margin-top: 44px; }
.card p { color: var(--muted); margin-top: 8px; }
@media (max-width: 700px) { .cards { grid-template-columns: minmax(0, 1fr); } .section { padding-block: 64px 16px; } }

.apps { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 14px; }
.apps li { padding: 22px 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.apps .app-name { font-weight: 700; font-size: 22px; letter-spacing: -0.02em; color: var(--fg); }
.apps p { color: var(--muted); margin-top: 4px; }

/* Big link rows */
.rows { list-style: none; margin: 36px 0 0; padding: 0; border-bottom: 1px solid var(--line); }
.rows a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 26px 0; border-top: 1px solid var(--line); color: var(--fg); text-decoration: none; }
.rows b { display: block; font-size: clamp(26px, 4.4vw, 42px); line-height: 1.1; letter-spacing: -0.03em; transition: translate 0.35s var(--ease), color 0.25s; }
.rows span { display: block; color: var(--muted); margin-top: 6px; transition: translate 0.35s var(--ease); }
.rows .go { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; border: 1.5px solid var(--line); color: var(--fg); transition: background-color 0.25s, border-color 0.25s, color 0.25s; }
.rows .go svg { width: 22px; height: 22px; transition: translate 0.35s var(--ease); }
.rows a:hover b { translate: 10px 0; color: var(--accent); }
.rows a:hover span { translate: 10px 0; }
.rows a:hover .go { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.rows a:hover .go svg { translate: 3px 0; }

/* Text pages */
.page-head { padding-block: 56px 36px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(42px, 7.4vw, 80px); line-height: 1; letter-spacing: -0.04em; margin-top: 16px; }
.page-head .intro { font-size: clamp(18px, 2.2vw, 21px); color: var(--muted); margin-top: 18px; max-width: 32em; }
.page-head .meta { color: var(--muted); font-size: 15px; margin-top: 14px; }
.doc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding-block: 40px 72px; }
.toc { display: none; }
@media (min-width: 960px) {
  .doc { grid-template-columns: 230px minmax(0, 700px); gap: 72px; }
  .toc { display: block; position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow: auto; }
}
.toc p { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; margin-left: -2px; padding: 6px 0 6px 14px; border-left: 2px solid transparent; color: var(--muted); font-size: 15px; line-height: 1.35; text-decoration: none; transition: color 0.2s, border-color 0.2s, padding-left 0.3s var(--ease); }
.toc a:hover { color: var(--fg); }
.toc a.active { color: var(--fg); font-weight: 600; border-left-color: var(--accent); padding-left: 18px; }
.prose h2 { font-size: 26px; margin-top: 44px; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin-top: 12px; }
.prose ul, .prose ol { margin: 12px 0 0; padding-left: 22px; display: grid; gap: 8px; }
.prose li::marker { color: var(--accent); }
.note { margin-top: 20px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.note p:first-child { margin-top: 0; }
.email { font-weight: 700; font-size: 20px; overflow-wrap: anywhere; }

/* Footer */
.site-footer { margin-top: 88px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; padding-block: 28px 40px; }
.site-footer .wrap { display: grid; gap: 10px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.site-footer a:hover { color: var(--fg); text-decoration: underline; }
.doc + .site-footer, main:has(.doc) + .site-footer { margin-top: 0; }

@keyframes rise { to { transform: none; } }
@keyframes fadeup { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes cardin { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 14px; } }
@keyframes spin { to { rotate: 360deg; } }
@keyframes ping { 0% { transform: scale(1); opacity: 0.9; } 80%, 100% { transform: scale(3); opacity: 0; } }
@keyframes slide { to { transform: translateX(-50%); } }
@keyframes toggle-bg { 0%, 30% { background: var(--line); } 38%, 88% { background: var(--accent); } 96%, 100% { background: var(--line); } }
@keyframes toggle-knob { 0%, 30% { translate: 0 0; } 38%, 88% { translate: 16px 0; } 96%, 100% { translate: 0 0; } }
@keyframes grow { 0%, 12% { transform: scaleY(0.15); } 34%, 86% { transform: scaleY(1); } 100% { transform: scaleY(0.15); } }
@keyframes fill { 0%, 10% { transform: scaleX(0.08); } 60%, 88% { transform: scaleX(0.86); } 100% { transform: scaleX(0.08); } }
@keyframes press { 0%, 86%, 100% { scale: 1; } 91% { scale: 0.95; } 96% { scale: 1; } }

/* People who ask for less motion get a still page. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .line > span { transform: none; }
  .fade, .d-card, .d-button { opacity: 1; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .ticker-track { width: auto; flex-wrap: wrap; }
  .ticker ul { flex-wrap: wrap; }
  .ticker ul[aria-hidden="true"] { display: none; }
  .status i::after { display: none; }
  @view-transition { navigation: none; }
}
