/* =============================================================
   SAYEDASIF.COM DESIGN SYSTEM
   Porcelain + Deep Teal + Ink.

   Load order on every page:
     1. /assets/css/site.css        tokens, base elements, shared components (this file)
     2. /assets/css/global-nav.css  header, footer, floating WhatsApp button
     3. the page's own <style>      page-specific layout, written ONLY with the tokens below

   Rule: page CSS never hard-codes a colour. Use a --color-* token. scripts/verify check 1
   (lint step) reports any hex/rgb colour in a page <style> block outside the project covers.

   Breakpoints (media queries cannot read custom properties, so they are listed here):
     560px  phone      768px  large phone / small tablet
     1024px tablet     1280px desktop
   ============================================================= */


/* -------------------------------------------------------------
   FONTS (self-hosted, SIL Open Font License, see /assets/fonts/LICENSE-*.txt)
   ------------------------------------------------------------- */

@font-face {
    font-family: "Source Serif 4";
    src: url("/assets/fonts/source-serif-4-latin-wght.woff2") format("woff2");
    font-weight: 200 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("/assets/fonts/ibm-plex-sans-latin-wght.woff2") format("woff2");
    font-weight: 100 700;
    font-style: normal;
    font-display: swap;
}

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

@font-face {
    font-family: "IBM Plex Mono";
    src: url("/assets/fonts/ibm-plex-mono-latin-500.woff2") format("woff2");
    font-weight: 500 700;
    font-style: normal;
    font-display: swap;
}

/* Metric-matched fallbacks: a local system face scaled to the web font's average glyph width, so text
   wraps the same before and after the web font arrives (no layout shift on swap). Ratios measured in
   Chromium on a mixed sentence (web font width / system font width). A face whose local() source is
   missing on a device is skipped and the next one in the stack is used. */
@font-face { font-family: "Serif Fallback A"; src: local("Georgia"); size-adjust: 93.5%; }
@font-face { font-family: "Serif Fallback B"; src: local("Times New Roman"); size-adjust: 112%; }
@font-face { font-family: "Sans Fallback A"; src: local("Arial"); size-adjust: 101%; }
@font-face { font-family: "Sans Fallback B"; src: local("Roboto"); size-adjust: 110.7%; }
@font-face { font-family: "Mono Fallback A"; src: local("Courier New"); size-adjust: 100%; }
@font-face { font-family: "Mono Fallback B"; src: local("Consolas"); size-adjust: 109.1%; }


/* -------------------------------------------------------------
   TOKENS: LIGHT THEME (default)
   Contrast figures are WCAG 2.2 ratios measured on Porcelain / White.
   ------------------------------------------------------------- */

