/* Umiji wiki. Colours are the panel's own (frontend/src/shared/constants/theme/theme.ts):
   magenta-tinted greys, rose accent, no brown and no yellow. Dark only, like the panel.
   Direction-dependent spacing uses logical properties, so the Persian pages (dir=rtl) mirror for free. */
:root {
    --bg: #130c11;
    --bg-2: #1b1218;
    --surface: #1f151c;
    --surface-2: #271c23;
    --line: rgba(255, 255, 255, 0.07);
    --line-2: rgba(255, 255, 255, 0.12);
    --text: #f6eff3;
    --text-2: #c9b6c1;
    --text-3: #a08d98;
    --rose: #ff7db5;
    --rose-2: #f563a2;
    --rose-strong: #d23a7c;
    /* white text sits on this one: 5.3:1, where the panel's #d23a7c gives 4.2:1 */
    --rose-btn: #c42f72;
    --rose-soft: rgba(255, 125, 181, 0.1);
    --rose-line: rgba(255, 125, 181, 0.32);
    --plum: #a07bfa;
    --teal: #38d9a9;
    --coral: #ff9469;
    --shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--line);
    --glow: rgba(210, 58, 124, 0.3);
    --tide-1: rgba(210, 58, 124, 0.55);
    --tide-2: rgba(180, 47, 105, 0.38);
    /* the back wave is opaque (22% violet already mixed into --bg) so the phone can't show through the water */
    --tide-3: #2a1a41;
    --font: Montserrat, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --display: Unbounded, Montserrat, system-ui, sans-serif;
    --mono: 'Fira Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
    --radius: 16px;
    --wrap: 1180px;
    --gutter: clamp(16px, 4vw, 40px);
    color-scheme: dark;
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 16px/1.7 var(--font);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--rose);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

:focus-visible {
    outline: 2px solid var(--rose);
    outline-offset: 3px;
    border-radius: 6px;
}

::selection {
    background: var(--rose-strong);
    color: #fff;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

p {
    margin: 0 0 1em;
}

code,
kbd {
    font-family: var(--mono);
    font-size: 0.88em;
}

/* commands, paths and domains read left to right inside Persian sentences */
code {
    direction: ltr;
    unicode-bidi: isolate;
}

:not(pre) > code {
    padding: 0.12em 0.42em;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text);
    word-break: break-word;
}

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.skip {
    position: absolute;
    inset-inline-start: -9999px;
    top: 8px;
    z-index: 100;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--rose-btn);
    color: #fff;
}

.skip:focus {
    inset-inline-start: 8px;
}

/* ---------- top bar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--line);
}

.topbar .wrap {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 64px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font: 700 20px/1 var(--font);
    letter-spacing: -0.02em;
}

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

.brand svg {
    width: 30px;
    height: 30px;
    color: var(--rose);
}

.brand .ji {
    color: var(--text);
}

.brand .umi {
    color: var(--rose);
}

.nav {
    display: flex;
    gap: 4px;
    margin-inline-start: auto;
}

.nav a {
    padding: 8px 14px;
    border-radius: 10px;
    color: var(--text-2);
    font-weight: 500;
    font-size: 15px;
}

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

.nav a[aria-current='page'] {
    color: var(--rose);
    background: var(--rose-soft);
}

/* the Telegram row only shows in the phone menu; wide screens have the header button */
.nav .tg-row {
    display: none;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--line-2);
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    transition:
        color 0.15s,
        border-color 0.15s;
}

.icon-btn:hover {
    color: var(--rose);
    border-color: var(--rose-line);
    text-decoration: none;
}

.icon-btn svg {
    width: 19px;
    height: 19px;
}

.tools {
    display: flex;
    gap: 8px;
}

/* the language switch: both languages, the current one lit */
.lang {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 40px;
    padding: 3px;
    border-radius: 12px;
    border: 1px solid var(--line-2);
    background: var(--surface);
}

.lang svg {
    width: 16px;
    height: 16px;
    margin-inline: 7px 3px;
    color: var(--text-3);
}

.lang a {
    display: grid;
    place-items: center;
    height: 100%;
    padding: 0 11px;
    border-radius: 9px;
    color: var(--text-2);
    font: 600 13.5px/1 var(--font);
    white-space: nowrap;
}

.lang a:lang(fa) {
    font-family: Vazirmatn, system-ui, sans-serif;
    font-size: 14px;
}

.lang a:hover {
    color: var(--text);
    background: var(--surface-2);
    text-decoration: none;
}

.lang a[aria-current] {
    color: var(--rose);
    background: var(--rose-soft);
}

/* the menu button: two lines that cross into an X */
.menu-btn {
    display: none;
}

