/* =====================================================================
   omarhassan.work / Omar Hassan  (v7, Nov 2026)
   Black on white. One typeface (Arimo, a Helvetica-style grotesque),
   two weights (400, 700), one narrow column, one spacing rhythm.
   Institutional, record-like structure: a top strip, boxed tabs, a
   breadcrumb, numbered sections and bordered tables. The one black
   panel on the site is the experiment on the profile page.
   ===================================================================== */

/* Arimo, self-hosted so no visitor data goes to a third party */
@font-face {
    font-family: 'Arimo';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../assets/fonts/arimo-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Arimo';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../assets/fonts/arimo-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --paper: #ffffff;
    --ink: #0a0a0a;
    --grey: #6b6b6b;
    --hair: #e0e0e0;
    --rule: #d4d4d4;      /* table and tab borders */
    --fill: #f3f3f3;      /* top strip, table label cells */
    --title-colour: var(--ink); /* the name in the header */

    --font: 'Arimo', 'Helvetica Neue', Helvetica, Arial, sans-serif;

    /* type scale */
    --t-small: 14.5px;
    --t-body: 17px;
    --t-h3: 1.2rem;
    --t-h2: 1.5rem;
    --t-deck: clamp(1.45rem, 2.6vw, 1.95rem);
    --t-name: clamp(1.6rem, 2.8vw, 2rem);
    --t-title: clamp(2rem, 4vw, 2.6rem);

    /* spacing: one rhythm used everywhere */
    --gap: 28px;
    --space: clamp(56px, 6vw, 88px);
    --gutter: clamp(20px, 4vw, 64px);
    --max: 1680px;
    --col-gap: clamp(40px, 4vw, 80px);

    color-scheme: light;
}

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

html {
    background: var(--paper);
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    overflow-x: clip;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    font-size: var(--t-body);
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--ink); color: var(--paper); }

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

a {
    color: inherit;
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}
a:hover { text-decoration-thickness: 2px; }