:root {
    color-scheme: light;

    /* Surfaces */
    --color-page: #F8F8F5;                 /* Porcelain */
    --color-surface: #FFFFFF;              /* cards, forms, menus */
    --color-surface-muted: #EFF4F0;        /* secondary panels */
    --color-surface-soft: #E5F3EF;         /* Soft Mint: selected / highlighted */
    --color-surface-inverse: #182522;      /* Ink panels: one loud moment per page */
    --color-surface-raised: #FFFFFF;       /* header, dropdowns */

    /* Text */
    --color-heading: #182522;              /* Deep Ink   14.9 / 15.8 */
    --color-text: #35433F;                 /* Body       9.7 / 10.4 */
    --color-text-muted: #53635F;           /* Quiet Slate 5.9 / 6.3 (5.5 on mint) */
    --color-text-inverse: #F8F8F5;         /* on Ink 14.9 */
    --color-text-inverse-muted: #B9C8C2;   /* on Ink 9.1 */
    --color-accent-inverse: #9FD8CC;       /* teal tint on Ink 9.9 */

    /* Brand */
    --color-brand: #087F70;                /* Signature Teal: fills, rings, graphics. As text only >= 4.6 on page/white */
    --color-brand-hover: #075E54;          /* Deep Teal: hover / pressed */
    --color-brand-soft: #E5F3EF;
    --color-on-brand: #FFFFFF;             /* white on #087F70 4.9, on #075E54 7.7 */
    --color-link: #075E54;                 /* text links: 6.7 on mint, 7.2 on page (Signature Teal fails on mint: 4.30) */
    --color-link-hover: #182522;

    /* Lines */
    --color-border: #DCE4DF;               /* Fine Border: decorative dividers only (1.3:1) */
    --color-border-strong: #7E8F89;        /* input and control boundaries: 3.4 on white (WCAG 1.4.11) */
    --color-focus: #087F70;                /* focus ring 4.6 on page */

    /* Semantic: text colour + tinted background, always paired with an icon or word */
    --color-success: #237448;
    --color-success-bg: #E8F3EC;           /* 5.0 */
    --color-warning: #8A5700;
    --color-warning-bg: #FBF1DE;           /* 5.4 */
    --color-error: #B42318;
    --color-error-bg: #FBEAE8;             /* 5.7 */

    /* Code (dark panel in both themes) */
    --color-code-bg: #182522;
    --color-code-fg: #E6ECE9;              /* 13.2 */
    --color-code-muted: #9DB0A9;           /* comments 7.0 */
    --color-code-keyword: #7FD1C2;         /* 8.9 */
    --color-code-string: #E9C77F;          /* 9.8 */
    --color-code-number: #F0A992;          /* 8.1 */
    --color-code-title: #A9C8F0;           /* 9.2 */
    --color-code-attr: #D3B4F0;            /* 8.7 */
    --color-code-inline-bg: #EFF4F0;

    /* Footer */
    --color-footer-bg: #182522;

    /* Elevation: low, cool, never glowing */
    --shadow-1: 0 1px 2px rgba(24, 37, 34, 0.06);
    --shadow-2: 0 1px 2px rgba(24, 37, 34, 0.05), 0 12px 32px -16px rgba(24, 37, 34, 0.22);
    --shadow-menu: 0 18px 40px -20px rgba(24, 37, 34, 0.35);

    /* Typography */
    --font-display: "Source Serif 4", "Serif Fallback A", "Serif Fallback B", Georgia, serif;
    --font-sans: "IBM Plex Sans", "Sans Fallback A", "Sans Fallback B", system-ui, -apple-system, sans-serif;
    --font-mono: "IBM Plex Mono", "Mono Fallback A", "Mono Fallback B", ui-monospace, Menlo, monospace;

    --text-xs: 0.8125rem;                  /* 13px: smallest allowed (mono labels) */
    --text-sm: 0.875rem;                   /* 14px: metadata */
    --text-base: 1rem;                     /* 16px: UI */
    --text-md: 1.0625rem;                  /* 17px: reading */
    --text-lg: 1.25rem;
    --text-xl: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
    --text-2xl: clamp(1.75rem, 1.4rem + 1.3vw, 2.375rem);
    --text-3xl: clamp(2.125rem, 1.55rem + 2.3vw, 3.25rem);
    --text-display: clamp(2.625rem, 1.6rem + 4.2vw, 5rem);

    --leading-tight: 1.08;
    --leading-snug: 1.3;
    --leading-body: 1.65;
    --tracking-display: -0.022em;
    --tracking-label: 0.06em;

    /* Space (4px base) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 2.5rem;
    --space-8: 3rem;
    --space-9: 4rem;
    --space-10: 6rem;
    --section-y: clamp(4rem, 2.8rem + 4.5vw, 7rem);
    --section-y-tight: clamp(2.75rem, 2rem + 3vw, 4.5rem);

    /* Layout */
    --content-max: 1200px;
    --gutter: clamp(1rem, 0.55rem + 1.9vw, 2rem);
    --measure: 66ch;
    --header-h: 64px;

    /* Shape */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-pill: 999px;

    /* Motion */
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --dur-fast: 140ms;
    --dur: 220ms;
}


