/* ==========================================================================
   Hardik Panchal — Portfolio
   Editorial design system: warm paper, ink type, one electric-blue accent.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
    --paper: #f5f3ee;
    --paper-2: #ebe8e0;
    --surface: #fbfaf7;
    --ink: #121212;
    --ink-2: #1b1b1d;
    --ink-3: #26262a;
    --text: #121212;
    --muted: #5d5c58;
    --line: rgba(18, 18, 18, 0.12);
    --line-strong: rgba(18, 18, 18, 0.24);

    --accent: #2e5bff;
    --accent-ink: #ffffff;
    --accent-soft: rgba(46, 91, 255, 0.1);
    --accent-on-dark: #8ea6ff;

    --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-serif: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;
    --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --container: 1240px;
    --gutter: clamp(20px, 4vw, 40px);
    --section-y: clamp(88px, 11vw, 160px);
    --header-h: 76px;

    --radius-sm: 10px;
    --radius: 18px;
    --radius-lg: 28px;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

* {
    margin: 0;
}

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

body {
    min-height: 100vh;
    background: var(--paper);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

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

img {
    height: auto;
}

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

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

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

ul,
ol {
    list-style: none;
    padding: 0;
}

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

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--paper);
    font-size: 0.875rem;
    font-weight: 500;
    transform: translateY(-160%);
    transition: transform 0.2s var(--ease-out);
}

.skip-link:focus {
    transform: none;
}

/* ---------- Layout helpers ---------- */
.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

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

.dark {
    --text: #f3f2ee;
    --muted: #a3a29d;
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.24);
    --accent: var(--accent-on-dark);
    --accent-ink: #0b0b0c;
    --accent-soft: rgba(142, 166, 255, 0.12);
    background: var(--ink);
    color: var(--text);
}

