/* ==========================================================================
   Sahariar Islam — Portfolio stylesheet
   Hand-written: fonts, design tokens, and the components that are more than a
   handful of utilities (nav, hero network, pipeline, constellation, timeline).
   Tailwind's compiled utilities live in assets/css/tailwind.css (generated,
   see README.md). Tailwind's colour names (bg, surface, ink, muted, line,
   accent) point at the custom properties below, so both files theme together.
   ========================================================================== */

/* ---- Self-hosted fonts ---------------------------------------------------
   Variable fonts: one file per family covers every weight the site uses. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url('../fonts/inter-variable.woff2') format('woff2-variations'), url('../fonts/inter-variable.woff2') format('woff2');
}
@font-face {
    font-family: 'Fira Code';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('../fonts/fira-code-variable.woff2') format('woff2-variations'), url('../fonts/fira-code-variable.woff2') format('woff2');
}

/* ---- Tokens --------------------------------------------------------------
   Colours are space-separated RGB triplets so they compose with alpha:
   rgb(var(--ink) / .6). Dark is the default; [data-theme="light"] flips them. */
:root {
    color-scheme: dark;
    --bg: 10 12 16;
    --surface: 19 22 30;
    --ink: 236 238 244;
    --muted: 146 154 174;
    --line: 255 255 255;
    --accent: 70 98 240;        /* fills: white text on it passes AA */
    --accent-ink: 142 163 255;  /* accent as text/strokes on the background */
    --amber: 245 176 65;        /* AWS certification only */
    --ok: 52 211 153;
    --danger: 248 113 113;
    --tok-key: 199 146 234;
    --tok-prop: 130 170 255;
    --tok-str: 163 217 165;
    --ease: cubic-bezier(.2, .7, .2, 1);
    --spring: cubic-bezier(.34, 1.56, .64, 1);
}
[data-theme="light"] {
    color-scheme: light;
    --bg: 246 247 250;
    --surface: 255 255 255;
    --ink: 15 18 25;
    --muted: 82 90 108;
    --line: 15 18 25;
    --accent: 52 84 235;
    --accent-ink: 40 68 210;
    --amber: 161 98 7;
    --ok: 5 122 85;
    --danger: 185 28 28;
    --tok-key: 126 58 178;
    --tok-prop: 30 80 190;
    --tok-str: 22 120 70;
}

/* ---- Base ---------------------------------------------------------------- */
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    background: rgb(var(--bg));
    color: rgb(var(--ink));
    overflow-x: hidden;
    transition: background-color .3s ease, color .3s ease;
}
/* Film-grain noise over the whole page. One fixed layer, rasterised once. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, .site-footer { position: relative; z-index: 1; }

.mono { font-family: 'Fira Code', ui-monospace, monospace; }
::selection { background: rgb(var(--accent) / .35); }
:focus-visible { outline: 2px solid rgb(var(--accent-ink)); outline-offset: 3px; border-radius: 6px; }

.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    flex-shrink: 0;
    overflow: visible; /* a couple of glyphs draw a hair outside their viewBox */
}

