@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/inter-latin-400-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/inter-latin-500-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Roboto Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/roboto-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Roboto Mono";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/roboto-mono-latin-500-normal.woff2") format("woff2");
}

:root {
    --bg: #fafafa;
    --text: #1a1a1a;
    --text-2: #555;
    --muted: #8a8a8a;
    --rule: #e0e0e0;
    --accent: #2a46c4;

    --mono: "Roboto Mono", ui-monospace, monospace;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

    --s1: 8px;
    --s2: 16px;
    --s3: 24px;
    --s4: 32px;
    --s5: 48px;
    --s6: 72px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111213;
        --text: #e8e8e8;
        --text-2: #a3a3a3;
        --muted: #6f6f6f;
        --rule: #2a2b2d;
        --accent: #8ea0ff;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

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

.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 96px 24px var(--s5);
}

/* ---------- shared section anatomy ---------- */

.section {
    margin-top: var(--s6);
    padding-top: var(--s3);
    border-top: 1px solid var(--rule);
}

.label {
    display: flex;
    gap: var(--s2);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-2);
    margin-bottom: var(--s4);
}

.label .idx {
    color: var(--muted);
    font-weight: 400;
}

.prose p + p {
    margin-top: var(--s2);
}

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

.prose a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
    transition:
        border-color 0.2s,
        color 0.2s;
}

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

.ar {
    font-family: "Noto Naskh Arabic", "Geeza Pro", "Segoe UI", serif;
    font-size: 1.05em;
    color: var(--text-2);
    white-space: nowrap;
}

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

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--s5);
}

h1 {
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.lang {
    display: flex;
    gap: var(--s1);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--muted);
}

.lang a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

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

.lang [aria-current] {
    color: var(--text);
}

.cursor {
    display: inline-block;
    width: 0.6em;
    height: 1.15em;
    margin-left: 2px;
    vertical-align: -0.2em;
    background: var(--accent);
    animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.sort {
    margin-bottom: var(--s5);
}

.sort pre {
    font-family:
        ui-monospace, "SFMono-Regular", Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: 12px;
    line-height: 1;
    color: var(--rule);
    user-select: none;
}

.sort pre .on {
    color: var(--text);
}

.sort pre .hi {
    color: var(--accent);
}

.sort figcaption {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    margin-top: var(--s2);
    white-space: pre;
    transition: color 0.2s;
}

.sort[role="button"] {
    cursor: pointer;
}

.sort[role="button"]:hover figcaption,
.sort[role="button"]:focus-visible figcaption {
    color: var(--accent);
}

.sort:focus-visible {
    outline: 1px dashed var(--accent);
    outline-offset: var(--s1);
}

.lead {
    font-size: 18px;
}

/* ---------- services ---------- */

.service-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s4) var(--s4);
}

.service-item {
    border-left: 2px solid var(--rule);
    padding-left: var(--s2);
    transition: border-color 0.2s;
}

.service-item:hover {
    border-color: var(--accent);
}

.service-item h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: var(--s1);
}

.service-item p {
    font-size: 15px;
    color: var(--text-2);
}

/* ---------- name / figure ---------- */

.figure {
    margin-top: var(--s4);
}

.figure svg {
    display: block;
    width: 100%;
    max-width: 280px;
    height: auto;
    color: var(--text);
    overflow: visible;
}

.figure svg text {
    font-family: var(--mono);
    font-size: 13px;
    fill: var(--text-2);
}

.figure .draw {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.25;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 1.2s ease;
}

.figure .draw:nth-of-type(2) {
    transition-delay: 0.4s;
}

.figure .draw:nth-of-type(3) {
    transition-delay: 0.6s;
}

.figure .completed,
.figure .late {
    opacity: 0;
    transition: opacity 0.6s ease 1.5s;
}

.figure .completed {
    fill: var(--accent);
    fill-opacity: 0.15;
    stroke: var(--accent);
    stroke-width: 1.25;
    stroke-dasharray: 4 3;
}

.figure .completed-label {
    fill: var(--accent) !important;
}

.figure.in .draw {
    stroke-dashoffset: 0;
}

.figure.in .completed,
.figure.in .late {
    opacity: 1;
}

.figure figcaption {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    margin-top: var(--s2);
}

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

.contact p + p {
    margin-top: var(--s1);
}

.contact p {
    color: var(--text-2);
}

#contact-email {
    font-family: var(--mono);
    font-size: 15px;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
    transition:
        border-color 0.2s,
        color 0.2s;
}

a#contact-email:hover {
    color: var(--accent);
    border-color: var(--accent);
}

footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--s2);
    margin-top: var(--s6);
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

#page-stats {
    white-space: nowrap;
}

@media (max-width: 640px) {
    .container {
        padding: 64px 20px var(--s4);
    }

    .section {
        margin-top: var(--s5);
    }

    .service-list {
        grid-template-columns: 1fr;
    }

    footer {
        flex-direction: column;
        gap: var(--s1);
    }

    .lead {
        font-size: 17px;
    }

    .sort pre {
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cursor {
        animation: none;
    }

    .figure .draw,
    .figure .completed,
    .figure .late {
        transition: none;
    }
}