.mono {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.icon {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Type ---------- */
h1,
h2,
h3 {
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.05;
    text-wrap: balance;
}

h2 {
    font-size: clamp(2.375rem, 5vw, 4.25rem);
    letter-spacing: -0.04em;
    line-height: 1;
}

h3 {
    font-size: 1.375rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1 em,
h2 em {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.01em;
    font-size: 1.08em;
    line-height: 0.9;
}

p {
    text-wrap: pretty;
}

strong {
    font-weight: 600;
    color: var(--text);
}

/* Section header: (01) — Label */
.section-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: clamp(28px, 4vw, 44px);
    color: var(--muted);
}

.section-head::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.section-num {
    color: var(--accent);
}

.section-intro {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px 64px;
    align-items: end;
    margin-bottom: clamp(48px, 6vw, 80px);
}

.section-intro p {
    max-width: 34rem;
    color: var(--muted);
    font-size: 1.125rem;
}

@media (min-width: 900px) {
    .section-intro {
        grid-template-columns: 1.4fr 1fr;
    }
}

/* ---------- Buttons & links ---------- */
.btn {
    --btn-bg: var(--ink);
    --btn-fg: var(--paper);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 54px;
    padding-inline: 26px;
    border-radius: 999px;
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-size: 0.9875rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: transform 0.35s var(--ease-out), background-color 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.35s var(--ease-out);
}

.btn .icon {
    font-size: 1.05rem;
    transition: transform 0.35s var(--ease-out);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:hover .icon-arrow-r {
    transform: translateX(3px);
}

.btn:hover .icon-arrow-ur {
    transform: translate(2px, -2px);
}

.btn:hover .icon-arrow-down {
    transform: translateY(3px);
}

.btn:active {
    transform: translateY(0);
}

.btn-accent {
    --btn-bg: var(--accent);
    --btn-fg: var(--accent-ink);
}

.btn-accent:hover {
    box-shadow: 0 14px 30px -12px var(--accent);
}

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

.btn-ghost:hover {
    border-color: var(--text);
}

.btn-small {
    height: 42px;
    padding-inline: 18px;
    font-size: 0.9rem;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text);
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.35s var(--ease-out), color 0.2s;
}

.link-arrow .icon {
    transition: transform 0.35s var(--ease-out);
}

.link-arrow:hover {
    background-size: 100% 1px;
    color: var(--accent);
}

.link-arrow:hover .icon {
    transform: translateX(3px);
}

/* ---------- Page loader ---------- */
.loader {
    display: none;
}

.js .loader {
    --accent: var(--accent-on-dark);
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    background: var(--ink);
    color: #f3f2ee;
    transition: transform 0.85s cubic-bezier(0.76, 0, 0.24, 1);
    /* CSS failsafe: never cover the page for more than 6s, even if scripts stall */
    animation: loader-failsafe 0.01s linear 6s forwards;
}

.js .loader.is-done {
    transform: translateY(-100%);
}

.loader-logo {
    width: min(520px, 72vw);
    height: auto;
    aspect-ratio: 1750 / 570;
    fill: currentColor;
    transition: opacity 0.4s var(--ease-out), transform 0.85s cubic-bezier(0.76, 0, 0.24, 1);
}

.loader.is-done .loader-logo {
    opacity: 0;
    transform: translateY(-48px);
}

/* faster, bolder strokes than the footer version */
.loader-logo.is-drawable path {
    --draw: 0.9s;
    --fill: 0.6s;
    --delay: calc(var(--i, 0) * 50ms + 0.15s);
    stroke-width: 44;
}

.loader-logo.is-drawable path.is-mono {
    --draw: 1.3s;
    stroke-width: 54;
}

.loader-foot {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #a3a29d;
}

.loader-count {
    color: #f3f2ee;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

.loader-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
}

.loader-bar span {
    display: block;
    height: 100%;
    background: var(--accent-on-dark);
    transform-origin: 0 50%;
    transform: scaleX(0);
}

@keyframes loader-failsafe {
    to {
        visibility: hidden;
        opacity: 0;
    }
}

/* Lock scrolling while the loader is up; keep the scrollbar gutter dark so nothing shifts */
html {
    scrollbar-gutter: stable;
}

html.js:not(.is-loaded) {
    overflow: hidden;
    background: var(--ink);
}

@media (max-width: 560px) {
    .loader-foot .mono:first-child {
        max-width: 60%;
    }
}

/* ---------- Progress bar ---------- */
.progress {
    position: fixed;
    inset: 0 0 auto 0;
    height: 2px;
    z-index: 60;
    background: var(--accent);
    transform-origin: 0 50%;
    transform: scaleX(0);
    pointer-events: none;
}

/* ---------- Header ---------- */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    height: var(--header-h);
    transition: background-color 0.3s, border-color 0.3s, backdrop-filter 0.3s;
    border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
    background: rgba(245, 243, 238, 0.82);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
    border-bottom-color: var(--line);
}

.site-header.on-dark.is-scrolled {
    background: rgba(18, 18, 18, 0.8);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.site-header.on-dark .brand {
    color: #f3f2ee;
}

.site-header.on-dark .nav a {
    color: #a3a29d;
}

.site-header.on-dark .nav a:hover,
.site-header.on-dark .nav a.is-active {
    color: #f3f2ee;
}

.site-header.on-dark .nav a.is-active {
    background: rgba(255, 255, 255, 0.08);
}

.site-header.on-dark .menu-toggle {
    border-color: rgba(255, 255, 255, 0.24);
}

.site-header.on-dark .menu-toggle span[aria-hidden] {
    background: #f3f2ee;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 100%;
}

.brand {
    display: inline-flex;
    align-items: center;
    color: var(--ink);
    border-radius: 6px;
    transition: color 0.3s;
}

.brand-logo {
    width: auto;
    height: 52px;
    aspect-ratio: 1750 / 570;
    fill: currentColor;
}

.nav ul {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding-inline: 14px;
    border-radius: 999px;
    font-size: 0.925rem;
    font-weight: 450;
    color: var(--muted);
    transition: color 0.2s, background-color 0.2s;
}

.nav a:hover {
    color: var(--ink);
}

.nav a.is-active {
    color: var(--ink);
    background: rgba(18, 18, 18, 0.06);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-toggle {
    display: none;
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
}

.menu-toggle span[aria-hidden] {
    position: absolute;
    left: 13px;
    right: 13px;
    height: 1.5px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.35s var(--ease-out), top 0.35s var(--ease-out);
}

.menu-toggle span[aria-hidden]:nth-child(1) {
    top: 17px;
}

.menu-toggle span[aria-hidden]:nth-child(2) {
    top: 25px;
}

.menu-open .menu-toggle span[aria-hidden]:nth-child(1) {
    top: 21px;
    transform: rotate(45deg);
}

.menu-open .menu-toggle span[aria-hidden]:nth-child(2) {
    top: 21px;
    transform: rotate(-45deg);
}

@media (max-width: 960px) {
    .nav,
    .header-cta {
        display: none;
    }

    .menu-toggle {
        display: block;
    }
}

/* Mobile menu */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: calc(var(--header-h) + 24px) var(--gutter) 32px;
    background: var(--paper);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s var(--ease-out), visibility 0.35s;
}

.menu-open .mobile-menu {
    opacity: 1;
    visibility: visible;
}

.menu-open .site-header {
    background: var(--paper);
    border-bottom-color: var(--line);
}

.mobile-menu ol {
    display: grid;
}

.mobile-menu li {
    border-bottom: 1px solid var(--line);
}

.mobile-menu ol a {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding-block: 14px;
    font-size: clamp(1.75rem, 8vw, 2.5rem);
    font-weight: 500;
    letter-spacing: -0.03em;
    transform: translateY(12px);
    opacity: 0;
    transition: transform 0.5s var(--ease-out), opacity 0.5s var(--ease-out), color 0.2s;
}

.mobile-menu ol a .mono {
    color: var(--accent);
}

.menu-open .mobile-menu ol a {
    transform: none;
    opacity: 1;
}

.menu-open .mobile-menu li:nth-child(2) a { transition-delay: 0.04s; }
.menu-open .mobile-menu li:nth-child(3) a { transition-delay: 0.08s; }
.menu-open .mobile-menu li:nth-child(4) a { transition-delay: 0.12s; }
.menu-open .mobile-menu li:nth-child(5) a { transition-delay: 0.16s; }
.menu-open .mobile-menu li:nth-child(6) a { transition-delay: 0.2s; }

.mobile-menu-foot {
    display: grid;
    gap: 16px;
}

.mobile-menu-foot .btn {
    width: 100%;
}

.mobile-menu-foot p {
    color: var(--muted);
    text-align: center;
}

body.menu-open {
    overflow: hidden;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding-top: calc(var(--header-h) + clamp(40px, 7vw, 96px));
    overflow: hidden;
    isolation: isolate;
}

.hero::before {
    /* faint blueprint grid, faded toward the edges */
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(to right, rgba(18, 18, 18, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(18, 18, 18, 0.05) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 60% 30%, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse 80% 70% at 60% 30%, #000 30%, transparent 75%);
}

.hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 720px;
    height: 720px;
    right: -220px;
    top: -260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(46, 91, 255, 0.16), transparent 65%);
    pointer-events: none;
}

.hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: clamp(28px, 4vw, 48px);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 38px;
    padding: 0 16px 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
    font-weight: 500;
    transition: border-color 0.2s;
}

.status-pill:hover {
    border-color: var(--ink);
}

.status-dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #18a058;
}

