*{
    margin: 0%;
    padding: 0%;
}
:root {
    --rgb-primary: 34 34 34;
    --rgb-secondary: 123 123 123;
    --rgb-tertiary: 248 248 248;
}

.dark {
    --rgb-primary: 236 236 236;
    --rgb-secondary: 140 140 140;
    --rgb-tertiary: 14 14 14;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Aronik TRIAL', 'Inter', ui-sans-serif, system-ui, sans-serif;
    font-feature-settings: 'ss01', 'cv11';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: #222222;
    color: #F8F8F8;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #F8F8F8;
}

::-webkit-scrollbar-thumb {
    background: #cfcfcf;
    border: 2px solid #F8F8F8;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #7B7B7B;
}

input:-webkit-autofill,
textarea:-webkit-autofill {
    -webkit-text-fill-color: #222222;
    -webkit-box-shadow: 0 0 0 1000px #F8F8F8 inset;
    transition: background-color 9999s ease-in-out 0s;
}

.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.typewriter-cursor {
    display: inline-block;
    width: 0.05em;
    height: 0.78em;
    margin-left: 0.04em;
    background: currentColor;
    vertical-align: -0.05em;
    animation: typewriter-blink 1.05s steps(2, jump-none) infinite;
}

#projectModal {
    opacity: 0;
    transition: opacity 0.25s ease;
}

#projectModal.is-open {
    opacity: 1;
}

#projectModalPanel {
    transform: translateY(12px) scale(0.98);
    transition: transform 0.3s ease;
}

#projectModal.is-open #projectModalPanel {
    transform: translateY(0) scale(1);
}

body.modal-open {
    overflow: hidden;
}

.journey-slider {
    overflow: hidden;
    border-radius: 1.5rem;
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        rgba(0, 0, 0, 0.5) 5%,
        black 13%,
        black 87%,
        rgba(0, 0, 0, 0.5) 95%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        rgba(0, 0, 0, 0.5) 5%,
        black 13%,
        black 87%,
        rgba(0, 0, 0, 0.5) 95%,
        transparent 100%
    );
}

.journey-track {
    display: flex;
    gap: 1.5rem;
    padding: 2rem 0.5rem;
    will-change: transform;
}

.journey-slide {
    flex: 0 0 20rem;
    border-radius: 1.25rem;
    overflow: hidden;
    border: 1px solid rgba(34, 34, 34, 0.07);
    background: #ffffff;
    box-shadow:
        0 2px 4px rgba(34, 34, 34, 0.04),
        0 8px 24px rgba(34, 34, 34, 0.06);
    transition:
        transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    cursor: default;
}

.journey-slide:hover {
    transform: translateY(-10px);
    box-shadow:
        0 12px 32px rgba(34, 34, 34, 0.09),
        0 32px 72px rgba(34, 34, 34, 0.08);
}

.journey-slide img {
    width: 100%;
    height: 13rem;
    object-fit: cover;
    display: block;
    filter: grayscale(20%) brightness(0.95) contrast(1.02);
    transition: filter 0.65s ease;
    transform-origin: center;
    /* Slightly oversized so initJourney's ±5% yPercent parallax never
       reveals an edge gap. GSAP owns the transform on desktop, so the
       hover scale below no longer applies there (parallax replaces it). */
    transform: scale(1.12);
}

.journey-slide:hover img {
    filter: grayscale(0%) brightness(1.03) contrast(1);
    transform: scale(1.07);
}

.journey-slide-content {
    padding: 1.125rem 1.25rem 1.375rem;
    border-top: 1px solid rgba(34, 34, 34, 0.05);
}

.journey-slide-title {
    font-size: 0.625rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #7B7B7B;
}

.journey-slide-text {
    margin-top: 0.5rem;
    color: #222222;
    line-height: 1.55;
    font-size: 0.875rem;
}

/* ── Timeline scroll zoom ──────────────────────────────── */
.timeline-item {
    transform-origin: center;
    transition:
        transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.65s ease;
    will-change: transform, opacity;
}

.timeline-item.is-inactive {
    opacity: 0.42;
    transform: scale(0.97);
}

.timeline-item.is-active {
    opacity: 1;
    transform: scale(1.03);
}

.timeline-dot {
    transition:
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.55s ease;
    transform-origin: center;
}

