/* ==========================================================================
   TOKENS & GLOBALS
   ========================================================================== */
* {
    font-family: 'Poppins', sans-serif;
}

html {
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

:root {
    --site-bg: #0f0f0f;
}

body {
    background-color: var(--site-bg);
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

.text-accent {
    color: oklch(66.7% 0.295 322.15);
}

.bg-accent {
    background-color: oklch(66.7% 0.295 322.15);
}

.border-accent {
    border-color: oklch(66.7% 0.295 322.15);
}

.border-accent-30 {
    border-color: color-mix(in oklch, oklch(66.7% 0.295 322.15) 30%, transparent);
}

.hero-title {
    font-size: clamp(2.2rem, 8vw, 5rem);
    font-weight: 900;
    line-height: 1.0;
    letter-spacing: -0.02em;
}

.section-title {
    font-size: clamp(1.8rem, 6vw, 3.5rem);
    font-weight: 800;
}

@media (hover: hover) {
    .portfolio-item:hover .portfolio-overlay {
        background-color: rgba(0, 0, 0, 0.5) !important;
    }

    .portfolio-item:hover .portfolio-title {
        color: oklch(66.7% 0.295 322.15) !important;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-fadein {
    animation: fadeIn 0.3s ease;
}

/* Selected Archive Card Animations */
.archive-card {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
}

.archive-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 25px color-mix(in oklch, oklch(66.7% 0.295 322.15) 20%, transparent);
}

/* ==========================================================================
   NAVIGATION & MENU
   ========================================================================== */

/* Mobile menu open state */
#mobile-menu.open {
    display: flex;
}

/* ==========================================================================
   HERO EFFECTS
   ========================================================================== */

.hero-bg-video {
    transform: scale(1.02);
    /* Scale up slightly to remove sub-pixel line rendering defects */
    transform-origin: center;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

@media (max-width: 768px) {
    .hero-bg-video {
        transform: scale(1.02);
        object-fit: cover;
        object-position: center center;
    }
}

/* ── Text Scramble ── */
.scramble-char {
    color: oklch(66.7% 0.295 322.15);
    opacity: 0.55;
    display: inline-block;
}

#scramble-target {
    display: inline-block;
    min-width: 1ch;
    white-space: nowrap;
    contain: layout;
    line-height: 1;
}

/* ==========================================================================
   CURSOR
   ========================================================================== */

/* ── Custom Cursor ── */
body,
* {
    cursor: none !important;
}

.custom-cursor {
    position: fixed;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.3);
    transform: translate(-50%, -50%);
    mix-blend-mode: screen;
    backdrop-filter: blur(0.5px);
}

@media (hover: none) {

    .custom-cursor,
    .cursor-trail {
        display: none !important;
    }

    body,
    * {
        cursor: auto !important;
    }
}

.cursor-trail {
    position: fixed;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    opacity: 0.6;
    filter: blur(0.5px);
    box-shadow: 0 0 8px currentColor;
}

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(15, 15, 15, 0.86);
    color: oklch(66.7% 0.295 322.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transform: translateY(14px) scale(0.92);
    box-shadow: 0 0 26px rgba(255, 0, 128, 0.2);
    transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

@media (hover: hover) {
    .back-to-top:hover {
        border-color: oklch(66.7% 0.295 322.15);
        background: rgba(255, 255, 255, 0.08);
        transform: translateY(-3px) scale(1);
    }
}

.back-to-top svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2.5;
}

/* ==========================================================================
   ABOUT SECTION ANIMATIONS
   ========================================================================== */

/* ── About Section ── */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

@keyframes rotate-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes glow-pulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(255, 0, 128, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(255, 0, 128, 0.6);
    }
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.about-card {
    animation: slide-in 0.6s ease-out forwards;
    opacity: 0;
}

.about-card:nth-child(1) {
    animation-delay: 0.1s;
}

.about-card:nth-child(2) {
    animation-delay: 0.2s;
}

.about-card:nth-child(3) {
    animation-delay: 0.3s;
}

.about-card:nth-child(4) {
    animation-delay: 0.4s;
}

.about-number {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    background: linear-gradient(135deg, oklch(66.7% 0.295 322.15), #ff0080, oklch(66.7% 0.295 322.15));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-accent-box {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 0, 128, 0.3);
    border-radius: 12px;
}

.about-accent-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 0, 128, 0.2), transparent);
    animation: shimmer 3s infinite;
}

.timeline-dot {
    position: relative;
    width: 16px;
    height: 16px;
    background: oklch(66.7% 0.295 322.15);
    border-radius: 50%;
    border: 3px solid var(--site-bg);
    animation: glow-pulse 2s ease-in-out infinite;
}

