/* mortezadehghan.ir — v4 (2026-10-25)
   Look: a night over Yazd. Lapis-blue sky, turquoise tile, saffron lamp light.
   Motion lives only in the portfolio and stops when it is off screen (see site.v2.js).
   ⚠️ CSS/JS are cached for 30 days by nginx + the CDN: after any edit, rename the file (v3, v4…)
   and update the <link>/<script> in index.html and 404.html. */

@font-face {
    font-family: 'Vazirmatn';
    src: url('/vendor/fonts/vazirmatn/Vazirmatn-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@property --ang {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

:root {
    --lapis-950: #0b1338;
    --lapis-900: #101a4a;
    --lapis-800: #16225c;
    --lapis-700: #1d2d6e;
    --line: #2a3c86;
    --turq: #34c3b5;
    --saffron: #f0b54a;
    --gach: #f3ead8;
    --muted: #a9b3d6;
    --radius-l: 28px;
    --radius-m: 20px;
    --radius-s: 12px;
    --header-h: 64px;
    color-scheme: dark;
}

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

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

body {
    margin: 0;
    font-family: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
    font-size: 1.0625rem;
    line-height: 1.9;
    color: var(--gach);
    background: var(--lapis-900);
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--turq); text-underline-offset: 4px; }
a:hover { color: var(--gach); }
h1, h2, h3 { line-height: 1.35; margin: 0; }
p { margin: 0 0 1rem; }

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

.container { width: min(1160px, 100% - 32px); margin-inline: auto; }
.container.narrow { width: min(860px, 100% - 32px); }

.skip-link {
    position: absolute;
    inset-inline-start: 8px;
    top: -60px;
    z-index: 2000;
    background: var(--saffron);
    color: var(--lapis-950);
    padding: 10px 16px;
    border-radius: var(--radius-s);
    font-weight: 700;
    text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* Buttons --------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-s);
    border: 1.5px solid transparent;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn-primary { background: var(--saffron); color: var(--lapis-950); }
.btn-primary:hover { background: #f6c86e; color: var(--lapis-950); }
.btn-ghost { background: transparent; color: var(--gach); border-color: var(--turq); }
.btn-ghost:hover { background: rgba(52, 195, 181, .12); color: var(--gach); }
.btn-small { min-height: 44px; padding: 0.45rem 1.15rem; font-size: .95rem; }
.link { font-weight: 600; }
.muted { color: var(--muted); font-size: .92rem; }

/* Header ---------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(16, 26, 74, .94);
    border-bottom: 1px solid rgba(42, 60, 134, .7);
}
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-h);
    gap: 1rem;
}
.nav-brand {
    color: var(--gach);
    font-weight: 800;
    font-size: 1.15rem;
    text-decoration: none;
}
.nav-menu {
    list-style: none;
    display: flex;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
}
.nav-menu a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    font-size: .97rem;
    border-radius: 10px;
}
.nav-menu a:hover { color: var(--gach); background: rgba(255, 255, 255, .05); }
.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 12px 10px;
    background: transparent;
    border: 0;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
}
.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--gach);
    border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
}

/* Hero ------------------------------------------------------------------ */
.hero {
    position: relative;
    overflow: hidden;
    padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(3rem, 7vw, 5rem);
    background:
        radial-gradient(120% 70% at 85% 0%, rgba(52, 195, 181, .10), transparent 60%),
        linear-gradient(180deg, var(--lapis-950) 0%, var(--lapis-900) 100%);
}
.hero-stars {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
}
.hero-name {
    font-size: clamp(3rem, 9.5vw, 6.4rem);
    font-weight: 900;
    line-height: 1.1;
    color: var(--gach);
}
.hero-role {
    margin-top: 1rem;
    font-size: clamp(1.15rem, 2.2vw, 1.45rem);
    font-weight: 600;
    color: var(--turq);
}
.hero-lead {
    max-width: 58ch;
    color: var(--muted);
    font-size: 1.08rem;
}
.hero-lead a { color: var(--gach); }
.hero-stats {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    margin: 1.5rem 0 0;
    padding: 0;
}
.hero-stats li {
    display: flex;
    flex-direction: column;
    padding-inline: 1.5rem;
    border-inline-start: 1px solid var(--line);
}
.hero-stats li:first-child { padding-inline-start: 0; border-inline-start: 0; }
.hero-stats strong {
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--saffron);
}
.hero-stats span { color: var(--muted); font-size: .95rem; }
.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin: 1.75rem 0 1.5rem;
}
.hero-now {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--muted);
    font-size: .95rem;
    margin: 0;
}
.now-dot {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--saffron);
    flex: none;
}
.now-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--saffron);
    animation: ping 2.4s ease-out 4;
}