.status-dot::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1.5px solid #18a058;
    animation: ping 2s var(--ease-out) infinite;
}

@keyframes ping {
    0% { transform: scale(0.6); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}

.hero-meta {
    color: var(--muted);
}

.hero-title {
    position: relative;
    display: grid;
    gap: clamp(16px, 2vw, 24px);
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 1.2vw, 0.875rem);
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.hero-eyebrow b {
    font-weight: 500;
    color: var(--ink);
}

.hero-head {
    position: relative;
}

.hero-display {
    display: block;
    max-width: 11.5em;
    font-size: clamp(2.75rem, 7.2vw, 6.75rem);
    font-weight: 500;
    letter-spacing: -0.05em;
    line-height: 0.96;
}

.hero-display em {
    color: var(--accent);
    padding-right: 0.04em;
}

/* rotating badge */
.hero-badge {
    position: absolute;
    right: 0;
    bottom: 0;
    width: clamp(112px, 10vw, 148px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--ink);
    transition: transform 0.5s var(--ease-out);
}

.hero-badge:hover {
    transform: scale(1.05);
}

.hero-badge-text {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    animation: spin 18s linear infinite;
}

.hero-badge-text text {
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    fill: currentColor;
}

.hero-badge-core {
    display: grid;
    place-items: center;
    width: 46%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 1.5rem;
    transition: transform 0.5s var(--ease-out);
}

.hero-badge:hover .hero-badge-core {
    transform: rotate(45deg);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1100px) {
    .hero-badge {
        display: none;
    }
}

.hero-bottom {
    display: grid;
    gap: 40px;
    margin-top: clamp(40px, 5vw, 64px);
    padding-bottom: clamp(56px, 7vw, 96px);
}

.hero-lede {
    max-width: 36rem;
    font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
    line-height: 1.55;
    color: var(--muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line-strong);
    align-self: end;
}

.stat {
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
    gap: 6px;
    padding: 20px 16px 0 0;
}

.stat + .stat {
    padding-left: 20px;
    border-left: 1px solid var(--line);
}

.stat dt {
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.35;
}

.stat dd {
    font-size: clamp(2.25rem, 4vw, 3.25rem);
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 1;
}

.stat dd span {
    color: var(--accent);
}

@media (min-width: 900px) {
    .hero-bottom {
        grid-template-columns: 1.15fr 1fr;
        gap: 64px;
    }
}

/* Marquee */
.marquee {
    position: relative;
    display: flex;
    overflow: hidden;
    border-block: 1px solid var(--line-strong);
    background: var(--surface);
    -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}

.marquee-track {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 40px;
    padding: 22px 20px;
    min-width: 100%;
    animation: marquee 40s linear infinite;
}

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

.marquee-track li {
    display: inline-flex;
    align-items: center;
    gap: 40px;
    white-space: nowrap;
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    font-weight: 500;
    letter-spacing: -0.02em;
}

.marquee-track li::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--accent);
    transform: rotate(45deg);
}

