/* ==========================================================================
   base.css — design tokens and the chrome every page shares: header, brand,
   language menu, buttons, footer, toast, long-form copy and the FAQ.
   Page-specific rules live in scroller.css and page.css.
   ========================================================================== */

/* ==========================================================
   tokens
   ========================================================== */
:root {
    --bg: #07080A;
    --bg-2: #0B0D11;
    --card: #0F1116;
    --card-2: #14171D;
    --line: #1E222B;
    --line-2: #2A303B;
    --text: #EDF0F5;
    --muted: #8B95A3;
    --dim: #5F6773;
    --accent: #FFB020;
    --accent-soft: rgba(255, 176, 32, .12);
    --danger: #FF5A5A;
    --r-lg: 18px;
    --r: 13px;
    --r-sm: 9px;
    --ui: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
    --gut: 20px;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--ui);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    /* Keeps the footer at the bottom of the viewport on a short page, so the
       404 doesn't leave a band of empty background under it. */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body>main {
    flex: 1 0 auto;
    width: 100%;
}

.site-foot {
    flex-shrink: 0;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

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

::selection {
    background: var(--accent);
    color: #111;
}

.wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 var(--gut);
}

.ico {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

/* Visible only once tabbed to, which is the whole point of it. */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    background: var(--accent);
    color: #150F02;
    padding: 10px 16px;
    border-radius: 0 0 var(--r) 0;
    font-weight: 600;
}

.skip-link:focus {
    left: 0;
}

/* ==========================================================
   header
   ========================================================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px var(--gut);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    /* Logical, so the brand still hugs the leading edge in Arabic. */
    margin-inline-end: auto;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.brand .mark {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    flex: 0 0 auto;
    /* The dot grid is painted into the content box, so the 3px padding gives it
       a margin inside the rounded square. Tiling across the full 24px instead
       ran the dots into the corner radius and the outer ones were clipped;
       4.5px tiles across the 18px content box give a clean, centred 4×4. */
    padding: 3px;
    background:
        radial-gradient(circle at center, var(--accent) 0 1.3px, transparent 1.5px) content-box 0 0 / 4.5px 4.5px,
        #13161c;
    background-clip: content-box, border-box;
    box-shadow: 0 0 12px rgba(255, 176, 32, .3), inset 0 0 0 1px var(--line-2);
}

.brand b {
    font-family: "Doto", var(--ui);
    font-weight: 800;
    font-size: 18px;
    letter-spacing: .01em;
    white-space: nowrap;
}

.brand b i {
    font-style: normal;
    color: var(--accent);
}

/* ==========================================================
   buttons
   ========================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 13px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
    white-space: nowrap;
}

.btn:hover {
    border-color: var(--line-2);
    background: var(--card-2);
}

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

.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #150F02;
}

.btn.primary:hover {
    background: #ffc247;
    border-color: #ffc247;
}

.btn.subtle {
    background: transparent;
}

.btn.sm {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 9px;
}

.btn.danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #1a0505;
}

.btn.danger:hover {
    background: #ff7676;
    border-color: #ff7676;
}

.btn[hidden] {
    display: none;
}

/* Square, so an icon on its own doesn't sit in a wide pill. */
.btn.icon-only {
    padding: 8px;
    width: 34px;
}

/* ==========================================================
   language menu
   ========================================================== */
.menu-anchor {
    position: relative;
}

.menu {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    min-width: 190px;
    max-height: min(70vh, 420px);
    overflow-y: auto;
    background: var(--card);
    border: 1px solid var(--line-2);
    border-radius: var(--r);
    padding: 6px;
    display: none;
    z-index: 80;
    box-shadow: 0 20px 44px -22px rgba(0, 0, 0, .9);
}

.menu.open {
    display: block;
}

/* In the footer there is nothing below to open into, so the list goes up. */
.menu.up {
    top: auto;
    bottom: calc(100% + 8px);
}

.menu a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    color: var(--muted);
    text-decoration: none;
    font-size: 13.5px;
}

.menu a:hover {
    background: var(--card-2);
    color: var(--text);
}

.menu a[aria-current="true"] {
    color: var(--accent);
}

/* ==========================================================
   language picker
   ========================================================== */
