/*
 * purl.at
 *
 * The colors are the iOS app's: its asset catalog
 * (purl-iOS/Purl/Resources/Assets.xcassets) and its code theme
 * (PurlCodeTheme in Modules/Common/Code/CodeView.swift). The type is the
 * system's, as in the app: SF Pro, SF Pro Rounded for the wordmark and
 * headings, SF Mono for code. When a color changes in the app, change it here.
 */

/* ------------------------------------------------------------------ tokens */

:root {
    color-scheme: light dark;

    /* App asset colors (light appearance) */
    --accent: #d64a2e;          /* AccentColor */
    --thread: #5856d6;          /* Thread: branches, refs, gaps in diffs */
    --state-open: #1a7f37;      /* StateOpen */
    --state-merged: #8250df;    /* StateMerged */
    --state-closed: #cf222e;    /* StateClosed */
    --state-neutral: #6e7781;   /* StateNeutral */
    --wool: #fff1ea;            /* Wool: the wash behind onboarding and profiles */
    --code-canvas: #fcfbf9;     /* CodeCanvas */
    --code-gutter: #f4f2ee;     /* CodeGutter */
    --orange: #ff9500;          /* system orange: a running workflow */
    --yellow: #ffcc00;          /* system yellow: a workflow waiting for approval */

    /* Accent variants for the web: small text needs 4.5:1 */
    --accent-ink: #c2401f;
    --accent-fill: #d64a2e;

    /* iOS system colors */
    --bg: #ffffff;
    --bg-secondary: #f2f2f7;
    --bg-tertiary: #ffffff;
    --label: #000000;
    --label-secondary: rgb(60 60 67 / 0.6);
    --label-tertiary: rgb(60 60 67 / 0.3);
    --separator: rgb(60 60 67 / 0.18);
    --fill: rgb(120 120 128 / 0.12);
    --segment: #ffffff;

    /* Page copy: a little firmer than iOS's secondary label, for long reading */
    --text: #1d1d1f;
    --text-secondary: #57575e;

    /* Liquid Glass, approximated */
    --glass: rgb(255 255 255 / 0.68);
    --glass-edge: rgb(255 255 255 / 0.95);
    --glass-line: rgb(0 0 0 / 0.08);
    --glass-shadow: 0 10px 30px rgb(0 0 0 / 0.08), 0 1px 3px rgb(0 0 0 / 0.06);

    --stitch: rgb(60 60 67 / 0.28);
    --bezel: #1c1c1e;
    --bezel-edge: #48484a;
    --device-shadow: 0 50px 90px -40px rgb(120 45 20 / 0.45), 0 24px 48px -28px rgb(0 0 0 / 0.35);

    /* PurlCodeTheme, light palette */
    --code-text: #1c1c1e;
    --code-comment: #707f8c;
    --code-keyword: #a6337e;
    --code-string: #b5442f;
    --code-type: #1f6e7a;
    --code-function: #2e6e5c;
    --code-property: #5a3fb0;
    --code-attribute: #8a5a00;

    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-rounded: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

    --radius-card: 22px;          /* Metrics.cardRadius */
    --page: 1160px;
    --gutter: 24px;
    --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --accent: #ff7b5c;
        --thread: #8f8cff;
        --state-open: #3fb950;
        --state-merged: #a371f7;
        --state-closed: #f85149;
        --state-neutral: #8b949e;
        --wool: #2b1913;
        --code-canvas: #121214;
        --code-gutter: #1a1a1d;
        --orange: #ff9f0a;
        --yellow: #ffd60a;

        --accent-ink: #ff7b5c;
        --accent-fill: #d64a2e;

        --bg: #000000;
        --bg-secondary: #1c1c1e;
        --bg-tertiary: #2c2c2e;
        --label: #ffffff;
        --label-secondary: rgb(235 235 245 / 0.6);
        --label-tertiary: rgb(235 235 245 / 0.3);
        --separator: rgb(84 84 88 / 0.6);
        --fill: rgb(118 118 128 / 0.24);
        --segment: #5a5a5f;

        --text: #f5f5f7;
        --text-secondary: #a1a1a8;

        --glass: rgb(48 48 52 / 0.62);
        --glass-edge: rgb(255 255 255 / 0.14);
        --glass-line: rgb(255 255 255 / 0.1);
        --glass-shadow: 0 10px 30px rgb(0 0 0 / 0.4), 0 1px 3px rgb(0 0 0 / 0.3);

        --stitch: rgb(235 235 245 / 0.22);
        --bezel: #2c2c2e;
        --bezel-edge: #5a5a5e;
        --device-shadow: 0 50px 100px -40px rgb(255 123 92 / 0.28), 0 24px 48px -28px rgb(0 0 0 / 0.8);

        --code-text: #f2f2f7;
        --code-comment: #7f8c99;
        --code-keyword: #ff7ab2;
        --code-string: #ff8e73;
        --code-type: #7dd8e5;
        --code-function: #7cc9ae;
        --code-property: #b79cff;
        --code-attribute: #e6b673;
    }
}

/* -------------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

body {
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.5;
    color: var(--text);
    /* WoolBackground: the accent's soft wash at the top, fading to the system background. */
    background: linear-gradient(to bottom, var(--wool), var(--bg) 760px) no-repeat, var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
code { font-family: var(--font-mono); font-size: 0.88em; padding: 0.1em 0.35em; border-radius: 6px; background: var(--fill); }

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 65%, transparent);
    outline-offset: 3px;
    border-radius: 6px;
}

.wrap {
    width: min(100% - 2 * var(--gutter), var(--page));
    margin-inline: auto;
}