@keyframes marquee {
    to { transform: translateX(-100%); }
}

/* ---------- About ---------- */
.about-grid {
    display: grid;
    gap: clamp(40px, 6vw, 96px);
    align-items: start;
}

.about-photo {
    position: relative;
    margin: 0;
}

.about-photo-frame {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    aspect-ratio: 4 / 5;
    background: var(--paper-2);
}

.about-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 20%;
    transition: transform 1.2s var(--ease-out);
}

.about-photo:hover img {
    transform: scale(1.04);
}

.about-photo figcaption {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(18, 18, 18, 0.72);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: #f3f2ee;
    font-size: 0.9rem;
}

.about-photo figcaption .mono {
    color: var(--accent-on-dark);
    font-size: 0.6875rem;
}

.about-body h2 {
    margin-bottom: 32px;
}

.prose {
    display: grid;
    gap: 18px;
    max-width: 38rem;
    color: var(--muted);
    font-size: 1.0625rem;
}

.prose p:first-child {
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.chips-label {
    margin: 40px 0 16px;
    color: var(--muted);
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip-list li {
    padding: 7px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 450;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.chip-list li:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}

@media (min-width: 900px) {
    .about-grid {
        grid-template-columns: 0.85fr 1.15fr;
    }

    .about-photo {
        position: sticky;
        top: calc(var(--header-h) + 32px);
    }
}

/* ---------- Services ---------- */
.services {
    background: var(--surface);
    border-block: 1px solid var(--line);
}

.service-grid {
    display: grid;
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.service-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 320px;
    padding: clamp(28px, 3vw, 40px);
    background: var(--surface);
    transition: background-color 0.35s var(--ease-out);
}

.service-card:hover {
    background: var(--paper);
}

.service-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: auto;
    padding-bottom: 36px;
}

.service-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    border: 1px solid var(--line-strong);
    font-size: 1.5rem;
    transition: background-color 0.35s var(--ease-out), color 0.35s, border-color 0.35s, transform 0.5s var(--ease-out);
}