.skip-link {
    position: fixed; top: 12px; left: 12px; z-index: 60;
    padding: .6rem 1rem; border-radius: 10px;
    background: rgb(var(--accent)); color: #fff; font-weight: 600;
    transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---- Layout + type ------------------------------------------------------- */
.wrap { max-width: 76rem; margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }
.section { padding-block: clamp(4.5rem, 10vw, 8.5rem); }
.section--ruled { border-top: 1px solid rgb(var(--line) / .08); }

.display {
    font-size: clamp(2.75rem, 8.5vw, 6.5rem);
    line-height: .95;
    letter-spacing: -.045em;
    font-weight: 600;
}
.h2 {
    font-size: clamp(2rem, 4.6vw, 3.5rem);
    line-height: 1.03;
    letter-spacing: -.035em;
    font-weight: 600;
    text-wrap: balance;
}
.h3 { font-size: 1.25rem; line-height: 1.25; letter-spacing: -.015em; font-weight: 600; }
.lead { font-size: clamp(1.05rem, 1.35vw, 1.2rem); line-height: 1.65; color: rgb(var(--muted)); max-width: 38rem; }
.lead strong, .prose strong { color: rgb(var(--ink)); font-weight: 600; }
.label { font-family: 'Fira Code', ui-monospace, monospace; font-size: .78rem; color: rgb(var(--muted)); }
.text-link { color: rgb(var(--accent-ink)); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgb(var(--accent-ink) / .4); transition: text-decoration-color .2s; }
.text-link:hover { text-decoration-color: currentColor; }

/* ---- Surfaces ------------------------------------------------------------ */
.panel {
    background: rgb(var(--surface) / .55);
    border: 1px solid rgb(var(--line) / .09);
    border-radius: 22px;
}
.glass {
    background: rgb(var(--surface) / .6);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgb(var(--line) / .1);
}
/* Cursor-following highlight; --mx/--my are set by build/js/spotlight.js. */
[data-spotlight] { position: relative; isolation: isolate; }
[data-spotlight]::before {
    content: "";
    position: absolute; inset: 0; z-index: -1;
    border-radius: inherit;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgb(var(--accent) / .16), transparent 60%);
    opacity: 0;
    transition: opacity .35s ease;
}
[data-spotlight]:hover::before, [data-spotlight]:focus-within::before { opacity: 1; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
    font-family: 'Fira Code', ui-monospace, monospace;
    font-size: .7rem;
    line-height: 1;
    padding: .42rem .6rem;
    border-radius: 999px;
    border: 1px solid rgb(var(--line) / .12);
    color: rgb(var(--muted));
    white-space: nowrap;
}

/* ---- Buttons ------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 46px; padding: .7rem 1.35rem;
    border-radius: 999px; border: 1px solid transparent;
    font-weight: 600; font-size: .95rem; white-space: nowrap;
    transition: transform .3s var(--spring), background-color .2s ease, border-color .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn--primary { background: rgb(var(--ink)); color: rgb(var(--bg)); }
.btn--ghost { border-color: rgb(var(--line) / .18); background: rgb(var(--surface) / .4); }
.btn--ghost:hover { border-color: rgb(var(--line) / .38); }
.btn--accent { background: rgb(var(--accent)); color: #fff; }
.btn--sm { min-height: 44px; padding: .5rem 1rem; font-size: .875rem; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.icon-btn {
    display: inline-grid; place-items: center;
    width: 44px; height: 44px; border-radius: 12px;
    color: rgb(var(--muted));
    border: 1px solid rgb(var(--line) / .1);
    transition: color .2s ease, border-color .2s ease, transform .3s var(--spring);
}
.icon-btn:hover { color: rgb(var(--ink)); border-color: rgb(var(--line) / .3); transform: translateY(-2px); }

/* ---- Navigation ----------------------------------------------------------
   Fixed, so shrinking it on scroll never shifts the page. Transparent at the
   top; becomes a narrower glass panel once the page has scrolled. */
