/* =========================================================
   Yussif H. Ammar — Portfolio
   Art direction: editorial / swiss-studio. Paper + ink + vermillion.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
    --bg: #EFEBE3;
    --bg-2: #E5E0D6;
    --fg: #14130F;
    --fg-2: #5C574E;
    --fg-3: #918B80;
    --line: rgba(20, 19, 15, .18);
    --line-soft: rgba(20, 19, 15, .09);
    --accent: #F03A0C;
    --accent-fg: #FFF6F0;
    --grain: .055;

    --pad: clamp(18px, 4vw, 56px);
    --maxw: 1560px;
    --ease: cubic-bezier(.16, 1, .3, 1);
    --ease-io: cubic-bezier(.65, .05, .36, 1);
}

html[data-theme="dark"] {
    --bg: #0E0D0B;
    --bg-2: #171512;
    --fg: #EFEBE3;
    --fg-2: #A8A196;
    --fg-3: #6E685E;
    --line: rgba(239, 235, 227, .18);
    --line-soft: rgba(239, 235, 227, .08);
    --accent: #FF5227;
    --accent-fg: #14100E;
    --grain: .09;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--fg);
    font-family: 'Inter Tight', system-ui, -apple-system, sans-serif;
    font-size: clamp(15px, 1.05vw, 17px);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background .6s var(--ease), color .6s var(--ease);
}

body.lock {
    overflow: hidden;
}

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

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

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

ul {
    list-style: none;
}

::selection {
    background: var(--accent);
    color: var(--accent-fg);
}

/* ---------- Type ---------- */
.display,
h1,
h2,
h3 {
    font-family: 'Bricolage Grotesque', 'Inter Tight', sans-serif;
    font-weight: 800;
    font-variation-settings: 'wdth' 100, 'opsz' 96;
    line-height: .88;
    letter-spacing: -.035em;
    text-transform: uppercase;
}

.serif {
    font-family: 'Instrument Serif', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    text-transform: none;
    letter-spacing: -.01em;
    color: var(--accent);
}

.mono {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-weight: 400;
}

.xl {
    font-size: clamp(3.4rem, 15.5vw, 15rem);
}

.lg {
    font-size: clamp(2.6rem, 8vw, 7rem);
}

.md {
    font-size: clamp(1.5rem, 3vw, 2.6rem);
    letter-spacing: -.025em;
}

.shell {
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: var(--pad);
}

section {
    position: relative;
}

/* ---------- Grain + noise ---------- */
.grain {
    position: fixed;
    /* Jitters the noise via background-position rather than transform.
       Same shimmer, but the layer stays exactly viewport-sized and never
       forces a full-page re-composite -- which the old oversized,
       transform-animated version did once 3D content sat underneath it. */
    inset: 0;
    z-index: 9000;
    pointer-events: none;
    opacity: var(--grain);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: grainshift 6s steps(5) infinite;
}

@keyframes grainshift {
    0% { background-position: 0 0 }
    20% { background-position: -31px 22px }
    40% { background-position: 24px -27px }
    60% { background-position: -17px -15px }
    80% { background-position: 29px 18px }
    100% { background-position: 0 0 }
}

/* ---------- Loader ---------- */
.loader {
    position: fixed;
    inset: 0;
    z-index: 8000;
    background: var(--bg);
    display: grid;
    align-content: end;
    padding: var(--pad);
    transition: transform 1s var(--ease);
}

.loader.done {
    transform: translateY(-101%);
}

.loader-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    overflow: hidden;
    padding-bottom: 14px;
}

.loader-name {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -.035em;
    font-size: clamp(2rem, 8vw, 6rem);
    line-height: .9;
}

.loader-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(1rem, 3vw, 2rem);
    color: var(--accent);
}

.loader-bar {
    height: 2px;
    background: var(--line);
    position: relative;
    overflow: hidden;
}

.loader-bar i {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: var(--accent);
}

/* ---------- Cursor ---------- */
.cursor {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 7500;
    pointer-events: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    mix-blend-mode: normal;
    transform: translate(-50%, -50%);
    transition: width .35s var(--ease), height .35s var(--ease), background .3s, opacity .3s;
    display: grid;
    place-items: center;
    opacity: 0;
}

.cursor.ready {
    opacity: 1;
}

.cursor.grow {
    width: 84px;
    height: 84px;
}

