/* ============================================================
   Pawan Kumar — portfolio v6 "THE FILM"
   Cinematic opening: 0→100 loader, full-screen B/W hero film,
   statement below, horizontal project reel on scroll.
   Dark is the home theme; light via [data-theme="light"].
   ============================================================ */

:root {
    --bg: #0a0a0a;
    --surface: #141413;
    --ink: #f4f2ec;
    --muted: #a3a099;
    --line: #2b2b28;
    --line-strong: #f4f2ec;
    --chip-bg: #1b1b19;
    --header-bg: rgba(10, 10, 10, 0.82);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-cine: cubic-bezier(0.65, 0, 0.35, 1);
}

[data-theme="light"] {
    --bg: #f5f4f0;
    --surface: #efece5;
    --ink: #0a0a0a;
    --muted: #6f6d66;
    --line: #d9d6cc;
    --line-strong: #0a0a0a;
    --chip-bg: #eceae3;
    --header-bg: rgba(245, 244, 240, 0.88);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: clip;
}

::selection {
    background: var(--ink);
    color: var(--bg);
}

body {
    font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    overflow-x: clip;
    scrollbar-width: thin;
    scrollbar-color: var(--muted) var(--bg);
    transition: background 0.3s ease, color 0.3s ease;
}

body.is-loading {
    overflow: hidden;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--ink);
    color: var(--bg);
    padding: 0.6rem 1rem;
    z-index: 3000;
}

.skip-link:focus {
    left: 0;
}

h1, h2, h3 {
    font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.05;
}

.reg {
    font-size: 0.45em;
    vertical-align: super;
    font-weight: 500;
}

/* ---------- loader ---------- */

.loader {
    position: fixed;
    inset: 0;
    z-index: 4000;
    background: #060606;
    color: #f4f2ec;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.9s var(--ease-cine);
}

.loader.done {
    transform: translateY(-101%);
}

.loader-frame {
    position: absolute;
    left: 0;
    right: 0;
    height: 7vh;
    background: #000;
}

.loader-frame--top { top: 0; }
.loader-frame--bottom { bottom: 0; }

.loader-inner {
    text-align: center;
    padding: 0 1.5rem;
}

.loader-kicker {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: #8f8c84;
    margin-bottom: 1.2rem;
    animation: loaderBlink 1.6s ease-in-out infinite;
}

.loader-count {
    font-family: "Archivo", Arial, sans-serif;
    font-weight: 900;
    font-size: clamp(5rem, 18vw, 11rem);
    line-height: 0.95;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.loader-pct {
    font-size: 0.32em;
    font-weight: 700;
    color: #8f8c84;
    margin-left: 0.4rem;
}

.loader-bar {
    width: min(420px, 70vw);
    height: 2px;
    background: #26261f;
    margin: 2rem auto 1.1rem;
    overflow: hidden;
}

.loader-bar-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: #f4f2ec;
    transition: width 0.18s linear;
}

.loader-status {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.3em;
    color: #8f8c84;
    text-transform: uppercase;
}

@keyframes loaderBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* ---------- header ---------- */

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    z-index: 1000;
    transition: transform 0.7s var(--ease-cine) 0.15s, opacity 0.5s ease 0.15s;
}

body.is-loading .site-header {
    transform: translateY(-110%);
    opacity: 0;
}

.nav {
    width: min(1360px, 94%);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2.4rem;
    padding: 1rem 0;
}

.logo {
    font-weight: 900;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
    text-decoration: none;
    font-family: "Archivo", Arial, sans-serif;
}

.nav-tagline {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin: 0 auto;
    text-align: center;
}

.nav-meta {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
}

