/*
 * The guide pages (engineering.html). Load tokens.css first: it carries the fonts, the Bell tokens and the
 * arrival motion this file builds on. The old landing's components are still here, and this page reuses many
 * of them (.btn, .nav, .section, .split, .card).
 */
.wrap {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 28px;
}

.skip {
    position: absolute;
    left: -9999px;
}

.skip:focus {
    left: 16px;
    top: 12px;
    z-index: 30;
    background: var(--card);
    padding: 8px 12px;
    border-radius: var(--r-sm);
}

/* ── Buttons ─────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--text);
    font: 500 15px var(--sans);
    cursor: pointer;
    transition:
        border-color 0.15s,
        background 0.15s,
        transform 0.15s;
}

.btn:hover {
    text-decoration: none;
    border-color: var(--muted);
    background: var(--card);
}

.btn:active {
    transform: translateY(1px);
}

/* The one live action takes the signal, as the app's send does. */
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.btn-primary:hover {
    background: color-mix(in oklab, var(--accent) 86%, white);
    border-color: color-mix(in oklab, var(--accent) 86%, white);
    color: var(--on-accent);
}

.btn-sm {
    height: 36px;
    padding: 0 14px;
    font-size: 14px;
}

.btn svg {
    width: 16px;
    height: 16px;
}

/* ── Navigation ──────────────────────────────────────────── */

.nav {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--line);
    backdrop-filter: saturate(1.6) blur(16px);
    -webkit-backdrop-filter: saturate(1.6) blur(16px);
}

.nav .wrap {
    display: flex;
    align-items: center;
    gap: 28px;
    height: 60px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: -0.01em;
}

.logo:hover {
    text-decoration: none;
}

.logo img {
    width: 26px;
    height: 26px;
    border-radius: var(--r);
}

.nav-links {
    display: flex;
    gap: 22px;
    margin-left: auto;
    font-size: 14px;
}

.nav-links a {
    color: var(--muted);
    white-space: nowrap;
    transition: color 0.15s;
}

.nav-links a:hover {
    color: var(--text);
    text-decoration: none;
}

.nav-sep {
    width: 1px;
    background: var(--line-strong);
    margin: 3px 0;
}

/* ── Hero ────────────────────────────────────────────────── */

.hero {
    position: relative;
    overflow: hidden;
}

.hero::before,
.page-head::before {
    content: "";
    position: absolute;
    inset: -20% -10% auto;
    height: 120%;
    background:
        radial-gradient(40% 45% at 72% 38%, var(--glow-1), transparent 70%),
        radial-gradient(35% 40% at 88% 70%, var(--glow-2), transparent 70%);
    pointer-events: none;
}

.hero .wrap {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 40px;
    align-items: center;
    padding-top: 80px;
    padding-bottom: 96px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    padding: 5px 14px 5px 5px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: color-mix(in srgb, var(--card) 70%, transparent);
    color: var(--body);
    font-size: 13.5px;
}

.badge:hover {
    text-decoration: none;
    color: var(--text);
    border-color: var(--muted);
}

.badge b {
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font: 600 12px var(--mono);
}

.hero h1 {
    font-size: clamp(44px, 5.4vw, 70px);
    line-height: 1.02;
    letter-spacing: -0.045em;
    font-weight: 600;
}

.hero h1 .pi {
    color: var(--brand);
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
    letter-spacing: 0;
}

.grad {
    color: var(--muted);
}

.lead {
    margin-top: 24px;
    max-width: 33em;
    font-size: clamp(17px, 1.6vw, 19px);
    line-height: 1.6;
    color: var(--body);
}

.cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

.install {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 480px;
    margin-top: 22px;
    padding: 6px 6px 6px 16px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: color-mix(in srgb, var(--code-bg) 80%, transparent);
    font-size: 13.5px;
}

.install .prompt {
    color: var(--muted);
    user-select: none;
    font-family: var(--mono);
}

.install code {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: none;
    padding: 0;
    font-size: 13px;
}

.copy {
    flex: none;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: var(--card);
    color: var(--body);
    font: 500 12.5px var(--sans);
    cursor: pointer;
}

.copy:hover {
    color: var(--text);
    border-color: var(--muted);
}

.copy.done {
    color: var(--ok);
}

.facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 26px;
    font-size: 13.5px;
    color: var(--muted);
}

.facts span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.facts span::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ok);
}