@media (max-width: 600px) {
    :root { --gutter: 16px; }
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
    width: 1em;
    height: 1em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--bg);
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--glass-shadow);
}
.skip-link:focus { top: 16px; }

/* ------------------------------------------------------- stitch divider */

/* StitchDivider: a running stitch of short round-capped dashes (6 on, 7 off). */
.stitch {
    height: 4px;
    background: var(--stitch);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='4'%3E%3Cpath d='M1 2h6' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") left center / 13px 4px repeat-x;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='4'%3E%3Cpath d='M1 2h6' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") left center / 13px 4px repeat-x;
}

/* ------------------------------------------------------------- loop mark */

.loop-mark { color: var(--accent); overflow: visible; }
.loop-strand {
    fill: none;
    stroke: currentColor;
    stroke-width: 92;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.loop-node { fill: currentColor; }

/* PurlLoopMark: the strand traces itself in, then the nodes land. */
@media (prefers-reduced-motion: no-preference) {
    .loop-mark.is-drawn .loop-strand {
        stroke-dasharray: 1 1;
        stroke-dashoffset: 1;
        animation: draw 1.1s ease-in-out 0.15s forwards;
    }
    .loop-mark.is-drawn .loop-node {
        transform-box: fill-box;
        transform-origin: center;
        animation: node-land 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 1s both;
    }
}

@keyframes draw {
    0% { stroke-dashoffset: 1; opacity: 0; }
    2% { opacity: 1; }
    100% { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes node-land {
    from { transform: scale(0.2); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* YarnSpinner: a thread running round the loop. */
.yarn { width: 1.35em; height: 1em; overflow: visible; color: var(--orange); }
.yarn path { fill: none; stroke: currentColor; stroke-width: 92; stroke-linecap: round; stroke-linejoin: round; }
.yarn-track { opacity: 0.18; }
.yarn-thread { stroke-dasharray: 0.35 1; stroke-dashoffset: 0.15; }

@media (prefers-reduced-motion: no-preference) {
    .yarn-thread { animation: yarn 1.6s linear infinite; }
}

@keyframes yarn {
    from { stroke-dashoffset: 0.35; }
    to { stroke-dashoffset: -0.65; }
}

/* ---------------------------------------------------------------- motion */

@media (prefers-reduced-motion: no-preference) {
    .rise { animation: rise 0.9s var(--ease-out) 0.35s both; }
    .rise-late { animation-delay: 0.75s; }

    @supports (animation-timeline: view()) {
        .reveal {
            animation: rise linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 40%;
        }
    }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------ navigation */

.site-nav {
    position: sticky;
    top: 12px;
    z-index: 50;
    margin-top: 12px;
}

.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 58px;
    padding: 0 8px 0 14px;
    border-radius: 999px;
    background: var(--glass);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    box-shadow: var(--glass-shadow), inset 0 0 0 0.5px var(--glass-line), inset 0 1px 0 var(--glass-edge);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-rounded);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
}
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand-small { font-size: 18px; gap: 8px; }
.brand-small img { width: 24px; height: 24px; border-radius: 6px; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0;
    list-style: none;
}
.nav-links a {
    display: block;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s, background-color 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--fill); }
.nav-links .nav-cta { color: var(--accent-ink); font-weight: 600; }
.nav-links .nav-cta:hover { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 12%, transparent); }

@media (max-width: 720px) {
    .nav-links li:not(:last-child) { display: none; }
}

/* --------------------------------------------------------------- buttons */

.actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 0 26px;
    border-radius: 999px;
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s, filter 0.2s;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: scale(0.97); }

/* .glassProminent with the accent tint */
.button-prominent {
    color: #fff;
    background: linear-gradient(to bottom, color-mix(in srgb, var(--accent-fill), #fff 12%), color-mix(in srgb, var(--accent-fill), #000 8%));
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35), inset 0 -1px 0 rgb(0 0 0 / 0.12), 0 10px 24px -10px rgb(214 74 46 / 0.7);
}
.button-prominent:hover { filter: brightness(1.05); }

/* .glass */
.button-glass {
    color: var(--text);
    background: var(--glass);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    box-shadow: var(--glass-shadow), inset 0 0 0 0.5px var(--glass-line), inset 0 1px 0 var(--glass-edge);
}

/* ------------------------------------------------------------------ hero */

.hero { padding-top: clamp(40px, 7vw, 72px); text-align: center; }

.hero .loop-mark {
    width: clamp(108px, 13vw, 148px);
    margin: 0 auto 22px;
}

.hero h1 {
    font-family: var(--font-rounded);
    font-size: clamp(4.25rem, 11vw, 6.75rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.035em;
}

.tagline {
    margin-top: 14px;
    font-size: clamp(1.3rem, 2.6vw, 1.7rem);
    line-height: 1.3;
    color: var(--text-secondary);
    text-wrap: balance;
}

.lede {
    max-width: 38em;
    margin: 18px auto 0;
    font-size: clamp(1rem, 1.5vw, 1.1rem);
    color: var(--text-secondary);
    text-wrap: pretty;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 30px;
    padding: 7px 15px 7px 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    background: var(--glass);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: inset 0 0 0 0.5px var(--glass-line), 0 2px 8px rgb(0 0 0 / 0.05);
}

.pulse {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
    .pulse::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 50%;
        background: var(--accent);
        animation: pulse 2s ease-out infinite;
    }
}
@keyframes pulse {
    from { transform: scale(1); opacity: 0.6; }
    to { transform: scale(3); opacity: 0; }
}

.hero .actions { margin-top: 18px; }

.fineprint {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.devices {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: clamp(20px, 3vw, 44px);
    margin-top: clamp(48px, 7vw, 76px);
    padding-inline: var(--gutter);
}

.phone-side { --w: 272px; margin-bottom: 30px; }
.phone-center { --w: 316px; }

@media (max-width: 1000px) {
    .phone-side { display: none; }
}

@media (max-width: 400px) {
    .phone-center { --w: calc(100vw - 2 * var(--gutter) - 8px); }
}

.jobs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    max-width: 1040px;
    margin-top: clamp(48px, 6vw, 72px);
    margin-bottom: clamp(64px, 9vw, 112px);
    padding: 0;
    list-style: none;
    text-align: left;
}

.job { display: flex; align-items: flex-start; gap: 16px; }
.job .icon { width: 30px; height: 30px; margin-top: 1px; color: var(--accent); stroke-width: 1.7; }
.job h2 { font-size: 17px; font-weight: 600; line-height: 1.35; }
.job p { margin-top: 3px; font-size: 15px; color: var(--text-secondary); }

@media (max-width: 860px) {
    .jobs { grid-template-columns: 1fr; max-width: 520px; gap: 24px; }
}

/* -------------------------------------------------------------- sections */

.section { padding-block: clamp(72px, 10vw, 124px); }
.section-tight { padding-top: 0; }

.section-head {
    max-width: 740px;
    margin: 0 auto clamp(40px, 5vw, 60px);
    text-align: center;
}

.eyebrow {
    margin-bottom: 12px;
    font-family: var(--font-rounded);
    font-size: 15px;
    font-weight: 600;
    color: var(--accent-ink);
}

.section-head h2,
.cta h2 {
    font-family: var(--font-rounded);
    font-size: clamp(2.1rem, 4.6vw, 3.25rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.028em;
    text-wrap: balance;
}

.section-head > p:not(.eyebrow) {
    margin-top: 16px;
    font-size: clamp(1.05rem, 1.6vw, 1.2rem);
    color: var(--text-secondary);
    text-wrap: pretty;
}

/* ----------------------------------------------------------------- bento */

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

.card {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 22px;
    border-radius: var(--radius-card);
    background: var(--bg-secondary);
}
.card-wide { grid-column: span 2; }
.card .copy { margin-top: auto; }
.card h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.card .copy p { margin-top: 6px; font-size: 15.5px; color: var(--text-secondary); }

@media (max-width: 980px) {
    .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .bento { grid-template-columns: minmax(0, 1fr); }
    .card-wide { grid-column: auto; }
}

/* A small piece of the app, drawn in the app's own components. */
.mini {
    font-size: 15px;
    line-height: 1.3;
    color: var(--label);
    padding: 14px;
    border-radius: 16px;
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 0.5px var(--separator), 0 6px 18px -12px rgb(0 0 0 / 0.25);
    user-select: none;
    -webkit-user-select: none;
}
.mini p { margin: 0; }

.tickets .ios-segmented { max-width: 260px; margin: 0 0 6px; }
.ticket-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 10px 2px;
}
.ticket-row + .ticket-row { border-top: 0.5px solid var(--separator); }
.ticket-row .state { width: 1.3em; height: 1.3em; margin-top: 0.05em; color: var(--c); stroke-width: 2.1; }
.ticket-row-title { font-weight: 600; font-size: 0.95em; }
.ticket-row-labels { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 4px !important; }
.ticket-row .count { display: inline-flex; align-items: center; gap: 4px; font-size: 0.82em; color: var(--label-secondary); }
.ticket-row .count .icon { width: 1.05em; height: 1.05em; }

.pipeline p { display: flex; align-items: center; gap: 10px; }
.pipeline-head { justify-content: space-between; padding-bottom: 8px; }
.commit-id {
    font-family: var(--font-mono);
    font-size: 0.76em;
    font-weight: 500;
    padding: 0.15em 0.45em;
    border-radius: 6px;
    background: var(--fill);
}
.workflow { padding: 8px 2px; border-top: 0.5px solid var(--separator); }
.workflow .icon { width: 1.25em; height: 1.25em; color: var(--c); }
.workflow .yarn { width: 1.25em; height: auto; }
.workflow span { flex: 1; font-family: var(--font-mono); font-size: 0.88em; }
.workflow time { font-size: 0.82em; color: var(--label-secondary); font-variant-numeric: tabular-nums; }
.workflow time.running { color: var(--orange); font-weight: 600; }
.pipeline-actions { flex-wrap: wrap; padding-top: 10px; gap: 8px !important; }

.ios-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.42em 0.9em;
    border-radius: 999px;
    font-size: 0.88em;
    font-weight: 600;
    background: var(--fill);
}
.ios-pill .icon { width: 1em; height: 1em; stroke-width: 2.2; }

.activity .bars {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: end;
    gap: 5px;
    height: 112px;
    padding: 4px 2px 0;
    border-bottom: 0.5px solid var(--separator);
}
/* Stacked BarMark: commits, pulls, issues and repos, as ActivityChart draws them. */
.activity .bars span {
    --unit: 3.4px;
    height: calc((var(--c1) + var(--c2) + var(--c3) + var(--c4)) * var(--unit));
    border-radius: 3px 3px 1px 1px;
    background: linear-gradient(to top,
        var(--accent) 0 calc(var(--c1) * var(--unit)),
        var(--state-merged) 0 calc((var(--c1) + var(--c2)) * var(--unit)),
        var(--state-open) 0 calc((var(--c1) + var(--c2) + var(--c3)) * var(--unit)),
        var(--thread) 0);
}
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; padding-top: 10px; font-size: 0.78em; color: var(--label-secondary); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

.links { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.url-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 9px 12px;
    border-radius: 12px;
    background: var(--fill);
    font-family: var(--font-mono);
    font-size: 0.74em;
    color: var(--label-secondary);
    white-space: nowrap;
}
.url-pill span { overflow: hidden; text-overflow: ellipsis; }
.url-pill .icon { color: var(--label-secondary); }
.link-arrow { width: 18px; height: 18px; color: var(--label-tertiary); stroke-width: 2.4; }
.opens-in { display: flex; align-items: center; gap: 12px; width: 100%; padding: 4px 2px; }
.opens-in > span:last-child { display: flex; flex-direction: column; font-size: 0.92em; }
.opens-in > span:last-child span { color: var(--label-secondary); font-size: 0.9em; }
.app-tile {
    display: grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(#e9674a, #c23f24);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.3);
}
.app-tile .icon { width: 28px; height: 20px; }

.menu p {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 4px;
    font-size: 0.95em;
}
.menu p + p { border-top: 0.5px solid var(--separator); }
.menu .menu-gap { border-top-width: 6px !important; border-top-color: var(--fill) !important; }
.menu .icon { width: 1.15em; height: 1.15em; color: var(--label-secondary); }

.search .search-field {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    background: var(--fill);
}
.search .search-field .icon { color: var(--label-secondary); }
.scopes { display: flex; gap: 4px; margin: 10px 0 8px !important; font-size: 0.78em; font-weight: 500; overflow: hidden; }
.scopes span { padding: 0.35em 0.75em; border-radius: 999px; color: var(--label-secondary); white-space: nowrap; }
.scopes .is-selected { color: #fff; background: var(--accent-fill); }
.result { display: flex; align-items: flex-start; gap: 10px; padding: 8px 2px 2px; }
.result .icon { width: 1.25em; height: 1.25em; color: var(--accent); margin-top: 0.1em; }
.result > span { display: flex; flex-direction: column; font-size: 0.92em; }
.result > span span { color: var(--label-secondary); font-size: 0.9em; }

.guest {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    min-height: 128px;
    background: linear-gradient(to bottom, var(--wool), var(--bg-tertiary));
}

.accounts p { display: flex; align-items: center; gap: 11px; padding: 9px 2px; }
.accounts p + p { border-top: 0.5px solid var(--separator); }
.accounts p > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; font-size: 0.95em; }
.accounts p > span:nth-child(2) span { font-size: 0.85em; color: var(--label-secondary); }
.accounts .icon { width: 1.3em; height: 1.3em; color: var(--accent); stroke-width: 2; }

/* ------------------------------------------------------------------ iPad */

.ipad-frame {
    container-type: inline-size;
    max-width: 1060px;
    margin-inline: auto;
}

.ipad {
    position: relative;
    width: 100%;
    aspect-ratio: 1376 / 1032;
    border: 1.7cqw solid var(--bezel);
    border-radius: 4.4cqw;
    background: var(--bg);
    box-shadow: 0 0 0 1px var(--bezel-edge), var(--device-shadow);
    overflow: hidden;
    container-type: inline-size;
}

.ipad .screen {
    flex-direction: row;
    gap: 0.9em;
    padding: 2.3em 0.9em 0.9em;
    font-size: calc(100cqw * 17 / 1376);
}

.ipad-status {
    position: absolute;
    top: 0.55em;
    left: 1.5em;
    right: 1.5em;
    display: flex;
    justify-content: space-between;
    font-size: 0.78em;
    font-weight: 600;
}
.ipad-status .indicators svg { height: 0.85em; }

.ipad-sidebar {
    flex: none;
    width: 16.5em;
    padding: 0.9em 0.6em;
    border-radius: 1.6em;
    background: var(--glass);
    box-shadow: inset 0 0 0 0.5px var(--glass-line), 0 0.4em 1.6em rgb(0 0 0 / 0.08);
    background-color: color-mix(in srgb, var(--bg-secondary) 85%, transparent);
}
.side-title { padding: 0.2em 0.6em 0.6em; font-size: 1.6em; font-weight: 700; letter-spacing: -0.02em; }
.side-item {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.5em 0.65em;
    border-radius: 0.75em;
}
.side-item .icon { width: 1.25em; height: 1.25em; color: var(--accent); }
.side-item em { margin-left: auto; font-style: normal; font-size: 0.88em; color: var(--label-secondary); }
.side-item.is-selected { background: color-mix(in srgb, var(--accent) 16%, transparent); font-weight: 600; }
.side-header { padding: 1em 0.65em 0.35em; font-size: 0.8em; font-weight: 600; color: var(--label-secondary); }

.ipad-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.ipad-toolbar { display: flex; align-items: center; gap: 0.8em; margin-bottom: 0.7em; }
.ipad-heading { flex: 1; min-width: 0; }
.ipad-heading p { display: flex; align-items: center; gap: 0.5em; white-space: nowrap; }
.ipad-heading b { font-size: 1.18em; letter-spacing: -0.01em; }
.ipad-heading .sub { margin-top: 0.15em; font-size: 0.76em; color: var(--label-secondary); }
.ipad-segments { width: 30em; margin: 0 0 0.8em; }

.review {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 17em minmax(0, 1fr);
    gap: 0.8em;
}

.files {
    display: flex;
    flex-direction: column;
    padding: 0.5em;
    border-radius: 1.3em;
    background: var(--bg-secondary);
    overflow: hidden;
}
.files-summary { padding: 0.4em 0.6em 0.6em; font-size: 0.8em; font-weight: 600; color: var(--label-secondary); }
.file {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.5em 0.6em;
    border-radius: 0.8em;
    font-size: 0.86em;
}
.file > span:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; white-space: nowrap; }
.file small { font-size: 0.78em; color: var(--label-secondary); overflow: hidden; text-overflow: ellipsis; }
.file.is-selected { background: color-mix(in srgb, var(--accent) 15%, transparent); font-weight: 600; }
.interdiff {
    display: flex;
    align-items: center;
    gap: 0.8em;
    margin-top: auto;
    padding: 0.8em 0.6em 0.4em;
    border-top: 0.5px solid var(--separator);
    font-size: 0.76em;
    color: var(--label-secondary);
}
.interdiff b { display: block; font-size: 1.08em; font-weight: 600; color: var(--label); }
/* Toggle, off */
.ios-switch {
    position: relative;
    flex: none;
    width: 2.75em;
    height: 1.65em;
    border-radius: 999px;
    background: rgb(120 120 128 / 0.16);
}
.ios-switch::after {
    content: "";
    position: absolute;
    top: 0.13em;
    left: 0.13em;
    width: 1.39em;
    height: 1.39em;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0.1em 0.35em rgb(0 0 0 / 0.2);
}

/* DiffStatBlocks: five squares, added then removed then unchanged. */
.blocks {
    --size: 0.55em;
    --step: 0.7em;
    flex: none;
    width: calc(var(--step) * 4 + var(--size));
    height: var(--size);
    background:
        repeating-linear-gradient(to right, transparent 0 var(--size), var(--bg-secondary) var(--size) var(--step)),
        linear-gradient(to right,
            var(--state-open) 0 calc(var(--add) * var(--step)),
            var(--state-closed) 0 calc((var(--add) + var(--del)) * var(--step)),
            color-mix(in srgb, var(--label) 22%, transparent) 0);
    border-radius: 0.1em;
}
.file.is-selected .blocks {
    background:
        repeating-linear-gradient(to right, transparent 0 var(--size), color-mix(in srgb, var(--accent) 15%, var(--bg-secondary)) var(--size) var(--step)),
        linear-gradient(to right,
            var(--state-open) 0 calc(var(--add) * var(--step)),
            var(--state-closed) 0 calc((var(--add) + var(--del)) * var(--step)),
            color-mix(in srgb, var(--label) 22%, transparent) 0);
}

.diff {
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-radius: 1em;
    background: var(--code-canvas);
    box-shadow: inset 0 0 0 0.5px var(--separator);
    overflow: hidden;
}
.diff-head {
    display: flex;
    justify-content: space-between;
    gap: 1em;
    padding: 0.7em 0.9em;
    font-family: var(--font-mono);
    font-size: 0.74em;
    color: var(--label-secondary);
    border-bottom: 0.5px solid var(--separator);
    white-space: nowrap;
}
.diff-head b { color: var(--label); }
.plus { color: var(--state-open); font-weight: 600; }
.minus { color: var(--state-closed); font-weight: 600; }

.split {
    position: relative;
    display: grid;
    grid-template-columns: 2.6em minmax(0, 1fr) 2.6em minmax(0, 1fr);
    font-family: var(--font-mono);
    font-size: 0.76em;
    line-height: 1.75;
    color: var(--code-text);
}
.split .no {
    padding-right: 0.6em;
    text-align: right;
    color: var(--label-tertiary);
    background: color-mix(in srgb, var(--code-gutter) 70%, transparent);
}
.split .ln { padding-left: 0.6em; white-space: pre; overflow: hidden; }
/* The line between the two sides: the columns are symmetric, so it sits at 50%. */
.split::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    border-left: 0.5px solid var(--separator);
    pointer-events: none;
}
.split i { font-style: normal; }
.split .t { color: var(--code-type); }
.split .k { color: var(--code-keyword); }
.split .p { color: var(--code-property); }
.split .c { color: var(--code-comment); font-style: italic; }
.split .add { background: color-mix(in srgb, var(--state-open) 13%, transparent); }
.split .del { background: color-mix(in srgb, var(--state-closed) 13%, transparent); }
.split .no.add, .split .no.del { color: var(--label-secondary); }
.split .empty { background: color-mix(in srgb, var(--label) 4%, transparent); }
.split .add mark { color: inherit; background: color-mix(in srgb, var(--state-open) 34%, transparent); border-radius: 0.2em; }
.split .del mark { color: inherit; background: color-mix(in srgb, var(--state-closed) 34%, transparent); border-radius: 0.2em; }
.split .gap {
    grid-column: 1 / -1;
    padding: 0.15em 0;
    text-align: center;
    font-family: var(--font-sans);
    font-size: 0.92em;
    color: var(--thread);
    background: color-mix(in srgb, var(--thread) 7%, transparent);
}