.menu-button {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    width: 34px;
    height: 34px;
    padding: 7px;
    background: none;
    border: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.menu-button span {
    display: block;
    background: var(--ink);
    border-radius: 1.5px;
    transition: transform 0.25s var(--ease-out);
}

.menu-button:hover span:nth-child(1) { transform: translate(1.5px, 1.5px); }
.menu-button:hover span:nth-child(2) { transform: translate(-1.5px, 1.5px); }
.menu-button:hover span:nth-child(3) { transform: translate(1.5px, -1.5px); }
.menu-button:hover span:nth-child(4) { transform: translate(-1.5px, -1.5px); }

.theme-toggle {
    font-size: 1rem;
    line-height: 1;
    background: none;
    border: 1px solid #3a3a3a;
    border-radius: 999px;
    width: 2.2rem;
    height: 2.2rem;
    cursor: pointer;
    color: #f2f1ec;
    flex-shrink: 0;
}

/* ---------- full-screen menu ---------- */

.menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 1500;
    padding: clamp(0.6rem, 2.5vw, 1.6rem);
    background: rgba(8, 8, 7, 0.6);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s var(--ease-out), visibility 0s linear 0.45s;
}

.menu-overlay.open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.45s var(--ease-out);
}

.menu-panel {
    height: 100%;
    max-width: 880px;
    margin: 0 auto;
    background: #111110;
    color: #f2f1ec;
    border-radius: 26px;
    padding: clamp(1.4rem, 4vw, 2.6rem);
    display: flex;
    flex-direction: column;
    transform: translateY(46px) scale(0.985);
    opacity: 0;
    transition: transform 0.55s var(--ease-out), opacity 0.45s ease;
    overflow-y: auto;
}

.menu-overlay.open .menu-panel {
    transform: none;
    opacity: 1;
}

.menu-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2.2rem;
}

.menu-mark {
    font-family: "Archivo", Arial, sans-serif;
    font-weight: 900;
    font-size: 1.6rem;
}

.menu-tagline {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    color: #a09d94;
    text-align: center;
}

.menu-close {
    background: none;
    border: 0;
    color: #f2f1ec;
    font-size: 1.25rem;
    cursor: pointer;
    width: 2.4rem;
    height: 2.4rem;
    transition: transform 0.3s var(--ease-out);
}

.menu-close:hover {
    transform: rotate(90deg);
}

.menu-links {
    list-style: none;
}

.menu-links li {
    border-top: 1px solid #2a2a28;
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.5s ease, transform 0.6s var(--ease-out);
}

.menu-links li:last-child {
    border-bottom: 1px solid #2a2a28;
}

.menu-overlay.open .menu-links li {
    opacity: 1;
    transform: none;
}

.menu-overlay.open .menu-links li:nth-child(1) { transition-delay: 0.10s; }
.menu-overlay.open .menu-links li:nth-child(2) { transition-delay: 0.17s; }
.menu-overlay.open .menu-links li:nth-child(3) { transition-delay: 0.24s; }
.menu-overlay.open .menu-links li:nth-child(4) { transition-delay: 0.31s; }
.menu-overlay.open .menu-links li:nth-child(5) { transition-delay: 0.38s; }
.menu-overlay.open .menu-links li:nth-child(6) { transition-delay: 0.45s; }

.menu-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.05rem 0.3rem;
    font-family: "Archivo", Arial, sans-serif;
    font-size: clamp(1.7rem, 4.6vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.015em;
    text-decoration: none;
    color: #f2f1ec;
    transition: padding-left 0.25s var(--ease-out), color 0.2s ease;
}

.menu-links a:hover {
    padding-left: 1rem;
    color: #c9c6bc;
}

.menu-arrow {
    font-size: 0.62em;
    font-weight: 400;
    color: #a09d94;
    transition: transform 0.25s var(--ease-out);
}

.menu-links a:hover .menu-arrow {
    transform: translate(3px, -3px);
    color: #f2f1ec;
}

.menu-bottom {
    margin-top: auto;
    padding-top: 2.2rem;
}