.menu-btn i {
    grid-area: 1 / 1;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.menu-btn i:first-child {
    transform: translateY(-4px);
}

.menu-btn i:last-child {
    transform: translateY(4px);
}

.topbar.open .menu-btn {
    color: var(--rose);
    border-color: var(--rose-line);
}

.topbar.open .menu-btn i:first-child {
    transform: rotate(45deg);
}

.topbar.open .menu-btn i:last-child {
    transform: rotate(-45deg);
}

/* on body, not html: body's overflow-x would otherwise make it the scroller and unstick the bar */
html.menu-open body {
    overflow: hidden;
}

/* on a phone the nav ran off both edges (and under 960px its links wrap), so it drops down from the bar as a sheet */
@media (max-width: 959px) {
    .topbar .wrap {
        gap: 10px;
        height: 60px;
    }
    .brand {
        margin-inline-end: auto;
    }
    .menu-btn {
        display: inline-grid;
    }
    /* the bar's backdrop-filter makes it the containing block, and a blur here would only see the bar */
    .nav {
        position: absolute;
        top: 100%;
        inset-inline: 0;
        display: grid;
        gap: 6px;
        margin: 0;
        padding: 14px var(--gutter) 22px;
        max-height: calc(100dvh - 60px);
        overflow-y: auto;
        overscroll-behavior: contain;
        border-bottom: 1px solid var(--line-2);
        background:
            radial-gradient(60% 140% at 100% 0%, rgba(210, 58, 124, 0.16), transparent 70%),
            radial-gradient(50% 120% at 0% 100%, rgba(124, 77, 235, 0.12), transparent 70%),
            rgb(22, 14, 20);
        box-shadow: 0 40px 60px -30px rgba(0, 0, 0, 0.8);
        visibility: hidden;
        opacity: 0;
        transform: translateY(-12px);
        transition:
            opacity 0.22s,
            transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
            visibility 0s 0.35s;
    }
    .topbar.open .nav {
        visibility: visible;
        opacity: 1;
        transform: none;
        transition-delay: 0s;
    }
    /* dims the page under the sheet; a tap on it closes the menu */
    .topbar::after {
        content: '';
        position: absolute;
        top: 100%;
        inset-inline: 0;
        z-index: -1;
        height: 100dvh;
        background: rgba(8, 4, 7, 0.62);
        visibility: hidden;
        opacity: 0;
        transition:
            opacity 0.25s,
            visibility 0s 0.25s;
    }
    .topbar.open::after {
        visibility: visible;
        opacity: 1;
        transition-delay: 0s;
    }
    .nav a {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 9px 12px 9px 9px;
        border-radius: 16px;
        border: 1px solid transparent;
        color: var(--text);
        font-size: 16.5px;
        font-weight: 600;
        opacity: 0;
        transform: translateY(-8px);
        transition:
            opacity 0.25s,
            transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1),
            background-color 0.15s,
            border-color 0.15s;
    }
    [dir='rtl'] .nav a {
        padding: 9px 9px 9px 12px;
    }
    .topbar.open .nav a {
        opacity: 1;
        transform: none;
    }
    .topbar.open .nav a:nth-child(2) {
        transition-delay: 75ms;
    }
    .topbar.open .nav a:nth-child(3) {
        transition-delay: 110ms;
    }
    .topbar.open .nav a:nth-child(4) {
        transition-delay: 145ms;
    }
    .topbar.open .nav a:nth-child(5) {
        transition-delay: 180ms;
    }
    .nav a:hover,
    .nav a:active {
        color: var(--text);
        background: color-mix(in srgb, var(--c) 7%, transparent);
    }
    .nav a[aria-current='page'] {
        color: var(--text);
        border-color: color-mix(in srgb, var(--c) 30%, transparent);
        background: color-mix(in srgb, var(--c) 10%, transparent);
    }
    /* each page gets an icon tile, rose drifting to violet down the list */
    .nav a::before {
        content: '';
        flex: none;
        width: 42px;
        height: 42px;
        border-radius: 12px;
        background: var(--icon) center / 21px no-repeat, color-mix(in srgb, var(--c) 13%, transparent);
        box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent);
    }
    .nav a:nth-child(1) {
        --c: #ff7db5;
        --icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff7db5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M2 4h6a4 4 0 0 1 4 4v13a3 3 0 0 0-3-3H2z'/><path d='M22 4h-6a4 4 0 0 0-4 4v13a3 3 0 0 1 3-3h7z'/></svg>");
    }
    .nav a:nth-child(2) {
        --c: #e77dc6;
        --icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e77dc6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='m16 3 4 4-4 4'/><path d='M20 7H4'/><path d='m8 21-4-4 4-4'/><path d='M4 17h16'/></svg>");
    }
    .nav a:nth-child(3) {
        --c: #d07cd8;
        --icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d07cd8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M9 18h6M10 22h4'/><path d='M12 2a7 7 0 0 0-4 12.7c.6.5 1 1.2 1 2V17h6v-.3c0-.8.4-1.5 1-2A7 7 0 0 0 12 2z'/></svg>");
    }
    .nav a:nth-child(4) {
        --c: #b87ce9;
        --icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b87ce9' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><circle cx='12' cy='12' r='3.5'/><path d='m5.6 5.6 4 4M14.4 14.4l4 4M14.4 9.6l4-4M5.6 18.4l4-4'/></svg>");
    }
    .nav a:nth-child(5) {
        --c: #a07bfa;
        --icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a07bfa' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='m8 7-5 5 5 5M16 7l5 5-5 5'/></svg>");
    }
    /* chevron */
    .nav a::after {
        content: '';
        width: 16px;
        height: 16px;
        margin-inline-start: auto;
        background: var(--text-3);
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
    }
    .nav a[aria-current='page']::after {
        background: var(--c);
    }
    [dir='rtl'] .nav a::after {
        transform: scaleX(-1);
    }
    .nav .tg-row {
        --c: #4cb3f0;
        --icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234cb3f0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M15 10l-4 4l6 6l4-16l-18 7l4 2l2 6l3-4'/></svg>");
        display: flex;
        position: relative;
        margin-top: 10px;
        transition-delay: 0s;
    }
    .topbar.open .nav .tg-row {
        transition-delay: 215ms;
    }
    .nav .tg-row::after {
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E");
    }
    [dir='rtl'] .nav .tg-row::after {
        transform: none;
    }
}

@media (max-width: 720px) {
    .tools :is(.gh, .tg) {
        display: none;
    }
}

/* the smallest phones: brand, languages and the menu button share 288px */
@media (max-width: 360px) {
    .lang svg {
        display: none;
    }
    .lang a {
        padding: 0 8px;
    }
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 50px;
    padding: 0 22px;
    border-radius: 14px;
    font: 600 16px/1 var(--font);
    border: 1px solid transparent;
    transition:
        transform 0.15s,
        background 0.15s,
        border-color 0.15s;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

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

.btn-primary {
    background: var(--rose-btn);
    color: #fff;
    box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.55);
}

.btn-primary:hover {
    background: #b42f69;
}

.btn-ghost {
    background: var(--surface);
    border-color: var(--line-2);
    color: var(--text);
}

.btn-ghost:hover {
    border-color: var(--rose-line);
}

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

/* centred, so the install command gets a whole line and nothing needs mirroring */
.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(48px, 6.5vw, 84px) 0 0;
    text-align: center;
    background:
        radial-gradient(55% 42% at 50% 0%, var(--glow), transparent 70%),
        radial-gradient(30% 40% at 0% 40%, rgba(124, 77, 235, 0.14), transparent 70%),
        radial-gradient(30% 40% at 100% 40%, rgba(124, 77, 235, 0.14), transparent 70%);
}

/* a faint sea chart behind the words */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1.5px) 0 0 / 28px 28px;
    -webkit-mask-image: radial-gradient(55% 45% at 50% 22%, #000, transparent);
    mask-image: radial-gradient(55% 45% at 50% 22%, #000, transparent);
}

.hero-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-copy > *,
.stage {
    animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-copy > :nth-child(2) {
    animation-delay: 0.07s;
}

.hero-copy > :nth-child(3) {
    animation-delay: 0.14s;
}

.hero-copy > :nth-child(4) {
    animation-delay: 0.21s;
}

.hero-copy > :nth-child(5) {
    animation-delay: 0.28s;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    padding-block: 6px;
    padding-inline: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--rose-line);
    background: var(--rose-soft);
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
}

.eyebrow b {
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--rose-btn);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
}

.hero h1 {
    max-width: 14em;
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(34px, 4.6vw, 60px);
    line-height: 1.08;
    letter-spacing: -0.045em;
    text-wrap: balance;
}

.hero h1 em {
    font-style: normal;
    background: linear-gradient(100deg, var(--rose) 30%, var(--plum));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero .lede {
    max-width: 30em;
    margin: 20px 0 36px;
    color: var(--text-2);
    font-size: clamp(17px, 1.6vw, 19px);
    text-wrap: balance;
}

/* the install command is the way in, so it gets a terminal of its own */
.hero .term {
    width: min(100%, 940px);
    max-width: none;
    margin: 0;
    border-radius: 16px;
    border-color: var(--rose-line);
    box-shadow:
        0 0 0 6px var(--rose-soft),
        0 30px 90px -20px var(--glow);
}

.hero .term-bar span {
    color: var(--text-2);
}

.hero .term pre.cmd {
    padding: 20px 116px 20px 46px;
    overflow: visible;
    background: none;
    font-size: 14.5px;
}

/* the root prompt stays out of the copied text */
.hero .term code::before {
    content: '#';
    position: absolute;
    left: 24px;
    color: var(--rose);
}

.hero .term .copy-btn {
    right: 14px;
    padding: 10px 18px;
    border: 0;
    border-radius: 10px;
    background: var(--rose-btn);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
}

.hero .term .copy-btn:hover {
    background: #b42f69;
    color: #fff;
}

/* the setup guide, and the way in from another panel */
.hero-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 32px;
    margin-top: 24px;
    text-align: center;
}

.hero-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
    font-weight: 500;
}

.hero-link:hover {
    color: var(--rose);
    text-decoration: none;
}

/* one sentence each on a wide screen; the icons only show on the phone cards */
.hero-link .ico {
    display: none;
}

.hero-link :is(small, b) {
    font: inherit;
}

.hero-link .arr {
    flex: none;
    width: 17px;
    height: 17px;
    color: var(--rose);
    transition: transform 0.2s;
}

.hero-link:hover .arr {
    transform: translateX(3px);
}