/* -------------------------------------------------------------
   TOKENS: DARK THEME
   Not an inversion: deep green-black surfaces that rise in lightness with elevation,
   light teal for interaction (dark text on teal buttons), softened semantic hues.
   Applied when the visitor chose dark (data-theme="dark", set by /assets/js/theme.js)
   or, with no stored choice, when the system prefers dark. The two blocks are identical.
   ------------------------------------------------------------- */

:root[data-theme="dark"] {
    color-scheme: dark;
    --color-page: #0E1513;
    --color-surface: #141D1A;
    --color-surface-muted: #1A2521;
    --color-surface-soft: #173029;
    --color-surface-inverse: #1C2925;
    --color-surface-raised: #18221F;
    --color-heading: #EEF3F0;              /* 16.5 on page */
    --color-text: #C9D4CF;                 /* 12.2 */
    --color-text-muted: #A3B3AD;           /* 8.5 */
    --color-text-inverse: #EEF3F0;
    --color-text-inverse-muted: #A3B3AD;   /* 6.9 on inverse */
    --color-accent-inverse: #6FD3C3;
    --color-brand: #4FC7B4;                /* 9.0 on page */
    --color-brand-hover: #6FD3C3;
    --color-brand-soft: #173029;
    --color-on-brand: #0E1513;             /* 9.0 on brand */
    --color-link: #6FD3C3;                 /* 7.9 on mint-dark */
    --color-link-hover: #EEF3F0;
    --color-border: #2A3833;
    --color-border-strong: #667A73;        /* 3.8 on surface */
    --color-focus: #6FD3C3;
    --color-success: #66C795;
    --color-success-bg: #14261C;
    --color-warning: #E6B04F;
    --color-warning-bg: #2A2112;
    --color-error: #F2958C;
    --color-error-bg: #2D1917;
    --color-code-bg: #0A100E;
    --color-code-inline-bg: #1A2521;
    --color-footer-bg: #0A100E;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.35), 0 16px 36px -18px rgba(0, 0, 0, 0.7);
    --shadow-menu: 0 18px 40px -16px rgba(0, 0, 0, 0.75);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --color-page: #0E1513;
        --color-surface: #141D1A;
        --color-surface-muted: #1A2521;
        --color-surface-soft: #173029;
        --color-surface-inverse: #1C2925;
        --color-surface-raised: #18221F;
        --color-heading: #EEF3F0;
        --color-text: #C9D4CF;
        --color-text-muted: #A3B3AD;
        --color-text-inverse: #EEF3F0;
        --color-text-inverse-muted: #A3B3AD;
        --color-accent-inverse: #6FD3C3;
        --color-brand: #4FC7B4;
        --color-brand-hover: #6FD3C3;
        --color-brand-soft: #173029;
        --color-on-brand: #0E1513;
        --color-link: #6FD3C3;
        --color-link-hover: #EEF3F0;
        --color-border: #2A3833;
        --color-border-strong: #667A73;
        --color-focus: #6FD3C3;
        --color-success: #66C795;
        --color-success-bg: #14261C;
        --color-warning: #E6B04F;
        --color-warning-bg: #2A2112;
        --color-error: #F2958C;
        --color-error-bg: #2D1917;
        --color-code-bg: #0A100E;
        --color-code-inline-bg: #1A2521;
        --color-footer-bg: #0A100E;
        --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.35), 0 16px 36px -18px rgba(0, 0, 0, 0.7);
        --shadow-menu: 0 18px 40px -16px rgba(0, 0, 0, 0.75);
    }
}


/* -------------------------------------------------------------
   RESET + BASE ELEMENTS
   ------------------------------------------------------------- */

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

* {
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    min-height: 100vh;
    background-color: var(--color-page);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-body);
    font-kerning: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img,