em { font-style: normal; font-weight: 700; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.skip {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 10;
    background: var(--ink);
    color: var(--paper);
    padding: 10px 14px;
    font-weight: 700;
    font-size: 14px;
}
.skip:focus { left: 8px; }

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

/* ---------- Shared type ----------------------------------------------- */

.kicker {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

.meta {
    font-size: var(--t-small);
    color: var(--grey);
    margin: 0;
}

.double-rule {
    border-top: 3px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    height: 7px;
}

/* ---------- Top strip (identical on every page) ----------------------- */

.util {
    background: var(--fill);
    border-bottom: 1px solid var(--hair);
    font-size: 12.5px;
    color: var(--grey);
}
.util .wrap {
    display: flex;
    justify-content: space-between;
    gap: 2px 16px;
    flex-wrap: wrap;
    padding-top: 7px;
    padding-bottom: 7px;
}
.util p { margin: 0; }

/* ---------- Site header (identical on every page) ---------------------- */

.site-head { padding-top: clamp(24px, 4vw, 40px); }

.head-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px 24px;
    flex-wrap: wrap;
}

.brand {
    display: block;
    padding-bottom: 14px;
    color: var(--title-colour);
    text-decoration: none;
}
.name {
    display: block;
    font-size: var(--t-name);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1;
    margin: 0;
    white-space: nowrap;
}
.tabs {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}
.tabs li + li { margin-left: -1px; }
.tabs a {
    display: block;
    min-width: 104px;
    padding: 9px 18px;
    text-align: center;
    border: 1px solid var(--rule);
    border-bottom: 0;
    text-decoration: none;
    font-size: 15px;
}
.tabs a:hover { background: var(--fill); }
.tabs a[aria-current="page"] {
    position: relative;
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}

.crumb { padding-top: 10px; font-size: 13px; color: var(--grey); }
.crumb ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.crumb li + li::before { content: '/'; margin: 0 8px; color: #b0b0b0; }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

@media (max-width: 560px) {
    .head-row { flex-direction: column; align-items: stretch; gap: 4px; }
    .tabs li { flex: 1; }
    .tabs a { min-width: 0; padding: 9px 0; }
}

/* ---------- Page title (blog, archive, 404) --------------------------- */

.page-title {
    font-size: var(--t-title);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.05;
    margin: clamp(36px, 5vw, 56px) 0 0;
}

/* ---------- Section headings: numbered box, rule underneath ------------ */

.section > h2,
.app > h2,
.experiment > h2 {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: var(--t-h2);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 0 var(--gap);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ink);
}
.num {
    flex: none;
    position: relative;
    top: -3px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.5;
    padding: 0 7px;
    border: 1px solid currentColor;
}

/* ---------- Record tables: bordered, grey label cells ------------------ */

.record {
    width: 100%;
    max-width: 700px;
    border-collapse: collapse;
    font-size: 15.5px;
    line-height: 1.45;
}
.record th,
.record td {
    border: 1px solid var(--rule);
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
}
.record th {
    width: 160px;
    background: var(--fill);
    font-size: 14.5px;
    font-weight: 700;
}
@media (max-width: 560px) {
    .record th { width: 110px; }
    .record th, .record td { padding: 9px 10px; }
}

.tag {
    display: inline-block;
    margin: 0 0 10px;
    padding: 0 8px;
    border: 1px solid #9a9a9a;
    font-size: 12.5px;
    line-height: 1.6;
    color: #444;
}

/* ---------- Profile intro --------------------------------------------- */

.intro { padding-top: clamp(36px, 5vw, 56px); }

.deck {
    font-size: var(--t-deck);
    font-weight: 400;
    line-height: 1.22;
    letter-spacing: -0.02em;
    max-width: 30ch;
    margin: 0 0 28px;
}

.intro-text { margin: 0; }
.intro-text p { margin: 0 0 1em; max-width: 60ch; }
.intro-text p:last-child { margin-bottom: 0; }


/* ---------- Sections (profile) ---------------------------------------- */

.section { margin-top: var(--space); }
.intro + .section { margin-top: clamp(48px, 6vw, 72px); }

.entries { list-style: none; margin: 0; padding: 0; }
.entry {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 4px 24px;
}
.entry + .entry { margin-top: 36px; }
.entry .when { font-size: var(--t-small); color: var(--grey); padding-top: 2px; }

.entry h3, .school h3 {
    font-size: var(--t-h3);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
}
.entry p, .school p { margin: 0 0 8px; max-width: 62ch; }
.entry p:last-child, .school p:last-child { margin-bottom: 0; }

@media (max-width: 560px) {
    .entry { grid-template-columns: 1fr; }
    .entry .when { padding-top: 0; }
}

.school + .school { margin-top: 28px; }


.plain { list-style: none; margin: 0; padding: 0; }
.plain li { max-width: 62ch; }
.plain li + li { margin-top: 12px; }

/* ---------- The experiment (the one black panel) ----------------------- */

.experiment {
    margin-top: var(--space);
    background: var(--ink);
    color: var(--paper);
    padding: clamp(28px, 5vw, 48px);
}
.experiment ::selection { background: var(--paper); color: var(--ink); }

.experiment > h2 { border-bottom-color: rgba(255, 255, 255, 0.5); }
.exp-head { margin-bottom: 32px; }
.exp-head h3 {
    font-size: clamp(1.6rem, 3.2vw, 2.2rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.035em;
    margin: 0 0 10px;
}
.exp-head p { margin: 0; color: #cfcfcf; font-size: 15.5px; max-width: 52ch; }

.exp-step[hidden] { display: none; }
.exp-step + .exp-step { margin-top: 32px; }

.exp-q {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 14px;
}

.tickets, .prices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ticket, .price {
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 20px 22px;
}

.ticket {
    appearance: none;
    font: inherit;
    color: inherit;
    text-align: left;
    background: transparent;
    cursor: pointer;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "label label"
        "odds  prize"
        "desc  desc";
    gap: 8px 16px;
    align-items: end;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.ticket:hover { border-color: var(--paper); }
.ticket[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); }

.t-label { grid-area: label; font-size: 14px; font-weight: 700; }
.t-odds { grid-area: odds; }
.t-prize { grid-area: prize; }
.t-odds, .t-prize, .price output {
    font-weight: 700;
    font-size: clamp(2.2rem, 4.4vw, 3.2rem);
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}
.t-desc { grid-area: desc; font-size: 14.5px; opacity: 0.8; }

.price label { display: block; font-size: 14.5px; }
.price label strong { font-weight: 700; }
.price output { display: block; margin: 10px 0 16px; }

.price input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 24px;
    background: transparent;
    cursor: pointer;
    margin: 0;
}
.price input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--paper); }
.price input[type="range"]::-moz-range-track { height: 1px; background: var(--paper); }
.price input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    margin-top: -9px;
    background: var(--paper);
    border: 0;
    border-radius: 0;
}
.price input[type="range"]::-moz-range-thumb {
    width: 18px; height: 18px;
    background: var(--paper);
    border: 0;
    border-radius: 0;
}
.price .scale { display: flex; justify-content: space-between; font-size: 13px; opacity: 0.6; margin-top: 4px; }