.hero-portrait {
    position: relative;
    justify-self: center;
    width: min(340px, 100%);
}
.girih {
    position: absolute;
    inset: -18%;
    width: 136%;
    height: 136%;
    pointer-events: none;
}
.arch {
    --arch: polygon(0.0% 100.0%, 0.0% 40.0%, 0.4% 35.1%, 1.4% 30.5%, 3.1% 26.4%, 5.4% 22.6%, 8.2% 19.2%, 11.5% 16.1%, 15.3% 13.3%, 19.4% 10.7%, 23.9% 8.4%, 28.7% 6.4%, 33.8% 4.5%, 39.0% 2.8%, 44.5% 1.4%, 50.0% 0.0%, 55.5% 1.4%, 61.0% 2.8%, 66.2% 4.5%, 71.3% 6.4%, 76.1% 8.4%, 80.6% 10.7%, 84.8% 13.3%, 88.5% 16.1%, 91.8% 19.2%, 94.6% 22.6%, 96.9% 26.4%, 98.6% 30.5%, 99.6% 35.1%, 100.0% 40.0%, 100.0% 100.0%);
    position: relative;
    padding: 6px;
    aspect-ratio: 4 / 5;
    clip-path: var(--arch);
    background: linear-gradient(165deg, var(--turq) 0%, var(--line) 55%, var(--saffron) 100%);
}
.arch picture, .arch img {
    width: 100%;
    height: 100%;
}
.arch img {
    object-fit: cover;
    object-position: 50% 30%;
    clip-path: var(--arch);
    background: var(--lapis-700);
}

/* Sections -------------------------------------------------------------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-title {
    font-size: clamp(1.75rem, 3.4vw, 2.5rem);
    font-weight: 800;
    color: var(--gach);
    margin-bottom: .75rem;
}
.section-lead {
    color: var(--muted);
    max-width: 62ch;
    margin-bottom: 2.5rem;
}
.about, .experience, .faq { background: var(--lapis-900); }
.portfolio, .expertise, .contact { background: var(--lapis-800); }
.skills { background: var(--lapis-900); }

/* About ----------------------------------------------------------------- */
.about .section-title { margin-bottom: 2rem; }
.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}
.about-story p { color: #d9d6e4; max-width: 64ch; }
.principles {
    list-style: none;
    margin: 1.75rem 0 0;
    padding: 0;
    display: grid;
    gap: .9rem;
}
.principles li {
    padding-inline-start: 1.1rem;
    border-inline-start: 2px solid var(--turq);
    color: var(--muted);
}
.principles strong { color: var(--gach); font-weight: 700; }

.facts {
    margin: 0;
    padding: 1.5rem 1.75rem;
    background: var(--lapis-800);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
}
.facts div {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: .75rem;
    padding: .8rem 0;
    border-bottom: 1px solid rgba(42, 60, 134, .7);
}
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); font-size: .95rem; }
.facts dd { margin: 0; font-weight: 600; }
.status-chip {
    display: inline-block;
    padding: .1rem .7rem;
    border: 1px solid var(--saffron);
    border-radius: 999px;
    color: var(--saffron);
    font-size: .92rem;
    font-weight: 600;
}