.cursor span {
    font-family: 'JetBrains Mono', monospace;
    font-size: .62rem;
    letter-spacing: .1em;
    color: var(--accent-fg);
    opacity: 0;
    transform: scale(.6);
    transition: .3s var(--ease);
    white-space: nowrap;
}

.cursor.grow span {
    opacity: 1;
    transform: none;
}

@media (hover:none),
(pointer:coarse) {
    .cursor { display: none }
}

/* ---------- Nav ---------- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 6000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px var(--pad);
    mix-blend-mode: normal;
    transition: transform .6s var(--ease), background .4s, border-color .4s;
    border-bottom: 1px solid transparent;
}

.nav.stuck {
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom-color: var(--line-soft);
}

.nav.hide {
    transform: translateY(-105%);
}

.nav-logo {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -.02em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-logo b {
    color: var(--accent);
}

.nav-mid {
    display: flex;
    gap: 4px;
}

.nav-mid a {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: .82rem;
    letter-spacing: .01em;
    color: var(--fg-2);
    transition: color .3s, background .3s;
}

.nav-mid a i {
    font-family: 'JetBrains Mono', monospace;
    font-style: normal;
    font-size: .6rem;
    color: var(--fg-3);
    transition: color .3s;
}

.nav-mid a:hover,
.nav-mid a.active {
    color: var(--fg);
}

.nav-mid a.active i {
    color: var(--accent);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.clock {
    color: var(--fg-3);
}

.swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: linear-gradient(105deg, var(--fg) 50%, var(--bg) 50%);
    transition: transform .5s var(--ease), border-color .3s;
}

.swatch:hover {
    transform: rotate(180deg);
    border-color: var(--accent);
}

.burger {
    display: none;
    width: 34px;
    height: 26px;
    position: relative;
}

.burger i {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--fg);
    transition: .4s var(--ease);
}

.burger i:nth-child(1) { top: 7px }
.burger i:nth-child(2) { bottom: 7px }

body.menu-open .burger i:nth-child(1) { top: 12px; transform: rotate(45deg) }
body.menu-open .burger i:nth-child(2) { bottom: 12px; transform: rotate(-45deg) }

/* nav sits on top of the accent overlay while the menu is open */
body.menu-open .nav-logo,
body.menu-open .nav-logo b { color: var(--accent-fg) }
body.menu-open .burger i { background: var(--accent-fg) }
body.menu-open .swatch { border-color: rgba(255, 246, 240, .5) }

/* ---------- Overlay menu ---------- */
.menu {
    position: fixed;
    inset: 0;
    z-index: 5500;
    background: var(--accent);
    color: var(--accent-fg);
    padding: 96px var(--pad) var(--pad);
    display: grid;
    align-content: space-between;
    clip-path: inset(0 0 100% 0);
    transition: clip-path .8s var(--ease);
    pointer-events: none;
}

body.menu-open .menu {
    clip-path: inset(0 0 0 0);
    pointer-events: auto;
}

.menu-links a {
    display: block;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -.03em;
    font-size: clamp(2.4rem, 11vw, 5rem);
    line-height: 1.02;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 246, 240, .25);
    transform: translateY(30px);
    opacity: 0;
    transition: transform .7s var(--ease), opacity .5s;
}

body.menu-open .menu-links a {
    transform: none;
    opacity: 1;
    transition-delay: calc(.12s + var(--i) * .06s);
}

.menu-foot {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 20px;
}

.menu-foot a:hover { text-decoration: underline }

/* ---------- Hero ---------- */
.hero {
    padding: clamp(110px, 16vh, 190px) 0 0;
}

.hero-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 24px;
    color: var(--fg-2);
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.avail {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--fg);
}

.avail::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    animation: blip 2s infinite;
}

@keyframes blip {
    0%, 100% { opacity: 1; transform: scale(1) }
    50% { opacity: .35; transform: scale(.75) }
}

/* Name block: both headline lines in column 1, the portrait in column 2
   spanning them. font-size here IS the headline size, so the `em` trims
   below track the type at every viewport. */
.hero-name {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: clamp(20px, 3vw, 56px);
    padding-top: clamp(14px, 2vw, 26px);
    font-size: clamp(3.4rem, 15.5vw, 15rem);
}

.hero-name > h1 {
    grid-column: 1;
}