.shortcuts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 12px;
    max-width: 900px;
    margin: clamp(36px, 5vw, 52px) auto 0;
    padding: 0;
    list-style: none;
}
.shortcuts li {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 15px 7px 8px;
    border-radius: 999px;
    font-size: 15px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
}
.keys { display: inline-flex; align-items: center; gap: 3px; color: var(--text-secondary); }
kbd {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    border-radius: 7px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: var(--bg-tertiary);
    box-shadow: inset 0 -1px 0 var(--separator), 0 0 0 0.5px var(--separator), 0 1px 2px rgb(0 0 0 / 0.08);
}

/* ------------------------------------------------------- open by design */

.open {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(40px, 6vw, 88px);
    align-items: start;
}
.open .section-head { margin: 0; text-align: left; position: sticky; top: 120px; }

/* A commit log: a stitched line with a node per entry, like the loop's ends. */
.log { padding: 0; list-style: none; }
.log li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 10px;
    top: 32px;
    bottom: 3px;
    width: 4px;
    background: color-mix(in srgb, var(--accent) 55%, transparent);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='13'%3E%3Cpath d='M2 1v6' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center top / 4px 13px repeat-y;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='13'%3E%3Cpath d='M2 1v6' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center top / 4px 13px repeat-y;
}
.log li { position: relative; padding: 0 0 30px 48px; }
.log li:last-child { padding-bottom: 0; }
.log li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
}
.log h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
.log p { margin-top: 5px; color: var(--text-secondary); text-wrap: pretty; }