svg,
video {
    max-width: 100%;
}

img {
    display: block;
    height: auto;
}

h1,
h2,
h3,
h4,
h5 {
    color: var(--color-heading);
    text-wrap: balance;
}

h1,
h2 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-display);
}

h3,
h4,
h5 {
    font-family: var(--font-sans);
    font-weight: 600;
    line-height: var(--leading-snug);
    letter-spacing: -0.005em;
}

p {
    text-wrap: pretty;
}

strong,
b {
    font-weight: 600;
    color: var(--color-heading);
}

a {
    color: var(--color-link);
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
    transition: color var(--dur-fast) var(--ease), text-decoration-color var(--dur-fast) var(--ease);
}

a:hover {
    color: var(--color-link-hover);
    text-decoration-color: currentColor;
}

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

button,
a {
    -webkit-tap-highlight-color: transparent;
}

::selection {
    background: var(--color-brand-soft);
    color: var(--color-heading);
}

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

hr {
    border: 0;
    border-top: 1px solid var(--color-border);
}

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

:not(pre) > code {
    padding: 0.1em 0.35em;
    border-radius: var(--radius-sm);
    background: var(--color-code-inline-bg);
    color: var(--color-heading);
    overflow-wrap: anywhere;
}

pre {
    font-family: var(--font-mono);
}


/* -------------------------------------------------------------
   LAYOUT PRIMITIVES
   ------------------------------------------------------------- */