/* on a phone the long sentence wrapped and left its arrow behind, so each link becomes a card */
@media (max-width: 720px) {
    .hero-links {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        gap: 10px;
        margin-top: 16px;
        text-align: start;
    }
    .hero-link {
        --c: var(--rose);
        display: flex;
        gap: 14px;
        padding: 14px 16px;
        border-radius: 16px;
        border: 1px solid color-mix(in srgb, var(--c) 22%, transparent);
        background:
            linear-gradient(color-mix(in srgb, var(--c) 7%, transparent), transparent),
            rgba(31, 21, 28, 0.78);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.05),
            0 18px 40px -26px var(--c);
        transition:
            border-color 0.2s,
            transform 0.15s;
    }
    .hero-link + .hero-link {
        --c: var(--plum);
    }
    .hero-link:hover {
        border-color: color-mix(in srgb, var(--c) 45%, transparent);
    }
    .hero-link:active {
        transform: scale(0.985);
    }
    .hero-link .ico {
        display: grid;
        place-items: center;
        flex: none;
        width: 42px;
        height: 42px;
        border-radius: 12px;
        background: color-mix(in srgb, var(--c) 14%, transparent);
        box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 32%, transparent);
        color: var(--c);
    }
    .hero-link .ico svg {
        width: 21px;
        height: 21px;
    }
    .hero-link .txt {
        flex: 1;
        min-width: 0;
        display: grid;
        gap: 2px;
    }
    /* the panel names would wrap the small line; the migrate page lists them */
    .hero-link .long {
        display: none;
    }
    .hero-link small {
        color: var(--text-3);
        font-size: 13px;
        line-height: 1.4;
    }
    .hero-link b {
        color: var(--text);
        font-weight: 600;
        font-size: 15.5px;
        line-height: 1.35;
    }
    .hero-link .arr {
        width: 18px;
        height: 18px;
        color: var(--c);
    }
}

/* the smallest phones: a tighter card keeps every line on one row */
@media (max-width: 359px) {
    .hero-link {
        gap: 10px;
        padding: 12px;
    }
    .hero-link .ico {
        width: 36px;
        height: 36px;
    }
}

/* the panel rises out of the tide, the phone in front of it */
.stage {
    position: relative;
    max-width: 1060px;
    margin: clamp(40px, 5vw, 64px) auto 0;
    padding-inline: 5%;
    perspective: 2200px;
    text-align: start;
    animation-delay: 0.35s;
}

.stage::before {
    content: '';
    position: absolute;
    inset: 8% 10% 0;
    z-index: -1;
    background: radial-gradient(closest-side, var(--glow), transparent);
    filter: blur(40px);
}

.window {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #1b1218;
    box-shadow: var(--shadow);
}

.window-bar {
    direction: ltr;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: #160f14;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.window-bar i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #372a32;
}

.window-bar span {
    flex: 1;
    min-width: 0;
    max-width: 260px;
    margin: 0 auto;
    padding: 3px 12px;
    border-radius: 7px;
    background: #231920;
    color: #a08d98;
    font: 500 11.5px/1.4 var(--mono);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stage .window {
    transform: rotateX(9deg);
    transform-origin: 50% 100%;
    -webkit-mask-image: linear-gradient(#000 55%, transparent 96%);
    mask-image: linear-gradient(#000 55%, transparent 96%);
}

/* the phone stands in the tide: its lower edge sits under the translucent waves (which are in front) */
.phone {
    position: absolute;
    inset-inline-start: 0;
    bottom: -34px;
    width: 24%;
    min-width: 116px;
    padding: 7px;
    border-radius: 34px;
    background: #0d080b;
    box-shadow:
        0 30px 60px -18px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.09);
}

.phone img {
    border-radius: 27px;
    aspect-ratio: 390 / 760;
    object-fit: cover;
    object-position: top;
}

/* the tide: the logo's two waves, moving */
/* in front of the stage, so the phone's edge goes under the water; the window has faded out by here */
.tide {
    position: relative;
    height: 150px;
    margin-top: -96px;
    z-index: 1;
    pointer-events: none;
}

.tide svg {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 200%;
    height: 100%;
    animation: drift 18s linear infinite;
}

.tide .w2 {
    animation-duration: 26s;
    animation-direction: reverse;
}

.tide .w3 {
    animation-duration: 34s;
}

.tide::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 40px;
    background: linear-gradient(transparent, var(--bg));
}

@keyframes drift {
    to {
        transform: translateX(-50%);
    }
}

@media (max-width: 720px) {
    .stage {
        padding-inline: 14% 0;
    }
    .stage .window {
        transform: none;
    }
    .phone {
        width: 34%;
        border-radius: 24px;
        padding: 5px;
    }
    .phone img {
        border-radius: 19px;
    }
}

/* on a phone the copy button moves up into the title bar, so the command gets the whole width */
@media (max-width: 520px) {
    .hero .term pre.cmd {
        padding: 14px 16px 16px 34px;
        font-size: 13.5px;
    }
    .hero .term code::before {
        left: 16px;
    }
    .hero .term pre.cmd .copy-btn {
        top: -30px;
        right: 8px;
        transform: none;
        padding: 6px 12px;
        font-size: 12.5px;
    }
}

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

.section {
    padding-top: clamp(64px, 9vw, 112px);
    padding-bottom: clamp(64px, 9vw, 112px);
}

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

.kicker {
    display: block;
    margin-bottom: 14px;
    color: var(--rose);
    font: 500 13px/1 var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section h2 {
    max-width: 22em;
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(26px, 3.1vw, 38px);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.section .intro {
    max-width: 40em;
    margin: 18px 0 0;
    color: var(--text-2);
    font-size: 18px;
}

/* the route: a card per stop, joined by a flowing wave. The colour drifts from rose (your server) to violet (the phone). */
.route {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 40px;
    margin: 56px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: stop;
}

.route li {
    --c: color-mix(in oklab, var(--plum) var(--mix, 0%), var(--rose));
    position: relative;
    counter-increment: stop;
}

.route li:nth-child(2) { --mix: 14%; }
.route li:nth-child(3) { --mix: 28%; }
.route li:nth-child(4) { --mix: 42%; }
.route li:nth-child(5) { --mix: 57%; }
.route li:nth-child(6) { --mix: 71%; }
.route li:nth-child(7) { --mix: 85%; }
.route li:nth-child(8) { --mix: 100%; }

.route a {
    position: relative;
    display: block;
    height: 100%;
    padding: 26px 24px 24px;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid var(--line-2);
    background:
        radial-gradient(110% 70% at 0% 0%, color-mix(in srgb, var(--c) 13%, transparent), transparent 65%),
        var(--surface);
    color: inherit;
    transition:
        transform 0.25s,
        border-color 0.25s,
        box-shadow 0.25s;
}

[dir='rtl'] .route a {
    background:
        radial-gradient(110% 70% at 100% 0%, color-mix(in srgb, var(--c) 13%, transparent), transparent 65%),
        var(--surface);
}

.route a:hover {
    text-decoration: none;
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--c) 50%, transparent);
    box-shadow: 0 26px 50px -26px color-mix(in srgb, var(--c) 70%, transparent);
}

/* the stop's number, large and hollow, in the far corner */
.route a::before {
    content: counter(stop, decimal-leading-zero);
    position: absolute;
    top: 18px;
    inset-inline-end: 20px;
    color: transparent;
    -webkit-text-stroke: 1px color-mix(in srgb, var(--c) 55%, transparent);
    font: 600 44px/1 var(--display);
    letter-spacing: -0.04em;
}

.route .stop {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 22px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
    background: color-mix(in srgb, var(--c) 14%, transparent);
    box-shadow: 0 0 28px -8px color-mix(in srgb, var(--c) 70%, transparent);
    color: var(--c);
    transition:
        background 0.25s,
        color 0.25s;
}

.route .stop svg {
    width: 22px;
    height: 22px;
}

.route a:hover .stop {
    background: var(--c);
    color: #fff;
}

.route h3 {
    font-size: 17px;
}

.route p {
    margin: 6px 0 0;
    color: var(--text-3);
    font-size: 15px;
    line-height: 1.6;
}

/* the wave that flows on to the next stop, across the gap at the height of the icons */
.route li::after {
    content: '';
    position: absolute;
    top: 44px;
    inset-inline-start: 100%;
    width: 40px;
    height: 12px;
    background: var(--c);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='12' viewBox='0 0 20 12'%3E%3Cpath d='M0 6q2.5-4 5 0t5 0 5 0 5 0' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") 0 50% / 20px 12px repeat-x;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='12' viewBox='0 0 20 12'%3E%3Cpath d='M0 6q2.5-4 5 0t5 0 5 0 5 0' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") 0 50% / 20px 12px repeat-x;
    animation: flow 1.4s linear infinite;
}