@media (max-width: 900px) {
    .open { grid-template-columns: minmax(0, 1fr); }
    .open .section-head { position: static; }
}

/* ------------------------------------------------------------------- CTA */

.cta {
    padding: clamp(48px, 8vw, 88px) clamp(20px, 5vw, 64px);
    border-radius: 32px;
    text-align: center;
    background: linear-gradient(to bottom, var(--wool), var(--bg-secondary));
}
.cta .loop-mark { width: 92px; margin: 0 auto 26px; }
.cta p { max-width: 34em; margin: 16px auto 0; font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--text-secondary); text-wrap: pretty; }
.cta .actions { margin-top: 28px; }

/* ---------------------------------------------------------------- footer */

.site-footer { padding: 40px 0 56px; font-size: 14px; color: var(--text-secondary); }
.footer-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
    padding-top: 28px;
    border-top: 0.5px solid var(--separator);
}
.site-footer .brand { color: var(--text); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.site-footer nav a { text-decoration: none; }
.site-footer nav a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.footer-note { flex-basis: 100%; }

/* ======================================================================
 * Device mockups. Inside a screen, 1em is 17pt (iOS body) at the device's
 * scale, so every size below reads in points ÷ 17.
 * ====================================================================== */

/* Size a phone with --w (set by .phone-side and .phone-center above). */
.phone {
    position: relative;
    flex: none;
    width: var(--w, 300px);
    aspect-ratio: 393 / 852;
    border: calc(var(--w, 300px) * 0.034) solid var(--bezel);
    border-radius: calc(var(--w, 300px) * 0.175);
    background: var(--bg);
    box-shadow: 0 0 0 1px var(--bezel-edge), var(--device-shadow);
    overflow: hidden;
    container-type: inline-size;
    text-align: left;
}

.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--font-sans);
    font-size: calc(100cqw * 17 / 393);
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--label);
    background: var(--bg);
    user-select: none;
    -webkit-user-select: none;
}
.screen p { margin: 0; }