.container {
    width: 100%;
    max-width: calc(var(--content-max) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.container-narrow {
    max-width: calc(820px + 2 * var(--gutter));
}

.section,
.section-padding {
    padding-block: var(--section-y);
}

.section-tight {
    padding-block: var(--section-y-tight);
}

.surface-muted { background: var(--color-surface-muted); }
.surface-white { background: var(--color-surface); }
.surface-soft { background: var(--color-surface-soft); }

.rule-top { border-top: 1px solid var(--color-border); }

.measure { max-width: var(--measure); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* -------------------------------------------------------------
   SECTION HEADS
   A report-style header: mono index label over a serif title, left-aligned,
   with an optional lede. Used instead of the old centred title + underline bar.

   <header class="section-head">
     <p class="kicker"><span class="kicker-num">02</span> Proof of work</p>
     <h2 class="section-title">...</h2>
     <p class="section-intro">...</p>
   </header>
   ------------------------------------------------------------- */

.kicker,
.eyebrow {
    display: inline-flex;
    align-items: baseline;
    gap: 0.6em;
    margin-bottom: var(--space-4);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.kicker-num {
    color: var(--color-link);
}

.kicker-num::after {
    content: "";
    display: inline-block;
    width: 1.75rem;
    height: 1px;
    margin-left: 0.6em;
    vertical-align: middle;
    background: currentColor;
}

.section-head {
    max-width: 760px;
    margin-bottom: var(--space-8);
}

.section-head-split {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: var(--space-5) var(--space-8);
    align-items: end;
    max-width: none;
}

.section-title {
    font-size: var(--text-3xl);
    color: var(--color-heading);
}

.section-intro,
.lede {
    max-width: 62ch;
    margin-top: var(--space-4);
    font-size: var(--text-md);
    line-height: 1.7;
    color: var(--color-text-muted);
}

.section-head-split .section-intro {
    margin-top: 0;
}

@media (max-width: 768px) {
    .section-head-split {
        grid-template-columns: 1fr;
    }
    .section-head {
        margin-bottom: var(--space-7);
    }
}


/* -------------------------------------------------------------
   BUTTONS
   .btn-primary   teal fill: the single main action in a view
   .btn-secondary outlined ink: secondary action
   .btn-quiet     text + arrow: tertiary
   .btn-inverse   for Ink panels
   ------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55em;
    min-height: 48px;
    padding: 0.7rem 1.35rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

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

.btn-primary {
    background: var(--color-brand);
    border-color: var(--color-brand);
    color: var(--color-on-brand);
}

.btn-primary:hover {
    background: var(--color-brand-hover);
    border-color: var(--color-brand-hover);
    color: var(--color-on-brand);
}

.btn-secondary,
.btn-outline {
    background: transparent;
    border-color: var(--color-heading);
    color: var(--color-heading);
}

.btn-secondary:hover,
.btn-outline:hover {
    background: var(--color-heading);
    color: var(--color-page);
}

.btn-quiet {
    min-height: 44px;
    padding-inline: 0;
    color: var(--color-link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.25em;
}

.btn-quiet:hover {
    color: var(--color-link-hover);
}

.btn-inverse {
    background: var(--color-text-inverse);
    border-color: var(--color-text-inverse);
    color: var(--color-surface-inverse);
}

.btn-inverse:hover {
    background: var(--color-accent-inverse);
    border-color: var(--color-accent-inverse);
    color: var(--color-surface-inverse);
}

.btn-inverse-outline {
    background: transparent;
    border-color: var(--color-text-inverse-muted);
    color: var(--color-text-inverse);
}

.btn-inverse-outline:hover {
    border-color: var(--color-text-inverse);
    color: var(--color-text-inverse);
}

.btn-sm {
    min-height: 40px;
    padding: 0.5rem 1rem;
    font-size: var(--text-sm);
}

.btn[disabled],
.btn[aria-disabled="true"] {
    cursor: not-allowed;
    background: var(--color-surface-muted);
    border-color: var(--color-border);
    color: var(--color-text-muted);
    transform: none;
}

.btn-group,
.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3) var(--space-4);
}

/* Inline arrow link: "Read the report ->" */
.arrow-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45em;
    min-height: 44px;
    font-weight: 600;
    color: var(--color-link);
    text-decoration: none;
}

.arrow-link::after {
    content: "\2192";
    font-family: var(--font-mono);
    transition: transform var(--dur-fast) var(--ease);
}

.arrow-link:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

.arrow-link:hover::after {
    transform: translateX(3px);
}


/* -------------------------------------------------------------
   TAGS, META, STATUS
   ------------------------------------------------------------- */

/* Technology tag: quiet mono text with a hairline. Not a coloured badge. */
.tag,
.tech-pill,
.skill-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0.15rem 0.55rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: transparent;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 400;
    line-height: 1.4;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.tag-list,
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* Mono metadata line: "37 test definitions · 34 run in CI" */
.meta {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--color-text-muted);
}

/* Key/value list: <dl class="meta-list"><div><dt>Stack</dt><dd>...</dd></div></dl> */
.meta-list {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--color-border);
}

.meta-list > div {
    display: grid;
    grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr);
    gap: var(--space-4);
    padding-block: var(--space-3);
    border-bottom: 1px solid var(--color-border);
}

.meta-list dt {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--color-text-muted);
    padding-top: 0.15em;
}

.meta-list dd {
    color: var(--color-heading);
}

@media (max-width: 560px) {
    .meta-list > div {
        grid-template-columns: 1fr;
        gap: var(--space-1);
    }
}

/* Status: always a glyph AND a word, never colour alone.
   <span class="status status-pass">Passed</span> */
.status {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.15rem 0.55rem 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
    background: var(--color-surface-muted);
    color: var(--color-heading);
}

.status::before {
    font-weight: 700;
}

.status-pass { background: var(--color-success-bg); color: var(--color-success); }
.status-pass::before { content: "\2713"; }
.status-fail { background: var(--color-error-bg); color: var(--color-error); }
.status-fail::before { content: "\2715"; }
.status-warn { background: var(--color-warning-bg); color: var(--color-warning); }
.status-warn::before { content: "!"; }
.status-info::before { content: "\2192"; }


/* -------------------------------------------------------------
   CALLOUTS
   ------------------------------------------------------------- */