[dir='rtl'] .route li::after {
    animation-direction: reverse;
}

.route li:nth-child(4n)::after,
.route li:last-child::after {
    display: none;
}

@keyframes flow {
    to {
        -webkit-mask-position: 20px 50%;
        mask-position: 20px 50%;
    }
}

/* where the browser can, each card rises in as it scrolls into view */
@supports (animation-timeline: view()) {
    .route li {
        animation: rise linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 55%;
    }
}

@media (max-width: 900px) {
    .route {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 32px;
    }
    .route li::after {
        width: 32px;
    }
    .route li:nth-child(2n)::after {
        display: none;
    }
}

/* one column: the wave turns and runs down from card to card */
@media (max-width: 520px) {
    .route {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .route li:not(:last-child)::after {
        display: block;
        top: calc(100% + 8px);
        inset-inline-start: 34px;
        width: 28px;
        transform: rotate(90deg);
    }
    [dir='rtl'] .route li::after {
        animation-direction: normal;
    }
}

/* features: calm rows, not a wall of cards */
.features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 40px;
    margin: 48px 0 0;
}

.feature {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 18px;
    padding: 26px 0;
    border-top: 1px solid var(--line);
}

.feature .ico {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--rose);
}

.feature .ico svg {
    width: 21px;
    height: 21px;
}

.feature h3 {
    font-size: 18px;
}

.feature p {
    margin: 6px 0 0;
    color: var(--text-2);
    font-size: 15.5px;
}

@media (max-width: 960px) {
    .features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .features {
        grid-template-columns: 1fr;
    }
}

/* showcase: one big shot with captions */
.showcase {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
    gap: clamp(28px, 5vw, 64px);
    align-items: center;
    margin-top: 56px;
}

.showcase + .showcase {
    margin-top: 88px;
}

.showcase.flip {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr);
}

.showcase.flip .copy {
    order: 2;
}

.showcase h3 {
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(21px, 2.2vw, 26px);
    line-height: 1.25;
    letter-spacing: -0.025em;
}

.showcase .copy p {
    margin: 14px 0 0;
    color: var(--text-2);
}

.checks {
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.checks + p {
    margin-top: 20px;
}

/* the hardware table: keep "1 core" and "10 GB" on one line */
html[lang="en"] .data.hw td + td {
    white-space: nowrap;
}

.checks li {
    position: relative;
    padding-inline-start: 28px;
    color: var(--text-2);
    font-size: 15.5px;
}

.checks li::before {
    content: '';
    position: absolute;
    inset-inline-start: 2px;
    top: 0.5em;
    width: 14px;
    height: 8px;
    border-left: 2px solid var(--rose);
    border-bottom: 2px solid var(--rose);
    transform: rotate(-45deg);
}

@media (max-width: 860px) {
    .showcase,
    .showcase.flip {
        grid-template-columns: minmax(0, 1fr);
    }
    .showcase.flip .copy {
        order: 0;
    }
}

/* doors to the other sections */
.doors {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 48px;
}

.door {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 240px;
    padding: 32px;
    border-radius: 22px;
    border: 1px solid var(--line-2);
    background:
        radial-gradient(80% 90% at 100% 0%, var(--rose-soft), transparent 70%),
        var(--surface);
    color: var(--text);
    transition:
        border-color 0.2s,
        transform 0.2s;
}

.door:hover {
    text-decoration: none;
    border-color: var(--rose-line);
    transform: translateY(-3px);
}

.door .n {
    color: var(--rose);
    font: 500 13px/1 var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.door h3 {
    font-family: var(--display);
    font-weight: 500;
    font-size: 24px;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.door p {
    margin: 0;
    color: var(--text-2);
    max-width: 30em;
}

.door .go {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--rose);
    font-weight: 600;
}

.door .go svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s;
}

.door:hover .go svg {
    transform: translateX(4px);
}

@media (max-width: 900px) {
    .doors {
        grid-template-columns: 1fr;
    }
}

/* ---------- framed screenshots ---------- */

.shot {
    margin: 28px 0;
}

.shot .window {
    cursor: zoom-in;
}

.shot img {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #1b1218;
}

.shot figcaption {
    margin-top: 12px;
    color: var(--text-3);
    font-size: 14px;
    text-align: center;
}

.shot.pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.shot.pair figcaption {
    grid-column: 1 / -1;
}

.shot.phones {
    display: flex;
    justify-content: center;
    gap: clamp(16px, 4vw, 40px);
    flex-wrap: wrap;
}

.shot.phones figcaption {
    flex-basis: 100%;
}

.shot .handset {
    width: min(280px, 44%);
    padding: 7px;
    border-radius: 36px;
    background: #0d080b;
    box-shadow:
        0 24px 50px -20px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.09);
    cursor: zoom-in;
}

.shot .handset img {
    border-radius: 29px;
    aspect-ratio: auto;
}

@media (max-width: 640px) {
    .shot.pair {
        grid-template-columns: 1fr;
    }
}

.zoom {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(10, 6, 9, 0.88);
    backdrop-filter: blur(6px);
    cursor: zoom-out;
    animation: fade 0.18s ease-out;
}

.zoom img {
    max-height: 92vh;
    width: auto;
    border-radius: 12px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

@keyframes fade {
    from {
        opacity: 0;
    }
}

/* ---------- docs layout (guide + concepts) ---------- */

.page-head {
    position: relative;
    overflow: hidden;
    padding-top: clamp(48px, 7vw, 84px);
    padding-bottom: clamp(36px, 5vw, 56px);
    border-bottom: 1px solid var(--line);
    background: radial-gradient(50% 80% at 85% 0%, var(--glow), transparent 70%);
}

.page-head .wrap {
    position: relative;
    z-index: 1;
}

.page-head h1 {
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(32px, 4.2vw, 50px);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.page-head p {
    max-width: 38em;
    margin: 18px 0 0;
    color: var(--text-2);
    font-size: 18px;
}

.page-head .facts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
}

.page-head .facts li {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    background: var(--surface);
    color: var(--text-2);
    font-size: 14px;
}

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

.page-head .waves {
    position: absolute;
    inset-inline-end: -40px;
    bottom: -30px;
    width: 340px;
    color: var(--rose);
    opacity: 0.1;
    pointer-events: none;
}

.docs {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: clamp(32px, 5vw, 72px);
    padding-top: 48px;
    padding-bottom: 96px;
}

.toc {
    position: sticky;
    top: 88px;
    align-self: start;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding-bottom: 24px;
    scrollbar-width: thin;
}

.toc h2 {
    margin: 0 0 12px;
    color: var(--text-3);
    font: 500 12px/1 var(--mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.toc ol,
.toc ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.toc a {
    display: flex;
    gap: 12px;
    align-items: baseline;
    padding: 7px 12px;
    border-radius: 10px;
    color: var(--text-2);
    font-size: 14.5px;
    line-height: 1.4;
}

.toc a:hover {
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
}

.toc a.active {
    background: var(--rose-soft);
    color: var(--rose);
}

.toc .num {
    flex: none;
    width: 20px;
    color: var(--text-3);
    font: 500 12px/1 var(--mono);
}

.toc a.active .num {
    color: var(--rose);
}

.toc .group + .group {
    margin-top: 18px;
}

.toc .group > span {
    display: block;
    padding: 0 12px 6px;
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
}

.toc .group a {
    padding: 5px 12px;
    font-size: 14px;
}

@media (max-width: 980px) {
    .docs {
        grid-template-columns: minmax(0, 1fr);
    }
    .toc {
        position: static;
        max-height: none;
        padding: 18px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--surface);
    }
    .toc.collapsible:not(.open) .group,
    .toc.collapsible:not(.open) ol {
        display: none;
    }
    .toc.collapsible h2 {
        display: none;
    }
    .page-head .waves {
        width: 200px;
        opacity: 0.06;
    }
    .toc-toggle {
        display: flex !important;
    }
}

.toc-toggle {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text);
    font: 600 15px var(--font);
    cursor: pointer;
}

.toc-toggle svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s;
}