.hero-stage {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.hero-stage .phone.back {
    position: absolute;
    left: 50%;
    bottom: 34px;
    --w: 252px;
    transform: translateX(-100%);
}

.hero-stage .phone.front {
    --w: 300px;
    transform: translateX(20%);
}

/* ── Phones ──────────────────────────────────────────────── */

/*
 * Phones drawn to the proportions of real ones: an iPhone 16 Pro (402×874 points, a 2.6 mm bezel inside a titanium
 * band, the Dynamic Island) and a Pixel 9 Pro (412×915, an even bezel, a centered camera hole, buttons on the right).
 * --w sets the phone's width; everything else scales from it. The screenshots leave the top and bottom insets empty,
 * where the status bar, the camera, and the home bar are drawn.
 */
.phone {
    --w: 290px;
    --u: calc(var(--w) / 430);
    position: relative;
    width: var(--w);
    margin: 0;
    flex: none;
}

.phone-body {
    position: relative;
    padding: calc(14 * var(--u));
    border-radius: calc(78 * var(--u));
    background: #050506;
    box-shadow:
        0 0 0 calc(2.6 * var(--u)) #2b2c30,
        0 0 0 calc(3.6 * var(--u)) #6d6e74,
        0 0 0 calc(4.4 * var(--u)) #1c1c1f,
        0 calc(40 * var(--u)) calc(70 * var(--u)) calc(-16 * var(--u)) rgba(0, 0, 0, 0.5);
}

/* The titanium band catches the light along its top and sides. */
.phone-body::before {
    content: "";
    position: absolute;
    inset: calc(-4.4 * var(--u));
    border-radius: calc(82 * var(--u));
    background: linear-gradient(
        160deg,
        rgba(255, 255, 255, 0.35),
        transparent 22%,
        transparent 78%,
        rgba(255, 255, 255, 0.18)
    );
    mask:
        linear-gradient(#000 0 0) content-box exclude,
        linear-gradient(#000 0 0);
    padding: calc(1.6 * var(--u));
    pointer-events: none;
}

.phone-screen {
    position: relative;
    overflow: hidden;
    aspect-ratio: 402 / 874;
    border-radius: calc(64 * var(--u));
    background: #0a1014;
    container-type: inline-size;
}

.phone-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Side buttons: the iPhone's action button and volume on the left, power and Camera Control on the right. */
.phone .keys {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.phone .keys i {
    position: absolute;
    width: calc(4 * var(--u));
    border-radius: calc(2 * var(--u));
    background: linear-gradient(90deg, #2e3d45, #7e93a0 50%, #2e3d45);
}

.phone .keys i:nth-child(1) {
    left: calc(-7 * var(--u));
    top: 19%;
    height: 3.6%;
}

.phone .keys i:nth-child(2) {
    left: calc(-7 * var(--u));
    top: 25.5%;
    height: 7%;
}

.phone .keys i:nth-child(3) {
    left: calc(-7 * var(--u));
    top: 34%;
    height: 7%;
}

.phone .keys i:nth-child(4) {
    right: calc(-7 * var(--u));
    top: 28%;
    height: 10.5%;
}

.phone .keys i:nth-child(5) {
    right: calc(-6 * var(--u));
    top: 62%;
    height: 7.5%;
    width: calc(3 * var(--u));
    opacity: 0.7;
}

/* The status bar, the Dynamic Island, and the home bar, in the screen's own units. */
.status {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 14.2cqw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2cqw 8cqw 0 13cqw;
    color: #fff;
    font:
        600 4.2cqw/1 -apple-system,
        "SF Pro Text",
        var(--sans);
    letter-spacing: -0.01em;
    pointer-events: none;
}

.status .icons {
    display: flex;
    align-items: center;
    gap: 1.6cqw;
}

.status svg {
    height: 3cqw;
    width: auto;
}

.island {
    position: absolute;
    left: 50%;
    top: 2.7cqw;
    width: 31.3cqw;
    height: 9.2cqw;
    transform: translateX(-50%);
    border-radius: 999px;
    background: #000;
}

.island::after {
    content: "";
    position: absolute;
    right: 3.2cqw;
    top: 50%;
    width: 2.9cqw;
    height: 2.9cqw;
    border-radius: 50%;
    transform: translateY(-50%);
    background: radial-gradient(circle at 35% 35%, #2b3a5c, #0b0d14 60%);
}

.home-bar {
    position: absolute;
    left: 50%;
    bottom: 2cqw;
    width: 33.3cqw;
    height: 1.25cqw;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
}

/* The Pixel 9 Pro: flatter edges, a uniform bezel, a smaller corner, the camera in a hole, buttons on the right. */
.phone.pixel {
    --u: calc(var(--w) / 438);
}

.pixel .phone-body {
    padding: calc(13 * var(--u));
    border-radius: calc(58 * var(--u));
    background: #07070a;
    box-shadow:
        0 0 0 calc(3 * var(--u)) #1e1f23,
        0 0 0 calc(4 * var(--u)) #4c4d53,
        0 0 0 calc(5 * var(--u)) #17171a,
        0 calc(40 * var(--u)) calc(70 * var(--u)) calc(-16 * var(--u)) rgba(0, 0, 0, 0.5);
}

.pixel .phone-body::before {
    inset: calc(-5 * var(--u));
    border-radius: calc(63 * var(--u));
}

.pixel .phone-screen {
    aspect-ratio: 412 / 915;
    border-radius: calc(46 * var(--u));
}

.pixel .keys i:nth-child(1) {
    left: auto;
    right: calc(-7 * var(--u));
    top: 22%;
    height: 7%;
}

.pixel .keys i:nth-child(2) {
    left: auto;
    right: calc(-7 * var(--u));
    top: 33%;
    height: 13%;
}

.pixel .status {
    height: 12.6cqw;
    padding: 0.6cqw 6.5cqw 0 7cqw;
    font:
        500 3.7cqw/1 "Google Sans",
        Roboto,
        var(--sans);
    letter-spacing: 0.01em;
}

.pixel .status svg {
    height: 3.2cqw;
}

.camera {
    position: absolute;
    left: 50%;
    top: 3.4cqw;
    width: 6.4cqw;
    height: 6.4cqw;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle at 38% 38%, #24314e 0 18%, #08090d 46%, #000 70%);
    box-shadow: 0 0 0 0.5cqw #000;
}

.pixel .home-bar {
    bottom: 1.6cqw;
    width: 26cqw;
    height: 1cqw;
    background: rgba(255, 255, 255, 0.7);
}

/* ── A browser window ────────────────────────────────────── */

.window {
    margin: 0;
    border-radius: var(--r);
    background: #0c1319;
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.window-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: 42px;
    padding: 0 16px;
    background: #10181e;
    border-bottom: 1px solid var(--line);
}

.window-dots {
    display: flex;
    gap: 8px;
}

/* Etched steel, not traffic lights: on the bell, color marks a state, and a fake window has none. */
.window-dots i {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #33454f;
}

.window-url {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 280px;
    justify-content: center;
    padding: 4px 14px;
    border-radius: var(--r-sm);
    background: #0a1014;
    color: var(--body);
    font: 12.5px var(--mono);
}

.window-url svg {
    width: 11px;
    height: 11px;
}

.window img {
    width: 100%;
    height: auto;
}

/* ── Sections ────────────────────────────────────────────── */

.section {
    padding: 104px 0;
}

.section + .section {
    border-top: 1px solid var(--line);
}

.section.alt {
    background: var(--bg-2);
}

.kicker {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
}

.section h2,
.page-head h1 {
    font-size: clamp(32px, 4.2vw, 50px);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.section-head {
    max-width: 680px;
    margin-bottom: 56px;
}

.section-head.center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.section-head p,
.split-copy > p {
    margin-top: 18px;
    font-size: 17.5px;
    color: var(--body);
}

.split-copy > p + p {
    margin-top: 14px;
}

.split-copy > .note {
    margin-top: 28px;
    font-size: 14px;
    color: var(--muted);
}

/* A feature: words beside a phone or a picture. */

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 80px;
    align-items: center;
}

.split.flip .split-copy {
    order: 2;
}

.split .media {
    display: flex;
    justify-content: center;
    position: relative;
}

.split .media .phone {
    --w: 320px;
}

.points {
    list-style: none;
    margin: 32px 0 0;
    padding: 0;
    display: grid;
    gap: 18px;
}

.points li {
    position: relative;
    padding-left: 30px;
    font-size: 15.5px;
}

.points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.42em;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-soft)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2 7 10.6l4.6-5' fill='none' stroke='%237aa2f7' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
        center / 16px no-repeat;
}

.points b {
    color: var(--text);
    font-weight: 600;
}

/* Cards and grids. */

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.card {
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--card);
    transition:
        border-color 0.2s,
        transform 0.2s;
}

.card:hover {
    border-color: var(--line-strong);
}

.card h3 {
    font-size: 17px;
    margin-bottom: 8px;
    letter-spacing: -0.015em;
}

.card p {
    font-size: 14.5px;
    line-height: 1.6;
}

.icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: 20px;
    border-radius: var(--r);
    background: var(--accent-soft);
    color: var(--accent);
}

.icon svg {
    width: 20px;
    height: 20px;
}

.map .card > code,
.card > .label {
    display: inline-block;
    margin-bottom: 14px;
    padding: 3px 9px;
    border-radius: var(--r-sm);
    background: var(--card-2);
    color: var(--brand);
    font-size: 12.5px;
    font-family: var(--mono);
}

.map-head {
    margin: 72px 0 24px;
    font-size: 20px;
}

/* The three reasons, under the hero. */

.pillars {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 56px;
}

.pillar h3 {
    margin: 18px 0 10px;
    font-size: 20px;
    letter-spacing: -0.02em;
}

.pillar p {
    font-size: 15.5px;
}

/* Everything else: a dense grid of small tiles. */

.bento {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.bento .card {
    padding: 22px;
}

.bento .card.wide {
    grid-column: span 2;
}

.bento .icon {
    width: 36px;
    height: 36px;
    margin-bottom: 16px;
    border-radius: var(--r);
}

.bento .icon svg {
    width: 18px;
    height: 18px;
}

.bento .card h3 {
    font-size: 15.5px;
    margin-bottom: 6px;
}

.bento .card p {
    font-size: 14px;
    color: var(--muted);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 4px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    font-size: 13px;
    color: var(--body);
}

.note {
    margin-top: 36px;
    font-size: 14px;
    color: var(--muted);
}

/* Durable: a run's timeline. */

.panel {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--card);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    font: 12.5px var(--mono);
    color: var(--muted);
}

.panel-head b {
    color: var(--text);
    font-weight: 600;
}

.panel-head .right {
    margin-left: auto;
}

.timeline {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.timeline li {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 9px 20px;
    font: 13px var(--mono);
}

.timeline .mark {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(114, 230, 193, 0.12);
    color: var(--ok);
    font-size: 11px;
}

.timeline .what {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline .what em {
    font-style: normal;
    color: var(--muted);
}

.timeline .state {
    color: var(--muted);
    font-size: 12px;
}

.timeline .crash {
    background: var(--err-soft);
}

.timeline .crash .mark {
    background: rgba(255, 138, 155, 0.15);
    color: var(--err);
}

.timeline .crash .state {
    color: var(--err);
}

.timeline .resume .mark {
    background: var(--accent-soft);
    color: var(--accent);
}

.timeline .resume .state {
    color: var(--accent);
}

/* Live editing: three steps. */

.flow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.step {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--card);
}

.step code {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--brand);
    background: var(--card-2);
    font-size: 12.5px;
}

.step h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

.step p {
    font-size: 14.5px;
}

/* Access: five ways to connect. */

.access {
    display: grid;
    /* Five modes read as 3 + 2: wide enough for a code line and a sentence, and the narrower
       breakpoints below collapse to 2 and then 1. */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.mode {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--card);
}

.mode.featured {
    border-color: var(--accent-line);
    background: linear-gradient(180deg, var(--accent-soft), transparent 70%), var(--card);
}

.mode > code {
    display: inline-block;
    margin-bottom: 14px;
    background: var(--card-2);
    color: var(--brand);
    font-size: 12px;
}

.mode h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

.mode p {
    font-size: 14px;
    color: var(--muted);
}

/* Guard approval, as the app draws it. */

.approval {
    border: 1px solid var(--warn-line);
    border-radius: var(--r-lg);
    background: var(--warn-soft);
    padding: 20px 22px;
    box-shadow: var(--shadow);
}

.approval-head {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14.5px;
    color: var(--warn);
    font-weight: 600;
}

.approval-head svg {
    width: 17px;
    height: 17px;
    flex: none;
}

.approval-reason {
    margin-top: 8px;
    font-size: 14px;
}

.approval pre {
    margin: 14px 0 0;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    background: var(--code-bg);
    border: 1px solid var(--line);
    color: var(--ok);
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.approval-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.approval-actions .btn {
    height: 36px;
    padding: 0 18px;
    border-radius: var(--r-sm);
    font-size: 14px;
}

.btn-allow {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.btn-deny {
    background: var(--card);
}

.approval-actions small {
    margin-right: auto;
    font-size: 12.5px;
    color: var(--muted);
}

.callout {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    margin-top: 20px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--err-soft);
    font-size: 14.5px;
}

.callout > b {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 138, 155, 0.16);
    color: var(--err);
    font-size: 13px;
}

.callout p b {
    color: var(--text);
}

/* Get started */

.start {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 72px;
    align-items: start;
}

.steps {
    list-style: none;
    margin: 36px 0 0;
    padding: 0;
    counter-reset: step;
    display: grid;
    gap: 24px;
}

.steps li {
    counter-increment: step;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 16px;
    font-size: 15px;
}

.steps li::before {
    content: counter(step);
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

.steps b {
    color: var(--text);
    font-weight: 600;
}

.steps b:first-child {
    display: block;
    margin-bottom: 2px;
}

.term {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--code-bg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.term-tabs {
    display: flex;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid var(--line);
}

.term-tablist {
    display: flex;
    gap: 4px;
}

.term-tabs button[role="tab"] {
    padding: 7px 14px;
    border: 0;
    border-radius: var(--r-sm);
    background: none;
    color: var(--muted);
    font: 500 13.5px var(--sans);
    cursor: pointer;
}

.term-tabs button[role="tab"]:hover {
    color: var(--text);
}

.term-tabs button[aria-selected="true"] {
    color: var(--text);
    background: var(--card-2);
}

.term-tabs .copy {
    margin-left: auto;
}

.term pre {
    margin: 0;
    padding: 22px 24px;
    overflow-x: auto;
    font-size: 13.5px;
    line-height: 1.9;
    color: var(--text);
}

.term .c {
    color: var(--muted);
}

.term .p {
    color: var(--ok);
    user-select: none;
}

.term-foot {
    padding: 14px 24px;
    border-top: 1px solid var(--line);
    font-size: 13.5px;
    color: var(--muted);
}

/* The closing call, above the footer. */

.closing {
    text-align: center;
}

.closing h2 {
    margin-bottom: 14px;
}

.closing p {
    max-width: 34em;
    margin: 0 auto;
    font-size: 17.5px;
}

.closing .cta {
    justify-content: center;
}

/* ── Engineering page ────────────────────────────────────── */

.page-head {
    position: relative;
    overflow: hidden;
    padding: 104px 0 88px;
    border-bottom: 1px solid var(--line);
}

.page-head .wrap {
    position: relative;
}

.page-head h1 {
    margin: 0 0 22px;
    font-size: clamp(38px, 5.4vw, 64px);
    line-height: 1.04;
    letter-spacing: -0.045em;
}

.page-head .lead {
    max-width: 40em;
}

/* The architecture: the request stack, top to bottom, with what runs beside it. */

.arch {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 24px;
    margin: 0 0 56px;
}

.arch-stack,
.arch-side {
    display: flex;
    flex-direction: column;
}

.arch-side {
    gap: 16px;
}

.layer {
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--card);
}

.layer.core {
    border-color: var(--accent-line);
    background: linear-gradient(180deg, var(--accent-soft), transparent 80%), var(--card);
}

.layer.store {
    background: var(--code-bg);
}

.layer-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
}

.layer-head b {
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
}

.layer-head code {
    background: none;
    padding: 0;
    font-size: 12.5px;
    color: var(--brand);
}

.layer p {
    margin-top: 8px;
    font-size: 14px;
}

.parts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.parts span {
    padding: 2px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg);
    font-size: 12.5px;
}

/* What crosses between two layers, on the line that joins them. */
.wire {
    position: relative;
    padding: 10px 0 10px 32px;
    font-size: 12.5px;
    color: var(--muted);
}

.wire::before {
    content: "";
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--line-strong);
}