.island {
    position: absolute;
    top: 0.62em;
    left: 50%;
    z-index: 6;
    width: 7.3em;
    height: 2.15em;
    border-radius: 1.1em;
    background: #000;
    transform: translateX(-50%);
}

.statusbar {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3.15em;
    padding: 0.3em 1.65em 0 2.15em;
    font-weight: 600;
}
.indicators { display: flex; align-items: center; gap: 0.32em; }
.indicators svg { width: auto; height: 0.7em; }

.home-indicator {
    position: absolute;
    bottom: 0.45em;
    left: 50%;
    z-index: 6;
    width: 8em;
    height: 0.3em;
    border-radius: 1em;
    background: var(--label);
    transform: translateX(-50%);
}

/* Scroll edge: content softens under the floating glass bars. */
.phone .screen::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    height: 7em;
    background: linear-gradient(to bottom, transparent, var(--bg) 75%);
    pointer-events: none;
}

.ios-toolbar {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6em;
    min-height: 3em;
    padding: 0.15em 1em 0.2em;
}

.ios-glass-btn,
.ios-glass-group,
.ios-pill-btn {
    background: var(--glass);
    -webkit-backdrop-filter: blur(12px) saturate(170%);
    backdrop-filter: blur(12px) saturate(170%);
    box-shadow: inset 0 0 0 0.5px var(--glass-line), inset 0 1px 0 var(--glass-edge), 0 0.25em 0.9em rgb(0 0 0 / 0.08);
}
.ios-glass-btn {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.6em;
    height: 2.6em;
    border-radius: 50%;
}
.ios-glass-btn .icon { width: 1.2em; height: 1.2em; stroke-width: 2.1; }
.ios-glass-group { display: flex; align-items: center; border-radius: 999px; }
.ios-glass-group > * { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.ios-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    height: 2.6em;
    padding: 0 0.3em 0 1em;
    border-radius: 999px;
    font-size: 0.94em;
    font-weight: 600;
    white-space: nowrap;
}
.ios-pill-btn .icon { width: 1em; height: 1em; stroke-width: 2.4; color: var(--label-secondary); }

