/* White and grey only. Colour comes from the screenshots. */
:root {
  --white: #fff;
  --grey-50: #fafafa;
  --grey-200: #e4e4e7;
  --grey-400: #a1a1aa;
  --grey-600: #52525b;
  --grey-900: #18181b;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--white); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--grey-900); font: 400 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2 { margin: 0; font-weight: 650; letter-spacing: -0.025em; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(32px, 5.5vw, 50px); }
h2 { font-size: clamp(22px, 3vw, 28px); }
p { margin: 14px 0 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--grey-900); outline-offset: 3px; }

/* Background: a fine grid and a slow sweep of light. CSS only; just transform moves. */
.background { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; contain: strict; }
.background::before { content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--grey-200) 1px, transparent 1px), linear-gradient(90deg, var(--grey-200) 1px, transparent 1px);
  background-size: 56px 56px; background-position: center top;
  -webkit-mask-image: radial-gradient(140% 90% at 50% 0%, #000 20%, rgba(0, 0, 0, .35) 75%); mask-image: radial-gradient(140% 90% at 50% 0%, #000 20%, rgba(0, 0, 0, .35) 75%); }
.background::after { content: ""; position: absolute; top: -20%; bottom: -20%; left: 0; width: 55vw; min-width: 320px;
  background: linear-gradient(90deg, transparent, rgba(161, 161, 170, .13) 30%, rgba(255, 255, 255, .95) 50%, rgba(161, 161, 170, .13) 70%, transparent);
  transform: translateX(-120%) skewX(-18deg); animation: sweep 8s ease-in-out infinite; will-change: transform; }
@keyframes sweep { 0% { transform: translateX(-120%) skewX(-18deg); } 65%, 100% { transform: translateX(240vw) skewX(-18deg); } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .background::after { display: none; } }

.narrow { max-width: 712px; margin: 0 auto; padding: 0 20px; }
.wide { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
section[id] { scroll-margin-top: 76px; }

.nav, footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.nav { position: sticky; top: 0; z-index: 2; height: 64px; font-size: 14px; }
.nav::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 50vw); right: calc(50% - 50vw); z-index: -1; background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--grey-200); }
.brand { font-weight: 650; text-decoration: none; }
.nav nav { display: flex; align-items: center; gap: 20px; }
.nav nav a:not(.btn) { color: var(--grey-600); text-decoration: none; }
footer { margin-top: 96px; padding-block: 28px; border-top: 1px solid var(--grey-200); color: var(--grey-600); font-size: 14px; }
footer a { margin-left: 18px; }

.btn { display: inline-block; border: 0; border-radius: 10px; padding: 12px 24px; background: var(--grey-900); color: var(--white); font: 550 15px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; text-decoration: none; cursor: pointer; transition: background .15s; }
.btn:hover { background: var(--grey-600); }
.btn:disabled { background: var(--grey-400); cursor: wait; }
.btn-small { padding: 9px 14px; font-size: 13px; }

/* Home */
.intro { padding-top: 48px; text-align: center; }
.avatar { width: 144px; height: 144px; margin: 0 auto 22px; border: 1px solid var(--grey-200); border-radius: 50%; background: var(--white); }
.role { margin-top: 10px; color: var(--grey-600); font-weight: 550; }
.lead { color: var(--grey-600); font-size: 19px; }
#message { margin-top: 40px; }
.box { padding: 28px; border: 1px solid var(--grey-200); border-radius: 16px; background: var(--white); box-shadow: 0 24px 48px -32px rgba(24, 24, 27, .25); }
.box label { display: block; margin-top: 16px; color: var(--grey-600); font-size: 14px; font-weight: 550; }
.box input, .box textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 13px; border: 1px solid var(--grey-200); border-radius: 10px; background: var(--grey-50); color: var(--grey-900); font: 400 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.box input:focus, .box textarea:focus { border-color: var(--grey-900); background: var(--white); outline: none; }
.box textarea { resize: vertical; }
.box .btn { width: 100%; margin-top: 20px; }
.box .trap { position: absolute; left: -9999px; }
#form-status:empty { display: none; }
#form-status { font-size: 15px; font-weight: 550; }

#stories { margin-top: 80px; }
.stories { display: grid; gap: 14px; margin-top: 20px; }
.stories a { display: grid; grid-template-columns: 180px 1fr; gap: 22px; align-items: center; padding: 14px; border: 1px solid var(--grey-200); border-radius: 16px; background: var(--white); text-decoration: none; transition: border-color .15s, transform .15s; }
.stories a:hover { border-color: var(--grey-900); transform: translateY(-2px); }
.stories strong { display: block; font-size: 19px; font-weight: 650; letter-spacing: -0.015em; line-height: 1.3; }
.stories a > span > span { display: block; margin-top: 4px; color: var(--grey-600); font-size: 15px; line-height: 1.5; }
.thumb { aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--grey-200); border-radius: 10px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }

/* Story pages */
.story-head { padding-top: 56px; }
.story-head h1, .story-head .lead { max-width: 820px; }
.meta { margin: 0 0 14px; color: var(--grey-600); font-size: 14px; }
.stack, .note { max-width: 820px; color: var(--grey-600); font-size: 14px; }
.numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 28px; }
.numbers li { padding: 18px; border: 1px solid var(--grey-200); border-radius: 14px; background: var(--white); }
.numbers strong { display: block; font-size: 30px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.1; }
.numbers span { display: block; margin-top: 6px; color: var(--grey-600); font-size: 13px; line-height: 1.45; }

/* One chapter: screenshots on the left, bullet points on the right */
.chapter { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 48px; align-items: start; max-width: 1160px; margin: 72px auto 0; padding: 72px 20px 0; border-top: 1px solid var(--grey-200); content-visibility: auto; contain-intrinsic-size: auto 600px; }
.text { position: sticky; top: 96px; }
.step { margin: 0 0 8px; color: var(--grey-400); font-size: 14px; font-weight: 650; }
.text ul { margin-top: 18px; }
.text li { position: relative; margin-top: 12px; padding-left: 20px; color: var(--grey-600); }
.text li::before { content: ""; position: absolute; left: 0; top: .66em; width: 7px; height: 7px; border-radius: 2px; background: var(--grey-900); }
.text b { color: var(--grey-900); font-weight: 650; }
.shots { display: grid; gap: 28px; }
figure { margin: 0; }
figure a { display: block; padding: 8px; border: 1px solid var(--grey-200); border-radius: 14px; background: var(--white); }
figure img { width: 100%; border-radius: 8px; }
figcaption { margin-top: 8px; color: var(--grey-600); font-size: 14px; }
.end { margin-top: 112px; text-align: center; }
.end .btn { margin-top: 6px; }
.next { color: var(--grey-600); font-size: 15px; }

@media (max-width: 860px) {
  .chapter { grid-template-columns: 1fr; gap: 24px; margin-top: 48px; padding-top: 48px; }
  .text { position: static; order: -1; }   /* on phones: words first, then pictures */
}
@media (max-width: 520px) {
  .nav nav a:not(.btn) { display: none; }
  .stories a { grid-template-columns: 96px 1fr; gap: 14px; padding: 10px; }
  .box { padding: 20px; }
}