.bio {
    margin-top: clamp(2.5rem, 5vw, 3.5rem);
    padding: 1.5rem 1.75rem;
    border-inline-start: 3px solid var(--saffron);
    background: linear-gradient(90deg, transparent, rgba(240, 181, 74, .06));
    border-radius: 4px;
}
.bio h3 { font-size: 1.2rem; margin-bottom: .6rem; }
.bio p { color: #d9d6e4; margin: 0; max-width: 80ch; }

/* Portfolio ------------------------------------------------------------- */
.sky {
    margin: 0 0 clamp(2rem, 5vw, 3.5rem);
    padding: 1rem 0;
    border-radius: var(--radius-l);
    background:
        radial-gradient(60% 90% at 50% 40%, rgba(52, 195, 181, .07), transparent 70%),
        var(--lapis-950);
    border: 1px solid var(--line);
}
.sky svg { display: block; width: 100%; height: auto; }
.sky-dust circle { opacity: .45; }
.sky-lines line { stroke-dasharray: 1; stroke-dashoffset: 0; opacity: .55; }
.js .sky-lines line {
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 1.1s ease var(--d, 0s);
}
.js .sky.is-shown .sky-lines line { stroke-dashoffset: 0; }
.star { cursor: pointer; }
.star .core { fill: var(--saffron); transition: fill .2s ease; }
.star .glow { fill: var(--saffron); opacity: .16; }
.star text {
    fill: var(--gach);
    font-size: 20px;
    font-weight: 600;
    text-anchor: middle;
    transition: fill .2s ease;
}
.star-main text { font-size: 24px; font-weight: 800; }
.star:hover .core, .star:focus-visible .core { fill: var(--turq); }
.star:hover text, .star:focus-visible text { fill: var(--turq); }
.star:focus-visible { outline: none; }
.star:focus-visible .glow { stroke: var(--turq); stroke-width: 2; opacity: 1; fill: none; }

.feature {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: center;
    padding: clamp(1.5rem, 4vw, 2.75rem);
    margin-bottom: 1.5rem;
    background: var(--lapis-900);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    overflow: clip;
}
.feature::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: conic-gradient(from var(--ang), transparent 0 55%, var(--turq) 72%, var(--saffron) 84%, transparent 96%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity .35s ease;
    animation: ang 5s linear infinite paused;
    pointer-events: none;
}
.feature:hover::before { opacity: 1; animation-play-state: running; }
.feature-alt .feature-body { order: 2; }
.feature-body { display: flex; flex-direction: column; }
.feature-body h3 { order: 1; font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; }
.feature-tag {
    order: 2;
    align-self: flex-start;
    margin: .5rem 0 1rem;
    padding: .1rem .75rem;
    border-radius: 999px;
    background: rgba(52, 195, 181, .12);
    color: var(--turq);
    font-size: .9rem;
    font-weight: 600;
}
.feature-body > p:not(.feature-tag):not(.feature-links),
.feature-list,
.feature-links { order: 3; }
.feature-body > p { color: #d9d6e4; }
.feature-list {
    list-style: none;
    margin: .25rem 0 1.5rem;
    padding: 0;
    display: grid;
    gap: .5rem;
    color: var(--muted);
}
.feature-list li { position: relative; padding-inline-start: 1.2rem; }
.feature-list li::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: .78em;
    width: 7px;
    height: 7px;
    background: var(--saffron);
    transform: rotate(45deg);
}
.feature-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    margin: 0;
}
.feature:target, .tile:target { outline: 2px solid var(--saffron); outline-offset: 4px; }

/* Orbit scene (Avidgard) */
.orbit {
    position: relative;
    width: min(380px, 100%);
    aspect-ratio: 1;
    margin-inline: auto;
    container-type: inline-size;
}
.orbit-ring {
    --r: 26cqi;
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(var(--r) * 2);
    height: calc(var(--r) * 2);
    margin: calc(var(--r) * -1) 0 0 calc(var(--r) * -1);
    border: 1px dashed rgba(52, 195, 181, .45);
    border-radius: 50%;
    animation: spin 48s linear infinite;
}
.ring-b {
    --r: 46cqi;
    border-color: rgba(240, 181, 74, .3);
    animation-duration: 80s;
    animation-direction: reverse;
}
.sat {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform: rotate(var(--a)) translateX(var(--r)) rotate(calc(-1 * var(--a)));
}
.sat span {
    position: absolute;
    left: 0;
    top: 0;
    translate: -50% -50%;
    white-space: nowrap;
    padding: .2rem .7rem;
    border-radius: 999px;
    background: var(--lapis-700);
    border: 1px solid var(--line);
    color: var(--gach);
    font-size: clamp(.72rem, 3.4cqi, .9rem);
    font-weight: 600;
    animation: spin 48s linear infinite reverse;
}
.ring-b .sat span { animation-duration: 80s; animation-direction: normal; }
.orbit-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30cqi;
    height: 30cqi;
    translate: -50% -50%;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ffd78d, var(--saffron) 55%, #c98a22);
    box-shadow: 0 0 0 8px rgba(240, 181, 74, .12), 0 0 40px rgba(240, 181, 74, .25);
    color: var(--lapis-950);
    font-weight: 900;
    font-size: clamp(.9rem, 5cqi, 1.2rem);
}

/* Map scene (Avidmap) */
.mapscene svg {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-m);
    background: var(--lapis-950);
    border: 1px solid var(--line);
}
.route { stroke-dasharray: 1; stroke-dashoffset: 0; }
/* Plays once each time the map scrolls into view, then stays still (no CPU). */
.mapscene.is-live .route { animation: draw 3.4s linear 1 both; }
.pulse { transform-box: fill-box; transform-origin: center; opacity: 0; }
.mapscene.is-live .pulse { animation: ping-svg 1.6s ease-out 3.4s 3; }
.map-label { fill: var(--muted); font-size: 15px; font-weight: 600; text-anchor: middle; }