.ios-nav-title { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.ios-nav-title .title { display: inline-flex; align-items: center; gap: 0.2em; font-size: 0.94em; font-weight: 600; white-space: nowrap; }
.ios-nav-title .title .icon { width: 0.8em; height: 0.8em; stroke-width: 2.6; color: var(--label-secondary); }
.ios-nav-title .subtitle { font-size: 0.68em; color: var(--label-secondary); white-space: nowrap; }

.ios-large-title {
    flex: none;
    padding: 0.05em 0.59em 0.3em;
    font-size: 2em;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.ios-content { flex: 1; min-height: 0; padding: 0 1.18em; }

.ios-segmented {
    display: flex;
    margin: 0.2em 0 0.7em;
    padding: 0.14em;
    border-radius: 999px;
    background: var(--fill);
}
.ios-segmented span {
    flex: 1;
    padding: 0.42em 0.4em;
    border-radius: 999px;
    text-align: center;
    font-size: 0.8em;
    font-weight: 500;
    white-space: nowrap;
}
.ios-segmented em { font-style: normal; color: var(--label-secondary); font-variant-numeric: tabular-nums; }
.ios-segmented .is-selected { font-weight: 600; background: var(--segment); box-shadow: 0 0.1em 0.4em rgb(0 0 0 / 0.12); }
.ios-segmented.compact span { font-size: 0.82em; padding-block: 0.38em; }

.ios-section-header { margin: 0.5em 0 0.15em; font-size: 0.82em; font-weight: 700; }

.ios-row { position: relative; display: flex; align-items: flex-start; gap: 0.7em; padding: 0.6em 0; }
.ios-row + .ios-row::before {
    content: "";
    position: absolute;
    top: 0;
    left: 2.85em;
    right: 0;
    border-top: 0.5px solid var(--separator);
}
.row-text { flex: 1; min-width: 0; font-size: 0.86em; }
.row-text p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-text > p:first-child { color: var(--label-secondary); }
.row-text b { color: var(--label); font-weight: 600; }
.row-title { margin-top: 0.1em !important; font-weight: 500; }
.row-meta { margin-top: 0.15em !important; font-size: 0.86em; color: var(--label-secondary); }
.mini .row-meta { font-size: 0.8em; }
.is-read .row-title { color: var(--label-secondary); }
.unread-dot { flex: none; width: 0.55em; height: 0.55em; margin-top: 0.4em; border-radius: 50%; background: var(--accent); }

/* AvatarImage's monogram: a two-stop gradient from the name, white initial. */
.av {
    --h: 20;
    --s: 2.15em;
    position: relative;
    flex: none;
    display: grid;
    place-items: center;
    width: var(--s);
    height: var(--s);
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, hsl(var(--h) 72% 71%), hsl(calc(var(--h) + 29) 43% 49%));
    box-shadow: inset 0 0 0 0.5px rgb(0 0 0 / 0.08);
}
.av::after {
    content: attr(data-i);
    font-family: var(--font-rounded);
    font-size: calc(var(--s) * 0.44);
    font-weight: 600;
    line-height: 1;
}
.av-sm { --s: 1.45em; }
.av-xs { --s: 1.2em; }
.av-badge {
    position: absolute;
    right: -0.22em;
    bottom: -0.22em;
    display: grid;
    place-items: center;
    width: 1.1em;
    height: 1.1em;
    border-radius: 50%;
    color: #fff;
    background: var(--c);
    box-shadow: 0 0 0 0.13em var(--bg);
}
.av-badge .icon { width: 0.68em; height: 0.68em; stroke-width: 2.6; }

/* StateBadge */
.ios-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.3em 0.68em;
    border-radius: 999px;
    font-size: 0.88em;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(to bottom, color-mix(in srgb, var(--c), #fff 16%), var(--c));
}
.ios-badge .icon { width: 1em; height: 1em; stroke-width: 2.3; }
.ios-badge.compact { font-size: 0.72em; padding: 0.2em 0.55em; }

/* RefLabel */
.ios-ref {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.2em 0.55em;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.72em;
    color: var(--thread);
    background: color-mix(in srgb, var(--thread) 12%, transparent);
    white-space: nowrap;
}
.ios-ref .icon { width: 1em; height: 1em; stroke-width: 2.1; }

/* LabelChip */
.ios-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.18em 0.55em;
    border-radius: 999px;
    font-size: 0.74em;
    font-weight: 500;
    background: color-mix(in srgb, var(--c) 14%, transparent);
    box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--c) 35%, transparent);
    white-space: nowrap;
}
.ios-label::before { content: ""; width: 0.5em; height: 0.5em; border-radius: 50%; background: var(--c); }