.toc.open .toc-toggle svg {
    transform: rotate(180deg);
}

.toc.open .toc-toggle {
    margin-bottom: 12px;
}

/* ---------- guide steps ---------- */

.step {
    position: relative;
    padding: 0 0 72px 0;
}

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

.step-head {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
}

.step-num {
    display: grid;
    place-items: center;
    flex: none;
    width: 56px;
    height: 56px;
    border-radius: 17px;
    background: linear-gradient(145deg, var(--rose-btn), #7a2a6c);
    color: #fff;
    font-family: var(--display);
    font-weight: 600;
    font-size: 20px;
    line-height: 1;
    box-shadow: 0 10px 22px -12px rgba(0, 0, 0, 0.6);
}

.step-head .meta {
    display: block;
    margin-bottom: 4px;
    color: var(--text-3);
    font: 500 12.5px/1 var(--mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.step h2 {
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(22px, 2.5vw, 29px);
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.step > p,
.prose p {
    color: var(--text-2);
    max-width: 44em;
}

.step h3 {
    margin: 32px 0 12px;
    font-size: 19px;
}

.do {
    margin: 18px 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 2px;
    max-width: 46em;
}

.do li {
    position: relative;
    /* grid items grow to fit a <pre>'s longest line; this lets the pre scroll instead */
    min-width: 0;
    padding-block: 10px;
    padding-inline: 44px 0;
    color: var(--text-2);
}

.do li::before {
    /* the built-in list counter, so <ol start="3"> carries on from the list before it */
    content: counter(list-item);
    position: absolute;
    inset-inline-start: 0;
    top: 10px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: var(--surface-2);
    border: 1px solid var(--line-2);
    color: var(--text);
    font: 600 13px/1 var(--mono);
}

.do li b,
.ui {
    display: inline;
    overflow-wrap: anywhere;
    padding: 0.1em 0.5em;
    border-radius: 7px;
    border: 1px solid var(--rose-line);
    background: var(--rose-soft);
    color: var(--text);
    font-weight: 600;
    font-size: 0.94em;
}

.path {
    color: var(--text-3);
    font-size: 0.94em;
}

.note {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 14px;
    max-width: 46em;
    margin: 22px 0;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--line-2);
    background: var(--surface);
    color: var(--text-2);
    font-size: 15.5px;
}

.note svg {
    width: 20px;
    height: 20px;
    margin-top: 3px;
    color: var(--plum);
}

.note p:last-child {
    margin: 0;
}

.note strong {
    color: var(--text);
}

.note.tip svg {
    color: var(--teal);
}

.note.warn {
    border-color: color-mix(in srgb, var(--coral) 40%, transparent);
}

.note.warn svg {
    color: var(--coral);
}

pre {
    direction: ltr;
    text-align: left;
    position: relative;
    max-width: 46em;
    margin: 18px 0;
    padding: 18px 20px;
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid var(--line-2);
    background: #0f0a0d;
    color: #e3d5dd;
    font: 400 14px/1.7 var(--mono);
}

pre .c {
    color: #8b7581;
}

/* a Persian comment wraps instead of scrolling: its start sits on the right, so scrolling would hide it */
pre .c [dir='rtl'] {
    white-space: normal;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #1f151c;
    color: #c9b6c1;
    font: 500 12px/1 var(--font);
    cursor: pointer;
}

.copy-btn:hover {
    color: #ff7db5;
}

.done {
    display: grid;
    gap: 6px;
    padding: 32px;
    border-radius: 22px;
    border: 1px solid var(--rose-line);
    background:
        radial-gradient(70% 120% at 100% 0%, var(--rose-soft), transparent 70%),
        var(--surface);
}

.done h2 {
    font-family: var(--display);
    font-weight: 500;
    font-size: 24px;
    line-height: 1.25;
    letter-spacing: -0.03em;
}

.done p {
    margin: 4px 0 0;
    color: var(--text-2);
}

.next {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.next a {
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--line-2);
    background: var(--bg-2);
    color: var(--text);
    font-weight: 600;
}

.next a span {
    display: block;
    margin-top: 4px;
    color: var(--text-3);
    font-weight: 400;
    font-size: 14px;
}

.next a:hover {
    border-color: var(--rose-line);
    text-decoration: none;
}

@media (max-width: 760px) {
    .next {
        grid-template-columns: 1fr;
    }
}

/* ---------- concepts ---------- */

.search {
    position: relative;
    display: block;
    max-width: 560px;
    margin-top: 28px;
}

.search svg {
    position: absolute;
    inset-inline-start: 16px;
    top: 50%;
    width: 19px;
    height: 19px;
    transform: translateY(-50%);
    color: var(--text-3);
}

.search input {
    width: 100%;
    height: 54px;
    padding-inline: 48px 56px;
    border-radius: 15px;
    border: 1px solid var(--line-2);
    background: var(--surface);
    color: var(--text);
    font: 500 16px var(--font);
}

.search input::placeholder {
    color: var(--text-3);
}

.search input:focus {
    outline: none;
    border-color: var(--rose);
    box-shadow: 0 0 0 4px var(--rose-soft);
}

.search kbd {
    position: absolute;
    inset-inline-end: 14px;
    top: 50%;
    transform: translateY(-50%);
    padding: 3px 8px;
    border-radius: 7px;
    border: 1px solid var(--line-2);
    color: var(--text-3);
    font-size: 12px;
}

.group-block {
    padding-bottom: 40px;
}

.group-block + .group-block {
    padding-top: 48px;
    border-top: 1px solid var(--line);
}

.group-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
}

.group-title .ico {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 13px;
    background: var(--rose-soft);
    border: 1px solid var(--rose-line);
    color: var(--rose);
}

.group-title .ico svg {
    width: 21px;
    height: 21px;
}

.group-title h2 {
    font-family: var(--display);
    font-weight: 500;
    font-size: clamp(22px, 2.5vw, 28px);
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.group-block > p {
    max-width: 44em;
    color: var(--text-2);
}

.concepts {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    margin-top: 22px;
}

.concept {
    padding: 22px 24px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    transition: border-color 0.2s;
}

.concept:target {
    border-color: var(--rose-line);
    box-shadow: 0 0 0 4px var(--rose-soft);
}

.concept h3 {
    margin-bottom: 10px;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 19px;
}

.concept h3 a.anchor {
    color: var(--text-3);
    font-weight: 400;
    opacity: 0;
    transition: opacity 0.15s;
}

.concept:hover h3 a.anchor,
.concept h3 a.anchor:focus {
    opacity: 1;
}

.concept .where {
    display: block;
    overflow-wrap: anywhere;
    margin: -4px 0 12px;
    color: var(--text-3);
    font: 500 13px/1.5 var(--mono);
}

.concept .who {
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    color: var(--text-3);
    font: 500 12px/1.5 var(--font);
}

.concept p {
    margin: 0 0 0.8em;
    color: var(--text-2);
    max-width: 48em;
}

.concept p:last-child,
.concept dl:last-child {
    margin-bottom: 0;
}

.concept dl {
    display: grid;
    grid-template-columns: minmax(130px, max-content) 1fr;
    gap: 8px 20px;
    margin: 14px 0;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--bg-2);
    font-size: 15px;
}

.concept dt {
    color: var(--text);
    font-weight: 600;
}

.concept dd {
    margin: 0;
    color: var(--text-2);
}

@media (max-width: 560px) {
    .concept {
        padding: 18px;
    }
    .concept dl {
        grid-template-columns: 1fr;
        gap: 2px;
    }
    .concept dd {
        margin-bottom: 8px;
    }
}

.related {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.related a {
    padding: 3px 11px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    color: var(--text-2);
    font-size: 13.5px;
}

.related a:hover {
    border-color: var(--rose-line);
    color: var(--rose);
    text-decoration: none;
}

.empty {
    display: none;
    padding: 40px;
    border-radius: var(--radius);
    border: 1px dashed var(--line-2);
    color: var(--text-3);
    text-align: center;
}

mark {
    background: var(--rose-soft);
    color: var(--rose);
    border-radius: 3px;
}

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

.footer {
    border-top: 1px solid var(--line);
    padding: 40px 0 48px;
    color: var(--text-3);
    font-size: 14px;
}

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

.footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
}

.footer a {
    color: var(--text-2);
}

.footer .jp {
    color: var(--text-2);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* 海路: the fonts link loads just these two letters, so they show on systems without a Japanese font */
:lang(ja) {
    font-family: 'Noto Sans JP', system-ui, sans-serif;
}

/* ---------- Persian (fa, right to left) ---------- */

/* The panel's own font: Montserrat's Latin plus Vazirmatn's Persian digits, so numbers read ۱۲۳ the
   way they do in the Persian panel, while v2rayNG or OAuth2 keep their Latin digits. Persian letters
   come from Vazirmatn. unicode-range and the fa-only stack mean English pages never download it. */
@font-face {
    font-family: 'Umiji Persian Digits';
    src: url('fonts/umiji-persian-digits.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+20-7E, U+6F0-6F9;
}

:root[lang='fa'] {
    --font: 'Umiji Persian Digits', Montserrat, Vazirmatn, system-ui, sans-serif;
    /* Unbounded has no Persian letters: Persian headings are Alexandria, Latin and digits as in the text */
    --display: 'Umiji Persian Digits', Montserrat, Alexandria, Vazirmatn, system-ui, sans-serif;
    /* Persian comments in code blocks; digits and Latin stay Fira Mono */
    --mono: 'Fira Mono', Vazirmatn, ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

/* letter-spacing pulls Persian letters apart and breaks their joins */
:root[lang='fa'] * {
    letter-spacing: 0 !important;
}

:root[lang='fa'] body {
    line-height: 1.85;
}

:root[lang='fa'] :is(.hero h1, .page-head h1, .section h2, .showcase h3, .door h3, .step h2, .done h2, .group-title h2) {
    font-weight: 800;
    line-height: 1.4;
}

:root[lang='fa'] .hero h1 {
    font-size: clamp(30px, 3.7vw, 48px);
}

:root[lang='fa'] .kicker,
:root[lang='fa'] .concept .where,
:root[lang='fa'] .door .n,
:root[lang='fa'] .step-head .meta,
:root[lang='fa'] .toc h2 {
    font-family: var(--font);
    font-weight: 600;
    font-size: 14px;
}

/* the route's numbers in Persian digits, from the panel's font */
:root[lang='fa'] .route a::before {
    font-family: var(--font);
    font-weight: 700;
}

:root[lang='fa'] .do li::before {
    font-family: var(--font);
    font-size: 14px;
}

:root[lang='fa'] .toc .num {
    font-family: var(--font);
    font-size: 13px;
}

/* mirror what has a direction: the arrows */
[dir='rtl'] .btn svg,
[dir='rtl'] .door .go svg,
[dir='rtl'] .hero-link .arr {
    transform: scaleX(-1);
}

[dir='rtl'] .door:hover .go svg {
    transform: scaleX(-1) translateX(4px);
}

[dir='rtl'] .hero-link:hover .arr {
    transform: scaleX(-1) translateX(3px);
}

[dir='rtl'] .hero h1 em {
    background-image: linear-gradient(-100deg, var(--rose) 30%, var(--plum));
}

[dir='rtl'] .page-head {
    background: radial-gradient(50% 80% at 15% 0%, var(--glow), transparent 70%);
}

[dir='rtl'] .door {
    background:
        radial-gradient(80% 90% at 0% 0%, var(--rose-soft), transparent 70%),
        var(--surface);
}

[dir='rtl'] .done {
    background:
        radial-gradient(70% 120% at 0% 0%, var(--rose-soft), transparent 70%),
        var(--surface);
}



/* ---------- API guide ---------- */

.page-head.api .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
    gap: clamp(28px, 4vw, 56px);
    align-items: center;
}

.page-head.api .kicker {
    margin-bottom: 18px;
}

.api-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.api-tools .search {
    flex: 1 1 320px;
    margin: 0;
}

.base-field {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 100%;
    height: 50px;
    padding-inline: 16px 10px;
    gap: 10px;
    border-radius: 15px;
    border: 1px solid var(--line-2);
    background: var(--surface);
    color: var(--text-3);
    font-size: 13px;
    white-space: nowrap;
}

.base-field:focus-within {
    border-color: var(--rose);
    box-shadow: 0 0 0 4px var(--rose-soft);
}

.base-field input {
    direction: ltr;
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    background: none;
    color: var(--text);
    font: 500 14px var(--mono);
    outline: none;
}

.api-hero {
    position: relative;
}

.api-hero .window {
    transform: perspective(1600px) rotateY(-6deg) rotateX(2deg);
    transform-origin: 100% 50%;
}

.api-hero pre {
    margin: 0;
    max-width: none;
    border: 0;
    border-radius: 0;
    padding: 18px 20px 20px;
    background: #120b10;
    font-size: 13px;
    line-height: 1.75;
}

.api-hero pre + pre {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: #0f090d;
}

.api-hero .label {
    display: block;
    margin-bottom: 6px;
    color: #8b7581;
    font: 500 11px/1 var(--mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.api-hero .status {
    position: absolute;
    inset-inline-end: -10px;
    bottom: -18px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid var(--line-2);
    background: var(--surface-2);
    box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.7);
    color: var(--text-2);
    font: 500 13px/1.2 var(--font);
}

.api-hero .status b {
    color: var(--teal);
    font: 600 13px/1 var(--mono);
}

.api-hero .status i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 0 4px rgba(56, 217, 169, 0.16);
}

@media (max-width: 980px) {
    .page-head.api .wrap {
        grid-template-columns: minmax(0, 1fr);
    }
    .api-hero .window {
        transform: none;
    }
    .api-hero .status {
        inset-inline-end: 12px;
    }
}

/* syntax colours for code blocks */
.tk-k {
    color: #ff9ac6;
}
.tk-s {
    color: #7ee0bf;
}
.tk-n {
    color: #c3a6ff;
}
.tk-b {
    color: #ffae8a;
}
.tk-p {
    color: #8b7581;
}
.tk-f {
    color: #f6eff3;
    font-weight: 500;
}

/* the guide part: prose blocks, wider than steps */
.guide-block {
    padding-bottom: 48px;
}

.guide-block + .guide-block,
.ref-section,
#error-codes,
.ref-group {
    padding-top: 48px;
    border-top: 1px solid var(--line);
}

.guide-block h3 {
    margin: 30px 0 10px;
    font-size: 18px;
}

.guide-block > p,
.guide-block .prose p,
.guide-block li {
    color: var(--text-2);
    max-width: 46em;
}

.guide-block ul.plain {
    margin: 12px 0 18px;
    padding-inline-start: 20px;
    display: grid;
    gap: 6px;
}

.guide-block ul.plain li::marker {
    color: var(--rose);
}

.searching .guide-block,
.searching .tiles-wrap {
    display: none;
}

.tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 26px 0 8px;
}

.tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid var(--line-2);
    background:
        radial-gradient(90% 90% at 100% 0%, var(--rose-soft), transparent 70%),
        var(--surface);
    color: var(--text);
    transition:
        border-color 0.2s,
        transform 0.2s;
}

[dir='rtl'] .tile {
    background:
        radial-gradient(90% 90% at 0% 0%, var(--rose-soft), transparent 70%),
        var(--surface);
}

.tile:hover {
    text-decoration: none;
    border-color: var(--rose-line);
    transform: translateY(-2px);
}

.tile svg {
    width: 22px;
    height: 22px;
    color: var(--rose);
}

.tile b {
    margin-top: 6px;
    font-weight: 600;
}

.tile span {
    color: var(--text-3);
    font-size: 14px;
    line-height: 1.5;
}

@media (max-width: 860px) {
    .tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* tabs over code samples */
.tabs {
    max-width: 46em;
    margin: 18px 0;
}

.tabs [role='tablist'] {
    direction: ltr;
    display: flex;
    gap: 4px;
    padding: 4px;
    width: max-content;
    max-width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--line-2);
    background: var(--surface);
}

.tabs [role='tab'] {
    padding: 7px 14px;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--text-2);
    font: 500 13.5px/1 var(--font);
    cursor: pointer;
    white-space: nowrap;
}

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

.tabs [role='tab'][aria-selected='true'] {
    background: var(--rose-soft);
    color: var(--rose);
}

.tabs pre {
    margin-top: 10px;
}

/* tables: status codes, events, headers, error codes */
.table-wrap {
    max-width: 100%;
    margin: 18px 0;
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid var(--line);
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
}

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

table.data tr:last-child td {
    border-bottom: 0;
}

/* a label in the first column breaks between words, never inside one */
table.data td:first-child > code {
    word-break: normal;
}

table.data th {
    background: var(--surface);
    color: var(--text-3);
    font: 500 12px/1.4 var(--mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

table.data td {
    color: var(--text-2);
}

table.data td:first-child {
    color: var(--text);
}

table.data tbody tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

.yes,
.no {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    font: 700 12px/1 var(--font);
}

.yes {
    background: rgba(56, 217, 169, 0.12);
    color: var(--teal);
}

.no {
    background: var(--surface-2);
    color: var(--text-3);
}

/* the scope ladder */
.ladder {
    display: grid;
    gap: 10px;
    max-width: 46em;
    margin: 22px 0;
    padding: 0;
    list-style: none;
}

.ladder li {
    display: grid;
    grid-template-columns: minmax(150px, max-content) 1fr;
    align-items: center;
    gap: 18px;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid var(--line-2);
    background: var(--surface);
}

.ladder li:nth-child(2) {
    margin-inline-start: 18px;
}

.ladder li:nth-child(3) {
    margin-inline-start: 36px;
}

.ladder li:nth-child(4) {
    margin-inline-start: 54px;
    border-color: var(--rose-line);
    background:
        linear-gradient(90deg, var(--rose-soft), transparent 80%),
        var(--surface);
}

[dir='rtl'] .ladder li:nth-child(4) {
    background:
        linear-gradient(270deg, var(--rose-soft), transparent 80%),
        var(--surface);
}

.ladder code {
    justify-self: start;
    color: var(--rose) !important;
}

.ladder span {
    color: var(--text-2);
    font-size: 15px;
}

@media (max-width: 600px) {
    .ladder li {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .ladder li:nth-child(n) {
        margin-inline-start: 0;
    }
}

/* HTTP methods */
.verb {
    direction: ltr;
    display: inline-grid;
    place-items: center;
    min-width: 62px;
    height: 26px;
    padding: 0 8px;
    border-radius: 8px;
    font: 600 11.5px/1 var(--mono);
    letter-spacing: 0.04em;
    --c: var(--text-2);
    color: var(--c);
    background: color-mix(in srgb, var(--c) 13%, transparent);
    border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}

.verb.get {
    --c: #38d9a9;
}
.verb.post {
    --c: #ff7db5;
}
.verb.patch {
    --c: #a07bfa;
}
.verb.put {
    --c: #ff9469;
}
.verb.delete {
    --c: #ff6b81;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
    color: var(--text-3);
    font-size: 14px;
}

.legend li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* endpoint cards */
.eps {
    display: grid;
    gap: 10px;
    margin-top: 22px;
}

.ep {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    transition: border-color 0.2s;
}

.ep:hover,
.ep[open] {
    border-color: var(--line-2);
}

.ep:target {
    border-color: var(--rose-line);
    box-shadow: 0 0 0 4px var(--rose-soft);
}

.ep > summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 6px 14px;
    padding: 14px 18px;
    list-style: none;
    cursor: pointer;
    border-radius: var(--radius);
}

.ep > summary::-webkit-details-marker {
    display: none;
}

.ep-route {
    display: block;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    overflow-wrap: anywhere;
    color: var(--text);
    font: 500 14px/1.45 var(--mono);
    text-align: start;
}

.ep-route b {
    color: var(--rose);
    font-weight: 500;
}

.ep .ep-title {
    display: block;
    color: var(--text-3);
    font-size: 14px;
    line-height: 1.45;
}

.ep .who-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.tag {
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    color: var(--text-3);
    font: 500 12px/1.4 var(--font);
    white-space: nowrap;
}

.tag.open {
    border-color: rgba(56, 217, 169, 0.35);
    color: var(--teal);
}

.tag.panel {
    border-color: color-mix(in srgb, var(--plum) 40%, transparent);
    color: #c3a6ff;
}

.ep .chev {
    width: 18px;
    height: 18px;
    color: var(--text-3);
    transition: transform 0.2s;
}

.ep[open] .chev {
    transform: rotate(180deg);
}

@media (max-width: 720px) {
    .ep > summary {
        grid-template-columns: auto minmax(0, 1fr) auto;
        padding: 14px;
    }
    .ep .who-tags {
        grid-column: 2 / -1;
        grid-row: 2;
        justify-content: flex-start;
    }
}

.ep-body {
    padding: 4px 18px 20px;
    border-top: 1px solid var(--line);
}

.ep-body .en,
.schema,
.params {
    direction: ltr;
    text-align: left;
}

.ep-body > p {
    margin: 16px 0 0;
    color: var(--text-2);
    max-width: 52em;
}

.ep-body h4 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 24px 0 10px;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

.ep-body h4 small {
    color: var(--text-3);
    font: 500 12.5px/1 var(--mono);
}

.access {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    color: var(--text-3);
    font-size: 14px;
}

.scope-chip {
    direction: ltr;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px 4px 11px;
    border-radius: 10px;
    border: 1px solid var(--rose-line);
    background: var(--rose-soft);
    color: var(--rose);
    font: 500 13px/1.4 var(--mono);
    cursor: pointer;
}

.scope-chip:hover {
    border-color: var(--rose);
}

.scope-chip em {
    padding: 1px 7px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-2);
    font: 500 11px/1.5 var(--font);
    font-style: normal;
}

.status-code {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 9px;
    border-radius: 7px;
    background: rgba(56, 217, 169, 0.1);
    color: var(--teal);
    font: 600 12.5px/1.5 var(--mono);
}

/* a JSON schema, as a tree of fields */
.schema {
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--bg-2);
    overflow: hidden;
}

.schema .schema {
    margin: 10px 0 2px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.18);
}