/* Height comes from the two headline rows it spans, so the photo's top
   edge meets the top of YUSSIF and its bottom sits on the AMMAR baseline
   (.17em is the line box's overshoot below the baseline). */
.hero-portrait {
    position: relative;
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: stretch;
    width: clamp(150px, 21vw, 330px);
    margin-bottom: .17em;
    overflow: hidden;
    background: var(--bg-2);
    clip-path: inset(100% 0 0 0);
    transition: clip-path 1.1s var(--ease) .5s;
}

.loaded .hero-portrait {
    clip-path: inset(0 0 0 0);
}

.hero-portrait img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 16%;
    filter: grayscale(1) contrast(1.06);
    transition: filter .7s var(--ease), transform 1.2s var(--ease);
}

.hero-portrait:hover img {
    filter: none;
    transform: scale(1.05);
}

.hero-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: clamp(24px, 4vw, 72px);
    align-items: baseline;
    padding: clamp(28px, 4vw, 54px) 0 clamp(30px, 5vw, 60px);
}

.hero-lead {
    font-size: clamp(1.05rem, 1.7vw, 1.45rem);
    line-height: 1.35;
    letter-spacing: -.015em;
    max-width: 34ch;
}

.facts {
    display: grid;
    gap: 0;
}

.fact {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line-soft);
}

.fact dt {
    color: var(--fg-3);
}

.fact dd {
    text-align: right;
}

.scroll-cue {
    grid-column: 2;
    margin-top: clamp(18px, 2vw, 30px);
    align-self: end;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--fg-2);
    white-space: nowrap;
}

.scroll-cue i {
    display: block;
    width: 1px;
    height: 44px;
    background: var(--line);
    position: relative;
    overflow: hidden;
}

.scroll-cue i::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent);
    animation: cue 2.2s var(--ease-io) infinite;
}

@keyframes cue {
    0% { transform: translateY(-100%) }
    60%, 100% { transform: translateY(100%) }
}

/* ---------- Ticker ---------- */
.ticker {
    background: var(--accent);
    color: var(--accent-fg);
    padding: 12px 0;
    overflow: hidden;
    border-block: 1px solid var(--accent);
}

.ticker-track {
    display: flex;
    width: max-content;
    gap: 34px;
    animation: slide 30s linear infinite;
}

.ticker.rev .ticker-track {
    animation-direction: reverse;
}

.ticker span {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: -.01em;
    font-size: clamp(.95rem, 1.7vw, 1.35rem);
    display: flex;
    align-items: center;
    gap: 34px;
    white-space: nowrap;
}

.ticker span::after {
    content: '✳';
    font-size: .8em;
    opacity: .7;
}

@keyframes slide {
    to { transform: translateX(-50%) }
}

/* ---------- Section frame ---------- */
.sec {
    padding: clamp(74px, 12vh, 150px) 0;
    border-top: 1px solid var(--line);
}

.sec-head {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: clamp(16px, 4vw, 60px);
    margin-bottom: clamp(34px, 5vw, 70px);
}

.sec-num {
    color: var(--accent);
    padding-top: .6em;
}

.sec-title {
    font-size: clamp(2.2rem, 6.5vw, 5.6rem);
}

.sec-sub {
    color: var(--fg-2);
    max-width: 46ch;
    margin-top: 20px;
    font-size: clamp(.95rem, 1.2vw, 1.1rem);
}

/* ---------- About ---------- */
.about-grid {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: clamp(16px, 4vw, 60px);
}

.statement {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 600;
    text-transform: none;
    letter-spacing: -.025em;
    line-height: 1.12;
    font-size: clamp(1.35rem, 3.1vw, 2.7rem);
    max-width: 20ch;
}

.about-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(24px, 4vw, 60px);
    margin-top: clamp(34px, 5vw, 64px);
}

.about-cols p {
    color: var(--fg-2);
    max-width: 44ch;
}

.about-cols p + p {
    margin-top: 16px;
}

.caps {
    display: grid;
    gap: 0;
    align-self: start;
}

.cap {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px;
    padding: 18px 0;
    border-top: 1px solid var(--line-soft);
    align-items: baseline;
}

.cap:last-child {
    border-bottom: 1px solid var(--line-soft);
}

.cap b {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 600;
    font-size: 1.02rem;
    letter-spacing: -.02em;
}