.timeline-item.is-active .timeline-dot {
    transform: scale(2);
}

/* Animated left line — drawn in by initTimeline via --tl-scale.
   Replaces the Tailwind border-l on the <ol>. Defaults to fully drawn
   (scaleY 1) so the reduced-motion / no-JS fallback shows a static line. */
#experience ol {
    position: relative;
}

#experience ol::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(
        to bottom,
        rgb(var(--rgb-primary) / 0.5),
        rgb(var(--rgb-primary) / 0.18)
    );
    transform: scaleY(var(--tl-scale, 1));
    transform-origin: top;
}

/* Active-entry emphasis (only on the GSAP-driven path — initTimeline adds
   .is-animated; without it, e.g. reduced-motion / no-JS, every entry stays
   fully visible). Entries rest slightly dimmed and the one crossing mid-screen
   brightens to full. `filter` is used (not opacity) so it composes with the
   inline opacity GSAP writes during the fade-in instead of being overridden. */
#experience ol.is-animated li {
    filter: opacity(0.5);
    transition: filter 0.45s ease;
}

#experience ol.is-animated li.is-active {
    filter: opacity(1);
}

/* Enlarge + ring the dot of the experience nearest the focus line. */
#experience li.is-active .timeline-dot {
    transform: scale(2.2);
    box-shadow: 0 0 0 4px rgb(var(--rgb-primary) / 0.12);
}

@keyframes typewriter-blink {
    50% {
        opacity: 0;
    }
}

/* ── Dark mode ─────────────────────────────────────────── */

html.dark {
    color-scheme: dark;
}

.dark ::selection {
    background: rgb(var(--rgb-primary));
    color: rgb(var(--rgb-tertiary));
}

.dark ::-webkit-scrollbar-track {
    background: rgb(var(--rgb-tertiary));
}

.dark ::-webkit-scrollbar-thumb {
    background: #2c2c2c;
    border-color: rgb(var(--rgb-tertiary));
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #484848;
}

.dark input:-webkit-autofill,
.dark textarea:-webkit-autofill {
    -webkit-text-fill-color: rgb(var(--rgb-primary));
    -webkit-box-shadow: 0 0 0 1000px rgb(var(--rgb-tertiary)) inset;
}

.dark .mix-blend-multiply {
    mix-blend-mode: normal;
}

.dark #projectModalBackdrop {
    background: rgba(0, 0, 0, 0.78);
}

.dark .journey-slide {
    background: #1d1d1d;
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.45);
}

.dark .journey-slide:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 32px 72px rgba(0, 0, 0, 0.38);
}

.dark .journey-slide img {
    filter: grayscale(15%) brightness(0.75) contrast(1.08);
}

.dark .journey-slide:hover img {
    filter: grayscale(0%) brightness(0.88) contrast(1);
}

.dark .journey-slide-content {
    border-top-color: rgba(255, 255, 255, 0.05);
}

.dark .journey-slide-title {
    color: rgb(var(--rgb-secondary));
}

.dark .journey-slide-text {
    color: rgb(var(--rgb-primary));
}

/* Smooth transition when toggling theme */
.theme-transitioning,
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
    transition:
        background-color 0.28s ease,
        border-color 0.28s ease,
        color 0.2s ease,
        box-shadow 0.28s ease,
        filter 0.28s ease !important;
}

/* ── Mori section punctuation ──────────────────────────── */
.mori-break {
    position: relative;
    width: 100%;
    pointer-events: none;
    margin-top: -3.5rem;
    margin-bottom: -1rem;
    display: flex;
    z-index: 2;
}

.mori-break.is-center  { justify-content: center; }
.mori-break.is-right   { justify-content: flex-end;   padding-right: 12%; }
.mori-break.is-left    { justify-content: flex-start; padding-left: 12%; }

.mori-medallion {
    position: relative;
    width: 5rem;
    --mori-parallax: 0px;
    animation: mori-float 5.5s ease-in-out infinite;
    will-change: transform;
}

.mori-break.is-right  .mori-medallion { animation-delay: -1.8s; }
.mori-break.is-left   .mori-medallion { animation-delay: -3.4s; }

.mori-image {
    display: block;
    width: 100%;
    height: auto;
    mix-blend-mode: multiply;
}

.dark .mori-image {
    mix-blend-mode: multiply;
}