.field {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
}

.field:last-child {
    border-bottom: 0;
}

.field-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
}

.fname {
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    color: var(--text);
    font: 500 13.5px/1.5 var(--mono);
    overflow-wrap: anywhere;
}

.ftype {
    color: #c3a6ff;
    font: 400 12.5px/1.5 var(--mono);
}

.freq {
    color: var(--coral);
    font: 500 11.5px/1.5 var(--font);
}

.fdesc {
    margin-top: 3px;
    color: var(--text-2);
    font-size: 13.5px;
    line-height: 1.6;
}

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

.fmeta span {
    padding: 1px 7px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-3);
    font: 400 12px/1.6 var(--mono);
    overflow-wrap: anywhere;
}

.field > details > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 3px 10px;
    border-radius: 8px;
    border: 1px solid var(--line-2);
    color: var(--text-2);
    font: 500 12.5px/1.5 var(--font);
    cursor: pointer;
    list-style: none;
}

.field > details > summary::-webkit-details-marker {
    display: none;
}

.field > details > summary::before {
    content: '+';
    color: var(--rose);
    font-family: var(--mono);
}

.field > details[open] > summary::before {
    content: '−';
}

.field > details > summary:hover {
    border-color: var(--rose-line);
}

.schema-empty {
    padding: 11px 14px;
    color: var(--text-3);
    font-size: 13.5px;
}