.exp-actions { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-top: 20px; }
.exp-hint { margin: 12px 0 0; font-size: 14.5px; color: #cfcfcf; min-height: 1.2em; }
.exp-note { margin: 10px 0 0; font-size: 14.5px; color: #cfcfcf; }

.exp-btn {
    appearance: none;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 18px;
    border: 1px solid var(--paper);
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
}
.exp-btn:hover { background: transparent; color: var(--paper); }
.exp-link {
    appearance: none;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-size: 15px;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.2em;
    cursor: pointer;
}

.exp-result { border-top: 1px solid rgba(255, 255, 255, 0.5); padding-top: 24px; }
.exp-verdict {
    font-size: clamp(1.35rem, 2.4vw, 1.7rem);
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -0.02em;
    max-width: 34ch;
    margin: 0;
}
.exp-verdict:focus { outline: none; }
.exp-explain { margin-top: 24px; max-width: 58ch; }
.exp-explain p { margin: 0 0 12px; color: #d6d6d6; font-size: 15.5px; }
.exp-explain .source { font-size: 13.5px; color: #9a9a9a; }

@media (max-width: 560px) { .tickets, .prices { grid-template-columns: 1fr; } }

/* ---------- Footer ------------------------------------------------------ */

.foot { margin-top: var(--space); padding-bottom: 32px; }
.foot .double-rule { margin-bottom: 22px; }
.foot-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px 32px;
    flex-wrap: wrap;
}
.foot .email {
    display: inline-block;
    margin-top: 8px;
    font-size: clamp(1.25rem, 2.4vw, 1.6rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.foot-note { margin-top: 8px; }
.foot-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; }
.foot-base {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 36px;
    font-size: 13.5px;
    color: var(--grey);
}

/* ---------- Archive ----------------------------------------------------- */

.statement { padding-top: 28px; }
.statement .lead p {
    font-size: clamp(1.15rem, 1.8vw, 1.35rem);
    line-height: 1.45;
    letter-spacing: -0.012em;
    max-width: 40ch;
    margin: 0 0 1em;
}
.statement aside {
    margin-top: 36px;
    border-top: 1px solid var(--ink);
    padding-top: 14px;
    max-width: 62ch;
}
.statement aside p { margin: 0 0 8px; }

.app { margin-top: var(--space); }
.app > p { margin: 0 0 20px; max-width: 62ch; }
.app .record { margin-bottom: 24px; }
.app .record a { font-weight: 700; }
.app figure { margin: 0; }
.app img {
    width: 100%;
    border: 1px solid var(--hair);
    filter: grayscale(1);
    transition: filter 0.35s ease;
}
/* colour on hover or keyboard focus; always in colour where there is no hover (phones, tablets) */
.app:hover img,
.app:focus-within img { filter: none; }
@media (hover: none) { .app img { filter: none; } }

/* ---------- Blog -------------------------------------------------------- */

.blog-empty { padding-top: 28px; }
.blog-empty .soon {
    font-size: var(--t-deck);
    line-height: 1.22;
    letter-spacing: -0.02em;
    margin: 0 0 10px;
}
.blog-empty p { margin: 0; max-width: 62ch; }

.posts { list-style: none; margin: 36px 0 0; padding: 0; border-top: 1px solid var(--ink); }
.post-item {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 4px 24px;
    padding: 18px 0;
    border-bottom: 1px solid var(--rule);
}
.post-item time { font-size: var(--t-small); color: var(--grey); padding-top: 3px; font-variant-numeric: tabular-nums; }
.post-item h2 {
    font-size: var(--t-h2);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 0 8px;
}
.post-item h2 a { text-decoration: none; }
.post-item h2 a:hover { text-decoration: underline; }
.post-item p { margin: 0; max-width: 62ch; }
@media (max-width: 560px) { .post-item { grid-template-columns: 1fr; } .post-item time { padding: 0; } }

/* Single post */
.article { max-width: 680px; }
.article-head { padding-top: clamp(48px, 7vw, 80px); margin-bottom: 36px; }
.article-head h1 {
    font-size: var(--t-title);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.035em;
    margin: 10px 0 12px;
}
.prose { font-size: 18px; line-height: 1.7; }
.prose h2, .prose h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; margin: 2em 0 0.5em; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table { margin: 0 0 1.1em; }
.prose blockquote { border-left: 3px solid var(--ink); padding-left: 20px; margin-left: 0; }
.prose code { font-family: ui-monospace, Menlo, monospace; font-size: 0.85em; background: #f2f2f2; padding: 1px 4px; }
.prose pre { background: #f4f4f4; padding: 16px; overflow-x: auto; font-size: 15px; }
.prose pre code { background: none; padding: 0; }
.prose img { margin: 1.6em 0; }
.prose hr { border: 0; border-top: 1px solid var(--hair); margin: 2.4em 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15.5px; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--hair); padding: 8px 10px; text-align: left; }
.prose th { border-bottom: 2px solid var(--ink); }

/* ---------- 404 --------------------------------------------------------- */

.lost p { margin: 20px 0 0; }

/* ---------- Desktop: full width, two blocks per row -------------------- */
/* Phones and tablets keep the single column above. */

@media (min-width: 1100px) {
    .row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 0 var(--col-gap);
        align-items: start;
        margin-top: var(--space);
    }
    .row > *,
    .row > .intro + .section { margin-top: 0; }
    .row:first-child { margin-top: 0; padding-top: clamp(36px, 5vw, 56px); }
    .row:first-child > .intro { padding-top: 0; }
    .row .record { max-width: none; }
    .row .entry p { max-width: none; }

    /* the experiment: explanation on the left, tickets and sliders on the right */
    .experiment {
        display: grid;
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        gap: 0 var(--col-gap);
        align-items: start;
    }
    .experiment > h2 { grid-column: 1 / -1; }
    .experiment > .exp-head { grid-column: 1; grid-row: 2 / span 4; margin-bottom: 0; }
    .experiment > .exp-step,
    .experiment > noscript { grid-column: 2; }

    /* other work: one list in two columns */
    .two-col { columns: 2; column-gap: var(--col-gap); }
    .two-col li { break-inside: avoid; max-width: none; }
    .two-col li + li { margin-top: 0; }
    .two-col li { padding-bottom: 12px; }

    /* archive: statement beside its note; each app's text and table beside its screenshot */
    .statement {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 0 var(--col-gap);
        align-items: end;
    }
    .statement .lead p { max-width: none; }
    .statement aside { margin-top: 0; }
    .app {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 0 var(--col-gap);
        align-items: start;
    }
    .app > h2 { grid-column: 1 / -1; }
    .app > p,
    .app > .record { grid-column: 1; }
    .app > figure { grid-column: 2; grid-row: 2 / span 2; }
    .app .record { max-width: none; }
}

/* ---------- Motion + print -------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.001ms !important; }
}

@media print {
    .experiment, .util, .tabs { display: none; }
}