.cap p {
    color: var(--fg-2);
    font-size: .92rem;
    margin-top: 3px;
}

.cap .mono {
    color: var(--accent);
}

.counters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
    margin-top: clamp(40px, 6vw, 80px);
}

.counter {
    padding: 26px 20px 6px 0;
}

.counter b {
    display: block;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: clamp(2.2rem, 5vw, 4.2rem);
    letter-spacing: -.04em;
    line-height: .9;
}

.counter > span {
    display: block;
    color: var(--fg-3);
    margin-top: 10px;
}

/* ---------- Experience (horizontal pin) ---------- */
.pin {
    position: relative;
}

.pin-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.track {
    display: flex;
    gap: clamp(16px, 2vw, 30px);
    padding-inline: var(--pad);
    will-change: transform;
}

.xp {
    flex: none;
    width: min(78vw, 460px);
    min-height: 56vh;
    border: 1px solid var(--line);
    background: var(--bg);
    padding: clamp(22px, 2.4vw, 34px);
    display: flex;
    flex-direction: column;
    transition: background .4s, border-color .4s, color .4s;
}

.xp:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-fg);
}

.xp:hover .xp-year,
.xp:hover .xp-org,
.xp:hover li {
    color: inherit;
    opacity: .92;
}

.xp:hover .xp-num {
    color: var(--accent-fg);
}

.xp-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid currentColor;
    opacity: 1;
}

.xp-num {
    color: var(--accent);
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -.02em;
}

.xp-year {
    color: var(--fg-3);
}

.xp h3 {
    font-size: clamp(1.4rem, 2.3vw, 2rem);
    margin: 22px 0 8px;
    text-transform: none;
    letter-spacing: -.03em;
    font-weight: 800;
}

.xp-org {
    font-family: 'JetBrains Mono', monospace;
    font-size: .74rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
}

.xp ul {
    margin-top: 20px;
    display: grid;
    gap: 11px;
}

.xp li {
    color: var(--fg-2);
    font-size: .93rem;
    padding-left: 18px;
    position: relative;
    line-height: 1.45;
}

.xp li::before {
    content: '—';
    position: absolute;
    left: 0;
    opacity: .6;
}

.xp-loc {
    margin-top: auto;
    padding-top: 22px;
    color: var(--fg-3);
}

.xp:hover .xp-loc {
    color: inherit;
    opacity: .8;
}

.pin-progress {
    position: absolute;
    left: var(--pad);
    right: var(--pad);
    bottom: 8vh;
    height: 1px;
    background: var(--line);
}

.pin-progress i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
}

.pin-hint {
    position: absolute;
    left: var(--pad);
    bottom: calc(8vh + 14px);
    color: var(--fg-3);
}

/* ---------- Work index ---------- */
.index {
    border-top: 1px solid var(--line);
}

.row {
    position: relative;
    display: grid;
    grid-template-columns: 74px 1fr 300px 74px 40px;
    align-items: center;
    gap: 16px;
    padding: clamp(18px, 2.4vw, 30px) 8px;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    cursor: pointer;
}

.row::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform .5s var(--ease);
    z-index: 0;
}

.row:hover::before {
    transform: scaleY(1);
    transform-origin: top;
}

.row > * {
    position: relative;
    z-index: 1;
    transition: color .4s var(--ease), transform .5s var(--ease);
}

.row:hover > * {
    color: var(--accent-fg);
}

.row:hover .row-title {
    transform: translateX(18px);
}

.row-num {
    color: var(--fg-3);
}

.row-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: clamp(1.25rem, 3vw, 2.5rem);
    letter-spacing: -.035em;
    text-transform: uppercase;
    line-height: 1;
}

.row-tags {
    color: var(--fg-2);
}

.row-year {
    color: var(--fg-3);
    text-align: right;
}

.row-arrow {
    text-align: right;
    font-size: 1.1rem;
    opacity: 0;
    transform: translate(-8px, 8px);
}

.row:hover .row-arrow {
    opacity: 1;
    transform: none;
}

.row.dim {
    opacity: .28;
    pointer-events: none;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 26px;
}

.filters button {
    font-family: 'JetBrains Mono', monospace;
    font-size: .7rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 8px 15px;
    border: 1px solid var(--line);
    border-radius: 100px;
    color: var(--fg-2);
    transition: .3s var(--ease);
}

