@font-face { font-family: 'DM Sans'; src: url('fonts/dm-sans.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'DM Serif Text'; src: url('fonts/dm-serif-text.woff2') format('woff2'); font-display: swap; }

:root {
  --ink: #2b2b2b; --ink-soft: #5b5f66; --accent: #004b87; --navy: #0b2a4a;
  --paper: #ffffff; --tint: #f4f1ec; --line: #e4e2dd;
  --measure: 820px; --wide: 1240px; --gutter: clamp(20px, 5vw, 48px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.65 'Lato', system-ui, sans-serif; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { font-family: 'Mulish', system-ui, sans-serif; font-weight: 400; color: var(--navy); line-height: 1.12; margin: 0; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: var(--wide); margin: 0 auto; padding: 14px var(--gutter); display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 16px; }
.top a { text-decoration: none; color: var(--ink); }
.top .brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.top .brand span { font-family: 'Mulish', system-ui, sans-serif; font-size: 20px; }
.top .brand small { font-size: 15px; color: var(--ink-soft); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 20; background: #fff; padding: 8px 14px; }
.skip:focus { left: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.top .back { color: var(--accent); }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; background: var(--accent); width: 0; }

/* Intro */
.intro { max-width: var(--wide); margin: 0 auto; padding: clamp(48px, 9vw, 110px) var(--gutter) 40px; }
.eyebrow { font-size: 15px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 18px; }
.intro h1 { font-size: clamp(40px, 6.4vw, 78px); max-width: 24ch; }
.intro .lede { font-size: clamp(19px, 2.1vw, 23px); color: var(--ink-soft); max-width: 40ch; margin: 24px 0 0; }
.meta { display: flex; flex-wrap: wrap; gap: 10px 40px; margin: 34px 0 0; font-size: 16px; color: var(--ink-soft); }
.meta dt { color: var(--ink); font-weight: 600; }
.meta dd { margin: 0; }

/* Two crafts */
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 44px; max-width: 980px; }
.role { border-radius: 16px; padding: 26px 28px 24px; }
.role-pd { background: var(--tint); }
.role-ds { background: var(--navy); color: #e8eef5; }
.role-label { margin: 0 0 12px; font-family: 'Mulish', system-ui, sans-serif; font-size: 27px; line-height: 1.1; color: var(--navy); }
.role-ds .role-label { color: #fff; }
.role ul { margin: 0; padding: 0; list-style: none; font-size: 16px; line-height: 1.5; }
.role li { padding: 7px 0 7px 22px; position: relative; border-top: 1px solid rgba(0,0,0,.08); }
.role-ds li { border-top-color: rgba(255,255,255,.14); }
.role li::before { content: ''; position: absolute; left: 0; top: 15px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.role-ds li::before { background: #7fb2e5; }

/* Discipline tags on each chapter */
.chapter-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.chapter-head .num { margin: 0; }
.tags { display: flex; gap: 8px; }
.tag { font-size: 13px; font-weight: 600; letter-spacing: .02em; padding: 3px 10px; border-radius: 999px; line-height: 1.5; }
.tag-pd { background: var(--tint); color: #6b4f1d; box-shadow: inset 0 0 0 1px #e2d6c1; }
.tag-ds { background: #e3edf7; color: var(--accent); box-shadow: inset 0 0 0 1px #c5d8ec; }

/* Images */
.bleed { margin: 0; }
.bleed img { width: 100%; }
.wide { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.wide img, .detail img { border-radius: 14px; box-shadow: 0 0 0 1px var(--line); }
figure { margin: 0; }
figcaption { font-size: 16px; color: var(--ink-soft); margin-top: 12px; max-width: var(--measure); }
.zoom { cursor: zoom-in; }

/* Numbers */
.stats { max-width: var(--wide); margin: 0 auto; padding: 56px var(--gutter); display: grid; grid-template-columns: repeat(6, 1fr); gap: 24px; }
.stat { border-top: 2px solid var(--navy); padding-top: 14px; }
.stat b { display: block; font-family: 'Mulish', system-ui, sans-serif; font-weight: 400; font-size: clamp(38px, 4.6vw, 58px); line-height: 1; color: var(--navy); }
.stat span { display: block; font-size: 16px; color: var(--ink-soft); margin-top: 10px; line-height: 1.4; }

/* Video */
.film { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter) 24px; }
.film video { width: 100%; border-radius: 14px; background: var(--navy); }

/* Chapters */
.chapter { padding: clamp(80px, 11vw, 150px) 0 0; }
.chapter.text-only { padding-top: clamp(48px, 6vw, 72px); }
.chapter.text-only .text { padding-bottom: 0; }
.chapter.text-only + .chapter:not(.text-only) { padding-top: clamp(64px, 8vw, 100px); }
.intro-p { font-size: 18px; color: var(--ink); max-width: 72ch; margin: 22px 0 0; }
.text { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter) 44px; }
.num { font-size: 15px; font-weight: 700; letter-spacing: .08em; color: var(--accent); text-transform: uppercase; }
.text h2 { font-size: clamp(32px, 4vw, 46px); margin: 12px 0 22px; }
.text p { margin: 0 0 18px; }
.pull { font-family: 'Mulish', system-ui, sans-serif; font-size: clamp(24px, 2.8vw, 31px); line-height: 1.3; color: var(--navy); border-left: 3px solid var(--accent); padding-left: 22px; margin: 30px 0 8px; }
.detail { max-width: var(--wide); margin: 32px auto 0; padding: 0 var(--gutter); }

/* The loop */
.loop { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.loop ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; counter-reset: s; }
.loop li { counter-increment: s; background: var(--tint); border-radius: 14px; padding: 22px 20px 24px; position: relative; font-size: 17px; line-height: 1.4; }
.loop li::before { content: counter(s); display: block; font-family: 'Mulish', system-ui, sans-serif; font-size: 30px; color: var(--accent); margin-bottom: 8px; }
.loop li:not(:last-child)::after { content: ''; position: absolute; right: -12px; top: 50%; width: 10px; height: 10px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); transform: translateY(-50%) rotate(45deg); }
.loop li:last-child { background: var(--navy); color: #fff; }
.loop li:last-child::before { color: #9cc3ea; }
.loop li em { display: block; font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; }
.loop li:last-child em { color: #9cc3ea; }
.loop .back-arrow { margin-top: 14px; font-size: 16px; color: var(--ink-soft); text-align: right; }

/* Learned */
.learned { background: var(--tint); margin-top: clamp(64px, 9vw, 120px); padding: clamp(56px, 8vw, 100px) 0; }
.learned .text { padding-bottom: 0; }
.learned + .bleed { margin-top: clamp(56px, 8vw, 100px); }

/* Footer */
.foot { max-width: var(--wide); margin: 0 auto; padding: 64px var(--gutter) 80px; }
.foot-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; padding-bottom: 36px; border-bottom: 1px solid var(--line); }
.foot-title { margin: 0; font-family: 'Mulish', system-ui, sans-serif; font-size: clamp(26px, 3vw, 36px); line-height: 1.2; color: var(--navy); max-width: 22ch; }
.button { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; padding: 14px 26px; border-radius: 999px; }
.button:hover { background: var(--navy); }
.button-ext { display: inline-flex; align-items: center; gap: 12px; border-radius: 8px; padding: 15px 24px; font-size: 18px; }
.button-ext svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 26px !important; }
.cta-note { font-size: 15px; color: var(--ink-soft); }
.foot-links { display: flex; flex-wrap: wrap; gap: 14px 32px; padding-top: 28px; border-top: 1px solid var(--line); font-size: 18px; }

/* Boards: the images from smart.paultinker.uk, rebuilt as live text and screens */
.board { width: calc(100% - 2 * var(--gutter)); max-width: calc(var(--wide) - 2 * var(--gutter)); margin: 44px auto 0; padding: clamp(28px, 4vw, 52px) clamp(20px, 4vw, 52px); border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.board-eyebrow { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.board-title { margin: 10px 0 0; font-family: 'Mulish', system-ui, sans-serif; font-weight: 400; font-size: clamp(26px, 3vw, 36px); line-height: 1.15; color: var(--navy); }
.board-sub { margin: 14px 0 0; max-width: 46rem; font-size: 18px; color: var(--ink-soft); }
.board h4 { margin: 0 0 10px; font-family: 'Lato', system-ui, sans-serif; font-weight: 600; font-size: 17px; color: var(--navy); }
.board figure { margin: 0; }
.board img { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: 0 14px 30px -18px rgba(10,30,60,.45), 0 0 0 1px rgba(10,30,60,.06); }
.board figcaption { margin-top: 12px; font-size: 15px; line-height: 1.45; color: var(--ink-soft); }
.brand-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px 48px; margin-top: 36px; }
.brand-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.brand-pair figcaption { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.screen-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 36px 22px; margin-top: 36px; }
.screen-grid h4 { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen-grid img { aspect-ratio: 390 / 600; object-fit: cover; object-position: top; }
.roles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 36px; }
.browser { border-radius: 12px; overflow: hidden; box-shadow: 0 14px 30px -18px rgba(10,30,60,.45), 0 0 0 1px rgba(10,30,60,.08); }
.browser img { border-radius: 0; box-shadow: none; }
.text-follow { padding-top: clamp(48px, 6vw, 72px); padding-bottom: 0; }

/* Brands carousel: one slide all light, one all dark */
.carousel-brands .carousel-track { background: transparent; align-items: stretch; }
.carousel-brands .carousel-track .slide { padding: 34px 40px 44px; background: #e8edf3; }
.carousel-brands .carousel-track .slide-dark { background: #0f1724; }
.brands-mode { margin: 0 0 22px; font-size: 14px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.slide-dark .brands-mode, .slide-dark .brand-row figcaption { color: #dbe3ec; }
.slide-dark .brand-row img { border-color: #3a4250; }
.slide-media.brand-row { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(14px, 3vw, 36px); }
.brand-row figure { margin: 0; text-align: center; }
.brand-row img { display: block; width: 100%; height: auto; border: .35rem solid #1c1917; border-radius: 1.4rem; background: #fff; }
.brand-row figcaption { margin-top: 14px; font-size: 16px; font-weight: 600; color: var(--ink); }

/* Before and after */
.carousel-ba .carousel-track { background: #eef2f7; align-items: stretch; }
.carousel-ba .carousel-track .slide { padding: 34px 40px 36px; gap: 26px; }
.slide-media.ba { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.ba figure { margin: 0; }
.ba figcaption { margin: 0 0 10px; font-size: 14px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.ba img { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid #d4d4d4; background: #fff; }
.carousel-ba .slide-caption { padding: 0; font-size: 17px; max-width: 46rem; }
.carousel-ba .slide-caption strong { font-family: 'Mulish', system-ui, sans-serif; font-weight: 400; font-size: 26px; color: var(--navy); margin-bottom: 6px; }
.rebuild-note { max-width: var(--wide); margin: 12px auto 0; padding: 0 var(--gutter); font-size: 14px; color: var(--ink-soft); }

/* English and Arabic pair carousel: two phones at real size */
.board-head { max-width: var(--wide); margin: 56px auto 0; padding: 0 var(--gutter); }
.carousel-pair .carousel-track { background: transparent; align-items: stretch; }
.carousel-pair .carousel-track .slide { flex-direction: row; align-items: center; justify-content: center; gap: clamp(28px, 5vw, 64px); padding: 40px; }
.slide-media.pair { flex: 0 0 auto; display: flex; flex-direction: row; gap: 28px; }
.pair figure { margin: 0; text-align: center; }
.pair img { width: 15rem; border: .4rem solid #1c1917; border-radius: 1.5rem; background: #fff; box-shadow: 0 24px 50px -24px rgba(10,30,60,.45); }
.pair figcaption { margin-top: 12px; font-size: 15px; font-weight: 600; color: var(--ink-soft); }
.carousel-pair .slide-caption { flex: 0 1 20rem; padding: 0; font-size: 18px; }
.carousel-pair .slide-caption strong { font-family: 'Mulish', system-ui, sans-serif; font-weight: 400; font-size: 30px; line-height: 1.15; margin-bottom: 12px; color: var(--navy); }

/* Docs carousel: one docs page per slide, with the AI log's arrows and counter underneath */
.carousel-docs { max-width: 1080px; }
.carousel-docs .carousel-track { background: #fff; border: 1px solid #d4d4d4; }
.carousel-docs .slide-media img { width: 100%; height: auto; }

/* App tabs: one carousel per app */
.app-tabs { max-width: var(--wide); margin: 44px auto 0; padding: 0 var(--gutter); }
.tablist { display: inline-flex; gap: 4px; padding: 5px; border-radius: 999px; background: #f1f1f1; margin-bottom: 16px; }
.tablist button { font: inherit; font-size: 17px; font-weight: 600; color: var(--ink-soft); background: transparent; border: 0; border-radius: 999px; padding: 10px 24px; cursor: pointer; }
.tablist button[aria-selected="true"] { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.app-tabs .carousel { margin-top: 0; padding: 0; }

/* Carousels: as on ai.paultinker.uk. One image at a time; swipe, arrows or arrow keys. */
.carousel { max-width: var(--wide); margin: 40px auto 0; padding: 0 var(--gutter); }
.carousel-heading { margin: 0 0 10px; font-size: 15px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.carousel-track { display: flex; align-items: center; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain; scrollbar-width: none; border-radius: 14px; background: #f6f6f6; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track .slide { flex: 0 0 100%; scroll-snap-align: center; align-self: stretch; display: flex; flex-direction: column; background: var(--slide-bg, transparent); }
.slide-media { flex: 1; display: block; }
.slide-caption { padding: 16px 20px 20px; font-size: 16px; line-height: 1.5; }
.slide-caption strong { display: block; margin-bottom: 4px; font-size: 17px; color: #000; }
.slide-caption span { display: block; }
.carousel-screens .carousel-track { background: transparent; align-items: stretch; }
.carousel-screens .slide { flex-direction: row; align-items: center; justify-content: center; gap: clamp(32px, 6vw, 80px); padding: 40px; min-height: 34rem; }
.carousel-screens .slide-media { flex: 0 0 auto; }
.carousel-screens .slide-media img { width: 15rem; border: .4rem solid #1c1917; border-radius: 1.5rem; background: #fff; box-shadow: 0 24px 50px -24px rgba(10,30,60,.45); }
.carousel-screens .slide-caption { flex: 0 1 26rem; padding: 0; font-size: 18px; }
.carousel-screens .slide-caption strong { font-family: 'Mulish', system-ui, sans-serif; font-weight: 400; font-size: 30px; line-height: 1.15; margin-bottom: 12px; color: var(--navy); }
.carousel-steps { max-width: 1080px; }
/* Laptop: a screen-only laptop shape (bezel, camera, a thin hinge; no keyboard) */
.carousel-laptop .carousel-track { background: transparent; align-items: stretch; }
.carousel-laptop .slide { flex-direction: row; align-items: center; justify-content: center; gap: clamp(28px, 4vw, 56px); padding: 44px 40px; min-height: 34rem; }
.carousel-laptop .slide-media { flex: 0 1 640px; min-width: 0; }
.laptop { position: relative; padding: 18px 18px 22px; border-radius: 20px 20px 10px 10px; background: #1c1f24; box-shadow: 0 0 0 1.5px #3a3e45 inset, 0 30px 60px -26px rgba(10,30,60,.5); }
.laptop::before { content: ''; position: absolute; top: 7px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #3d434b; }
.laptop::after { content: ''; position: absolute; left: -4%; right: -4%; bottom: -12px; height: 12px; border-radius: 0 0 14px 14px; background: linear-gradient(#c9ced5, #9aa1aa); }
.laptop img { display: block; width: 100%; border-radius: 3px; background: #fff; }
.carousel-laptop .slide-caption { flex: 0 1 22rem; padding: 0; font-size: 18px; }
.carousel-laptop .slide-caption strong { font-family: 'Mulish', system-ui, sans-serif; font-weight: 400; font-size: 30px; line-height: 1.15; margin-bottom: 12px; color: var(--navy); }
.carousel-bordered .carousel-track { background: transparent; box-shadow: inset 0 0 0 1px #dcdcdc; }
.carousel-steps .slide-media img { border-radius: 14px 14px 0 0; }
.carousel-steps .slide-caption { background: #fff; border-top: 1px solid #e3e3e3; border-radius: 0 0 14px 14px; }
.carousel-steps .slide-caption strong { font-family: 'Mulish', system-ui, sans-serif; font-weight: 400; font-size: 22px; color: var(--navy); }
.carousel-controls { display: none; }
.js .carousel-controls { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 12px; font-size: 16px; color: var(--ink-soft); }
.carousel-controls button { width: 2.5rem; height: 2.5rem; border: 1px solid #b8b8b8; border-radius: 50%; background: #fff; color: #000; font: inherit; font-size: 18px; line-height: 1; cursor: pointer; }
.carousel-controls button:hover:not(:disabled) { border-color: #000; }
.carousel-controls button:disabled { opacity: .35; cursor: default; }
.carousel-count { min-width: 3.5rem; text-align: center; font-variant-numeric: tabular-nums; }
.film .carousel-heading { margin-bottom: 12px; }

/* Full-size view; inside a carousel, arrows step through its images */
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 24px 24px 84px; border: 0; background: rgba(8,18,32,.95); cursor: zoom-out; }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: transparent; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 8px; }
.lightbox-nav { position: fixed; left: 0; right: 0; bottom: 20px; display: flex; justify-content: center; align-items: center; gap: 16px; color: #fff; font-size: 16px; cursor: default; }
.lightbox-nav button { width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 1px solid rgba(255,255,255,.4); background: transparent; color: #fff; font: inherit; font-size: 20px; cursor: pointer; }
.lightbox-nav button:disabled { opacity: .3; cursor: default; }

/* Reveal */
.rv { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

@media (max-width: 900px) {
  .brand-grid { grid-template-columns: 1fr; }
  .screen-grid { grid-template-columns: repeat(3, 1fr); }
  .roles-grid { grid-template-columns: 1fr; }
  .roles { grid-template-columns: 1fr; }
  .carousel-screens .slide { flex-direction: column; gap: 20px; padding: 24px; min-height: 0; }
  .carousel-screens .slide-media img { width: 12.5rem; }
  .carousel-screens .slide-caption { flex: none; text-align: center; }
  .carousel-pair .carousel-track .slide { flex-direction: column; gap: 22px; padding: 24px 16px; }
  .slide-media.pair { gap: 14px; }
  .slide-media.ba { grid-template-columns: 1fr; gap: 18px; }
  .carousel-ba .carousel-track .slide { padding: 20px 16px 24px; }
  .slide-media.brand-row { grid-template-columns: repeat(2, 1fr); gap: 22px 14px; }
  .carousel-brands .carousel-track .slide { padding: 22px 16px 28px; }
  .pair img { width: min(9.5rem, 40vw); border-width: .3rem; border-radius: 1.1rem; }
  .carousel-pair .slide-caption { flex: none; text-align: center; }
  .carousel-laptop .slide { flex-direction: column; gap: 28px; padding: 24px 20px 28px; min-height: 0; }
  .carousel-laptop .slide-media { flex: none; width: 100%; }
  .laptop { padding: 10px 10px 13px; border-radius: 12px 12px 6px 6px; }
  .laptop::before { top: 3px; width: 4px; height: 4px; margin-left: -2px; }
  .laptop::after { bottom: -8px; height: 8px; }
  .carousel-laptop .slide-caption { flex: none; text-align: center; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .loop ol { grid-template-columns: 1fr; }
  .loop li:not(:last-child)::after { right: 50%; top: auto; bottom: -11px; transform: translateX(50%) rotate(135deg); }
  .meta { gap: 14px 24px; }
}
@media (max-width: 600px) {
  .screen-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 16px; }
  body { font-size: 17px; }
  .top .brand span { font-size: 18px; }
  .top .brand { flex-direction: column; gap: 0; }
  .top .brand small { font-size: 13px; }
  .wide img, .detail img, .film video { border-radius: 10px; }
}

/* Type scale: one size per role, used everywhere on the page.
   h1 / h2 section heading / h3 sub-heading and slide titles / lede / body / small / label */
:root { --fs-h1: clamp(40px, 6.4vw, 78px); --fs-h2: clamp(32px, 4vw, 46px); --fs-h3: clamp(24px, 2.6vw, 30px);
  --fs-lede: clamp(19px, 2.1vw, 23px); --fs-body: 18px; --fs-small: 16px; --fs-label: 14px; }
@media (max-width: 600px) { :root { --fs-body: 17px; --fs-small: 15px; } }
.intro h1 { font-size: var(--fs-h1); }
.text h2, .learned h2 { font-size: var(--fs-h2); }
.board-title, .role-label, .pull, .foot-title,
.slide-caption strong, .carousel-screens .slide-caption strong, .carousel-laptop .slide-caption strong,
.carousel-pair .slide-caption strong, .carousel-ba .slide-caption strong, .carousel-steps .slide-caption strong { font-size: var(--fs-h3); line-height: 1.15; }
.intro .lede { font-size: var(--fs-lede); }
body, .intro-p, .text p, .board-sub, .button-ext, .foot-links,
.slide-caption, .carousel-screens .slide-caption, .carousel-laptop .slide-caption, .carousel-pair .slide-caption, .carousel-ba .slide-caption { font-size: var(--fs-body); }
.board-sub { color: var(--ink); }
.meta, .role ul, figcaption, .stat span, .board figcaption, .board h4, .screen-grid h4, .brand-row figcaption, .pair figcaption,
.tablist button, .cta-note, .rebuild-note, .loop li, .loop .back-arrow, .js .carousel-controls, .lightbox-nav, .top-in { font-size: var(--fs-small); }
.eyebrow, .num, .board-eyebrow, .carousel-heading, .ba figcaption, .brands-mode, .brand-pair figcaption, .loop li em, .tag { font-size: var(--fs-label); letter-spacing: .08em; }

/* Before and after: both pictures the same height; the older, shorter screens are extended at the bottom (not scaled). */
.ba img { aspect-ratio: 1440 / 900; object-fit: cover; object-position: center top; background: #f3f4f6; }

/* Intro: the subtitle and the paragraph under it share one width. */
.intro .lede, .intro-p { max-width: 980px; }

/* 12-column body: the intro text spans 10 columns, the two craft panels 6 each. */
.intro .lede, .intro-p { max-width: calc((100% + 24px) * 10 / 12 - 24px); }
.roles { max-width: none; gap: 24px; }

/* Smart's own type: Mulish for headings (heavy, tight), Lato for text. */
h1, h2, h3, .role-label, .board-title, .stat b, .pull, .foot-title, .top .brand span, .loop li::before,
.slide-caption strong, .carousel-screens .slide-caption strong, .carousel-laptop .slide-caption strong,
.carousel-pair .slide-caption strong, .carousel-ba .slide-caption strong, .carousel-steps .slide-caption strong {
  font-family: 'Mulish', system-ui, sans-serif; font-weight: 800; letter-spacing: -0.015em; }
.intro h1 { letter-spacing: -0.025em; }
.top .brand span { font-weight: 800; letter-spacing: 0; }
.board h4, .brand-row figcaption, .pair figcaption { font-family: 'Mulish', system-ui, sans-serif; font-weight: 700; }
.meta { max-width: calc((100% + 24px) * 10 / 12 - 24px); }

/* Four numbers in a row; on phones, intro text and details use the full width like every other text block. */
.stats { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .intro .lede, .intro-p, .meta { max-width: none; }
}

/* Balanced headings: no single word left on its own line. */
h1, h2, h3 { text-wrap: balance; }
p, li, figcaption { text-wrap: pretty; }

/* Top bar keeps Paul's own site type: DM Serif Text name, DM Sans links. */
.top-in, .top-in a, .top .brand small { font-family: 'DM Sans', system-ui, sans-serif; }
.top .brand span { font-family: 'DM Serif Text', Georgia, serif; font-weight: 400; letter-spacing: 0; }

/* No shadows on device frames or screenshots. */
.carousel-screens .slide-media img, .pair img, .brand-row img, .board img, .browser, .laptop { box-shadow: none !important; }
.laptop { box-shadow: 0 0 0 1.5px #3a3e45 inset !important; }

/* Captions under full-bleed images sit on the 12-column grid, with the page's side spacing on phones. */
.bleed figcaption { max-width: var(--wide); margin: 12px auto 0; padding: 0 var(--gutter); }
.carousel-brands .carousel-track .slide:not(.slide-dark), .carousel-ba .carousel-track { background: #d9e6f2; }
/* One size for all running text in the intro: bullets and the Role/When/Products line match the body. */
.meta, .role ul { font-size: var(--fs-body); }
.role li::before { top: 16px; }
h1[tabindex="-1"]:focus { outline: none; }
/* One gap before every section heading, whatever the section above ends with (text, a button, a carousel or a video). */
:root { --section-gap: clamp(88px, 10vw, 136px); }
.chapter, .chapter.text-only, .chapter.text-only + .chapter:not(.text-only) { padding-top: var(--section-gap); }
.chapter > :last-child { padding-bottom: 0 !important; margin-bottom: 0 !important; }
.chapter > .text:last-child > :last-child, .chapter > .text-follow:last-child > :last-child { margin-bottom: 0 !important; }
.learned { margin-top: var(--section-gap); }
.stats + .chapter { padding-top: 72px; }
/* Top bar link underlined, like the footer links. */
.top .back { text-decoration: underline; text-underline-offset: 3px; }
/* One gap between every block inside a section (text, button, image, carousel, video, diagram).
   A small label that introduces the block after it stays close to it. */
:root { --block-gap: clamp(40px, 5vw, 64px); }
.chapter > .text, .chapter > .text-follow { padding-top: 0 !important; padding-bottom: 0 !important; }
.chapter > * { margin-top: 0 !important; margin-bottom: 0 !important; }
.chapter > * + * { margin-top: var(--block-gap) !important; }
.chapter > .board-head + * { margin-top: 24px !important; }
.chapter > .text > :last-child, .chapter > .text-follow > :last-child { margin-bottom: 0 !important; }