.site-nav { position: fixed; inset: 0 0 auto 0; z-index: 50; padding: 12px 12px 0; pointer-events: none; }
.site-nav__bar, .site-nav__menu { pointer-events: auto; }
.site-nav__bar {
    max-width: 76rem; height: 64px; margin-inline: auto; padding-inline: clamp(.75rem, 2.5vw, 1.5rem);
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    border: 1px solid transparent; border-radius: 18px;
    transition: height .4s var(--ease), max-width .5s var(--ease), background-color .4s ease, border-color .4s ease, box-shadow .4s ease;
}
.site-nav.is-scrolled .site-nav__bar, .site-nav.is-open .site-nav__bar {
    height: 56px; max-width: 62rem;
    background: rgb(var(--surface) / .72);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
    border-color: rgb(var(--line) / .1);
    box-shadow: 0 18px 40px -28px rgb(0 0 0 / .8);
}
.wordmark { font-weight: 700; letter-spacing: .14em; font-size: .9rem; min-height: 44px; display: inline-flex; align-items: center; }
.site-nav__links { display: none; align-items: center; gap: .25rem; }
.site-nav__links a, .site-nav__menu a {
    display: inline-flex; align-items: center; min-height: 44px; padding-inline: .85rem;
    font-size: .9rem; font-weight: 500; color: rgb(var(--muted));
    border-radius: 10px; transition: color .2s ease;
}
.site-nav__links a:hover, .site-nav__menu a:hover { color: rgb(var(--ink)); }
.site-nav__actions { display: flex; align-items: center; gap: .5rem; }
.site-nav__actions .icon-btn { border-color: transparent; }
.site-nav__menu {
    max-width: 62rem; margin: 8px auto 0; padding: .5rem;
    border-radius: 18px; display: grid;
}
.site-nav__menu[hidden] { display: none; }
.site-nav__menu a { padding-inline: 1rem; min-height: 48px; }
#menu-toggle .icon--close { display: none; }
#menu-toggle[aria-expanded="true"] .icon--open { display: none; }
#menu-toggle[aria-expanded="true"] .icon--close { display: inline-block; }
.nav-cta { display: none; }
@media (min-width: 900px) {
    .site-nav__links { display: flex; }
    .nav-cta { display: inline-flex; }
    #menu-toggle, .site-nav__menu { display: none; }
}
[data-theme="light"] .theme-icon--moon, :root:not([data-theme="light"]) .theme-icon--sun { display: none; }

/* ---- Hero ---------------------------------------------------------------- */
.hero { position: relative; padding-top: clamp(7.5rem, 14vw, 10.5rem); padding-bottom: clamp(3rem, 6vw, 5rem); overflow: hidden; }
.hero__grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgb(var(--line) / .045) 1px, transparent 1px),
        linear-gradient(90deg, rgb(var(--line) / .045) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 75% 70% at 60% 35%, #000 20%, transparent 78%);
    mask-image: radial-gradient(ellipse 75% 70% at 60% 35%, #000 20%, transparent 78%);
}
.hero__inner { position: relative; display: grid; gap: 3rem; align-items: center; }
@media (min-width: 1024px) { .hero__inner { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 2.5rem; } }
.br-lg { display: none; }
@media (min-width: 1024px) { .br-lg { display: inline; } }

.status {
    display: inline-flex; align-items: center; gap: .6rem;
    padding: .45rem .9rem .45rem .7rem; border-radius: 999px;
    border: 1px solid rgb(var(--line) / .12);
    background: rgb(var(--surface) / .5);
    font-size: .8rem; color: rgb(var(--muted));
}
.status__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: rgb(var(--ok)); box-shadow: 0 0 0 0 rgb(var(--ok) / .5); animation: status-ping 2.4s ease-out infinite; }
@keyframes status-ping { 70%, 100% { box-shadow: 0 0 0 8px rgb(var(--ok) / 0); } }