.callout {
    padding: var(--space-4) var(--space-5);
    border-left: 3px solid var(--color-brand);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--color-surface-soft);
    color: var(--color-text);
}

.callout > * + * {
    margin-top: var(--space-2);
}

.callout-title {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--color-heading);
}

.callout-warn {
    border-left-color: var(--color-warning);
    background: var(--color-warning-bg);
}

.callout-error {
    border-left-color: var(--color-error);
    background: var(--color-error-bg);
}

.callout-neutral {
    border-left-color: var(--color-border-strong);
    background: var(--color-surface-muted);
}


/* -------------------------------------------------------------
   PANELS
   Use sparingly; most content sits on the page with hairlines, not in boxes.
   ------------------------------------------------------------- */

.panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.panel-inverse {
    background: var(--color-surface-inverse);
    color: var(--color-text-inverse-muted);
    border-radius: var(--radius-lg);
}

.panel-inverse h2,
.panel-inverse h3,
.panel-inverse strong {
    color: var(--color-text-inverse);
}

.panel-inverse a:not(.btn) {
    color: var(--color-accent-inverse);
}

.panel-inverse a:not(.btn):hover {
    color: var(--color-text-inverse);
}

.panel-inverse .tag,
.panel-inverse .tech-pill {
    border-color: color-mix(in srgb, var(--color-text-inverse) 22%, transparent);
    color: var(--color-text-inverse-muted);
}

.panel-inverse .meta,
.panel-inverse .kicker {
    color: var(--color-text-inverse-muted);
}

.panel-inverse :focus-visible {
    outline-color: var(--color-accent-inverse);
}


/* -------------------------------------------------------------
   TABLES
   ------------------------------------------------------------- */

.table-wrap {
    position: relative;                    /* keeps absolutely positioned .sr-only text inside the scroll box */
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    -webkit-overflow-scrolling: touch;
}

.table-wrap:focus-visible {
    outline-offset: 2px;
}

.table-wrap table,
table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
    line-height: 1.5;
}

.table-wrap th,
.table-wrap td,
table.data-table th,
table.data-table td {
    padding: 0.7rem 0.9rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--color-border);
}

.table-wrap thead th,
table.data-table thead th {
    position: sticky;
    top: 0;
    background: var(--color-surface-muted);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.table-wrap tbody th {
    font-weight: 600;
    color: var(--color-heading);
}

.table-wrap tbody tr:last-child > * {
    border-bottom: 0;
}

.table-wrap caption {
    padding: 0.75rem 0.9rem;
    text-align: left;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    caption-side: bottom;
    border-top: 1px solid var(--color-border);
}


/* -------------------------------------------------------------
   CODE BLOCKS (highlight.js class names as already used in the pages)
   ------------------------------------------------------------- */

.code-figure {
    margin: var(--space-4) 0 var(--space-6);
}

.code-block,
pre.code-block {
    margin: 0;
    padding: var(--space-4) var(--space-5);
    overflow-x: auto;
    border-radius: var(--radius);
    background: var(--color-code-bg);
    color: var(--color-code-fg);
    font-family: var(--font-mono);
    font-size: 0.8438rem;
    line-height: 1.65;
    tab-size: 2;
}

.code-block code {
    padding: 0;
    background: none;
    color: inherit;
    font-size: inherit;
    font-family: inherit;
    white-space: pre;
}

.code-block .hljs-comment { color: var(--color-code-muted); font-style: italic; }
.code-block .hljs-keyword,
.code-block .hljs-literal,
.code-block .hljs-built_in { color: var(--color-code-keyword); }
.code-block .hljs-string,
.code-block .hljs-regexp { color: var(--color-code-string); }
.code-block .hljs-number { color: var(--color-code-number); }
.code-block .hljs-title,
.code-block .hljs-title.function_,
.code-block .hljs-title.class_ { color: var(--color-code-title); }
.code-block .hljs-attr,
.code-block .hljs-property,
.code-block .hljs-variable { color: var(--color-code-attr); }
.code-block .hljs-subst,
.code-block .hljs-params { color: var(--color-code-fg); }

.code-figure figcaption,
figure figcaption {
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    line-height: 1.55;
    color: var(--color-text-muted);
}

.code-figure figcaption a,
figure figcaption a {
    font-weight: 500;
}


/* -------------------------------------------------------------
   PROSE (articles, case-study body text, privacy notice)
   ------------------------------------------------------------- */

.prose {
    font-size: var(--text-md);
    line-height: 1.75;
    color: var(--color-text);
}

.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2.2em; font-size: var(--text-2xl); }
.prose h3 { margin-top: 1.8em; font-size: var(--text-lg); }
.prose h2 + *,
.prose h3 + * { margin-top: 0.6em; }
.prose ul,
.prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--color-text-muted); }
.prose blockquote {
    padding-left: var(--space-5);
    border-left: 2px solid var(--color-brand);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    color: var(--color-heading);
}