@media (min-width: 768px) {
    .mori-medallion { width: 6rem; }
    .mori-break { margin-top: -4rem; }
}

@media (min-width: 1024px) {
    .mori-medallion { width: 7rem; }
    .mori-break.is-right { padding-right: 15%; }
    .mori-break.is-left  { padding-left: 15%; }
}

@keyframes mori-float {
    0%, 100% { transform: translateY(var(--mori-parallax)); }
    50%      { transform: translateY(calc(var(--mori-parallax) - 8px)); }
}


/* Large Mori-3 popping out from right side of Experience section */
/* Clips #moriExperience without putting overflow:hidden on the section, so the
   section's sticky timeline cards aren't broken by a clipping ancestor. */
.mori-clip {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.mori-experience {
    display: none;
    position: absolute;
    top: 50%;
    right: 1rem;
    width: 22rem;
    height: auto;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: center;
    mix-blend-mode: multiply;
    pointer-events: none;
    user-select: none;
    z-index: 1;
}

.dark .mori-experience {
    mix-blend-mode: normal;
}

@media (min-width: 1024px) {
    .mori-experience {
        display: block;
        width: 22rem;
        right: 1rem;
    }
}

@media (min-width: 1280px) {
    .mori-experience {
        width: 26rem;
        right: 2rem;
    }
}

/* Mori-2 standing at the bottom of Contact, extending into footer area */
.mori-contact {
    display: none;
    position: absolute;
    bottom: -5rem;
    left: 28%;
    width: 11rem;
    height: auto;
    mix-blend-mode: multiply;
    pointer-events: none;
    user-select: none;
    z-index: 5;
}

.dark .mori-contact {
    mix-blend-mode: normal;
}

@media (min-width: 768px) {
    .mori-contact {
        display: block;
        width: 15rem;
        bottom: -5rem;
        left: 28%;
    }
}

@media (min-width: 1024px) {
    .mori-contact {
        width: 17rem;
        bottom: -6rem;
        left: 30%;
    }
}

@media (min-width: 1280px) {
    .mori-contact {
        width: 19rem;
        bottom: -7rem;
        left: 32%;
    }
}

/* Hide Mori-2 and Mori-3 below desktop width */
@media (max-width: 1101px) {
    .mori-experience,
    .mori-contact {
        display: none;
    }
}

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

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

    .typewriter-cursor {
        animation: none;
    }

    #projectModal,
    #projectModalPanel {
        transition: none;
    }

    .timeline-item {
        transition: none;
    }

    .timeline-item.is-inactive,
    .timeline-item.is-active {
        transform: none;
        opacity: 1;
    }

    .timeline-dot {
        transition: none;
        transform: none !important;
    }

    .mori-medallion {
        animation: none;
    }

}

/* ── Lenis smooth scroll ─────────────────────────────── */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-smooth iframe {
    pointer-events: none;
}

/* Desktop Journey runs as a pinned horizontal scrub over the 8 unique
   slides; the duplicate loop set (used only by the mobile auto-marquee)
   is hidden at >=768px. */
@media (min-width: 768px) {
    .journey-slide:nth-child(n + 9) {
        display: none;
    }
}

/* ── Skills: tool chips + list icons ─────────────────── */
/* Monochrome icons inherit currentColor so they track the theme (incl. dark).
   Chips rest quiet (hairline outline, muted icon) and lift on hover. */
.skill-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.7rem 0.4rem 0.6rem;
    border: 1px solid rgb(var(--rgb-primary) / 0.1);
    border-radius: 0.625rem;
    font-size: 0.875rem;
    line-height: 1;
    white-space: nowrap;
    color: rgb(var(--rgb-primary) / 0.82);
    background: rgb(var(--rgb-primary) / 0.015);
    transition:
        border-color 0.3s cubic-bezier(0.22, 1, 0.36, 1),
        color 0.3s ease,
        background-color 0.3s ease,
        transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.skill-chip iconify-icon {
    font-size: 1.05rem;
    color: rgb(var(--rgb-primary) / 0.5);
    transition:
        color 0.3s ease,
        transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.skill-chip:hover {
    border-color: rgb(var(--rgb-primary) / 0.28);
    background: rgb(var(--rgb-primary) / 0.05);
    color: rgb(var(--rgb-primary));
    transform: translateY(-2px);
}

.skill-chip:hover iconify-icon {
    color: rgb(var(--rgb-primary));
    transform: scale(1.12);
}

.skill-list-icon {
    font-size: 1rem;
    flex-shrink: 0;
    color: rgb(var(--rgb-secondary));
}

/* Avoid a flash of unstyled custom-element text before the web component
   upgrades / icons load. */
iconify-icon {
    display: inline-block;
    vertical-align: -0.125em;
}

/* Quote interlude — "Turning Ideas Into Efficient Systems".
   Monochrome scroll-reveal between Services and Experience.
   Default (no-JS / reduced-motion) state is fully legible; GSAP mutes
   words only when it takes over (see initQuote in script.js). */
.quote-interlude {
    height: auto;
}

.quote-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1.5rem;
    min-height: 60vh;
}