/* One orchestrated entrance on page load: each hero line rises in turn. */
.rise { animation: rise .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms + 80ms); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.hero__visual { position: relative; width: 100%; max-width: 34rem; margin-inline: auto; }
.network { display: block; width: 100%; height: auto; overflow: visible; }
.net-edge { stroke: rgb(var(--line) / .16); stroke-width: 1; }
.net-edge--minor { stroke: rgb(var(--line) / .07); stroke-dasharray: 3 5; }
.net-packet { fill: rgb(var(--accent-ink)); }
.net-node__ring { fill: rgb(var(--surface)); stroke: rgb(var(--line) / .2); stroke-width: 1; transition: stroke .25s ease; }
.net-node__label { fill: rgb(var(--ink)); font-family: 'Fira Code', ui-monospace, monospace; font-size: 11.5px; text-anchor: middle; dominant-baseline: central; }
.net-node:hover .net-node__ring { stroke: rgb(var(--accent-ink)); }
.net-node--core .net-node__ring { fill: rgb(var(--accent)); stroke: rgb(var(--accent-ink)); }
.net-node--core .net-node__label { fill: #fff; font-weight: 600; font-size: 11px; letter-spacing: .12em; }
.net-node__halo { fill: none; stroke: rgb(var(--accent-ink) / .35); transform-box: fill-box; transform-origin: center; animation: halo 4.5s ease-out infinite; }
.net-node__halo + .net-node__halo { animation-delay: 2.25s; }
@keyframes halo { from { transform: scale(1); opacity: .7; } to { transform: scale(1.9); opacity: 0; } }

.codepanel {
    display: none;
    position: absolute; right: -4px; bottom: -18px;
    width: min(21rem, 78%);
    border-radius: 16px; padding: 0;
    box-shadow: 0 30px 60px -30px rgb(0 0 0 / .7);
    font-family: 'Fira Code', ui-monospace, monospace; font-size: .72rem; line-height: 1.75;
}
@media (min-width: 640px) { .codepanel { display: block; } }
.codepanel__bar { display: flex; align-items: center; gap: 6px; padding: .6rem .9rem; border-bottom: 1px solid rgb(var(--line) / .08); color: rgb(var(--muted)); font-size: .68rem; }
.codepanel__bar i { width: 8px; height: 8px; border-radius: 50%; background: rgb(var(--line) / .2); }
.codepanel pre { margin: 0; padding: .8rem .95rem 1rem; white-space: pre-wrap; color: rgb(var(--muted)); }
.tok-k { color: rgb(var(--tok-key)); }
.tok-p { color: rgb(var(--tok-prop)); }
.tok-s { color: rgb(var(--tok-str)); }

/* ---- Stats --------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-block: 1px solid rgb(var(--line) / .09); }
.stat { padding: 1.75rem 1rem 1.75rem 0; }
.stat:nth-child(even) { padding-left: 1.25rem; border-left: 1px solid rgb(var(--line) / .09); }
.stat:nth-child(n+3) { border-top: 1px solid rgb(var(--line) / .09); }
.stat__value { font-size: clamp(2rem, 4.5vw, 3.25rem); font-weight: 600; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat__label { margin-top: .6rem; font-size: .875rem; color: rgb(var(--muted)); max-width: 15rem; }
@media (min-width: 900px) {
    .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .stat, .stat:nth-child(even) { padding: 2.25rem 1.5rem; border-left: 1px solid rgb(var(--line) / .09); border-top: 0; }
    .stat:first-child { padding-left: 0; border-left: 0; }
}

/* ---- Work cards ---------------------------------------------------------- */
.work-card {
    position: relative; display: flex; flex-direction: column; overflow: hidden;
    transition: border-color .35s ease, background-color .35s ease, transform .5s var(--ease);
}
.work-card:hover, .work-card:focus-within { border-color: rgb(var(--line) / .2); background: rgb(var(--surface) / .85); }
.work-card__preview {
    position: relative; display: grid; place-items: center;
    min-height: 13rem; padding: 2.75rem 1.25rem 1.5rem;
    border-bottom: 1px solid rgb(var(--line) / .08);
    background:
        radial-gradient(120% 90% at 50% 0%, rgb(var(--accent) / .1), transparent 62%),
        rgb(var(--bg) / .5);
    overflow: hidden;
}
.work-card__preview > .flow, .work-card__preview > .pipeline { transition: transform .6s var(--ease); width: 100%; }
.work-card:hover .work-card__preview > .flow, .work-card:hover .work-card__preview > .pipeline,
.work-card:focus-within .work-card__preview > .flow, .work-card:focus-within .work-card__preview > .pipeline { transform: scale(1.035); }
.work-card__body { padding: 1.5rem; display: flex; flex-direction: column; gap: .85rem; flex: 1; }
@media (min-width: 768px) { .work-card__body { padding: 1.75rem 2rem 2rem; } }
.work-card__title { transition: transform .45s var(--ease); }
.work-card:hover .work-card__title, .work-card:focus-within .work-card__title { transform: translateX(6px); }
/* The whole card is the link: the title's anchor is stretched over it. */
.work-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.work-card__title a:focus-visible { outline: none; }
.work-card:has(a:focus-visible) { outline: 2px solid rgb(var(--accent-ink)); outline-offset: 3px; }
.work-card__cta {
    position: absolute; top: .9rem; right: .9rem; z-index: 1;
    font-family: 'Fira Code', ui-monospace, monospace; font-size: .68rem; letter-spacing: .08em;
    padding: .4rem .65rem; border-radius: 999px;
    background: rgb(var(--ink)); color: rgb(var(--bg));
    opacity: 0; transform: translateY(-6px);
    transition: opacity .3s ease, transform .4s var(--spring);
}
.work-card:hover .work-card__cta, .work-card:focus-within .work-card__cta { opacity: 1; transform: none; }
@media (hover: none) { .work-card__cta { opacity: 1; transform: none; } }

/* Mini architecture diagram: nodes and arrows that wrap instead of scrolling. */
.flow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem .4rem; font-family: 'Fira Code', ui-monospace, monospace; font-size: .7rem; }
.flow__node { padding: .5rem .7rem; border-radius: 10px; border: 1px solid rgb(var(--line) / .14); background: rgb(var(--surface) / .8); white-space: nowrap; }
.flow__arrow { display: inline-block; color: rgb(var(--muted)); }
.work-card:hover .flow__arrow, .work-card:focus-within .flow__arrow { animation: arrow-pulse 1.4s ease-in-out infinite; animation-delay: calc(var(--i) * 160ms); }
@keyframes arrow-pulse { 30% { color: rgb(var(--accent-ink)); transform: translateX(2px); } }
.flow--lg { font-size: .8rem; gap: .75rem .6rem; justify-content: flex-start; }
.flow--lg .flow__node { padding: .75rem 1rem; white-space: normal; text-align: center; }