/* Tiles */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 1.25rem;
    margin-top: 2.25rem;
}
.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: 1.5rem;
    background: var(--lapis-900);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    overflow: hidden;
    transition: border-color .25s ease, opacity .5s ease, transform .5s ease;
}
.tile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%), rgba(52, 195, 181, .14), transparent 70%);
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
}
.tile:hover { border-color: rgba(52, 195, 181, .55); }
.tile:hover::before { opacity: 1; }
.tile h3 { font-size: 1.15rem; font-weight: 700; }
.tile p { color: var(--muted); margin: 0; flex: 1; }
.tile .link, .tile .muted { margin-top: .4rem; align-self: flex-start; }
.tile a.link { direction: ltr; unicode-bidi: isolate; }
.tile bdi { white-space: nowrap; }
.glyph { width: 56px; height: 56px; }
.glyph svg { width: 100%; height: 100%; overflow: visible; }
.glyph * { transform-box: fill-box; transform-origin: center; }

.js .tiles .tile { opacity: 0; transform: translateY(14px); }
.js .tiles.is-shown .tile { opacity: 1; transform: none; }
.tiles .tile:nth-child(2) { transition-delay: 0s, .07s, .07s; }
.tiles .tile:nth-child(3) { transition-delay: 0s, .14s, .14s; }
.tiles .tile:nth-child(4) { transition-delay: 0s, .21s, .21s; }
.tiles .tile:nth-child(5) { transition-delay: 0s, .28s, .28s; }
.tiles .tile:nth-child(6) { transition-delay: 0s, .35s, .35s; }
.tiles .tile:nth-child(7) { transition-delay: 0s, .42s, .42s; }
.tiles .tile:nth-child(8) { transition-delay: 0s, .49s, .49s; }

/* Tile icons move only while the visitor points at (or tabs into) that tile. */
.tile:is(:hover, :focus-within) .win { animation: flicker 5s steps(1) infinite; }
.tile:is(:hover, :focus-within) .dot { animation: hop 1.2s ease-in-out infinite; }
.tile:is(:hover, :focus-within) .d2 { animation-delay: .15s; }
.tile:is(:hover, :focus-within) .d3 { animation-delay: .3s; }
.tile:is(:hover, :focus-within) .caret { animation: blink 1.05s steps(1) infinite; }
.tile:is(:hover, :focus-within) .steam { animation: rise 3s ease-in-out infinite; }
.tile:is(:hover, :focus-within) .s2 { animation-delay: 1.5s; }
.steam { opacity: .6; }
.tile:is(:hover, :focus-within) .scan { animation: scan 2.8s ease-in-out infinite; }
.tile:is(:hover, :focus-within) .strip { animation: roll 1.4s linear infinite; }
.tile:is(:hover, :focus-within) .spark { animation: sparkle 1.6s ease-in-out infinite; }
.tile:is(:hover, :focus-within) .s-small { animation-delay: .5s; }

.earlier {
    margin: 2rem 0 0;
    color: var(--muted);
    font-size: .97rem;
}
.earlier strong { color: var(--gach); }

/* Experience ------------------------------------------------------------ */
.timeline {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
}
.timeline::before {
    content: '';
    position: absolute;
    inset-inline-start: 6px;
    top: .6rem;
    bottom: .6rem;
    width: 2px;
    background: linear-gradient(180deg, var(--line), var(--turq) 70%, var(--saffron));
}
.timeline li {
    position: relative;
    padding: 0 0 2rem;
    padding-inline-start: 2.25rem;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: .55rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--lapis-900);
    border: 3px solid var(--turq);
}
.timeline li:last-child::before { border-color: var(--saffron); background: var(--saffron); }
.when { color: var(--turq); font-weight: 700; font-size: .95rem; }
.timeline h3 { font-size: 1.2rem; margin: .1rem 0 .3rem; }
.timeline p { color: var(--muted); margin: 0; }

/* Expertise ------------------------------------------------------------- */
.expertise-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
    column-gap: clamp(1.5rem, 4vw, 3rem);
}
.expertise-list li {
    padding: 1.4rem 0;
    border-top: 1px solid var(--line);
}
.expertise-list h3 { font-size: 1.15rem; margin-bottom: .35rem; }
.expertise-list p { color: var(--muted); margin-bottom: .6rem; }
.example { color: var(--saffron); font-size: .9rem; font-weight: 600; }