.menu-cta {
    display: block;
    text-align: center;
    background: #1e1e1c;
    border: 1px solid #3a3a38;
    color: #f2f1ec;
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    padding: 1.15rem 1.5rem;
    border-radius: 18px;
    transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.menu-cta:hover {
    background: #f2f1ec;
    color: #111110;
    transform: translateY(-2px) scale(1.03);
}

.menu-foot {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    margin-top: 1.4rem;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
    color: #a09d94;
}

body.menu-open {
    overflow: hidden;
}

/* ---------- layout ---------- */

main {
    width: min(1360px, 94%);
    margin: 0 auto;
}

.section {
    padding: 6.5rem 0 1rem;
    scroll-margin-top: 5rem;
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 2px solid var(--line-strong);
    padding-bottom: 1.1rem;
    margin-bottom: 0.5rem;
}

.section-head h2 {
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    font-weight: 900;
    letter-spacing: -0.015em;
}

.section-note {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: var(--muted);
    text-transform: uppercase;
    white-space: nowrap;
}

/* ---------- hero: the film ---------- */

.hero {
    position: relative;
    height: 100vh;
    height: 100svh;
    min-height: 560px;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    overflow: hidden;
    background: #050505;
    color: #f4f2ec;
    isolation: isolate;
}

.hero-media {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-img {
    position: absolute;
    inset: -4% 0;
    width: 100%;
    height: 108%;
    max-width: none;
    object-fit: cover;
    object-position: 50% 22%;
    filter: contrast(1.06) brightness(0.96);
    transform: scale(1.14);
    will-change: transform, opacity;
    opacity: 0;
}

body.loaded .hero-img {
    animation: kenburns 2.8s var(--ease-cine) forwards;
}

@keyframes kenburns {
    from { opacity: 0; transform: scale(1.22); }
    to   { opacity: 1; transform: scale(1.14); }
}

/* slow projector light sweep across the frame */
.hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(112deg, transparent 42%, rgba(255, 255, 255, 0.085) 50%, transparent 58%);
    background-size: 280% 100%;
    background-position: 130% 0;
    animation: lightSweep 9s var(--ease-cine) infinite;
}

@keyframes lightSweep {
    0%, 55% { background-position: 130% 0; }
    88%, 100% { background-position: -40% 0; }
}

/* cinematic colour grade: deep bottom, soft top light, vignette */
.hero-grade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120% 90% at 50% 42%, transparent 55%, rgba(0, 0, 0, 0.55) 100%),
        linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.25) 34%, transparent 55%),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.5) 0%, transparent 26%);
}

/* film grain */
.hero-grain {
    position: absolute;
    inset: -60px;
    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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    opacity: 0.07;
    pointer-events: none;
    animation: grainShift 0.9s steps(4) infinite;
}

@keyframes grainShift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-18px, 12px); }
    50% { transform: translate(14px, -16px); }
    75% { transform: translate(-10px, -8px); }
    100% { transform: translate(0, 0); }
}

/* letterbox bars — tall while loading, slim once the film starts */
.hero-bar {
    position: absolute;
    left: 0;
    right: 0;
    height: 7vh;
    background: #000;
    z-index: 3;
    transition: height 1.2s var(--ease-cine) 0.35s;
}

.hero-bar--top { top: 0; }
.hero-bar--bottom { bottom: 0; }

body.loaded .hero-bar {
    height: 3.2vh;
}

.hero-ui {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: calc(3.2vh + 4.6rem) clamp(1.2rem, 4vw, 3.4rem) calc(3.2vh + 1.6rem);
}

.hero-kicker {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease 0.55s, transform 0.8s var(--ease-out) 0.55s;
}

body.loaded .hero-kicker {
    opacity: 1;
    transform: none;
}

.hero-rec {
    color: #ff4b41;
    animation: recBlink 1.5s steps(1) infinite;
}

@keyframes recBlink {
    0%, 60% { opacity: 1; }
    61%, 100% { opacity: 0.15; }
}

.hero-ui-right {
    margin-left: auto;
}

.hero-name {
    font-weight: 900;
    font-size: clamp(4.2rem, 14.5vw, 12.5rem);
    line-height: 0.88;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    text-shadow: 0 10px 60px rgba(0, 0, 0, 0.55);
}

.hero-line {
    display: block;
    overflow: hidden;
}

.hero-line-inner {
    display: block;
    transform: translateY(112%);
    transition: transform 1.15s var(--ease-cine);
}

.hero-line:nth-child(2) .hero-line-inner {
    transition-delay: 0.14s;
}

body.loaded .hero-line-inner {
    transform: translateY(0);
}