.params .field-head .fin {
    color: var(--text-3);
    font: 400 12px/1.5 var(--mono);
}

.samples {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    margin-top: 24px;
}

.samples:has(> div:only-child) {
    grid-template-columns: minmax(0, 1fr);
}

.samples pre {
    max-width: none;
    max-height: 420px;
    margin: 6px 0 0;
    font-size: 12.5px;
    line-height: 1.65;
}

.samples .cap {
    color: var(--text-3);
    font: 500 12px/1 var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@media (max-width: 860px) {
    .samples {
        grid-template-columns: minmax(0, 1fr);
    }
}

.panel-only {
    margin-top: 16px;
}

#toc-ref {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.toc.collapsible:not(.open) #toc-ref {
    display: none;
}

#toc-ref .group:first-child {
    margin-top: 0;
}

.ref-group {
    margin-top: 40px;
}

.ref-group .group-title h2 {
    font-size: clamp(20px, 2.2vw, 25px);
}

.ref-count {
    margin: 14px 0 0;
    color: var(--text-3);
    font-size: 14px;
}

.err-filter {
    max-width: 380px;
    margin-top: 18px;
}

.err-filter input {
    height: 46px;
}

#error-table td:nth-child(2) {
    font-family: var(--mono);
    color: var(--text-3);
}