/* The path of a message: numbered steps down a line. */

.trace {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: step;
    border-left: 1px solid var(--line-strong);
}

.trace li {
    position: relative;
    counter-increment: step;
    padding: 0 0 34px 44px;
}

.trace li:last-child {
    padding-bottom: 0;
}

.trace li::before {
    content: counter(step);
    position: absolute;
    left: -15px;
    top: 0;
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--line-strong);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
}

.section.alt .trace li::before {
    background: var(--bg-2);
}

.trace li > code:first-child {
    background: none;
    padding: 0;
    font-size: 12.5px;
    color: var(--brand);
}

.trace h3 {
    margin: 4px 0 6px;
    font-size: 16px;
}

.trace p {
    max-width: 44em;
    font-size: 15px;
}

/* HADAL's documents. */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--r);
}

.docs {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.docs th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--card);
}

.docs th,
.docs td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.docs tbody tr:last-child td {
    border-bottom: 0;
}

.docs td:first-child {
    white-space: nowrap;
}

.docs td:last-child {
    white-space: nowrap;
    color: var(--muted);
}

.tag b {
    color: var(--text);
    font-weight: 600;
    margin-right: 6px;
}

/* Extensions, in install order. */

.ext {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--line);
}

.ext li {
    display: grid;
    grid-template-columns: 150px 130px minmax(0, 1fr);
    gap: 16px;
    align-items: baseline;
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
    font-size: 14.5px;
}