.hero-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.9s ease 0.95s, transform 0.9s var(--ease-out) 0.95s;
}

body.loaded .hero-bottom {
    opacity: 1;
    transform: none;
}

.hero-role {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.hero-scroll {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    white-space: nowrap;
}

.hero-scroll-arrow {
    display: inline-block;
    animation: scrollNudge 1.8s var(--ease-out) infinite;
}

@keyframes scrollNudge {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* ---------- statement (below the film) ---------- */

.statement-sec {
    padding: 7rem 0 1rem;
}

.statement-kicker {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin-bottom: 2rem;
}

.statement {
    font-size: clamp(2.4rem, 5.4vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.05;
    max-width: 22ch;
    margin-bottom: 3.4rem;
}

.statement-meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.8rem 2.5rem;
    border-top: 1px solid var(--line);
    padding-top: 2rem;
    margin-bottom: 2.8rem;
}

.meta-item {
    font-size: 1.02rem;
    font-weight: 500;
}

.meta-item span {
    display: block;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.statement-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0.9rem 1.7rem;
    border-radius: 999px;
    border: 1.5px solid var(--line-strong);
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.btn:hover {
    transform: translateY(-2px) scale(1.06);
}

.btn-solid {
    background: var(--ink);
    color: var(--bg);
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
}

.btn-ghost:hover {
    background: var(--ink);
    color: var(--bg);
}

/* ---------- marquee ---------- */

.marquee {
    overflow: hidden;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 1.6rem 0;
    margin-top: 6.5rem;
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marqueeMove 30s linear infinite;
}

.marquee:hover .marquee-track {
    animation-play-state: paused;
}

.marquee-group {
    display: flex;
    align-items: center;
    gap: 2.6rem;
    padding-right: 2.6rem;
    font-family: "Archivo", Arial, sans-serif;
    font-weight: 900;
    font-size: clamp(2rem, 4.6vw, 3.6rem);
    letter-spacing: -0.015em;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1;
}

.mq-outline {
    color: transparent;
    -webkit-text-stroke: 1.5px var(--ink);
}

.mq-dot {
    font-size: 0.42em;
    color: var(--muted);
    -webkit-text-stroke: 0;
}

@keyframes marqueeMove {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ---------- work index list ---------- */

.work-list {
    border-bottom: 1px solid var(--line);
}

.work-item {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto auto 2rem;
    align-items: baseline;
    gap: 2rem;
    padding: 1.7rem 0.4rem;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    transition: padding-left 0.25s var(--ease-out);
}

/* ink sweep washes across the row on hover */
.work-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--surface);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.45s var(--ease-cine);
    z-index: -1;
}

.work-item:hover {
    padding-left: 1.2rem;
}

.work-item:hover::before {
    transform: scaleX(1);
}

.work-item h3 {
    font-size: clamp(1.7rem, 3.4vw, 2.7rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.work-cat {
    color: var(--muted);
    font-size: 1rem;
    white-space: nowrap;
}

.work-status {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.82rem;
    color: var(--muted);
    white-space: nowrap;
}

.live-dot {
    color: #2fbf5f;
}

.work-arrow {
    font-size: 1.5rem;
    justify-self: end;
    transition: transform 0.25s var(--ease-out);
}

.work-item:hover .work-arrow {
    transform: translate(3px, -3px);
}

/* ---------- projects: horizontal reel ---------- */

.projects {
    padding-top: 6.5rem;
}

.projects-pin {
    position: relative;
}

.projects-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 2px solid var(--line-strong);
    padding-bottom: 1.1rem;
    margin-bottom: 2.6rem;
}

.projects-head h2 {
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    font-weight: 900;
    letter-spacing: -0.015em;
}

.projects-viewport {
    overflow: hidden;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: max(3vw, calc(50vw - 680px));
    padding-right: 6vw;
}

.projects-track {
    display: flex;
    gap: clamp(1.6rem, 3.5vw, 3.2rem);
    width: max-content;
    will-change: transform;
}

.pcard {
    width: min(600px, 82vw);
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 26px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s ease;
}

.pcard:hover {
    border-color: var(--muted);
}

.pcard-media {
    position: relative;
    overflow: hidden;
    /* The media clips itself: its own top radius (1px inside the card's
       border) + its own layer, so the image zoom can never square off
       the card's rounded top corners mid-animation. */
    border-radius: 25px 25px 0 0;
    transform: translateZ(0);
}

.pcard-media img {
    display: block;
    width: 100%;
    height: 300px;
    object-fit: cover;
    filter: saturate(0.82) contrast(1.03);
    transition: transform 0.8s var(--ease-out), filter 0.5s ease;
    will-change: transform;
}

.pcard:hover .pcard-media img {
    transform: scale(1.04);
    filter: saturate(1.05) contrast(1.03);
}

.pcard-num {
    position: absolute;
    top: 0.9rem;
    left: 0.9rem;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    background: rgba(5, 5, 5, 0.72);
    color: #f4f2ec;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    backdrop-filter: blur(4px);
}

.pcard-body {
    padding: 1.9rem 2rem 2.1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.pcard-body h3 {
    font-size: clamp(1.7rem, 2.6vw, 2.3rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-bottom: 0.9rem;
}

.pcard-body > p {
    color: var(--muted);
    font-size: 0.99rem;
    margin-bottom: 1.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pcard-body .chips {
    margin-bottom: 1.4rem;
}

.pcard-body .feature-links {
    margin-top: auto;
}

.pcard--end {
    justify-content: center;
    padding: 2.4rem;
    background: transparent;
    border-style: dashed;
}

.pcard-end-big {
    font-family: "Archivo", Arial, sans-serif;
    font-size: clamp(2.4rem, 4vw, 3.6rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 1rem;
}

.pcard-end-note {
    color: var(--muted);
    margin-bottom: 1.6rem;
}

.projects-progress {
    height: 2px;
    background: var(--line);
    margin-top: 2.4rem;
}

.projects-progress-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--ink);
}

/* pinned mode (JS adds .is-pinned when it drives the reel) */
.projects.is-pinned {
    height: var(--projects-scroll, 320vh);
}

.projects.is-pinned .projects-pin {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* native sideways scroll fallback (touch / reduced motion / no JS) */
.projects-viewport.native-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.projects-viewport.native-scroll .pcard {
    scroll-snap-align: start;
}

/* ---------- chips & links (shared) ---------- */

.chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.chips li {
    font-size: 0.84rem;
    font-weight: 500;
    background: var(--chip-bg);
    border: 1px solid var(--line);
    padding: 0.34rem 0.75rem;
    border-radius: 999px;
}

.feature-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.feature-links a {
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border-bottom: 1.5px solid var(--ink);
    padding-bottom: 2px;
}

.feature-links a:hover {
    opacity: 0.55;
}

.feature-index,
.service-index {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

/* ---------- services ---------- */

.service {
    display: grid;
    grid-template-columns: 110px 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
    padding: 2.6rem 0;
    border-bottom: 1px solid var(--line);
}

.service h3 {
    font-size: clamp(1.5rem, 2.8vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -0.015em;
    margin-bottom: 0.7rem;
}

.service p {
    color: var(--muted);
    max-width: 30rem;
}

.service .chips {
    margin-bottom: 0;
    align-content: start;
}

/* ---------- proof strip ---------- */

.proof {
    border-top: 2px solid var(--line-strong);
    border-bottom: 2px solid var(--line-strong);
    padding: 3.2rem 0;
}

.proof-big {
    font-family: "Archivo", Arial, sans-serif;
    font-size: clamp(1.7rem, 3.6vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    max-width: 26ch;
    margin-bottom: 1.4rem;
}

.proof-note {
    color: var(--muted);
    max-width: 36rem;
}

.proof-note strong {
    color: var(--ink);
}

/* ---------- about ---------- */

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding-top: 2.2rem;
    font-size: 1.08rem;
    color: var(--muted);
}

/* ---------- FAQ ---------- */

.faq {
    border-bottom: 1px solid var(--line);
}

.faq-q {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--ink);
    font-family: "Archivo", Arial, sans-serif;
    font-size: clamp(1.15rem, 2.2vw, 1.6rem);
    font-weight: 700;
    text-align: left;
    padding: 1.6rem 0.2rem;
}

.faq-icon {
    font-family: "Inter", Arial, sans-serif;
    font-weight: 400;
    font-size: 1.6rem;
    line-height: 1;
    transition: transform 0.3s var(--ease-out);
    flex-shrink: 0;
}

.faq.open .faq-icon {
    transform: rotate(45deg);
}

.faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--ease-out);
}

.faq-a p {
    color: var(--muted);
    max-width: 44rem;
    padding: 0 0.2rem 1.7rem;
}

/* ---------- contact ---------- */

.contact {
    padding-bottom: 6rem;
}

.contact-title {
    font-size: clamp(3rem, 9vw, 8rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 0.95;
    margin-bottom: 2.6rem;
}

.socials {
    list-style: none;
    margin-top: 3.6rem;
    border-top: 1px solid var(--line);
}

.socials a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 1.15rem 0.2rem;
    font-family: "Archivo", Arial, sans-serif;
    font-size: clamp(1.25rem, 2.8vw, 1.9rem);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    transition: padding-left 0.2s var(--ease-out), opacity 0.2s ease;
}

.socials a span {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--muted);
}

.socials a:hover {
    padding-left: 0.9rem;
    opacity: 0.7;
}

/* ---------- footer ---------- */

.site-footer {
    border-top: 2px solid var(--line-strong);
    width: min(1360px, 94%);
    margin: 0 auto;
    padding: 2rem 0 2.6rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 2.4rem;
    justify-content: space-between;
    font-size: 0.92rem;
    color: var(--muted);
}

.footer-note {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

/* ---------- finale: end of reel ---------- */

/* One scrub variable (--p, 0 → 1) is written by JS on .finale; every layer
   derives its own progress --t from it, so the whole act reverses cleanly.
   Without JS, --p stays 1 and the composition renders finished. */
.finale {
    --p: 1;
    position: relative;
    height: 215vh;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    background: var(--bg);
    border-top: 2px solid var(--line-strong);
}

.finale-pin {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    display: flex;
    padding: 5.2rem 0 2rem;
}

.finale-stage {
    position: relative;
    width: min(1360px, 94%);
    height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

/* --- top rule --- */

.fin-top {
    --t: clamp(0, calc((var(--p) - 0.02) * 7), 1);
    position: relative;
    z-index: 2;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.9rem;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.68rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--muted);
}

.fin-top::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--line-strong);
    transform: scaleX(var(--t));
    transform-origin: left;
}

/* --- ghost lettering, slowest layer --- */

.fin-ghost {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8%;
    z-index: 0;
    font-family: "Archivo", Arial, sans-serif;
    font-weight: 900;
    font-size: clamp(7rem, 29vw, 22rem);
    line-height: 0.72;
    letter-spacing: -0.045em;
    text-align: center;
    white-space: nowrap;
    color: var(--ink);
    opacity: 0.06;
    pointer-events: none;
    transform: translateY(calc(52px - var(--p) * 96px));
}

/* --- headline --- */

.fin-title {
    position: relative;
    z-index: 2;
    margin-top: clamp(0.9rem, 3.2vh, 2.8rem);
    font-size: clamp(2.6rem, min(8.4vw, 10vh), 6.6rem);
    font-weight: 900;
    letter-spacing: -0.035em;
    line-height: 0.94;
}

.fin-line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.09em;
    margin-bottom: -0.09em;
}

.fin-line-inner {
    --t: clamp(0, calc((var(--p) - var(--s, 0.08)) * var(--k, 4.4)), 1);
    display: block;
    transform: translateY(calc((1 - var(--t)) * 108%));
}

/* --- the scene --- */

.fin-scene {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-top: clamp(0.4rem, 1.6vh, 1rem);
}

.fin-scene svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 50vh;
    color: var(--ink);
}

.fin-sky,
.fin-crowd {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Chrome resolves <use> shadow content's fill from the referenced element's
   own cascade, not from the <use> or its group, so the defs shapes must be
   filled here — a fill="none" presentation attribute is not enough. */
#fin-bust,
#fin-head {
    fill: none !important;
}

.fin-sky { opacity: 0.5; }

.fin-part {
    --t: clamp(0, calc((var(--p) - var(--s, 0.25)) * 2.6), 1);
}

.fig {
    --t: clamp(0, calc((var(--p) - var(--s, 0.42)) * 3.4), 1);
}

/* dash properties inherit into <use> shadow trees, so they go on every child */
.fin-sky *,
.fin-crowd * {
    stroke-dasharray: 900;
    stroke-dashoffset: calc(900 * (1 - var(--t, 1)));
}

/* --- credit strip --- */

.fin-credit {
    --t: clamp(0, calc((var(--p) - 0.72) * 5.6), 1);
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem 2rem;
    margin-top: clamp(0.8rem, 2vh, 1.4rem);
    padding-top: 0.9rem;
    border-top: 1px solid var(--line);
    opacity: var(--t);
    transform: translateY(calc((1 - var(--t)) * 12px));
}

.fin-credit p {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.68rem;
    line-height: 1.7;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.fin-credit p span {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink);
    opacity: 0.5;
}

/* --- say hi card --- */

.fin-card {
    --t: clamp(0, calc((var(--p) - 0.8) * 5), 1);
    position: absolute;
    right: 0;
    bottom: 6.6rem;
    z-index: 3;
    width: min(300px, 80vw);
    padding: 0.9rem 1rem 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
    opacity: var(--t);
    transform: translateY(calc((1 - var(--t)) * 40px));
}

/* hidden until the scrub reaches it, so nothing invisible can take focus */
.finale.fin-scrubbing .fin-card {
    visibility: hidden;
}

.finale.fin-scrubbing.fin-ready .fin-card {
    visibility: visible;
}

.fin-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0.65rem;
}