.timeline-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, oklch(66.7% 0.295 322.15), transparent);
}

.about-stat {
    transition: all 0.3s ease;
}

.about-stat:hover {
    transform: translateY(-8px);
}

.about-kicker {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.about-kicker::before {
    content: '';
    width: 44px;
    height: 1px;
    background: oklch(66.7% 0.295 322.15);
}

.about-hero-panel {
    position: relative;
}

.section-heading-video {
    display: block;
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    height: auto;
}

@media (max-width: 767px) {
    .section-heading-video {
        mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
        -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
    }
}

.about-system-node {
    position: relative;
    min-height: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    transition: border-color 0.3s ease, transform 0.3s ease;
}

@media (hover: hover) {
    .about-system-node:hover {
        transform: translateX(8px);
        border-color: rgba(255, 0, 128, 0.8);
    }
}

.about-system-number {
    color: oklch(66.7% 0.295 322.15);
    font-size: clamp(2.25rem, 5vw, 4.5rem);
    font-weight: 900;
    line-height: 0.9;
}

.about-system-rail {
    position: relative;
}

.about-system-rail::before {
    content: none;
}

.about-process-card {
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.about-process-card:hover {
    transform: translateY(-6px);
    border-color: oklch(66.7% 0.295 322.15);
}

.about-process-card::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: oklch(66.7% 0.295 322.15);
    box-shadow: 0 0 22px rgba(255, 0, 128, 0.5);
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 0, 128, 0.3), transparent);
}

.floating-shape {
    animation: float 4s ease-in-out infinite;
}

/* ==========================================================================
   MOTION GRAPHICS
   ========================================================================== */

/* ── Motion Graphics ── */
@keyframes counter-pop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes float-up {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateY(-60px);
    }
}

@keyframes draw-line {
    0% {
        stroke-dasharray: 1000;
        stroke-dashoffset: 1000;
    }

    100% {
        stroke-dasharray: 1000;
        stroke-dashoffset: 0;
    }
}

.stat-number {
    animation: counter-pop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
}

.stat-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: oklch(66.7% 0.295 322.15);
    border-radius: 50%;
    pointer-events: none;
}

.progress-bar-fill {
    animation: none;
    transition: width 2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-bar-fill.animate {
    animation: none;
}

.skill-icon {
    display: inline-block;
    font-size: 1.5rem;
    margin-right: 8px;
}

svg.line-draw {
    stroke: oklch(66.7% 0.295 322.15);
    stroke-width: 2;
    fill: none;
    animation: draw-line 2s ease-in-out forwards;
}

.experience-item {
    position: relative;
    padding-left: 30px;
}

.experience-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    width: 20px;
    height: 20px;
    background: oklch(66.7% 0.295 322.15);
    border-radius: 50%;
    border: 3px solid #0f0f0f;
    animation: glow-pulse 2s ease-in-out infinite;
}

.process-step-icon {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
}

.process-step-icon svg {
    animation: rotate-slow 20s linear infinite;
}

/* ==========================================================================
   ACCESSIBILITY WIDGET OVERRIDE
   ========================================================================== */

/* Align Sienna accessibility widget to match back-to-top button */
.asw-menu-btn {
    width: 56px !important;
    height: 56px !important;
    bottom: 24px !important;
    left: 24px !important;
}

/* Restore default cursor on accessibility widget */
.asw-menu-btn,
.asw-menu-btn *,
.asw-menu,
.asw-menu *,
.asw-container,
.asw-container * {
    cursor: auto !important;
}

/* Restore default cursor on mobile disclaimer */
#mobile-disclaimer,
#mobile-disclaimer * {
    cursor: auto !important;
}

/* ==========================================================================
   SCROLL REVEAL ANIMATIONS (ABOUT ME)
   ========================================================================== */

/* Container reveal (Fade and Slide Up) */
.reveal-fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.25, 1, 0.5, 1), transform 1s cubic-bezier(0.25, 1, 0.5, 1);
}

