/* ====================================================
   ANIMATIONS — Editorial Storytelling
   ====================================================
   Each section assembles like a magazine page.
   Elements enter in deliberate sequence, not all at once.
   Timing feels authored, not generated.

   Easing reference:
   · snap  = cubic-bezier(0.22, 1, 0.36, 1)      — expo out, decisive
   · drift = cubic-bezier(0.215, 0.61, 0.355, 1)  — ease-out cubic
   · wipe  = cubic-bezier(0.77, 0, 0.18, 1)       — power4 inOut
   ==================================================== */

/* ═══════════════════════════════════════════════════
   BASE STATES — hidden before in-view fires
   ═══════════════════════════════════════════════════ */

.chapter-eyebrow {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.42s ease, transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.chapter-ornament {
    opacity: 0;
    letter-spacing: 6px;
    transition: opacity 0.5s ease;
}

/* About text paragraphs + pull-quote */
.about-text > p,
.about-text > blockquote {
    opacity: 0;
    transform: translateY(18px);
    transition:
        opacity 0.52s ease,
        transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}

/* About photo — hard wipe from right */
.about-photo-wrap {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.88s cubic-bezier(0.77, 0, 0.18, 1) 0.12s;
    will-change: clip-path;
}

/* CS sections on inner pages */
.cs-eyebrow {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.42s ease, transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.cs-subtitle {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.cs-body > p,
.cs-body > ul > li,
.cs-body > ol > li {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ═══════════════════════════════════════════════════
   CHAPTER SEQUENCE — main page .chapter.in-view
   ═══════════════════════════════════════════════════ */

/* t=0s  Eyebrow appears */
.chapter.in-view .chapter-eyebrow {
    opacity: 1;
    transform: none;
    transition-delay: 0s;
}

/* t=0.48s  Ornament (after heading words finish staggering) */
.chapter.in-view .chapter-ornament {
    opacity: 1;
    transition-delay: 0.48s;
}

/* t=0.28s+  About text stacks up line by line */
.chapter.in-view .about-text > p:nth-child(1)  { opacity: 1; transform: none; transition-delay: 0.28s; }
.chapter.in-view .about-text > p:nth-child(2)  { opacity: 1; transform: none; transition-delay: 0.44s; }
.chapter.in-view .about-text > blockquote      { opacity: 1; transform: none; transition-delay: 0.60s; }
.chapter.in-view .about-text > p:nth-child(4)  { opacity: 1; transform: none; transition-delay: 0.76s; }
.chapter.in-view .about-text > p:nth-child(5)  { opacity: 1; transform: none; transition-delay: 0.90s; }

/* t=0.12s  Photo wipes in from right (starts early, finishes with text) */
.chapter.in-view .about-photo-wrap {
    clip-path: inset(0 0% 0 0);
}

/* ═══════════════════════════════════════════════════
   CS SECTIONS — inner pages .cs-section.in-view / .cs-hero.in-view
   ═══════════════════════════════════════════════════ */
.cs-section.in-view .cs-eyebrow,
.cs-hero.in-view    .cs-eyebrow {
    opacity: 1;
    transform: none;
    transition-delay: 0s;
}

.cs-hero.in-view .cs-subtitle {
    opacity: 1;
    transform: none;
    transition-delay: 0.38s;
}

.cs-section.in-view .cs-body > p:nth-child(1)         { opacity: 1; transform: none; transition-delay: 0.15s; }
.cs-section.in-view .cs-body > p:nth-child(2)         { opacity: 1; transform: none; transition-delay: 0.30s; }
.cs-section.in-view .cs-body > p:nth-child(3)         { opacity: 1; transform: none; transition-delay: 0.45s; }
.cs-section.in-view .cs-body > p:nth-child(n+4)       { opacity: 1; transform: none; transition-delay: 0.55s; }
.cs-section.in-view .cs-body > ul > li:nth-child(1)   { opacity: 1; transform: none; transition-delay: 0.10s; }
.cs-section.in-view .cs-body > ul > li:nth-child(2)   { opacity: 1; transform: none; transition-delay: 0.22s; }
.cs-section.in-view .cs-body > ul > li:nth-child(3)   { opacity: 1; transform: none; transition-delay: 0.34s; }
.cs-section.in-view .cs-body > ul > li:nth-child(n+4) { opacity: 1; transform: none; transition-delay: 0.46s; }

/* ═══════════════════════════════════════════════════
   WORD-REVEAL (headings)
   JS splits into word-spans. CSS snaps them up.
   ═══════════════════════════════════════════════════ */
.word-wrap {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    line-height: inherit;
    margin-right: 0.25em;
}

.word-inner {
    display: inline-block;
    transform: translateY(108%);
    transition: transform 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

.word-inner.in-view {
    transform: translateY(0);
}

/* Heading letter-spacing breathes near cursor (JS drives) */
.chapter-heading,
.cs-title {
    transition:
        letter-spacing 0.5s ease,
        color           0.3s ease !important;
}

/* ═══════════════════════════════════════════════════
   EYEBROW GRADIENT — warm only
   ═══════════════════════════════════════════════════ */
.chapter-eyebrow,
.cs-eyebrow {
    background: linear-gradient(90deg, var(--accent) 55%, var(--hot) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.day-mode .chapter-eyebrow,
.day-mode .cs-eyebrow {
    background: linear-gradient(90deg, var(--accent) 55%, rgba(180, 75, 0, 0.9) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ═══════════════════════════════════════════════════
   COVER-BAR LINE DRAW
   ═══════════════════════════════════════════════════ */
.cover-bar {
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.55s;
}

.cover-bar.drawn {
    transform: scaleX(1);
}

/* ═══════════════════════════════════════════════════
   PROJECT CARDS — scale in with lift
   ═══════════════════════════════════════════════════ */
.project-card {
    position: relative;
    cursor: pointer;
    transition:
        transform 0.42s cubic-bezier(0.215, 0.61, 0.355, 1),
        box-shadow 0.42s cubic-bezier(0.215, 0.61, 0.355, 1) !important;
}

.project-card:hover {
    box-shadow:
        0 30px 64px rgba(0, 0, 0, 0.45),
        0 8px 20px  rgba(0, 0, 0, 0.22) !important;
}

/* Stretched link — full card is clickable */
.project-link {
    position: static;
}

.project-link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
}

/* Card image depth layer (JS drives translate) */
.project-img-wrap img,
.project-img-wrap {
    transition: transform 0.18s cubic-bezier(0.215, 0.61, 0.355, 1) !important;
    will-change: transform;
}

/* ═══════════════════════════════════════════════════
   BLOG ENTRIES — vertical accent + stretched link
   ═══════════════════════════════════════════════════ */
.blog-entry {
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease !important;
}

.blog-entry::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 0;
    width: 2px;
    height: 0%;
    background: var(--accent);
    transition: height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.blog-entry:hover::before {
    height: 100%;
}

.blog-entry:hover {
    background: rgba(255, 76, 41, 0.018) !important;
    transform: none !important;
    box-shadow: none !important;
}

.read-link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
}

/* ═══════════════════════════════════════════════════
   SKILL CHIPS — stagger in (JS), no float
   ═══════════════════════════════════════════════════ */
.skill-chip {
    animation: none !important;
    transition:
        border-color 0.22s ease,
        color        0.22s ease,
        background   0.22s ease !important;
}

.skill-chip:hover {
    border-color: var(--accent) !important;
    color: var(--text) !important;
    background: rgba(255, 76, 41, 0.05) !important;
    box-shadow: none !important;
    transform: none !important;
}

/* ═══════════════════════════════════════════════════
   METRIC CARDS
   ═══════════════════════════════════════════════════ */
.metric-card {
    transition:
        transform  0.4s cubic-bezier(0.215, 0.61, 0.355, 1),
        box-shadow 0.4s ease !important;
}

.metric-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28) !important;
}

/* ═══════════════════════════════════════════════════
   CURSOR STATES
   ═══════════════════════════════════════════════════ */

/* Label inside the ring */
.cursor-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fff;
    opacity: 0;
    transition: opacity 0.18s ease;
    pointer-events: none;
    user-select: none;
}

/* VIEW state — project cards */
.cursor-ring.state-view {
    width: 78px !important;
    height: 78px !important;
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    opacity: 1 !important;
}

.cursor-ring.state-view .cursor-label {
    opacity: 1;
}

.cursor-dot.state-view {
    opacity: 0 !important;
    transform: translate(-50%, -50%) scale(0) !important;
}

/* TEXT state — headings */
.cursor-ring.state-text {
    width: 88px !important;
    height: 88px !important;
    opacity: 0.32 !important;
    border-width: 1px !important;
    background: transparent !important;
}

.cursor-dot.state-text {
    opacity: 0 !important;
    transform: translate(-50%, -50%) scale(0) !important;
}

/* DRAG state */
.cursor-ring.state-drag {
    transform: translate(-50%, -50%) scale(0.8) !important;
    background: rgba(255, 76, 41, 0.1) !important;
    opacity: 1 !important;
}

@media (pointer: coarse) {
    .cursor-label { display: none; }
}

/* ═══════════════════════════════════════════════════
   CTA BUTTONS — magnetic (JS handles transform)
   ═══════════════════════════════════════════════════ */
.enter-btn,
.resume-download-btn,
.cs-prototype,
.submit-btn {
    transition:
        background   0.25s ease,
        color        0.25s ease,
        box-shadow   0.25s ease,
        transform    0.55s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    overflow: visible;
}

/* ═══════════════════════════════════════════════════
   PULL-QUOTE
   ═══════════════════════════════════════════════════ */
.pull-quote {
    transition: border-left-color 0.35s ease !important;
}

.pull-quote:hover {
    border-left-color: var(--hot) !important;
    box-shadow: none !important;
}

/* ═══════════════════════════════════════════════════
   HEADER SCROLL
   ═══════════════════════════════════════════════════ */
.site-header.is-scrolled {
    box-shadow:
        0 1px 0 rgba(255, 76, 41, 0.1),
        0 4px 24px rgba(0, 0, 0, 0.22) !important;
}

.day-mode .site-header.is-scrolled {
    box-shadow:
        0 1px 0 rgba(224, 58, 24, 0.12),
        0 4px 20px rgba(0, 0, 0, 0.08) !important;
}

/* ═══════════════════════════════════════════════════
   OFJ PING
   ═══════════════════════════════════════════════════ */
@keyframes ofj-ping {
    0%   { transform: scale(1);   opacity: 0.6; }
    75%  { transform: scale(2.2); opacity: 0;   }
    100% { transform: scale(2.2); opacity: 0;   }
}

.ofj-dot { position: relative; }

.ofj-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: inherit;
    animation: ofj-ping 2.8s ease-out infinite;
}

/* ═══════════════════════════════════════════════════
   CHAPTER — dot texture
   ═══════════════════════════════════════════════════ */
.chapter {
    border-bottom: 1px solid var(--border) !important;
    background-image: radial-gradient(circle, rgba(255, 76, 41, 0.025) 1px, transparent 1px);
    background-size: 36px 36px;
    position: relative;
}

.chapter::after { display: none !important; }

.day-mode .chapter {
    background-image: radial-gradient(circle, rgba(200, 40, 20, 0.03) 1px, transparent 1px);
}

/* ═══════════════════════════════════════════════════
   COVER PAGE — multi-layer mouse parallax
   Each element sits at a different perceived depth.
   JS drives translate() per layer via RAF lerp.
   ═══════════════════════════════════════════════════ */

/* Layers need smooth transforms, no other motion fighting */
.cover-blobs,
.cover-eyebrow,
.cover-name,
.cover-bar,
.cover-tagline,
.cover-roles,
.cover-edition {
    will-change: transform;
    transition: transform 0.05s linear; /* near-instant, RAF lerp handles smoothing */
}

/* ═══════════════════════════════════════════════════
   PROJECT CARDS — image reveal overlay on hover
   An overlay slides up from below the image on hover.
   ═══════════════════════════════════════════════════ */

/* Card overflow visible so .project-num parallax can drift freely.
   Image clipping lives on the img-wrap itself. */
.project-card { overflow: visible !important; }

.project-img-wrap {
    overflow: hidden !important;
    position: relative !important;
}

.project-img-wrap svg,
.project-img-wrap img {
    display: block;
    width: 100%;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) !important;
    transform-origin: center;
}

.project-card:hover .project-img-wrap svg,
.project-card:hover .project-img-wrap img {
    transform: scale(1.07) !important;
}

/* Overlay injected by JS — slides up on hover */
.card-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 22px 20px 26px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(10, 6, 18, 0.88) 45%,
        rgba(10, 6, 18, 0.96) 100%
    );
    transform: translateY(105%);
    transition: transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.project-card:hover .card-overlay {
    transform: translateY(0);
}

.card-ol-tag {
    font-family: var(--font-sans);
    font-size: 0.52rem;
    font-weight: 600;
    letter-spacing: 3.5px;
    text-transform: uppercase;
    color: var(--accent);
}

.card-ol-cta {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.08rem;
    color: #fff;
    opacity: 0.9;
}

/* ═══════════════════════════════════════════════════
   PAGE TRANSITIONS — two-panel cinematic wipe
   Panel 1 (coral) enters first, Panel 2 (surface) 80ms after.
   On new page both panels exit to the left.
   ═══════════════════════════════════════════════════ */

.pt-panel {
    position: fixed;
    inset: 0;
    pointer-events: none;
    transform: translateX(105%);
    will-change: transform;
    transition: transform 0.52s cubic-bezier(0.77, 0, 0.18, 1);
}

.pt-panel-1 { background: var(--accent);  z-index: 9997; }
.pt-panel-2 { background: var(--surface); z-index: 9996; }

.pt-panel.is-entering {
    transform: translateX(0);
    pointer-events: all;
}

.pt-panel.is-covered {
    transform: translateX(0);
    transition: none;
}

.pt-panel.is-leaving {
    transform: translateX(-105%);
    transition: transform 0.60s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════
   NULLIFY GIMMICKY EFFECTS
   ═══════════════════════════════════════════════════ */
#particle-canvas        { display: none !important; }
.enter-btn::after,
.resume-download-btn::after,
.cs-prototype::after,
.submit-btn::after      { display: none !important; }
.project-card::after    { display: none !important; }
.project-img-wrap::after { display: none !important; }
.logo-mark              { animation: none; }
.footer-ornament        { animation: none; opacity: 0.4; }
.bookmark-progress      { box-shadow: none !important; }

/* ═══════════════════════════════════════════════════
   NAV ACTIVE
   ═══════════════════════════════════════════════════ */
.nav-link.active,
.nav-link--active {
    color: var(--text) !important;
    border-bottom-color: var(--accent) !important;
}

/* ═══════════════════════════════════════════════════
   FORM FOCUS
   ═══════════════════════════════════════════════════ */
.form-field input:focus,
.form-field textarea:focus {
    box-shadow: 0 0 0 2px rgba(255, 76, 41, 0.12) !important;
}

/* ═══════════════════════════════════════════════════
   ACCESSIBILITY & MOBILE
   ═══════════════════════════════════════════════════ */
@media (max-width: 680px) {
    .word-wrap  { overflow: visible; }
    .word-inner { transform: none; transition: none; }
}

@media (prefers-reduced-motion: reduce) {
    /* Snap everything to final state immediately */
    .chapter-eyebrow,
    .cs-eyebrow,
    .chapter-ornament,
    .about-text > p,
    .about-text > blockquote,
    .about-photo-wrap,
    .cs-subtitle,
    .cs-body > p,
    .cs-body > ul > li,
    .cs-body > ol > li,
    .word-inner {
        opacity: 1 !important;
        transform: none !important;
        clip-path: none !important;
        transition: none !important;
    }

    *, *::before, *::after {
        transition-duration: 0.001ms !important;
        animation-duration:  0.001ms !important;
    }
}