.quote-line {
    margin: 0;
    font-weight: 300;
    letter-spacing: -0.03em;
    line-height: 1.05;
    font-size: clamp(2.25rem, 7vw, 5.5rem);
    max-width: 18ch;
}

.quote-word {
    display: inline-block;
    color: rgb(var(--rgb-primary));
    /* opacity/transform/text-shadow are written inline by GSAP during the
       scrub; keep them off CSS transitions so they don't fight GSAP. */
}

.quote-progress {
    margin-top: clamp(2rem, 5vh, 3.5rem);
    width: min(60%, 28rem);
    height: 1px;
    background: rgb(var(--rgb-primary) / 0.12);
    overflow: hidden;
}

.quote-progress-fill {
    display: block;
    height: 100%;
    width: 0;
    background: rgb(var(--rgb-primary) / 0.6);
}

@media (min-width: 768px) {
    /* Tall section gives the sticky stage room to scrub. ~250vh tunable. */
    .quote-interlude {
        height: 250vh;
    }

    .quote-stage {
        position: sticky;
        top: 0;
        min-height: 100vh;
        padding: 0 5rem;
    }
}

/* ── Certificates: matted credential cards ───────────── */
/* Image sits in a mat (like a framed document); a hairline fact sheet
   replaces the loose meta lines. Tokens keep it theme-aware. */
.cert-card {
    outline: none;
}

.cert-frame {
    box-shadow: 0 1px 2px rgb(var(--rgb-primary) / 0.06);
    transition:
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.cert-card:hover .cert-frame,
.cert-card:focus-visible .cert-frame {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgb(var(--rgb-primary) / 0.12);
}

.cert-card:focus-visible .cert-mat {
    outline: 2px solid rgb(var(--rgb-primary) / 0.6);
    outline-offset: 4px;
}

.cert-meta {
    border-top: 1px solid rgb(var(--rgb-primary) / 0.1);
}

.cert-meta > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgb(var(--rgb-primary) / 0.1);
}

.cert-meta dt {
    color: rgb(var(--rgb-secondary));
}

.cert-meta dd {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.cert-verify {
    transition: color 0.3s ease;
}

.cert-card:hover .cert-verify,
.cert-card:focus-visible .cert-verify {
    color: rgb(var(--rgb-primary));
}

@media (prefers-reduced-motion: reduce) {
    .cert-frame {
        transition: none;
    }

    .cert-card:hover .cert-frame,
    .cert-card:focus-visible .cert-frame {
        transform: none;
    }
}

/* ── Experience: centered, alternating timeline (md and up) ──
   Rail runs down the middle; entries alternate left / right of it.
   Below md the original single left rail is kept. */
@media (min-width: 768px) {
    #experience ol {
        margin-left: 0;
    }

    #experience ol::before {
        left: 50%;
        transform: translateX(-50%) scaleY(var(--tl-scale, 1));
    }

    #experience ol li {
        width: 50%;
        padding-left: 3.5rem;
        padding-right: 3.5rem;
    }

    #experience ol li:nth-child(odd) {
        text-align: right;
        padding-left: 0;
    }

    #experience ol li:nth-child(even) {
        margin-left: 50%;
        padding-right: 0;
    }

    #experience ol li:nth-child(odd) p {
        margin-left: auto;
    }

    #experience ol li > span:first-child {
        left: auto;
        right: auto;
    }

    #experience ol li:nth-child(odd) > span:first-child {
        right: -4px;
    }

    #experience ol li:nth-child(even) > span:first-child {
        left: -4px;
    }
}