.ext code {
    background: none;
    padding: 0;
    color: var(--brand);
}

.ext .kinds {
    font-size: 13px;
    color: var(--muted);
}

/* ── Footer ──────────────────────────────────────────────── */

.footer {
    padding: 56px 0 64px;
    border-top: 1px solid var(--line);
    font-size: 14px;
    color: var(--muted);
}

.footer .wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 32px;
}

.footer .logo {
    margin-bottom: 12px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    max-width: 560px;
}

.footer-links a {
    color: var(--body);
}

.footer small {
    display: block;
    margin-top: 4px;
    font-size: 13px;
}

.footer-links + small {
    margin-top: 14px;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 1000px) {
    .hero .wrap,
    .split,
    .start {
        grid-template-columns: minmax(0, 1fr);
        gap: 64px;
    }

    .hero .wrap {
        padding-top: 64px;
        padding-bottom: 80px;
        text-align: center;
    }

    .hero .lead,
    .hero .install {
        margin-left: auto;
        margin-right: auto;
    }

    .hero .cta,
    .hero .facts {
        justify-content: center;
    }

    .split.flip .split-copy {
        order: 0;
    }

    .grid,
    .bento {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pillars {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
        max-width: 560px;
    }

    .access {
        grid-template-columns: repeat(2, 1fr);
    }

    .arch {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* The section links need the full width of the page. Narrower screens show only the guides and the docs. */
@media (max-width: 1100px) {
    .nav-links a:not(.nav-guide),
    .nav-sep {
        display: none;
    }
}

@media (max-width: 900px) {
    .nav-long {
        display: none;
    }
}

@media (min-width: 1101px) {
    .nav-long {
        display: none;
    }
}

/* On a phone, the logo and the GitHub button show only their icons. */
@media (max-width: 560px) {
    .nav .wrap {
        gap: 16px;
    }

    .nav-links {
        gap: 16px;
    }

    .nav .logo,
    .nav .btn {
        font-size: 0;
        gap: 0;
    }

    .nav .btn {
        padding: 0 10px;
    }

    .nav-links a {
        font-size: 13.5px;
    }
}

@media (max-width: 720px) {
    body {
        font-size: 15px;
    }

    .wrap {
        padding: 0 20px;
    }

    .section {
        padding: 84px 0;
    }

    .section-head {
        margin-bottom: 40px;
    }

    .hero h1 {
        font-size: clamp(34px, 9.6vw, 56px);
    }

    .hero-stage .phone.front {
        --w: min(262px, 66vw);
        transform: translateX(14%);
    }

    .hero-stage .phone.back {
        --w: min(218px, 55vw);
        bottom: 26px;
    }

    .split .media .phone {
        --w: min(280px, 74vw);
    }

    .grid,
    .bento,
    .access,
    .flow {
        grid-template-columns: minmax(0, 1fr);
    }

    .bento .card.wide {
        grid-column: auto;
    }

    .window {
        border-radius: var(--r);
    }

    .window-bar {
        height: 32px;
        padding: 0 12px;
    }

    .window-dots i {
        width: 9px;
        height: 9px;
    }

    .window-url {
        min-width: 0;
        font-size: 11px;
        padding: 2px 10px;
    }

    .timeline li {
        padding: 9px 16px;
        gap: 10px;
    }

    .timeline .state {
        display: none;
    }

    .page-head {
        padding: 72px 0 60px;
    }

    .ext li {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 4px 12px;
    }

    .ext li p {
        grid-column: 1 / -1;
    }

    .docs th,
    .docs td {
        padding: 9px 10px;
    }

    .docs td:first-child,
    .docs td:last-child {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .approval-actions small {
        display: none;
    }

    .term pre {
        padding: 18px;
        font-size: 12.5px;
    }

    .term-foot {
        padding: 14px 18px;
    }
}