#error-table code {
    color: var(--rose) !important;
}

:root[lang='fa'] .ep-body h4,
:root[lang='fa'] table.data th,
:root[lang='fa'] .samples .cap,
:root[lang='fa'] .api-hero .label {
    font-family: var(--font);
}

:root[lang='fa'] table.data th {
    font-size: 13px;
    font-weight: 600;
}

[dir='rtl'] .api-hero .window {
    transform: perspective(1600px) rotateY(6deg) rotateX(2deg);
    transform-origin: 0% 50%;
}

@media (max-width: 980px) {
    [dir='rtl'] .api-hero .window {
        transform: none;
    }
}

/* English from the API (descriptions, error messages) keeps Latin digits: "Max 16", not "Max ۱۶" */
:root[lang='fa'] :is(#reference, #error-table) [lang='en'] {
    font-family: Montserrat, Vazirmatn, system-ui, sans-serif;
}

/* ---------- installer and one-command boxes (setup guide) ---------- */

/* one command per box, so each can be copied and run on its own */
pre.cmd {
    margin: 10px 0;
    padding: 12px 84px 12px 16px;
    /* long commands wrap on screen; the copy button still copies one line */
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

pre.cmd .copy-btn {
    top: 50%;
    transform: translateY(-50%);
}

/* the contents of a file, not a command: its path sits on top */
pre[data-file] {
    padding-top: 42px;
}

pre[data-file]::before {
    content: attr(data-file);
    position: absolute;
    top: 13px;
    left: 20px;
    color: #8b7581;
    font: 500 12px/1 var(--mono);
}

.step kbd {
    display: inline-block;
    min-width: 1.6em;
    padding: 0.05em 0.45em;
    border-radius: 6px;
    border: 1px solid var(--line-2);
    border-bottom-width: 2px;
    background: var(--surface-2);
    color: var(--text);
    font: 500 0.82em/1.5 var(--mono);
    text-align: center;
}

.tabs [role='tabpanel'] {
    padding-top: 6px;
}

.tabs [role='tabpanel'] > p {
    max-width: 44em;
    margin-top: 12px;
    color: var(--text-2);
}

/* what the installer looks like on screen */
.term {
    direction: ltr;
    max-width: 46em;
    margin: 22px 0;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid var(--line-2);
    background: #0f0a0d;
    box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.7);
}

.term-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    background: #160f14;
}

.term-bar i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
}

.term-bar span {
    margin-left: 8px;
    color: #8b7581;
    font: 500 12px/1 var(--mono);
}

.term pre {
    margin: 0;
    max-width: none;
    border: 0;
    border-radius: 0;
    font-size: 13px;
    line-height: 1.65;
}

.term b {
    color: #f6eff3;
    font-weight: 500;
}

.term .r {
    color: var(--rose);
}

.term .ok {
    color: var(--teal);
}

.term .h {
    color: var(--rose);
    font-weight: 500;
}

.term .d {
    color: #8b7581;
}

/* the by-hand install, folded away under the installer */
details.manual {
    max-width: 46em;
    margin: 26px 0;
    border-radius: 14px;
    border: 1px solid var(--line-2);
    background: var(--surface);
}

details.manual > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 18px;
    border-radius: 14px;
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

details.manual > summary::-webkit-details-marker {
    display: none;
}

details.manual > summary::before {
    content: '';
    flex: none;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--rose);
    border-bottom: 2px solid var(--rose);
    transform: rotate(-45deg);
    transition: transform 0.15s;
}

:root[lang='fa'] details.manual:not([open]) > summary::before {
    transform: rotate(135deg);
}

details.manual[open] > summary::before {
    transform: rotate(45deg);
}

details.manual > summary:hover {
    color: var(--rose);
}

details.manual > summary:focus-visible {
    outline: 2px solid var(--rose);
    outline-offset: 2px;
}

details.manual > :not(summary) {
    margin-inline: 18px;
}

details.manual > :last-child {
    margin-bottom: 18px;
}

details.manual > p {
    color: var(--text-2);
}

.step .table-wrap {
    max-width: 46em;
}

@media (max-width: 520px) {
    details.manual > :not(summary) {
        margin-inline: 12px;
    }

    /* on a phone the copy button sits above the command, so the command gets the whole width */
    pre.cmd {
        padding: 42px 14px 12px;
    }

    pre.cmd .copy-btn {
        top: 8px;
        transform: none;
    }
}

/* Move from another panel: what comes over, and the per-panel notes */
table.data.moves td.y {
    color: var(--teal);
}

table.data.moves td.n {
    color: var(--text-3);
}

dl.per-panel {
    display: grid;
    grid-template-columns: minmax(150px, max-content) 1fr;
    gap: 14px 24px;
    max-width: 46em;
    margin: 18px 0 22px;
}

dl.per-panel dt {
    color: var(--text);
    font-weight: 600;
}

dl.per-panel dd {
    margin: 0;
    color: var(--text-2);
}

@media (max-width: 560px) {
    dl.per-panel {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    dl.per-panel dd {
        margin-bottom: 12px;
    }
}