.service-card:hover .service-icon {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: rotate(-8deg);
}

.service-num {
    color: var(--muted);
}

.service-card p {
    color: var(--muted);
    font-size: 0.975rem;
}

.service-card .link-arrow {
    margin-top: 10px;
    align-self: flex-start;
}

@media (min-width: 640px) {
    .service-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .service-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ---------- Work ---------- */
.work .section-intro {
    margin-bottom: 40px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: clamp(36px, 4vw, 56px);
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding-inline: 18px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}

.filter-btn:hover {
    color: var(--text);
    border-color: var(--text);
}

.filter-btn[aria-pressed="true"] {
    background: var(--text);
    border-color: var(--text);
    color: var(--ink);
}

.filter-count {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    opacity: 0.6;
}

.work-grid {
    display: grid;
    gap: clamp(40px, 4vw, 56px) clamp(24px, 3vw, 40px);
}

.work-card {
    display: flex;
    flex-direction: column;
    gap: 22px;
    transition: opacity 0.4s var(--ease-out), transform 0.5s var(--ease-out);
}

.work-card.is-hidden {
    display: none;
}

.work-grid .work-card.is-entering,
.js .work-grid .work-card.is-entering {
    opacity: 0;
    transform: translateY(16px);
    transition: none;
}

.work-media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    background: var(--ink-3);
}

.work-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 0;
    transition: transform 1s var(--ease-out);
}

.work-card:hover .work-media img {
    transform: scale(1.045);
}

.work-cat {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(11, 11, 12, 0.78);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #f3f2ee;
}

.work-info {
    display: grid;
    gap: 10px;
}

.work-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
}

.work-info h3 {
    font-size: clamp(1.5rem, 2.4vw, 1.875rem);
    letter-spacing: -0.03em;
}

.work-info p {
    max-width: 34rem;
    color: var(--muted);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.tags li {
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.work-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: clamp(56px, 6vw, 88px);
    padding: clamp(28px, 4vw, 44px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--ink-2);
}

.work-cta p {
    font-size: clamp(1.375rem, 2.6vw, 2rem);
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.work-cta p em {
    font-family: var(--font-serif);
    font-weight: 400;
    color: var(--accent);
}

@media (min-width: 820px) {
    .work-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---------- Skills ---------- */
.skills-grid {
    display: grid;
    gap: clamp(56px, 6vw, 96px);
}

.panel-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--line-strong);
}

.panel-title h3 {
    font-size: 1.25rem;
}

.panel-title .mono {
    color: var(--muted);
}

.skill-list li {
    display: grid;
    grid-template-columns: 7.5rem 1fr 3rem;
    align-items: center;
    gap: 20px;
    padding-block: 16px;
    border-bottom: 1px solid var(--line);
}

.skill-name {
    font-weight: 500;
}

.skill-bar {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: var(--paper-2);
    overflow: hidden;
}

.skill-bar span {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--v);
    border-radius: inherit;
    background: var(--ink);
    transform-origin: 0 50%;
    transition: transform 1.4s var(--ease-out);
}

