/* ============================================================================
   Base layer: reset, typography, layout primitives.

   Replaces bootstrap.min.css (v3.3.7), vendor.css (v4.3.1) and the reset that
   used to live in aditya.css. Depends only on tokens.css.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* ---- Reset --------------------------------------------------------------- */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    /* Anchored sections must clear the fixed nav. */
    scroll-padding-top: 88px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* Modules park children off-canvas on purpose; never let that scroll the page. */
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
    margin: 0;
}

ul[class], ol[class] {
    list-style: none;
    margin: 0;
    padding: 0;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

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

button {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

table {
    border-collapse: collapse;
    width: 100%;
}

:target {
    scroll-margin-top: 96px;
}

/* ---- Typography ---------------------------------------------------------- */

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

/* The ramp has to stay legible as a RANK, not just as a set of sizes. h2 was
   step-4, which is also what .hero h1 is pinned to in site.css so the hero's
   call to action clears the fold: the page title and every section title
   therefore rendered at exactly the same 49.6px/600 (34px on a phone) and
   nothing told a reader which was which. h2 moves down one step, which leaves
   a clean descending ramp of title 49.6 -> section 37.6 -> subhead 28 and does
   not touch the hero's height. Base h1 stays at step-5 for pages that want a
   full-size title; the hero and the About hero both opt down to step-4. */
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

h5, h6 {
    font-family: var(--font-mono);
    font-size: var(--step--1);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.4;
}

p {
    text-wrap: pretty;
}

strong { font-weight: 600; }

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

/* The mono accent voice: section eyebrows, metadata, counters, labels. */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    margin: 0 0 var(--sp-4);
    color: var(--ink-soft);
    font: 500 var(--step--1) / 1 var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* No rule before the label. A 22px bar sitting on the baseline ahead of "WHO I
   AM" read as a long dash, which is exactly the punctuation this repo bans in
   prose; it looked like an em dash had been typed into every section heading.
   The uppercase mono label already separates itself from the heading below. */

.lede {
    max-width: var(--measure);
    color: var(--ink-soft);
    font-size: var(--step-1);
    line-height: 1.55;
}

/* ---- Layout primitives --------------------------------------------------- */

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

.wrap--wide { max-width: var(--maxw-wide); }
.wrap--text { max-width: calc(var(--measure) + var(--gutter) * 2); }

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

/* A dark band is just a wrapper attribute; tokens.css does the rest. */
.section--dark {
    background: var(--bg);
    color: var(--ink);
}

.section__head {
    max-width: var(--measure);
    margin-bottom: var(--sp-8);
}

.stack > * + * { margin-top: var(--flow, var(--sp-4)); }

.cluster {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    align-items: center;
}

/* ---- Accessibility ------------------------------------------------------- */

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

:focus:not(:focus-visible) { outline: none; }

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: var(--sp-3);
    left: var(--sp-3);
    z-index: calc(var(--z-nav) + 1);
    padding: var(--sp-3) var(--sp-5);
    border-radius: var(--radius-pill);
    background: var(--ink);
    color: var(--bg);
    font: 600 var(--step--1) / 1 var(--font-mono);
    transform: translateY(-200%);
    transition: transform var(--dur-1) var(--ease-out);
}

.skip-link:focus { transform: translateY(0); }

/* ---- Themed islands ------------------------------------------------------
   A section carrying data-theme must restate colour and background, for the
   same reason the token bridge has to match [data-theme]: `color: var(--ink)`
   is declared on body, computed THERE, and inherited by descendants as a
   literal colour. Redefining --ink further down the tree does not re-resolve
   what body already computed, so without this a dark island would keep the
   light theme's near-black text on its dark background. */

[data-theme] {
    color: var(--ink);
    background-color: var(--bg);
}

/* ---- Module mount points -------------------------------------------------
   Every lazily mounted section reserves its box up front, so loading a module
   never shifts the page. This is what keeps CLS under 0.1 with 36 modules.  */

[data-module] {
    min-height: var(--module-h, 420px);
    contain: layout paint;
}

[data-mounted] { min-height: 0; }

/* Shown until a module mounts, and whenever JS is unavailable. The fallback
   content inside is the real content, so the page is complete without JS. */
.module-fallback {
    display: block;
}

/* Keyed on data-mounted alone, not [data-module][data-mounted]: a few hosts
   are mounted by hand because they need callbacks that cannot travel through
   a JSON attribute, and those carry no data-module. */
[data-mounted] > .module-fallback {
    display: none;
}

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

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