.filters button:hover {
    border-color: var(--fg);
    color: var(--fg);
}

.filters button.on {
    background: var(--fg);
    border-color: var(--fg);
    color: var(--bg);
}

/* floating preview */
.preview {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 4000;
    width: 300px;
    aspect-ratio: 4/3;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transform: translate(-50%, -50%) scale(.9);
    transition: opacity .35s var(--ease), transform .45s var(--ease);
    background: var(--accent);
}

.preview.on {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview .ph {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    padding: 20px;
    text-align: center;
    background: var(--accent);
    color: var(--accent-fg);
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -.03em;
    font-size: 1.5rem;
    line-height: .95;
}

@media (hover:none),
(pointer:coarse) {
    .preview { display: none }
}

/* ---------- Project sheet ---------- */
.sheet {
    position: fixed;
    inset: 0;
    z-index: 7000;
    background: var(--bg);
    transform: translateY(100%);
    transition: transform .8s var(--ease);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sheet.open {
    transform: none;
}

.sheet-bar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px var(--pad);
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.sheet-close {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 9px 16px;
    border: 1px solid var(--line);
    border-radius: 100px;
    transition: .3s var(--ease);
}

.sheet-close:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-fg);
}

.sheet-inner {
    padding: clamp(28px, 6vw, 80px) var(--pad) 120px;
    max-width: var(--maxw);
    margin-inline: auto;
}

.sheet-title {
    font-size: clamp(2.2rem, 8vw, 6.5rem);
    margin-bottom: 20px;
}

.sheet-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 26px;
    padding: 16px 0;
    border-block: 1px solid var(--line);
    color: var(--fg-3);
}

.sheet-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(26px, 5vw, 70px);
    margin-top: clamp(28px, 4vw, 54px);
}

.sheet-visual {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--accent);
    position: sticky;
    top: 100px;
}

.sheet-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sheet-visual .ph {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    padding: 30px;
    text-align: center;
    color: var(--accent-fg);
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -.03em;
    font-size: clamp(1.6rem, 3.4vw, 3rem);
    line-height: .95;
}

.sheet-desc {
    font-size: clamp(1.1rem, 1.7vw, 1.5rem);
    line-height: 1.32;
    letter-spacing: -.02em;
    margin-bottom: 30px;
}

.sheet-points li {
    padding: 15px 0 15px 34px;
    border-top: 1px solid var(--line-soft);
    color: var(--fg-2);
    position: relative;
}

.sheet-points li::before {
    content: counter(p, decimal-leading-zero);
    counter-increment: p;
    position: absolute;
    left: 0;
    top: 17px;
    font-family: 'JetBrains Mono', monospace;
    font-size: .68rem;
    letter-spacing: .1em;
    color: var(--accent);
}

.sheet-points {
    counter-reset: p;
    margin-bottom: 30px;
}

.tagset {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}

.tagset span {
    font-family: 'JetBrains Mono', monospace;
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 7px 13px;
    border: 1px solid var(--line);
    border-radius: 100px;
    color: var(--fg-2);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 15px 26px;
    border-radius: 100px;
    background: var(--fg);
    color: var(--bg);
    font-family: 'JetBrains Mono', monospace;
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    transition: .4s var(--ease);
    border: 1px solid var(--fg);
}

.btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-fg);
    transform: translateY(-2px);
}

.btn.ghost {
    background: transparent;
    color: var(--fg);
    border-color: var(--line);
}

.btn.ghost:hover {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}

/* ---------- Skills ---------- */
.skill-row {
    overflow: hidden;
    padding: clamp(6px, 1vw, 12px) 0;
    border-bottom: 1px solid var(--line-soft);
}

.skill-track {
    display: flex;
    width: max-content;
    gap: 30px;
    animation: slide 42s linear infinite;
}

.skill-row:nth-child(even) .skill-track {
    animation-duration: 54s;
    animation-direction: reverse;
}

.skill-row:hover .skill-track {
    animation-play-state: paused;
}

.skill-track b {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -.035em;
    font-size: clamp(1.8rem, 4.6vw, 4rem);
    line-height: 1.1;
    display: flex;
    align-items: center;
    gap: 30px;
    color: transparent;
    -webkit-text-stroke: 1px var(--fg);
    transition: color .35s, -webkit-text-stroke-color .35s;
    white-space: nowrap;
}