.skill-list li:hover .skill-bar span {
    background: var(--accent);
}

.js .skill-list:not(.is-visible) .skill-bar span {
    transform: scaleX(0);
}

.skill-list li:nth-child(2) .skill-bar span { transition-delay: 0.06s; }
.skill-list li:nth-child(3) .skill-bar span { transition-delay: 0.12s; }
.skill-list li:nth-child(4) .skill-bar span { transition-delay: 0.18s; }
.skill-list li:nth-child(5) .skill-bar span { transition-delay: 0.24s; }
.skill-list li:nth-child(6) .skill-bar span { transition-delay: 0.3s; }
.skill-list li:nth-child(7) .skill-bar span { transition-delay: 0.36s; }
.skill-list li:nth-child(8) .skill-bar span { transition-delay: 0.42s; }

.skill-val {
    text-align: right;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--muted);
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    margin-top: 8px;
}

.tool-grid li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    font-weight: 450;
}

.tool-grid li .mono {
    width: 1.75rem;
    color: var(--accent);
    font-size: 0.6875rem;
}

@media (min-width: 640px) {
    .tool-grid {
        grid-template-columns: repeat(3, 1fr);
        column-gap: 24px;
    }
}

@media (min-width: 1024px) {
    .skills-grid {
        grid-template-columns: 1.1fr 1fr;
    }

    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---------- Experience ---------- */
.experience {
    background: var(--surface);
    border-top: 1px solid var(--line);
}

.timeline {
    border-top: 1px solid var(--line-strong);
}

.timeline-item {
    position: relative;
    display: grid;
    gap: 16px 48px;
    padding-block: clamp(32px, 4vw, 48px);
    border-bottom: 1px solid var(--line);
}

.timeline-when {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.8125rem;
}

.timeline-when::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid var(--ink);
    flex-shrink: 0;
}

.timeline-item.is-current .timeline-when {
    color: var(--accent);
}

.timeline-item.is-current .timeline-when::before {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline-role h3 {
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.timeline-role p {
    color: var(--muted);
}

.checks {
    display: grid;
    gap: 10px;
    color: var(--muted);
}

.checks li {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 10px;
}

.checks .icon {
    margin-top: 0.3em;
    font-size: 1rem;
    color: var(--accent);
    stroke-width: 2.25;
}

.timeline-item .tags li {
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--muted);
}

@media (min-width: 960px) {
    .timeline-item {
        grid-template-columns: 11rem 1fr 1.35fr;
        align-items: start;
    }

    .timeline-when {
        padding-top: 0.7em;
    }

    .timeline-detail .tags {
        margin-top: 20px;
    }
}

/* ---------- Contact ---------- */
.contact {
    overflow: hidden;
    isolation: isolate;
}

.contact::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: 900px;
    height: 900px;
    left: -300px;
    bottom: -500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(46, 91, 255, 0.22), transparent 62%);
    pointer-events: none;
}

.contact-title {
    font-size: clamp(3rem, 9vw, 8.5rem);
    letter-spacing: -0.055em;
    line-height: 0.92;
    margin-bottom: clamp(48px, 6vw, 80px);
}

.contact-title em {
    color: var(--accent);
}

.contact-grid {
    display: grid;
    gap: clamp(48px, 6vw, 88px);
    align-items: start;
}

.contact-lede {
    max-width: 30rem;
    color: var(--muted);
    font-size: 1.125rem;
    margin-bottom: 36px;
}

.contact-list {
    border-top: 1px solid var(--line);
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-block: 18px;
    border-bottom: 1px solid var(--line);
}

.contact-row-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.contact-row-label {
    display: block;
    color: var(--muted);
    font-size: 0.6875rem;
    margin-bottom: 2px;
}

.contact-row-value {
    font-size: 1.0625rem;
    font-weight: 500;
    overflow-wrap: anywhere;
    transition: color 0.2s;
}