.fin-card-title {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.62rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--muted);
}

.fin-card-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff4b41;
    animation: recBlink 1.5s steps(1) infinite;
}

.fin-card-msg {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.45;
    margin-bottom: 0.4rem;
}

.fin-card-sub {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--muted);
    margin-bottom: 0.85rem;
}

.fin-card-cta {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0.42rem 0.85rem;
    border: 1.5px solid var(--line-strong);
    border-radius: 999px;
    transition: background 0.15s ease, color 0.15s ease;
}

.fin-card-cta:hover {
    background: var(--ink);
    color: var(--bg);
}

.fin-card-cta span {
    display: inline-block;
    transition: transform 0.2s var(--ease-out);
}

.fin-card-cta:hover span {
    transform: translateX(3px);
}

/* short laptop viewports (720–820px tall) need a smaller scene,
   otherwise the credit strip is clipped by the pinned stage */
@media (min-width: 721px) and (max-height: 820px) {
    .fin-scene svg {
        max-height: 42vh;
    }

    .fin-credit {
        font-size: 0.6rem;
    }
}

@media (max-width: 1020px) {
    .fin-credit {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 720px) {
    .finale {
        height: 185vh;
    }

    .finale-pin {
        padding: 4.4rem 0 1.4rem;
    }

    .fin-top {
        font-size: 0.58rem;
        letter-spacing: 0.16em;
    }

    .fin-top span:last-child {
        display: none;
    }

    .fin-title {
        margin-top: 0.9rem;
    }

    .fin-ghost {
        bottom: 14%;
        font-size: 34vw;
    }

    .fin-scene svg {
        width: 168%;
        margin-left: -34%;
        max-height: 30vh;
    }

    .fin-crowd .fig:nth-child(n+9) {
        display: none;
    }

    .fin-credit {
        gap: 0.5rem 1rem;
        font-size: 0.6rem;
    }

    .fin-credit p {
        font-size: 0.6rem;
    }

    .fin-card {
        position: static;
        width: 100%;
        margin-top: 1rem;
        padding: 0.8rem 0.95rem 0.95rem;
        border-radius: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .finale {
        --p: 1 !important;
        height: auto;
    }

    .finale-pin {
        position: static;
        height: auto;
        min-height: 100svh;
        padding-bottom: 3rem;
    }

    .finale-stage {
        height: auto;
    }

    .fin-ghost {
        transform: none;
    }

    .fin-scene svg {
        max-height: none;
    }

    .fin-card {
        position: static;
        width: min(340px, 100%);
        margin-top: 1.6rem;
    }
}

/* ---------- reveal ---------- */

.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal.in {
    opacity: 1;
    transform: none;
}

/* ---------- cursor follower (JS adds the elements) ---------- */

.cursor-shadow,
.cursor-ring,
.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    border-radius: 50%;
    opacity: 0;
    z-index: 9999;
    will-change: transform;
}

body.has-cursor .cursor-shadow,
body.has-cursor .cursor-ring,
body.has-cursor .cursor-dot {
    opacity: 1;
}

.cursor-shadow {
    width: 64px;
    height: 64px;
    background: rgba(127, 127, 127, 0.35);
    filter: blur(18px);
    z-index: 9997;
}

.cursor-ring {
    width: 38px;
    height: 38px;
    background: #fff;
    mix-blend-mode: difference;
    transition: width 0.25s ease, height 0.25s ease;
}

.cursor-ring.is-hover {
    width: 58px;
    height: 58px;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background: #fff;
    mix-blend-mode: difference;
}

@media (hover: none), (pointer: coarse) {
    .cursor-shadow,
    .cursor-ring,
    .cursor-dot {
        display: none;
    }
}

/* ---------- responsive ---------- */

@media (max-width: 1020px) {
    .service {
        grid-template-columns: 80px 1fr;
    }

    .service .chips {
        grid-column: 2;
    }

    .nav-meta {
        display: none;
    }

    .statement-meta {
        grid-template-columns: 1fr 1fr;
    }

    .pcard-media img {
        height: 250px;
    }
}

@media (max-width: 720px) {
    .nav-tagline {
        display: none;
    }

    .nav {
        gap: 1.2rem;
        justify-content: space-between;
    }

    .menu-panel {
        border-radius: 20px;
    }

    .menu-tagline {
        display: none;
    }

    .hero {
        min-height: 520px;
    }

    .hero-img {
        object-position: 50% 18%;
    }

    .hero-ui {
        padding-bottom: calc(3.2vh + 1.2rem);
    }

    .hero-kicker {
        gap: 0.8rem;
        font-size: 0.62rem;
        letter-spacing: 0.18em;
    }

    .hero-ui-right {
        display: none;
    }

    .hero-name {
        font-size: clamp(3.4rem, 17.5vw, 5.2rem);
    }

    .hero-role {
        font-size: 0.66rem;
        letter-spacing: 0.18em;
        max-width: 24ch;
        line-height: 1.9;
    }

    .hero-scroll {
        font-size: 0.62rem;
    }

    .statement-sec {
        padding-top: 4.5rem;
    }

    .statement-meta {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .statement-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .statement-buttons .btn {
        text-align: center;
    }

    .work-item {
        grid-template-columns: 1fr 2rem;
        gap: 0.4rem 1rem;
    }

    .work-cat,
    .work-status {
        grid-column: 1;
    }

    .work-arrow {
        grid-row: 1;
        grid-column: 2;
    }

    .section {
        padding: 4.2rem 0 1rem;
    }

    .projects {
        padding-top: 4.2rem;
    }

    .projects-head .section-note {
        display: none;
    }

    .pcard-body {
        padding: 1.5rem 1.4rem 1.7rem;
    }

    .pcard-body > p {
        -webkit-line-clamp: 6;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .service {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .service .chips {
        grid-column: 1;
    }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .loader {
        display: none;
    }

    .hero-img {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .hero-grain {
        animation: none;
    }

    .hero-media::after {
        animation: none;
        display: none;
    }

    .marquee-track {
        animation: none;
    }

    .hero-kicker,
    .hero-bottom {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero-line-inner {
        transform: none;
        transition: none;
    }

    .hero-bar {
        height: 3.2vh;
        transition: none;
    }

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .faq-a {
        transition: none;
    }

    .projects.is-pinned {
        height: auto;
    }

    .projects.is-pinned .projects-pin {
        position: static;
        height: auto;
    }
}