/* Skills ---------------------------------------------------------------- */
.skill-groups { display: grid; gap: 0; }
.skill-group {
    display: grid;
    grid-template-columns: 8rem 1fr;
    gap: 1rem;
    align-items: baseline;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(42, 60, 134, .7);
}
.skill-group:last-child { border-bottom: 0; }
.skill-group h3 { font-size: 1rem; color: var(--muted); font-weight: 600; }
.skill-group ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.skill-group li {
    direction: ltr;
    unicode-bidi: isolate;
    padding: .2rem .8rem;
    border-radius: 999px;
    background: var(--lapis-800);
    border: 1px solid var(--line);
    font-size: .93rem;
}

/* FAQ ------------------------------------------------------------------- */
.faq .section-title { margin-bottom: 1.75rem; }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list details:first-child { border-top: 1px solid var(--line); }
.faq-list summary {
    position: relative;
    list-style: none;
    cursor: pointer;
    padding: 1.1rem 0;
    padding-inline-end: 2.5rem;
    font-weight: 700;
    font-size: 1.08rem;
    min-height: 44px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
    content: '+';
    position: absolute;
    inset-inline-end: .25rem;
    top: 50%;
    translate: 0 -50%;
    color: var(--turq);
    font-size: 1.5rem;
    font-weight: 400;
    transition: rotate .2s ease;
}
.faq-list details[open] summary::after { rotate: 45deg; }
.faq-list summary:hover { color: var(--turq); }
.faq-list details p { color: #d9d6e4; padding-bottom: 1.25rem; margin: 0; max-width: 70ch; }

/* Contact --------------------------------------------------------------- */
.contact .section-title { margin-bottom: 2rem; }
.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 1.5rem;
}
.contact-status, .contact-ways {
    padding: 1.75rem;
    border-radius: var(--radius-m);
    border: 1px solid var(--line);
    background: var(--lapis-900);
}
.contact-status { border-inline-start: 4px solid var(--saffron); }
.contact-status h3, .contact-ways h3 { font-size: 1.15rem; margin-bottom: .6rem; }
.contact-status p { color: #d9d6e4; }
.contact-ways h3 + p { margin-bottom: 1.25rem; }
.phones a {
    display: block;
    width: fit-content;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gach);
    text-decoration: none;
    padding: .2rem 0;
}
.phones a:hover { color: var(--turq); }
.sites { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 0; }
.sites a { direction: ltr; unicode-bidi: isolate; font-weight: 600; }

/* Footer ---------------------------------------------------------------- */
.footer {
    background: var(--lapis-950);
    border-top: 1px solid var(--line);
    padding: 2rem 0;
    color: var(--muted);
    font-size: .93rem;
    text-align: center;
}
.footer p { margin: .2rem 0; }

/* Dialog ---------------------------------------------------------------- */
.collab {
    width: min(520px, 100% - 32px);
    padding: 2rem 1.75rem 1.5rem;
    border: 1px solid var(--line);
    border-top: 4px solid var(--saffron);
    border-radius: var(--radius-m);
    background: var(--lapis-800);
    color: var(--gach);
}
.collab[open] { animation: pop .22s ease-out; }
.collab::backdrop { background: rgba(5, 10, 35, .72); }
.collab h2 { font-size: 1.35rem; font-weight: 800; margin-bottom: .9rem; padding-inline-end: 2rem; }
.collab p { color: #d9d6e4; }
.collab-close-form { margin: 0; }
.collab-x {
    position: absolute;
    inset-inline-end: .75rem;
    top: .75rem;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}
.collab-x:hover { color: var(--gach); background: rgba(255, 255, 255, .06); }
.collab-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.collab-actions form { margin: 0; }

/* 404 ------------------------------------------------------------------- */
.notfound {
    min-height: 70vh;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 4rem 0;
}
.notfound h1 { font-size: clamp(2rem, 6vw, 3rem); margin-bottom: 1rem; }
.notfound p { color: var(--muted); }

/* Scroll feel ------------------------------------------------------------
   Blocks fade and slide in once as they scroll into view (site.v3.js adds .in).
   Only opacity + transform, so the graphics card does the work, not the CPU.
   If the script never runs, the inline head script removes .js after 5 s and everything shows. */
.scroll-progress {
    position: fixed;
    top: 0;
    inset-inline: 0;
    height: 3px;
    z-index: 1100;
    background: linear-gradient(90deg, var(--saffron), var(--turq));
    transform: scaleX(0);
    transform-origin: right center;
    pointer-events: none;
}

.js :is(.section-title, .section-lead, .about-story > p, .principles li, .facts, .bio, .sky, .feature,
       .earlier, .timeline li, .expertise-list li, .skill-group, .faq-list details,
       .contact-status, .contact-ways) {
    transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1);
    transition-delay: var(--rv-delay, 0s);
}
.js :is(.section-title, .section-lead, .about-story > p, .principles li, .facts, .bio, .sky,
       .earlier, .expertise-list li, .skill-group, .faq-list details,
       .contact-status, .contact-ways):not(.in) {
    opacity: 0;
    transform: translateY(28px);
}
.js .feature:not(.in) { opacity: 0; transform: translateY(44px) scale(.97); }
.js .timeline li:not(.in) { opacity: 0; transform: translateY(24px); }
@media (min-width: 861px) { .js .timeline li:not(.in) { transform: translateX(-32px); } }
main { overflow-x: clip; }
.js .facts:not(.in) { transform: translateY(28px) scale(.98); }