.reveal-fade-up.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Vertical Timeline Track Animation */
.timeline-track {
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.animate .timeline-track {
    transform: scaleY(1);
}

/* Timeline Experience Items Slide & Fade */
.reveal-fade-up .experience-item {
    opacity: 0;
    transform: translateX(25px);
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.reveal-fade-up.animate .experience-item {
    opacity: 1;
    transform: translateX(0);
}

/* Stagger delays for timeline items */
.reveal-fade-up.animate .experience-item:nth-child(2) {
    transition-delay: 0.3s;
}

.reveal-fade-up.animate .experience-item:nth-child(3) {
    transition-delay: 0.6s;
}

.reveal-fade-up.animate .experience-item:nth-child(4) {
    transition-delay: 0.9s;
}

/* ==========================================================================
   FORM VALIDATION STYLES
   ========================================================================== */
.input-error {
    border-color: #ff3b30 !important;
    box-shadow: 0 0 8px rgba(255, 59, 48, 0.25) !important;
}

.error-message {
    color: #ff3b30;
    font-size: 0.85rem;
    margin-top: 6px;
    display: none;
    animation: fadeIn 0.2s ease-in-out;
}

/* Show error message only when the invalid input is focused/clicked */
.input-error:focus+.error-message {
    display: block;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-6px);
    }

    40%,
    80% {
        transform: translateX(6px);
    }
}

.shake-element {
    animation: shake 0.4s ease-in-out;
}

/* ==========================================================================
   FLOATING BIO BUTTON VISIBILITY CLASS
   ========================================================================== */
#openBioDrawerBtn.bio-btn-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-50%) translateX(100%) !important;
}

/* ==========================================================================
   DYNAMIC HEADING STYLES (TILTING NORMAL TO ITALIC + ECHO TRAIL)
   ========================================================================== */
.section-dynamic-title-container {
    width: auto;
    margin-left: 0;
    margin-right: calc(-1 * (100vw - 100%));
    margin-bottom: 2.5rem;
    overflow: hidden;
}

@media (min-width: 768px) {
    .section-dynamic-title-container {
        margin-left: calc(-1 * clamp(1.5rem, 4.5vw, 4rem));
    }
}

/* Flex row that wraps the main title + echo copies; animates as a unit */
.dynamic-title-row {
    display: flex;
    align-items: baseline;
    gap: 0;
    transform-origin: bottom left;
    animation: dynamic-tilt 5s infinite;
    white-space: nowrap;
}

.section-dynamic-title {
    font-size: clamp(2.8rem, 9.5vw, 6rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 0.9;
    text-transform: uppercase;
    color: oklch(66.7% 0.295 322.15);
    display: inline-block;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

/* Outline echo copies — hidden by default, revealed via JS class toggle */
.title-echo {
    font-size: clamp(2.8rem, 9.5vw, 6rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 0.9;
    text-transform: uppercase;
    color: transparent;
    -webkit-text-stroke: 2.5px oklch(66.7% 0.295 322.15);
    display: inline-block;
    flex-shrink: 0;
    pointer-events: none;
    user-select: none;
    margin-left: 0.25em;
    opacity: 0;
    position: relative;
    z-index: 1;
    transform: translateX(calc(-1 * var(--echo-step-offset, 0px)));
    transition: opacity 0.2s ease, transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

/* When JS adds this class, each echo smoothly emerges 1 step right from its predecessor */
.title-echo.echo-visible {
    opacity: var(--echo-max-opacity, 0.2);
    transform: translateX(0);
}

/* When fading out: dissolve in place (no slide back), smooth opacity fade */
.title-echo.echo-fading {
    opacity: 0 !important;
    transform: translateX(0);
    transition: opacity 0.6s ease-out;
}

/* ── Main title tilt (5s cycle) ──
   0–15%  (0–0.75s)    : normal, rest
   15–25% (0.75–1.25s) : tilt to italic
   25–75% (1.25–3.75s) : hold italic (echoes cascade during this window)
   75–85% (3.75–4.25s) : return to normal
   85–100% (4.25–5s)   : rest
   ─────────────────────────────────── */
@keyframes dynamic-tilt {

    0%,
    15% {
        transform: skewX(0deg);
        animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
    }

    25% {
        transform: skewX(-15deg);
    }

    75% {
        transform: skewX(-15deg);
        animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
    }

    85%,
    100% {
        transform: skewX(0deg);
    }
}

.no-scroll {
    overflow: hidden !important;
}

/* ==========================================================================
   PROJECT GALLERY CAPTIONS (EDITORIAL GALLERY STYLE)
   ========================================================================== */
.project-caption {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.6;
    color: #ffffff;
    padding-left: 14px;
    border-left: 2px solid oklch(66.7% 0.295 322.15);
    margin-bottom: 0.85rem;
}

/* Ensure strong tags inherit uniform bold uppercase white styling */
.project-caption strong {
    display: inline-block;
    font-size: inherit;
    font-weight: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    color: inherit;
    margin-right: 0;
}

/* Treat H1 tags inside descriptions cleanly and keep them inline */
.project-caption h1 {
    font-size: inherit;
    font-weight: inherit;
    margin: 0;
    padding: 0;
    display: inline;
}