/* ---- YesSME pipeline -----------------------------------------------------
   Five nodes, four links. One packet per link, each running for a fifth of
   the cycle and delayed by its position, so a single packet appears to travel
   the whole pipeline; each node lights as the packet reaches it. */
.pipeline { --cycle: 7.5s; display: flex; align-items: stretch; font-family: 'Fira Code', ui-monospace, monospace; }
.pipeline__node {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; justify-content: center; gap: .3rem;
    padding: .85rem .6rem; text-align: center;
    border: 1px solid rgb(var(--line) / .14); border-radius: 14px;
    background: rgb(var(--surface) / .85);
    font-size: .72rem; font-weight: 500; line-height: 1.35;
    animation: node-hit var(--cycle) linear infinite;
    animation-delay: calc(var(--i) * var(--cycle) / 5);
}
.pipeline__node small { font-family: 'Inter', system-ui, sans-serif; font-size: .68rem; font-weight: 400; color: rgb(var(--muted)); }
.pipeline__link { flex: 0 0 clamp(14px, 3.2vw, 44px); align-self: center; position: relative; height: 1px; background: rgb(var(--line) / .2); }
.pipeline__packet { position: absolute; inset: -3px 0; animation: packet-x var(--cycle) linear infinite; animation-delay: calc(var(--i) * var(--cycle) / 5); opacity: 0; }
.pipeline__packet::before {
    content: ""; position: absolute; left: -3.5px; top: 0; width: 7px; height: 7px; border-radius: 50%;
    background: rgb(var(--accent-ink)); box-shadow: 0 0 12px 2px rgb(var(--accent) / .8);
}
@keyframes packet-x {
    0% { transform: translateX(0); opacity: 0; }
    2%, 18% { opacity: 1; }
    20%, 100% { transform: translateX(100%); opacity: 0; }
}
@keyframes packet-y {
    0% { transform: translateY(0); opacity: 0; }
    2%, 18% { opacity: 1; }
    20%, 100% { transform: translateY(100%); opacity: 0; }
}
@keyframes node-hit {
    0%, 16%, 100% { border-color: rgb(var(--line) / .14); box-shadow: 0 0 0 0 rgb(var(--accent) / 0); }
    3% { border-color: rgb(var(--accent-ink)); box-shadow: 0 0 0 4px rgb(var(--accent) / .16); }
}
@media (max-width: 767px) {
    .pipeline { flex-direction: column; align-items: center; }
    .pipeline__node { flex: none; width: min(100%, 17rem); }
    .pipeline__link { flex-basis: 26px; width: 1px; height: 26px; }
    .pipeline__packet { inset: 0 -3px; animation-name: packet-y; }
    .pipeline__packet::before { left: 0; top: -3.5px; }
}