.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.lang-btn:hover {
    border-color: var(--line-2);
    background: var(--card-2);
}

.lang-btn .ico:first-child {
    color: var(--muted);
}

.lang-btn .ico:last-child {
    width: 13px;
    height: 13px;
    color: var(--muted);
}

.lang-btn[aria-expanded="true"] .ico:last-child {
    transform: rotate(180deg);
}

/* ==========================================================
   long-form copy
   ========================================================== */
.section-title {
    font-size: 14px;
    margin: 0 0 12px;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: .02em;
}

.hero {
    margin-top: 40px;
}

.hero h1 {
    font-size: clamp(26px, 5vw, 36px);
    line-height: 1.12;
    margin: 8px 0 10px;
    letter-spacing: -.015em;
}

.eyebrow {
    display: inline-block;
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
}

.lede {
    font-size: 16px;
    color: var(--muted);
    max-width: 68ch;
    margin: 0;
    line-height: 1.6;
}

.article {
    margin-top: 40px;
    max-width: 72ch;
}

.article h2 {
    font-size: 19px;
    margin: 30px 0 10px;
    letter-spacing: -.01em;
}

.article h2:first-child {
    margin-top: 0;
}

.article p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.65;
}

.article strong,
.article b {
    color: var(--text);
    font-weight: 600;
}

.uses,
.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.uses li,
.steps li {
    display: flex;
    gap: 11px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 13px 15px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.uses li b,
.steps li b {
    color: var(--text);
}

.bullet {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--mono);
    font-size: 12px;
}

.howto {
    margin-top: 36px;
}

/* ==========================================================
   FAQ
   ========================================================== */
.faq-block {
    margin-top: 40px;
}

.faq {
    display: grid;
    gap: 8px;
}

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

.acc>summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
    font-size: 14.5px;
    font-weight: 600;
}

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

.acc>summary .ico {
    margin-inline-start: auto;
    color: var(--muted);
    transition: transform .2s;
}

.acc[open]>summary .ico {
    transform: rotate(180deg);
}

.acc-body {
    padding: 0 16px 15px;
}

.acc-body p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.acc-body a,
.prose a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--line-2);
}

.acc-body a:hover,
.prose a:hover {
    border-color: var(--accent);
}

/* ==========================================================
   breadcrumbs
   ========================================================== */
.crumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
    padding: 0;
    font-size: 12.5px;
    color: var(--dim);
}

.crumbs li+li::before {
    content: "/";
    margin-inline-end: 8px;
    color: var(--line-2);
}

.crumbs a {
    color: var(--muted);
    text-decoration: none;
}

.crumbs a:hover {
    color: var(--accent);
}

/* ==========================================================
   footer
   ========================================================== */
.site-foot {
    margin-top: 48px;
    border-top: 1px solid var(--line);
    padding: 26px var(--gut) 34px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    font-size: 12.5px;
    color: var(--dim);
    text-align: center;
}

.foot-meta {
    display: flex;
    gap: 6px 18px;
    flex-wrap: wrap;
    justify-content: center;
}

.foot-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}

.site-foot a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid var(--line-2);
}

.site-foot a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ==========================================================
   modal
   ========================================================== */
.modal {
    border: 1px solid var(--line-2);
    border-radius: var(--r-lg);
    background: var(--card);
    color: var(--text);
    padding: 22px 24px 20px;
    max-width: min(420px, calc(100vw - 32px));
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .95);
}

.modal::backdrop {
    background: rgba(4, 5, 7, .72);
    backdrop-filter: blur(3px);
}

.modal h2 {
    margin: 0 0 8px;
    font-size: 17px;
    letter-spacing: -.01em;
}

.modal p {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* ==========================================================
   toast
   ========================================================== */
.toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translate(-50%, 20px);
    background: #181C23;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    padding: 11px 16px;
    font-size: 13px;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: .22s;
    max-width: 88vw;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 640px) {
    :root {
        --gut: 14px;
    }

    .brand b {
        font-size: 16px;
    }

    .btn .lbl {
        display: none;
    }

    .btn {
        padding: 9px 11px;
    }

    .hero {
        margin-top: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn {
        transition: none;
    }
}