/* cardBackground() */
.ios-card { margin-top: 0.7em; padding: 0.85em; border-radius: 1.3em; background: var(--bg-secondary); }

.ticket { display: flex; flex-direction: column; align-items: flex-start; }
.ticket-title { margin-top: 0.45em !important; font-size: 1.3em; font-weight: 700; line-height: 1.18; letter-spacing: -0.015em; }
.ticket-byline { display: flex; align-items: center; gap: 0.35em; margin-top: 0.55em !important; font-size: 0.8em; color: var(--label-secondary); }
.ticket-byline b { color: var(--label); font-weight: 600; }
.branch-flow { display: flex; align-items: center; gap: 0.35em; margin: 0.55em 0 0.75em !important; }
.flow-arrow { width: 0.85em; height: 0.85em; color: var(--label-secondary); stroke-width: 2.2; }
.ticket .ios-segmented { align-self: stretch; margin-bottom: 0.1em; }
.ticket .ios-segmented span { font-size: 0.74em; }
.ticket .ios-card { align-self: stretch; }

.comment { font-size: 0.86em; }
.comment-head { display: flex; align-items: center; gap: 0.4em; margin-bottom: 0.5em !important; }
.comment-head b { font-weight: 600; }
.comment-head .when { margin-left: auto; color: var(--label-secondary); font-size: 0.9em; }
.ios-tag {
    padding: 0.05em 0.45em;
    border-radius: 999px;
    font-size: 0.78em;
    font-weight: 600;
    color: var(--label-secondary);
    box-shadow: inset 0 0 0 0.5px var(--label-tertiary);
}
.reactions { display: flex; gap: 0.35em; margin-top: 0.7em !important; }
.ios-reaction { padding: 0.22em 0.6em; border-radius: 999px; font-size: 0.9em; background: var(--fill); }
.ios-reaction.is-mine {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--accent) 45%, transparent);
}

.merge-box { display: flex; flex-direction: column; gap: 0.75em; }
.merge-head { display: flex; align-items: flex-start; gap: 0.7em; }
.merge-symbol {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.1em;
    height: 2.1em;
    border-radius: 50%;
    color: var(--c);
    background: color-mix(in srgb, var(--c) 15%, transparent);
}
.merge-symbol .icon { width: 1.25em; height: 1.25em; }
.merge-title { font-weight: 600; }
.merge-detail { font-size: 0.82em; color: var(--label-secondary); }