.skill-track b:hover {
    color: var(--accent);
    -webkit-text-stroke-color: var(--accent);
}

.skill-track b::after {
    content: '/';
    -webkit-text-stroke: 0;
    color: var(--accent);
    font-size: .5em;
    opacity: .5;
}

.skill-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 20px;
    color: var(--fg-3);
    padding: 26px 0 8px;
}

/* ---------- Leadership ---------- */
.lead-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(20px, 4vw, 60px);
    margin-top: clamp(30px, 5vw, 56px);
}

.lead-item {
    border-top: 1px solid var(--line);
    padding-top: 22px;
}

.lead-item h4 {
    font-size: clamp(1.2rem, 2.2vw, 1.8rem);
    text-transform: none;
    letter-spacing: -.03em;
    margin-bottom: 4px;
}

.lead-item .mono {
    color: var(--accent);
    display: block;
    margin-bottom: 14px;
}

.lead-item p {
    color: var(--fg-2);
    max-width: 46ch;
}

/* ---------- Contact ---------- */
.contact-top {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 30px;
    align-items: end;
}

.mailto {
    display: inline-block;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 600;
    text-transform: none;
    letter-spacing: -.02em;
    font-size: clamp(1.05rem, 2.2vw, 1.9rem);
    position: relative;
    margin-top: 20px;
    padding-bottom: 4px;
}

.mailto::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
    transform-origin: right;
    transform: scaleX(1);
    transition: transform .5s var(--ease);
}

.mailto:hover {
    color: var(--accent);
}

.mailto:hover::after {
    transform-origin: left;
    animation: swipe .6s var(--ease);
}

@keyframes swipe {
    0% { transform: scaleX(1) }
    45% { transform: scaleX(0) }
    55% { transform: scaleX(0); transform-origin: left }
    100% { transform: scaleX(1); transform-origin: left }
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(26px, 5vw, 70px);
    margin-top: clamp(40px, 6vw, 76px);
}

.field {
    position: relative;
    margin-bottom: 26px;
}

.field label {
    display: block;
    color: var(--fg-3);
    margin-bottom: 8px;
}

.field input,
.field textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--line);
    color: var(--fg);
    font-family: inherit;
    font-size: 1.05rem;
    padding: 8px 0 12px;
    resize: vertical;
    transition: border-color .4s;
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--fg-3);
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-bottom-color: var(--accent);
}

.links-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 17px 0;
    border-bottom: 1px solid var(--line-soft);
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 600;
    font-size: clamp(1.05rem, 1.8vw, 1.4rem);
    letter-spacing: -.02em;
    transition: color .3s, padding .4s var(--ease);
}

.links-list a:hover {
    color: var(--accent);
    padding-left: 12px;
}

.links-list a em {
    font-style: normal;
    color: var(--fg-3);
    font-family: 'JetBrains Mono', monospace;
    font-size: .7rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

/* ---------- Footer ---------- */
footer {
    border-top: 1px solid var(--line);
    padding-top: clamp(30px, 4vw, 50px);
    overflow: hidden;
}

.foot-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 24px;
    color: var(--fg-3);
    padding-bottom: clamp(20px, 3vw, 40px);
}

.foot-name {
    font-size: clamp(3.6rem, 21vw, 22rem);
    line-height: .8;
    letter-spacing: -.05em;
    white-space: nowrap;
    text-align: center;
    margin-bottom: -.06em;
    color: var(--fg);
    user-select: none;
}

.top-btn {
    position: fixed;
    right: var(--pad);
    bottom: 22px;
    z-index: 4500;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--fg);
    color: var(--bg);
    display: grid;
    place-items: center;
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
    transition: .45s var(--ease);
}