a.contact-row-value:hover {
    color: var(--accent);
}

.copy-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding-inline: 12px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.copy-btn:hover {
    color: var(--text);
    border-color: var(--text);
}

.copy-btn.is-copied {
    color: #4ade80;
    border-color: #4ade80;
}

.social {
    display: flex;
    gap: 10px;
    margin-top: 32px;
}

.social a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding-inline: 18px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    font-size: 0.925rem;
    font-weight: 500;
    transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}

.social a:hover {
    background: var(--text);
    border-color: var(--text);
    color: var(--ink);
}

.social .icon {
    font-size: 1.05rem;
}

/* Form */
.contact-form {
    display: grid;
    gap: 28px;
    padding: clamp(28px, 4vw, 48px);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.03);
}

.form-row {
    display: grid;
    gap: 28px;
}

@media (min-width: 640px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.field {
    position: relative;
    display: grid;
    gap: 8px;
}

.field label {
    color: var(--muted);
    font-size: 0.6875rem;
}

.field input,
.field textarea {
    width: 100%;
    padding: 10px 0 14px;
    border: 0;
    border-bottom: 1px solid var(--line-strong);
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font-size: 1.125rem;
    outline: none;
    transition: border-color 0.25s;
}

.field textarea {
    resize: vertical;
    min-height: 140px;
    line-height: 1.5;
}

.field input::placeholder,
.field textarea::placeholder {
    color: rgba(255, 255, 255, 0.28);
}

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

.field input:-webkit-autofill {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px var(--ink) inset;
    caret-color: var(--text);
}

.field-hint {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.8125rem;
}

.field.has-error input,
.field.has-error textarea {
    border-bottom-color: #ff7a7a;
}

.form-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.form-note {
    max-width: 22rem;
    color: var(--muted);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.form-status {
    min-height: 1.5em;
    font-size: 0.925rem;
    color: var(--accent);
}

.form-status.is-error {
    color: #ff7a7a;
}

@media (min-width: 1024px) {
    .contact-grid {
        grid-template-columns: 1fr 1.25fr;
    }
}

/* ---------- Footer ---------- */
.site-footer {
    padding-top: clamp(56px, 7vw, 96px);
    padding-bottom: 32px;
    border-top: 1px solid var(--line);
}

.footer-top {
    display: grid;
    gap: 32px;
    padding-bottom: clamp(40px, 5vw, 64px);
}

.footer-tagline {
    max-width: 22rem;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    line-height: 1.35;
}

.footer-tagline em {
    font-family: var(--font-serif);
    font-size: 1.1em;
    color: var(--accent);
}

.footer-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, max-content));
    gap: 10px 48px;
}

.footer-nav a {
    color: var(--muted);
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: var(--text);
}

.footer-wordmark {
    color: var(--text);
    padding-block: clamp(12px, 2vw, 24px);
}

.footer-wordmark svg {
    width: 100%;
    height: auto;
    aspect-ratio: 1750 / 570;
    fill: currentColor;
    opacity: 0.95;
}

/* Signature animation (paths are injected by script.js; the group is scaled by .1,
   so stroke widths are in tenths of a viewBox unit) */
svg.is-drawable path {
    fill-opacity: 0;
    stroke: var(--accent);
    stroke-width: 22;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1 1;
    stroke-dashoffset: 1;
    --draw: 1.1s;
    --delay: calc(var(--i, 0) * 85ms);
    transition: fill 0.5s var(--ease-out);
}

svg.is-drawable path.is-mono {
    --draw: 1.8s;
    stroke-width: 28;
}

svg.is-drawn path {
    animation:
        logo-draw var(--draw) cubic-bezier(0.65, 0, 0.35, 1) var(--delay) forwards,
        logo-fill var(--fill, 0.9s) var(--ease-out) calc(var(--delay) + var(--draw) * 0.7) forwards;
}