/* .glassProminent with a tint */
.ios-button-prominent,
.ios-button-glass {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    height: 2.85em;
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
}
.ios-button-prominent {
    color: #fff;
    background: linear-gradient(to bottom, color-mix(in srgb, var(--c), #fff 14%), color-mix(in srgb, var(--c), #000 6%));
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.3), 0 0.4em 1em -0.5em color-mix(in srgb, var(--c) 80%, transparent);
}
.ios-button-prominent .icon { width: 1.1em; height: 1.1em; stroke-width: 2.1; }
.ios-button-glass {
    background: var(--glass);
    box-shadow: inset 0 0 0 0.5px var(--glass-line), inset 0 1px 0 var(--glass-edge), 0 0.3em 1em rgb(0 0 0 / 0.08);
}

.ios-composer {
    position: absolute;
    left: 1em;
    right: 1em;
    bottom: 1.6em;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 0.5em;
}
.ios-composer .field {
    flex: 1;
    display: flex;
    align-items: center;
    height: 2.75em;
    padding: 0 1.1em;
    border-radius: 999px;
    color: var(--label-tertiary);
    background: var(--glass);
    -webkit-backdrop-filter: blur(14px) saturate(170%);
    backdrop-filter: blur(14px) saturate(170%);
    box-shadow: inset 0 0 0 0.5px var(--glass-line), inset 0 1px 0 var(--glass-edge), 0 0.3em 1em rgb(0 0 0 / 0.1);
}
.ios-composer .send {
    display: grid;
    place-items: center;
    width: 2.75em;
    height: 2.75em;
    border-radius: 50%;
    color: #fff;
    background: var(--accent-fill);
}
.ios-composer .send .icon { width: 1.2em; height: 1.2em; stroke-width: 2.4; }

.ios-tabbar {
    position: absolute;
    left: 1.05em;
    right: 1.05em;
    bottom: 1.6em;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 0.55em;
}
.ios-tabbar .tabs,
.ios-tabbar .search {
    background: var(--glass);
    -webkit-backdrop-filter: blur(14px) saturate(170%);
    backdrop-filter: blur(14px) saturate(170%);
    box-shadow: inset 0 0 0 0.5px var(--glass-line), inset 0 1px 0 var(--glass-edge), 0 0.3em 1.2em rgb(0 0 0 / 0.12);
}
.ios-tabbar .tabs { flex: 1; display: flex; height: 3.65em; padding: 0.25em; border-radius: 999px; }
.ios-tabbar .tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25em;
    border-radius: 999px;
    font-size: 0.59em;
    font-weight: 600;
    letter-spacing: 0;
    white-space: nowrap;
}
.ios-tabbar .tab .icon { width: 2.25em; height: 2.25em; stroke-width: 1.9; }
.ios-tabbar .tab.is-selected { color: var(--accent); background: var(--fill); }
.ios-tabbar .search { flex: none; display: grid; place-items: center; width: 3.65em; height: 3.65em; border-radius: 50%; }
.ios-tabbar .search .icon { width: 1.35em; height: 1.35em; stroke-width: 2.1; }

/* CodeView */
.code-bar {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3em 1.18em 0.6em;
}
.code-meta { font-size: 0.7em; color: var(--label-secondary); }

.ios-code {
    flex: 1;
    min-height: 0;
    display: flex;
    font-family: var(--font-mono);
    font-size: 0.66em;
    line-height: 1.62;
    background: var(--code-canvas);
    border-top: 0.5px solid var(--separator);
}
.ios-code pre { margin: 0; padding: 0.7em 0; font: inherit; }
.ios-code .gutter {
    flex: none;
    padding-inline: 0.9em 0.7em;
    text-align: right;
    color: var(--label-tertiary);
    background: var(--code-gutter);
}
.ios-code .source { flex: 1; min-width: 0; padding-inline: 0.8em; overflow: hidden; color: var(--code-text); white-space: pre; }
.source .k { color: var(--code-keyword); }
.source .t { color: var(--code-type); }
.source .f { color: var(--code-function); }
.source .p { color: var(--code-property); }
.source .a { color: var(--code-attribute); }
.source .c { color: var(--code-comment); font-style: italic; }

/* ===================================================== simple pages */

.page { padding: clamp(48px, 8vw, 88px) 0 clamp(64px, 9vw, 104px); }

.legal { max-width: 720px; margin-inline: auto; }
.legal h1 {
    font-family: var(--font-rounded);
    font-size: clamp(2.2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.028em;
    line-height: 1.1;
}
.legal .updated { margin: 8px 0 36px; font-size: 15px; color: var(--text-secondary); }
.legal h2 { margin: 40px 0 10px; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.legal p, .legal li { color: var(--text-secondary); }
.legal p + p { margin-top: 12px; }
.legal ul { margin: 12px 0; padding-left: 22px; }
.legal li + li { margin-top: 8px; }
.legal strong { color: var(--text); font-weight: 600; }
.legal a { color: var(--accent-ink); text-underline-offset: 3px; }
.legal .summary {
    margin-bottom: 8px;
    padding: 18px 20px;
    border-radius: var(--radius-card);
    background: var(--bg-secondary);
}

.notice {
    display: grid;
    place-items: center;
    min-height: min(70vh, 640px);
    text-align: center;
}
.notice .loop-mark { width: 110px; margin: 0 auto 24px; }
.notice h1 {
    font-family: var(--font-rounded);
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.1;
    text-wrap: balance;
}
.notice p { max-width: 30em; margin: 14px auto 0; color: var(--text-secondary); text-wrap: pretty; }
.notice .actions { margin-top: 28px; }
.notice .target {
    display: block;
    max-width: 100%;
    margin: 18px auto 0;
    padding: 10px 14px;
    border-radius: 12px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    overflow-wrap: anywhere;
}
[hidden] { display: none !important; }