/* Hero comes in on page load, one piece after another. */
.js .hero-text > *, .js .hero-portrait { animation: rise-in .9s cubic-bezier(.2, .7, .2, 1) both; }
.js .hero-portrait { animation-name: arch-in; animation-duration: 1.1s; }
.js .hero-role { animation-delay: .12s; }
.js .hero-lead { animation-delay: .22s; }
.js .hero-stats { animation-delay: .32s; }
.js .hero-cta { animation-delay: .42s; }
.js .hero-portrait { animation-delay: .1s; }

/* Keyframes ------------------------------------------------------------- */
@keyframes rise-in { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes arch-in { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ang { to { --ang: 360deg; } }
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(2.8); opacity: 0; } }
@keyframes ping-svg { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.8); opacity: 0; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes flicker { 0%, 100% { opacity: 1; } 42% { opacity: .35; } 46% { opacity: 1; } 70% { opacity: .55; } }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-4px); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes rise { 0% { transform: translateY(4px); opacity: 0; } 40% { opacity: .7; } 100% { transform: translateY(-6px); opacity: 0; } }
@keyframes scan { 0% { transform: translateX(0); } 100% { transform: translateX(70px); } }
@keyframes roll { from { transform: translateX(0); } to { transform: translateX(-10px); } }
@keyframes sparkle { 0%, 100% { transform: scale(1); } 50% { transform: scale(.82); } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* Everything that loops is paused unless its block is on screen (site.v2.js adds .is-live). */
.scene:not(.is-live) * { animation-play-state: paused; }

/* Responsive ------------------------------------------------------------ */
@media (max-width: 960px) {
    .feature, .feature-alt { grid-template-columns: 1fr; }
    .feature-alt .feature-body { order: 0; }
    .orbit { width: min(340px, 84%); }
}

@media (max-width: 860px) {
    .nav-toggle { display: flex; }
    .nav-menu {
        position: absolute;
        top: 100%;
        inset-inline: 0;
        flex-direction: column;
        gap: 0;
        padding: .5rem 16px 1rem;
        background: var(--lapis-900);
        border-bottom: 1px solid var(--line);
        display: none;
    }
    .nav-menu.open { display: flex; }
    .nav-menu a { padding: .8rem .5rem; font-size: 1.02rem; color: var(--gach); }
    .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

    .hero-grid { grid-template-columns: 1fr; }
    .hero-portrait { order: -1; justify-self: start; width: min(210px, 56%); }
    .about-grid, .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    body { font-size: 1rem; }
    .hero-cta .btn { flex: 1 1 100%; }
    .star text { font-size: 30px; }
    .star-main text { font-size: 34px; }
    .facts { padding: 1rem 1.25rem; }
    .facts div { grid-template-columns: 5.5rem 1fr; }
    .skill-group { grid-template-columns: 1fr; gap: .5rem; }
    .contact-status, .contact-ways { padding: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    .js .tiles .tile { opacity: 1; transform: none; }
    .js :is(.section-title, .section-lead, .about-story > p, .principles li, .facts, .bio, .sky, .feature,
       .earlier, .timeline li, .expertise-list li, .skill-group, .faq-list details,
       .contact-status, .contact-ways) { opacity: 1; transform: none; }
    .scroll-progress { display: none; }
    .js .sky-lines line { stroke-dashoffset: 0; }
}