/* -------------------------------------------------------------
   BREADCRUMB / BACK LINK
   ------------------------------------------------------------- */

.breadcrumb,
.project-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4em;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.02em;
    color: var(--color-text-muted);
}

.breadcrumb a,
.project-breadcrumb a {
    color: var(--color-text-muted);
    text-decoration: none;
    padding-block: 0.35rem;
}

.breadcrumb a:hover,
.project-breadcrumb a:hover {
    color: var(--color-link);
    text-decoration: underline;
}


/* -------------------------------------------------------------
   FORMS
   ------------------------------------------------------------- */

.form-group,
.field {
    display: grid;
    gap: var(--space-2);
}

.form-group + .form-group,
.field + .field {
    margin-top: var(--space-5);
}

label {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--color-heading);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="search"],
select,
textarea {
    width: 100%;
    min-height: 48px;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-heading);
    font-size: var(--text-base);
    line-height: 1.5;
    transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

textarea {
    min-height: 150px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
    opacity: 1;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--color-heading);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 1px;
    border-color: var(--color-focus);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: var(--color-error);
    box-shadow: inset 3px 0 0 var(--color-error);
}

input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    border-color: var(--color-border);
}

.field-hint {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.field-error {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-error);
}

.field-error:not(:empty)::before {
    content: "\2715\00a0";
    font-weight: 700;
}

.success-message,
.error-message {
    display: flex;
    gap: 0.6em;
    align-items: flex-start;
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius);
    border-left: 3px solid currentColor;
    font-weight: 500;
    line-height: 1.55;
}

.success-message {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.success-message::before {
    content: "\2713";
    font-weight: 700;
}

.error-message {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.error-message::before {
    content: "\2715";
    font-weight: 700;
}

.success-message a,
.error-message a {
    color: inherit;
    font-weight: 600;
}

/* Honeypot fields stay hidden from people */
.hp-field,
.honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}


/* -------------------------------------------------------------
   DISCLOSURE (FAQ)
   ------------------------------------------------------------- */

details.faq-item,
.faq-item {
    border-bottom: 1px solid var(--color-border);
}

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: 56px;
    padding-block: var(--space-4);
    cursor: pointer;
    font-weight: 600;
    color: var(--color-heading);
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--color-link);
    transition: transform var(--dur) var(--ease);
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item summary:hover {
    color: var(--color-link);
}


/* -------------------------------------------------------------
   PROJECT COVERS (inline SVG from scripts/covers/build.js)
   ------------------------------------------------------------- */

.cover-wrap {
    container-type: inline-size;
    overflow: hidden;
}


/* -------------------------------------------------------------
   MOTION PREFERENCES
   ------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Theme switch: no colour transitions while the theme flips (avoids a slow cross-fade) */
.theme-switching,
.theme-switching * {
    transition: none !important;
}