.top-btn.on {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.top-btn:hover {
    background: var(--accent);
    color: var(--accent-fg);
}

/* ---------- Reveal primitives ---------- */
.wd {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    padding-bottom: .1em;
    margin-bottom: -.1em;
}

.wd i {
    display: inline-block;
    font-style: inherit;
    transform: translateY(115%);
    transition: transform 1s var(--ease) var(--d, 0s);
}

.in .wd i,
.wd.in i {
    transform: none;
}

.fade {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .9s var(--ease), transform .9s var(--ease);
    transition-delay: var(--d, 0s);
}

.fade.in {
    opacity: 1;
    transform: none;
}

.linegrow {
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.1s var(--ease);
}

.linegrow.in {
    transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .nav-mid { display: none }
    .burger { display: block }
    .clock { display: none }

    .hero-bottom {
        grid-template-columns: 1fr 1fr;
    }

    .scroll-cue { display: none }

    .sheet-body,
    .about-cols,
    .contact-grid,
    .lead-grid {
        grid-template-columns: 1fr;
    }

    .sheet-visual { position: static }

    .row {
        grid-template-columns: 54px 1fr 60px 30px;
    }

    .row-tags { display: none }
}

@media (max-width: 760px) {
    .sec-head,
    .about-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .sec-num { padding-top: 0 }

    .hero-bottom {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .counters {
        grid-template-columns: 1fr 1fr;
    }

    .counter {
        padding: 20px 12px 14px 0;
        border-bottom: 1px solid var(--line-soft);
    }

    .hero-name {
        grid-template-columns: 1fr;
        row-gap: 12px;
    }

    .hero-portrait {
        grid-column: 1;
        grid-row: auto;
        align-self: start;
        width: 56vw;
        aspect-ratio: 3/4;
        margin-bottom: 0;
    }

    /* horizontal track becomes a swipe carousel */
    .pin {
        height: auto !important;
    }

    .pin-sticky {
        position: static;
        height: auto;
        display: block;
    }

    .track {
        transform: none !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .track::-webkit-scrollbar { height: 2px }
    .track::-webkit-scrollbar-thumb { background: var(--accent) }

    .xp {
        scroll-snap-align: center;
        width: 84vw;
        min-height: auto;
    }

    .pin-progress,
    .pin-hint { display: none }

    .statement { max-width: none }
}

@media (max-width: 560px) {
    .row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "num year"
            "title title";
        gap: 4px 12px;
        padding: 20px 4px;
    }

    .row-num { grid-area: num }
    .row-year { grid-area: year }
    .row-title { grid-area: title; font-size: 1.5rem }
    .row-arrow { display: none }

    .row:hover .row-title { transform: none }

    .filters button { padding: 7px 12px }

    .contact-top { grid-template-columns: 1fr }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }

    .wd i { transform: none }
    .fade { opacity: 1; transform: none }
    .hero-portrait { clip-path: none }
}

/* =========================================================
   DEPTH LAYER — 3D objects, tilt, magnetism, scroll motion
   Additive: every rule degrades to the flat layout above.
   ========================================================= */

/* ---------- Scroll progress rail ---------- */
.prog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 6300;
    pointer-events: none;
}

.prog i {
    display: block;
    height: 100%;
    background: var(--accent);
    transform: scaleX(var(--p, 0));
    transform-origin: 0 50%;
}

/* ---------- Hero wireframe object ---------- */
.hero .shell {
    position: relative;
}

/* Parked in the gap between the headline and the photo, bottom edge on
   the YUSSIF baseline; absolute, so it never disturbs the name stack. */
.hero-3d {
    position: absolute;
    right: calc(clamp(150px, 21vw, 330px) + clamp(20px, 3vw, 56px));
    bottom: 1.05em;
    width: min(1.2em, 24vw);
    aspect-ratio: 1;
    z-index: 2;
    pointer-events: none;
}

.hero-3d canvas {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    cursor: grab;
    touch-action: pan-y;
}

.hero-3d canvas:active {
    cursor: grabbing;
}

/* technical corner brackets */
.hero-3d::before,
.hero-3d::after {
    content: '';
    position: absolute;
    width: 13px;
    height: 13px;
    border: 1px solid var(--line);
    pointer-events: none;
}

.hero-3d::before {
    top: 0;
    left: 0;
    border-right: 0;
    border-bottom: 0;
}

.hero-3d::after {
    right: 0;
    bottom: 0;
    border-left: 0;
    border-top: 0;
}

.hero-3d-label {
    position: absolute;
    top: 0;
    left: 22px;
    font-size: .58rem;
    color: var(--fg-3);
    white-space: nowrap;
    pointer-events: none;
}

.hero-3d-label i {
    font-style: normal;
    color: var(--accent);
}

/* ---------- 3D word reveal ---------- */
.wd {
    perspective: 620px;
}