.footer-wordmark:hover svg.is-drawn path.is-mono {
    fill: var(--accent);
}

@keyframes logo-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes logo-fill {
    to {
        fill-opacity: 1;
        stroke-opacity: 0;
    }
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.875rem;
}

.to-top {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 500;
}

.to-top .icon {
    transition: transform 0.35s var(--ease-out);
}

.to-top:hover .icon {
    transform: translateY(-3px);
}

@media (min-width: 820px) {
    .footer-top {
        grid-template-columns: 1fr auto;
        align-items: end;
    }

    .footer-nav {
        grid-template-columns: repeat(3, minmax(0, max-content));
    }
}

/* Floating back-to-top */
.back-to-top {
    position: fixed;
    right: clamp(16px, 3vw, 28px);
    bottom: clamp(16px, 3vw, 28px);
    z-index: 40;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #2e5bff;
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 10px 30px -10px rgba(46, 91, 255, 0.7);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.4s var(--ease-out), background-color 0.2s;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.back-to-top:hover {
    background: var(--ink);
}

/* ---------- Reveal on scroll ---------- */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
    transition-delay: var(--d, 0s);
}

.js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* Service cards: reveal contents, not the card (keeps the hairline grid solid) */
.js .service-grid > [data-reveal] {
    opacity: 1;
    transform: none;
    transition: background-color 0.35s var(--ease-out);
}

.js .service-grid > [data-reveal] > * {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
    transition-delay: var(--d, 0s);
}

.js .service-grid > [data-reveal] > .link-arrow {
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out), background-size 0.35s var(--ease-out), color 0.2s;
    transition-delay: var(--d, 0s), var(--d, 0s), 0s, 0s;
}

.js .service-grid > [data-reveal].is-visible > * {
    opacity: 1;
    transform: none;
}

/* Hero entrance */
.js .hero [data-hero] {
    opacity: 0;
    transform: translateY(24px);
}

/* starts as the loader curtain lifts */
.js.is-loaded .hero [data-hero] {
    animation: rise 1s var(--ease-out) forwards;
    animation-delay: calc(var(--d, 0s) + 0.25s);
}

@keyframes rise {
    to {
        opacity: 1;
        transform: none;
    }
}

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

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
    }

    .marquee-track,
    .hero-badge-text {
        animation: none !important;
    }

    svg.is-drawable path {
        fill-opacity: 1 !important;
        stroke: none !important;
        animation: none !important;
    }

    .js [data-reveal],
    .js .service-grid > [data-reveal] > *,
    .js .hero [data-hero] {
        opacity: 1;
        transform: none;
    }
}

/* ---------- Small screens ---------- */
@media (max-width: 560px) {
    body {
        font-size: 1rem;
    }

    .btn {
        height: 50px;
        padding-inline: 22px;
    }

    .hero-actions .btn {
        flex: 1 1 auto;
    }

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

    .stat + .stat {
        padding-left: 12px;
    }

    .stat dt {
        font-size: 0.8125rem;
    }

    .skill-list li {
        grid-template-columns: 6rem 1fr 2.5rem;
        gap: 14px;
    }

    .brand-logo {
        height: 40px;
    }

    .contact-row {
        flex-wrap: wrap;
    }

    .copy-btn {
        margin-left: 60px;
    }
}

/* ---------- Print ---------- */
@media print {
    .loader,
    .site-header,
    .progress,
    .back-to-top,
    .marquee,
    .hero-badge,
    .contact-form,
    .mobile-menu {
        display: none !important;
    }

    .dark {
        background: #fff;
        --text: #000;
        --muted: #444;
    }

    .js [data-reveal],
    .js .service-grid > [data-reveal] > *,
    .js .hero [data-hero] {
        opacity: 1 !important;
        transform: none !important;
    }

    svg.is-drawable path {
        fill-opacity: 1 !important;
        stroke: none !important;
        animation: none !important;
    }
}