/* ---- Stack constellation ------------------------------------------------- */
.constellation { position: relative; }
.constellation__lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 0; }
.constellation__lines path { fill: none; stroke: rgb(var(--accent-ink)); stroke-width: 1.25; stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
.constellation__groups { position: relative; z-index: 1; display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .constellation__groups { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3.5rem; } }
.constellation__list { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1rem; }
/* Slight vertical stagger so the pills read as a scatter, not a table. */
@media (min-width: 900px) {
    .constellation__list li:nth-child(3n+2) { margin-top: 1.1rem; }
    .constellation__list li:nth-child(4n+3) { margin-top: .45rem; }
}
.tech {
    min-height: 44px; padding: .55rem 1rem; border-radius: 999px;
    border: 1px solid rgb(var(--line) / .14); background: rgb(var(--bg));
    font-size: .9rem; font-weight: 500;
    transition: border-color .25s ease, background-color .25s ease, color .25s ease, opacity .25s ease, transform .35s var(--spring);
}
.constellation.has-active .tech { opacity: .38; }
.constellation.has-active .tech.is-related { opacity: 1; border-color: rgb(var(--accent-ink) / .7); }
.constellation.has-active .tech.is-active { opacity: 1; background: rgb(var(--accent)); border-color: rgb(var(--accent)); color: #fff; transform: scale(1.06); }
.constellation__detail { min-height: 5.5rem; margin-top: 2.5rem; padding: 1.25rem 1.5rem; }
.constellation__detail b { display: block; font-weight: 600; margin-bottom: .25rem; }
.constellation__detail span { color: rgb(var(--muted)); font-size: .95rem; line-height: 1.6; }

/* ---- Progress rails: experience timeline + process ------------------------
   --p (0..1) is set from scroll position by build/js/progress.js. The rail's
   fill is a transform, so drawing it never causes layout. */
.rail { --p: 0; position: relative; display: grid; gap: 2.75rem; }
.rail__track { position: absolute; left: 7px; top: 8px; bottom: 0; width: 1px; background: rgb(var(--line) / .12); }
.rail__track::after { content: ""; position: absolute; inset: 0; background: rgb(var(--accent-ink)); transform-origin: top; transform: scaleY(var(--p)); }
.rail__item { position: relative; padding-left: 2.5rem; }
.rail__dot {
    position: absolute; left: 0; top: 4px; width: 15px; height: 15px; border-radius: 50%;
    border: 1px solid rgb(var(--line) / .3); background: rgb(var(--bg));
    transition: background-color .4s ease, border-color .4s ease, box-shadow .4s ease;
}
.rail__item.is-reached .rail__dot { background: rgb(var(--accent)); border-color: rgb(var(--accent-ink)); box-shadow: 0 0 0 5px rgb(var(--accent) / .16); }
.js .rail__body { opacity: .4; transform: translateY(10px); transition: opacity .6s ease, transform .6s var(--ease); }
.js .rail__item.is-reached .rail__body { opacity: 1; transform: none; }

@media (min-width: 1280px) {
    .rail--timeline { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.25rem; }
    .rail--timeline .rail__track { left: 0; right: 0; top: 7px; bottom: auto; width: auto; height: 1px; }
    .rail--timeline .rail__track::after { transform-origin: left; transform: scaleX(var(--p)); }
    .rail--timeline .rail__item { padding-left: 0; padding-top: 2.75rem; }
    .rail--timeline .rail__dot { top: 0; }
}
@media (min-width: 1024px) {
    .rail--process { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.5rem; }
    .rail--process .rail__track { left: 0; right: 0; top: 7px; bottom: auto; width: auto; height: 1px; }
    .rail--process .rail__track::after { transform-origin: left; transform: scaleX(var(--p)); }
    .rail--process .rail__item { padding-left: 0; padding-top: 2.75rem; }
    .rail--process .rail__dot { top: 0; }
}
.role__bullets { display: grid; gap: .7rem; margin-top: 1rem; font-size: .9rem; line-height: 1.65; color: rgb(var(--muted)); }
.role__bullets li { padding-left: 1rem; position: relative; }
.role__bullets li::before { content: ""; position: absolute; left: 0; top: .7em; width: 5px; height: 1px; background: rgb(var(--muted)); }

/* ---- Certification card -------------------------------------------------- */
.cert { position: relative; overflow: hidden; display: grid; gap: 2rem; align-items: center; padding: clamp(1.75rem, 4vw, 3rem); animation: float 9s ease-in-out infinite; }
.cert::after { content: ""; position: absolute; right: -6rem; top: -6rem; width: 20rem; height: 20rem; border-radius: 50%; background: rgb(var(--amber) / .12); filter: blur(60px); pointer-events: none; }
@media (min-width: 768px) { .cert { grid-template-columns: auto minmax(0, 1fr); gap: 3rem; } }
.cert__badge { width: clamp(8rem, 18vw, 11rem); height: auto; filter: drop-shadow(0 18px 30px rgb(var(--amber) / .25)); }
.verified { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 600; color: rgb(var(--ok)); }
.verified .icon { width: 1.15em; height: 1.15em; padding: 2px; border-radius: 50%; background: rgb(var(--ok) / .16); }
@keyframes float { 50% { transform: translateY(-8px); } }

/* ---- Contact form -------------------------------------------------------- */
.field label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: .5rem; }
.field input, .field textarea {
    width: 100%; padding: .8rem 1rem; border-radius: 12px;
    background: rgb(var(--bg) / .7); border: 1px solid rgb(var(--line) / .14); color: rgb(var(--ink));
    font: inherit; font-size: .95rem;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.field input::placeholder, .field textarea::placeholder { color: rgb(var(--muted) / .8); }
.field input:focus, .field textarea:focus { outline: none; border-color: rgb(var(--accent-ink)); box-shadow: 0 0 0 3px rgb(var(--accent) / .25); }
#contact-status { font-size: .9rem; color: rgb(var(--muted)); }
#contact-status[data-state="ok"] { color: rgb(var(--ok)); }
#contact-status[data-state="error"] { color: rgb(var(--danger)); }

/* ---- Case-study pages ---------------------------------------------------- */
.prose p { color: rgb(var(--muted)); line-height: 1.8; max-width: 44rem; margin-bottom: 1.25rem; }
.prose ul, .prose ol { color: rgb(var(--muted)); line-height: 1.75; max-width: 44rem; margin: 0 0 1.5rem 1.25rem; display: grid; gap: .75rem; font-size: .95rem; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose code { font-family: 'Fira Code', ui-monospace, monospace; font-size: .85em; color: rgb(var(--ink)); }
.prose pre { max-width: 44rem; margin-bottom: 1.5rem; padding: 1.1rem 1.25rem; border-radius: 14px; overflow-x: auto; border: 1px solid rgb(var(--line) / .1); background: rgb(var(--surface) / .7); font-size: .85rem; }
.prose .diagram { margin-bottom: 1.75rem; padding: clamp(1.25rem, 3vw, 2rem); }
.fact { padding: 1.1rem 1.25rem; }
.fact dt { font-size: .75rem; color: rgb(var(--muted)); margin-bottom: .3rem; }
.fact dd { font-size: .9rem; font-weight: 600; }

/* ---- Scroll reveal --------------------------------------------------------
   Hidden only when JS is running (the .js class is set in <head>), so the
   page is fully readable without it. Transform + opacity only: no layout. */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---- Reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition-duration: .001ms !important; }
    .js .reveal, .js .rail__body { opacity: 1; transform: none; }
    .rail { --p: 1 !important; }
    .pipeline__packet, .net-packet, .net-node__halo { display: none; }
    .btn:hover, .icon-btn:hover, .work-card:hover .work-card__preview > .flow, .work-card:hover .work-card__title { transform: none; }
}