.wd i {
    transform-origin: 50% 0;
    transform: translateY(115%) rotateX(-58deg);
}

/* ---------- Experience: scroll-driven depth carousel ---------- */
.pin-sticky {
    perspective: 1500px;
    perspective-origin: 50% 45%;
}

.track {
    transform-style: preserve-3d;
}

.xp {
    transform-style: preserve-3d;
    transform:
        translateZ(var(--tz, 0px))
        rotateY(calc(var(--ry, 0deg) + var(--hy, 0deg)))
        rotateX(var(--hx, 0deg));
    opacity: var(--dim, 1);
    /* transform + opacity are eased per-frame in JS, so they stay out of
       the transition list — otherwise the compositor interpolates on top
       of the interpolation and the section drops frames. */
    transition:
        background .4s,
        border-color .4s,
        color .4s;
}

/* card lifts toward the viewer on hover */
.xp:hover {
    --tz: 46px;
}

/* ---------- Hero portrait tilt ---------- */
.hero-portrait {
    transform:
        perspective(1000px)
        rotateX(var(--hx, 0deg))
        rotateY(var(--hy, 0deg));
    transition:
        clip-path 1.1s var(--ease) .5s,
        transform .5s var(--ease);
}

/* ---------- Magnetic controls ---------- */
.mag {
    transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
    transition: transform .5s var(--ease), background .4s var(--ease),
        color .4s var(--ease), border-color .4s var(--ease);
}

.mag.pull {
    transition-duration: .12s, .4s, .4s, .4s;
}

.btn.mag,
.btn.mag:hover {
    transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
}

.top-btn.mag.on {
    transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
}

/* ---------- Floating preview: velocity tilt ---------- */
.preview {
    transform:
        perspective(760px)
        translate(-50%, -50%)
        rotateX(var(--tiltx, 0deg))
        rotateY(var(--tilty, 0deg))
        scale(.9);
}

.preview.on {
    transform:
        perspective(760px)
        translate(-50%, -50%)
        rotateX(var(--tiltx, 0deg))
        rotateY(var(--tilty, 0deg))
        scale(1);
}

/* ---------- Work index: staggered reveal ---------- */
.row.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .8s var(--ease) var(--d, 0s),
        transform .8s var(--ease) var(--d, 0s);
}

.row.reveal.in {
    opacity: 1;
    transform: none;
}

/* keep the accent wipe independent of the reveal transform */
.row.reveal > * {
    transition: color .4s var(--ease), transform .5s var(--ease);
}

/* ---------- Marquees driven by scroll velocity ---------- */
.js-marquee .ticker-track,
.js-marquee .skill-track {
    animation: none;
    will-change: transform;
}

/* ---------- Footer name drift ---------- */
.foot-name {
    transform: translate3d(var(--drift, 0px), 0, 0);
}

/* ---------- Responsive placement of the 3D object ---------- */
@media (max-width: 900px) {
    /* The wash below bleeds past the right edge on purpose; clip it here so
       it cannot widen the document and push the nav/meta off-screen. */
    .hero {
        overflow: hidden;
    }

    /* static again, so the object anchors to the whole hero shell */
    .hero-name {
        position: static;
    }

    .hero-3d {
        top: auto;
        bottom: -2vh;
        right: -10vw;
        width: 66vw;
        max-width: none;
        z-index: -1;
    }

    .hero-3d canvas {
        opacity: .32;
        pointer-events: none;
    }

    .hero-3d::before,
    .hero-3d::after,
    .hero-3d-label {
        display: none;
    }
}

@media (max-width: 760px) {
    .xp {
        transform: none;
        opacity: 1;
    }

    .xp:hover {
        --tz: 0px;
    }
}

/* ---------- Reduced motion: flatten the depth layer ---------- */
@media (prefers-reduced-motion: reduce) {
    .wd i {
        transform: none;
    }

    .hero-3d {
        display: none;
    }

    .xp,
    .hero-portrait,
    .mag,
    .foot-name {
        transform: none;
    }

    .xp {
        opacity: 1;
    }

    .preview {
        transform: translate(-50%, -50%) scale(.9);
    }

    .preview.on {
        transform: translate(-50%, -50%) scale(1);
    }

    .row.reveal {
        opacity: 1;
        transform: none;
    }
}
