/* PUGPUGI — Hand-drawn Paper UI */

html {
    scroll-behavior: smooth;
    /* Fluid root font: 16px on ≤1600px, scales to 20px at 2560px (2K) */
    font-size: clamp(16px, 1vw, 20px);
}

body {
    background-color: var(--paper);
    background-image:
        radial-gradient(
            circle at 16% 16%,
            rgba(255, 255, 255, 0.42),
            transparent 28%
        ),
        radial-gradient(
            circle at 84% 8%,
            rgba(90, 60, 30, 0.09),
            transparent 26%
        );
    color: var(--ink);
    overflow-x: hidden;
}

/* Paper noise grain overlay */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.16;
    mix-blend-mode: multiply;
    background-image: repeating-radial-gradient(
        circle at 0 0,
        rgba(0, 0, 0, 0.07) 0,
        rgba(0, 0, 0, 0.07) 1px,
        transparent 1px,
        transparent 4.5px
    );
    z-index: 9998;
}

/* ─── Desktop nav links ─────────────────────────────────── */
.nav-link {
    font-family: "Lato", sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-soft);
    text-decoration: none;
    padding: 0.3rem 0;
    position: relative;
    transition: color 0.3s;
}
.nav-link:hover {
    color: var(--rust-red);
}
.nav-link::after {
    content: "";
    position: absolute;
    left: -4px;
    right: -4px;
    bottom: -4px;
    height: 2px;
    background: var(--rust-red);
    transform: scaleX(0) rotate(-1deg);
    transition: transform 0.3s ease;
    transform-origin: left;
}
.nav-link:hover::after {
    transform: scaleX(1) rotate(-1deg);
}

/* Nav links mobile reset */
.nav-links {
    right: -100%;
}
.nav-links.active {
    right: 0;
}

/* Mobile nav links */
.mobile-nav-link {
    display: block;
    font-family: "Caveat", cursive;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ink) !important;
    padding: 0.65rem 1.5rem;
    text-decoration: none;
    transition: color 0.3s;
    position: relative;
}
.mobile-nav-link:hover {
    color: var(--rust-red) !important;
}
.mobile-nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--paper-dark);
    opacity: 0.5;
}

/* ─── Marker highlight ──────────────────────────────────── */
.marker-hl {
    position: relative;
    display: inline;
}
.marker-hl::before {
    content: "";
    position: absolute;
    left: -0.1em;
    right: -0.1em;
    bottom: 0.06em;
    height: 0.46em;
    background: rgba(185, 74, 53, 0.28);
    transform: rotate(-0.8deg);
    z-index: -1;
    border-radius: 40% 60% 55% 45%;
}

/* ─── Sketch card ───────────────────────────────────────── */
.sketch-card {
    position: relative;
    overflow: visible;
    background: rgba(246, 237, 216, 0.78);
    box-shadow: 6px 8px 0 var(--shadow-soft);
    transform: rotate(-0.2deg);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}
.sketch-card:hover {
    transform: translateY(-3px) rotate(0.1deg);
    box-shadow: 9px 13px 0 var(--shadow-strong);
}
/* Clip-path border — fades out once Rough.js card borders are ready */
.sketch-card::before {
    content: "";
    position: absolute;
    inset: -7px;
    border: 2px solid var(--ink);
    clip-path: polygon(0.8% 1.5%, 99.2% 0.3%, 98.8% 98.5%, 1.2% 99.7%);
    pointer-events: none;
    opacity: 0.55;
    transition: opacity 0.4s ease;
}
.rough-cards-ready .sketch-card::before {
    opacity: 0;
}

/* ─── Card label ────────────────────────────────────────── */
.card-lbl {
    position: absolute;
    top: -13px;
    left: 16px;
    font-family: "Caveat", cursive;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    background: rgba(210, 161, 58, 0.38);
    padding: 2px 10px;
    transform: rotate(-1deg);
    letter-spacing: 0.03em;
}

/* ─── Stat blocks ───────────────────────────────────────── */
.stat-block {
    text-align: center;
    padding: 1.1rem 1.7rem;
    background: rgba(246, 237, 216, 0.65);
    position: relative;
    transform: rotate(-0.3deg);
    transition: transform 0.3s;
}
.stat-block::before {
    content: "";
    position: absolute;
    inset: -4px;
    border: 1.5px solid var(--ink);
    clip-path: polygon(1% 3%, 99% 0, 98% 97%, 2% 100%);
    opacity: 0.55;
}
.stat-block:hover {
    transform: rotate(0.4deg) translateY(-2px);
}

/* ─── Skill tiles ───────────────────────────────────────── */
.skill-tile {
    text-align: center;
    padding: 0.7rem 0.4rem;
    background: rgba(255, 248, 225, 0.65);
    border: 1px solid rgba(33, 27, 22, 0.14);
    transition: all 0.3s ease;
    cursor: pointer;
}
.skill-tile:hover {
    background: rgba(185, 74, 53, 0.08);
    border-color: var(--rust-red);
    transform: translateY(-2px);
}

/* Typography scale boost for non-hero content */
main .text-xs {
    font-size: 0.95rem !important;
}
main .text-sm {
    font-size: 1.05rem !important;
}
main .text-base {
    font-size: 1.15rem !important;
}
main .text-lg {
    font-size: 1.3rem !important;
}
main .text-xl {
    font-size: 1.45rem !important;
}

.field-note-lbl {
    font-size: 1.03rem;
    letter-spacing: 0.17em;
}
.skill-lbl {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ink);
    margin-top: 2px;
    font-family: "Lato", sans-serif;
}
.skill-sub {
    display: block;
    font-size: 0.92rem;
    color: var(--rust-red);
    font-family: "Caveat", cursive;
}

/* ─── Focus items ───────────────────────────────────────── */
.focus-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.5rem 0;
    font-size: 1.05rem;
    border-bottom: 1px dashed rgba(33, 27, 22, 0.12);
}
.focus-item:last-child {
    border-bottom: none;
}
.focus-arr {
    font-family: "Caveat", cursive;
    color: var(--rust-red);
    font-size: 1.2rem;
    line-height: 1.4;
    flex-shrink: 0;
}

/* ─── Interest items ────────────────────────────────────── */
.interest-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    padding: 0.7rem 0.9rem;
    background: rgba(255, 248, 225, 0.55);
    border: 1px solid rgba(33, 27, 22, 0.16);
    border-left: 3px solid var(--rust-red);
    transition: all 0.3s;
}
.interest-item:hover {
    background: rgba(185, 74, 53, 0.08);
    transform: translateX(3px);
}

/* ─── Tag chips ─────────────────────────────────────────── */
.tag-chip {
    font-family: "Caveat", cursive;
    font-size: 0.98rem;
    font-weight: 600;
    padding: 3px 12px;
    background: rgba(210, 161, 58, 0.28);
    border: 1px solid rgba(210, 161, 58, 0.5);
    color: var(--ink-soft);
    display: inline-block;
    transform: rotate(-0.4deg);
    transition: all 0.3s;
}
.tag-chip:hover {
    background: rgba(185, 74, 53, 0.18);
    border-color: var(--rust-red);
    transform: rotate(0.4deg) translateY(-2px);
}

/* ─── Stamp badges ──────────────────────────────────────── */
.stamp-badge {
    display: inline-block;
    font-family: "Caveat", cursive;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 3px 10px;
    border: 1.5px solid;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transform: rotate(-1.5deg);
}
.stamp-done {
    color: var(--olive);
    border-color: var(--olive);
    background: rgba(127, 143, 95, 0.15);
}
.stamp-plan {
    color: var(--faded-blue);
    border-color: var(--faded-blue);
    background: rgba(111, 168, 179, 0.15);
}
.stamp-club {
    color: var(--ochre);
    border-color: var(--ochre);
    background: rgba(210, 161, 58, 0.15);
}

/* ─── Project icon box ──────────────────────────────────── */
.proj-icon {
    width: 56px;
    height: 56px;
}

/* ─── Tech tags ─────────────────────────────────────────── */
.tech-tag {
    font-family: "Caveat", cursive;
    font-size: 0.98rem;
    padding: 2px 8px;
    background: rgba(78, 68, 56, 0.1);
    border: 1px dashed rgba(78, 68, 56, 0.28);
    color: var(--ink-soft);
}

/* ─── Sketch link (draw underline — see animation block below) ── */

/* ─── Buttons ───────────────────────────────────────────── */
.btn-primary {
    position: relative;
    display: inline-block;
    background: var(--rust-red);
    color: var(--paper-light);
    font-family: "Lato", sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.9rem 1.8rem;
    border: none;
    cursor: pointer;
    box-shadow: 4px 5px 0 var(--shadow-strong);
    transform: rotate(-0.3deg);
    transition: all 0.3s ease;
    letter-spacing: 0.03em;
    text-decoration: none;
}
.btn-primary::before {
    content: "";
    position: absolute;
    inset: -5px;
    border: 2px solid var(--ink);
    clip-path: polygon(1.5% 6%, 98.5% 0%, 99% 92%, 1% 100%);
    pointer-events: none;
}
.btn-primary:hover {
    background: var(--hover-red);
    transform: translateY(-2px) rotate(0.2deg);
    box-shadow: 6px 8px 0 var(--shadow-strong);
}
.btn-primary:active {
    transform: translateY(2px) rotate(-0.2deg);
    box-shadow: 2px 3px 0 var(--shadow-strong);
}
.btn-primary:focus {
    outline: 3px solid var(--focus);
    outline-offset: 4px;
}

.btn-secondary {
    position: relative;
    display: inline-block;
    background: rgba(210, 161, 58, 0.45);
    color: var(--ink);
    font-family: "Lato", sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.9rem 1.8rem;
    border: none;
    cursor: pointer;
    box-shadow: 4px 5px 0 var(--shadow-soft);
    transform: rotate(0.3deg);
    transition: all 0.3s ease;
    letter-spacing: 0.03em;
    text-decoration: none;
}
.btn-secondary::before {
    content: "";
    position: absolute;
    inset: -5px;
    border: 2px solid var(--ink);
    clip-path: polygon(2% 2%, 98% 0.5%, 98.5% 98%, 0.5% 99.5%);
    pointer-events: none;
}
.btn-secondary:hover {
    background: rgba(210, 161, 58, 0.65);
    transform: translateY(-2px) rotate(-0.2deg);
    box-shadow: 6px 8px 0 var(--shadow-soft);
}
.btn-secondary:active {
    transform: translateY(2px);
    box-shadow: 2px 3px 0 var(--shadow-soft);
}
.btn-secondary:focus {
    outline: 3px solid var(--focus);
    outline-offset: 4px;
}

/* ─── Hero visual blocks ────────────────────────────────── */
.bblock {
    position: absolute;
    border: 2px solid var(--ink);
    box-shadow: 7px 9px 0 var(--shadow-soft);
    transition: transform 0.4s ease;
}
.bb-red {
    width: 180px;
    height: 340px;
    background: rgba(185, 74, 53, 0.72);
    right: 100px;
    top: 60px;
    transform: rotate(-0.5deg);
}
.bb-blue {
    width: 240px;
    height: 170px;
    background: rgba(111, 168, 179, 0.65);
    right: 170px;
    top: 225px;
    transform: rotate(0.8deg);
}
.bb-paper {
    width: 310px;
    height: 210px;
    background: rgba(246, 237, 216, 0.82);
    right: 10px;
    top: 25px;
    transform: rotate(0.6deg);
}
.bb-gray {
    width: 90px;
    height: 90px;
    background: rgba(184, 177, 163, 0.72);
    right: 340px;
    top: 316px;
    transform: rotate(-1deg);
}

@media (min-width: 1280px) {
    .bb-red {
        width: 200px;
        height: 370px;
        right: 120px;
        top: 55px;
    }
    .bb-blue {
        width: 265px;
        height: 185px;
        right: 200px;
        top: 230px;
    }
    .bb-paper {
        width: 340px;
        height: 225px;
        right: 10px;
        top: 20px;
    }
    .bb-gray {
        width: 100px;
        height: 100px;
        right: 390px;
        top: 330px;
    }
}

/* Hatching on paper block */
.bb-paper::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.06;
    background-image: repeating-linear-gradient(
        -35deg,
        var(--ink) 0,
        var(--ink) 1px,
        transparent 1px,
        transparent 9px
    );
}

/* ─── Annotations ───────────────────────────────────────── */
.annotation {
    position: absolute;
    font-family: "Caveat", cursive;
    z-index: 5;
}
.ann-1 {
    top: 96px;
    right: 348px;
}
.ann-2 {
    top: 30px;
    right: 22px;
}

/* ─── Badge pills (hero) ────────────────────────────────── */
.badge-pill {
    font-family: "Caveat", cursive;
    font-size: 1.12rem;
    color: var(--ink-soft);
    padding: 3px 14px;
    background: rgba(246, 237, 216, 0.7);
    border: 1px dashed rgba(33, 27, 22, 0.22);
    display: inline-block;
    transition: all 0.3s;
}
.badge-pill:hover {
    background: rgba(185, 74, 53, 0.1);
    border-color: var(--rust-red);
}

/* ─── Social icons (footer) ─────────────────────────────── */
.social-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(246, 237, 216, 0.65);
    border: 1.5px solid var(--ink);
    font-family: "Caveat", cursive;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--ink);
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 2px 3px 0 var(--shadow-soft);
}
.social-icon svg {
    width: 18px;
    height: 18px;
}
.social-icon:hover {
    background: var(--rust-red);
    color: var(--paper-light);
    border-color: var(--rust-red);
    transform: translateY(-2px);
    box-shadow: 3px 5px 0 var(--shadow-strong);
}

/* ─── Copy email (contact) ──────────────────────────────── */
.copy-email-btn {
    font-family: "Lato", sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--ink);
    background: rgba(246, 237, 216, 0.8);
    border: 1.5px solid var(--ink);
    padding: 0.35rem 0.9rem;
    cursor: pointer;
    box-shadow: 2px 3px 0 var(--shadow-soft);
    transition: all 0.3s;
}
.copy-email-btn:hover {
    background: var(--rust-red);
    border-color: var(--rust-red);
    color: var(--paper-light);
    transform: translateY(-2px);
}
.copy-email-btn.copied {
    background: var(--olive);
    border-color: var(--olive);
    color: var(--paper-light);
}

/* ─── Footer links ──────────────────────────────────────── */
.footer-lnk {
    font-size: 1.05rem;
    color: var(--ink-soft);
    text-decoration: none;
    transition: color 0.3s;
}
.footer-lnk:hover {
    color: var(--rust-red);
}

footer .text-xs {
    font-size: 0.9rem !important;
}
footer .text-sm {
    font-size: 1rem !important;
}

.section-title {
    font-size: clamp(2.6rem, 4.6vw, 5.1rem);
}

/* ─── Section visibility (driven from inline style) ─────── */
.section.visible {
    opacity: 1;
    transform: translateY(0);
}
.section.visible .section-title {
    opacity: 1;
    transform: translateX(0);
}
.card.visible {
    transform: translateY(0);
    opacity: 1;
}

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--paper-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--rust-red);
    border-radius: 3px;
}
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 4px;
    }
}

/* ─── Focus states ──────────────────────────────────────── */
button:focus,
a:focus {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 760px) {
    .annotation {
        display: none;
    }
    section {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }
    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
    }
    .mobile-nav-links {
        max-height: calc(100vh - 160px);
        overflow-y: auto;
    }
}

@media (max-height: 600px) {
    .mobile-nav-link {
        font-size: 1.2rem !important;
        padding: 0.4rem 1rem !important;
    }
}

/* Mobile viewport height fix support */
.min-h-screen {
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
}
body {
    overflow-x: hidden;
}

/* Breakpoints (duplicate safeguard) */
@media (max-width: 900px) {
    .menu-toggle {
        display: flex !important;
    }
    .desktop-nav {
        display: none !important;
    }
}
@media (min-width: 901px) {
    .menu-toggle {
        display: none !important;
    }
    .mobile-menu {
        display: none !important;
    }
    .desktop-nav {
        display: flex !important;
    }
}

/* Mobile section padding */
@media (max-width: 768px) {
    section {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }
    .min-h-screen {
        min-height: calc(var(--vh, 1vh) * 100);
    }
}

/* Draw line animation for SVG decorations */
@keyframes drawPath {
    to {
        stroke-dashoffset: 0;
    }
}

/* Rough.js drawn elements inherit font */
#heroRoughLayer text {
    font-family: "Caveat", cursive;
}

/* ─── Field note labels ─────────────────────────────────── */
/* clip-path reveal avoids fighting the per-element inline rotate */
.field-note-lbl {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transition:
        opacity 0.4s ease 0.1s,
        clip-path 0.55s cubic-bezier(0.22, 0.68, 0, 1.1) 0.1s;
}
.section.visible .field-note-lbl {
    opacity: 1;
    clip-path: inset(0 0% 0 0);
}

/* ─── Section rule (grows from centre, under centred titles) ─ */
.section-rule {
    height: 3px;
    width: 0;
    background: var(--rust-red);
    opacity: 0.55;
    transform: rotate(var(--rule-rotate, -1deg));
    transition: width 0.6s cubic-bezier(0.22, 0.68, 0, 1.2) 0.15s;
    transform-origin: center;
    margin: 0 auto 1.5rem;
}
.section.visible .section-rule {
    width: 56px;
}

/* ─── Keyframes ─────────────────────────────────────────── */
@keyframes bbFloat1 {
    0%,
    100% {
        transform: rotate(-0.5deg) translateY(0);
    }
    50% {
        transform: rotate(-0.5deg) translateY(-7px);
    }
}
@keyframes bbFloat2 {
    0%,
    100% {
        transform: rotate(0.8deg) translateY(0);
    }
    50% {
        transform: rotate(0.8deg) translateY(-5px);
    }
}
@keyframes bbFloat3 {
    0%,
    100% {
        transform: rotate(0.6deg) translateY(0);
    }
    50% {
        transform: rotate(0.6deg) translateY(-9px);
    }
}
@keyframes bbFloat4 {
    0%,
    100% {
        transform: rotate(-1deg) translateY(0);
    }
    50% {
        transform: rotate(-1deg) translateY(-6px);
    }
}

@keyframes bbFadeIn {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes markerExpand {
    from {
        transform: scaleX(0) rotate(-0.8deg);
    }
    to {
        transform: scaleX(1) rotate(-0.8deg);
    }
}

@keyframes stampPop {
    0% {
        opacity: 0;
        transform: scale(0.6) rotate(-4deg);
    }
    65% {
        transform: scale(1.08) rotate(-1.2deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(-1.5deg);
    }
}

@keyframes skillPop {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes arrowNudge {
    0%,
    100% {
        transform: translateX(0);
    }
    40% {
        transform: translateX(4px);
    }
    70% {
        transform: translateX(-2px);
    }
}

@keyframes chipScatter {
    from {
        opacity: 0;
        transform: rotate(-0.4deg) translateY(8px);
    }
    to {
        opacity: 1;
        transform: rotate(-0.4deg) translateY(0);
    }
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes annoFade {
    from {
        opacity: 0;
        transform: translateY(-6px) rotate(-1deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotate(-1deg);
    }
}

/* ─── Hero building blocks — float + fade-in ────────────── */
.bb-red {
    animation:
        bbFadeIn 0.7s ease 0.2s both,
        bbFloat1 5.2s ease-in-out 1s infinite;
}
.bb-blue {
    animation:
        bbFadeIn 0.7s ease 0.4s both,
        bbFloat2 6.1s ease-in-out 1.4s infinite;
}
.bb-paper {
    animation:
        bbFadeIn 0.7s ease 0.3s both,
        bbFloat3 7s ease-in-out 1.1s infinite;
}
.bb-gray {
    animation:
        bbFadeIn 0.7s ease 0.55s both,
        bbFloat4 4.8s ease-in-out 1.7s infinite;
}

/* ─── Annotation fade-in ────────────────────────────────── */
.annotation {
    animation: annoFade 0.9s ease 1s both;
}

/* ─── Marker highlight expand ───────────────────────────── */
.marker-hl::before {
    transform-origin: left;
    animation: markerExpand 0.7s ease 2.1s both;
}

/* ─── Badge pills entrance ───────────────────────────────── */
.badge-pill {
    animation: fadeSlideUp 0.5s ease both;
}
.badge-pill:nth-child(1) {
    animation-delay: 0.6s;
}
.badge-pill:nth-child(2) {
    animation-delay: 0.75s;
}
.badge-pill:nth-child(3) {
    animation-delay: 0.9s;
}

/* ─── Stat blocks entrance ───────────────────────────────── */
.stat-block {
    opacity: 0;
    transform: rotate(-0.3deg) translateY(14px);
    transition:
        opacity 0.5s ease,
        transform 0.5s ease;
}
.section.visible .stat-block {
    opacity: 1;
    transform: rotate(-0.3deg) translateY(0);
}
.section.visible .stat-block:nth-child(1) {
    transition-delay: 0.05s;
}
.section.visible .stat-block:nth-child(2) {
    transition-delay: 0.15s;
}
.section.visible .stat-block:nth-child(3) {
    transition-delay: 0.25s;
}
.section.visible .stat-block:nth-child(4) {
    transition-delay: 0.35s;
}

/* ─── Stamp badges pop ───────────────────────────────────── */
.stamp-badge {
    opacity: 0;
    animation-fill-mode: both;
}
.section.visible .stamp-badge {
    animation: stampPop 0.5s ease both;
}
.section.visible .stamp-badge:nth-child(1) {
    animation-delay: 0.1s;
}
.section.visible .stamp-badge:nth-child(2) {
    animation-delay: 0.2s;
}
.section.visible .stamp-badge:nth-child(3) {
    animation-delay: 0.3s;
}
.section.visible .stamp-badge:nth-child(4) {
    animation-delay: 0.4s;
}

/* ─── Skill tiles stagger ────────────────────────────────── */
.skill-tile {
    opacity: 0;
    animation: skillPop 0.4s ease both;
    animation-play-state: paused;
}
.section.visible .skill-tile {
    animation-play-state: running;
}
.section.visible .skill-tile:nth-child(1) {
    animation-delay: 0.05s;
}
.section.visible .skill-tile:nth-child(2) {
    animation-delay: 0.1s;
}
.section.visible .skill-tile:nth-child(3) {
    animation-delay: 0.15s;
}
.section.visible .skill-tile:nth-child(4) {
    animation-delay: 0.2s;
}
.section.visible .skill-tile:nth-child(5) {
    animation-delay: 0.25s;
}
.section.visible .skill-tile:nth-child(6) {
    animation-delay: 0.3s;
}
.section.visible .skill-tile:nth-child(7) {
    animation-delay: 0.35s;
}
.section.visible .skill-tile:nth-child(8) {
    animation-delay: 0.4s;
}

/* ─── Focus arrow nudge ──────────────────────────────────── */
.focus-arr {
    animation: arrowNudge 2.4s ease-in-out 1.5s infinite;
}

/* ─── Tag chips scatter entrance ────────────────────────── */
.tag-chip {
    opacity: 0;
    animation: chipScatter 0.45s ease both;
    animation-play-state: paused;
}
.section.visible .tag-chip {
    animation-play-state: running;
}
.section.visible .tag-chip:nth-child(1) {
    animation-delay: 0s;
}
.section.visible .tag-chip:nth-child(2) {
    animation-delay: 0.07s;
}
.section.visible .tag-chip:nth-child(3) {
    animation-delay: 0.14s;
}
.section.visible .tag-chip:nth-child(4) {
    animation-delay: 0.21s;
}
.section.visible .tag-chip:nth-child(5) {
    animation-delay: 0.28s;
}
.section.visible .tag-chip:nth-child(6) {
    animation-delay: 0.35s;
}

/* ─── Sketch-link underline draw on hover ───────────────── */
.sketch-link {
    border-bottom: none;
    background-image: linear-gradient(var(--rust-red), var(--rust-red));
    background-size: 0% 1.5px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition:
        background-size 0.35s ease,
        color 0.3s;
}
.sketch-link:hover {
    background-size: 100% 1.5px;
    color: var(--hover-red);
}

/* ─── About cards staggered entrance ────────────────────── */
.about-card {
    opacity: 0;
    transform: translateY(16px) rotate(-0.3deg);
    transition:
        opacity 0.5s ease,
        transform 0.5s ease,
        box-shadow 0.3s ease;
}
.section.visible .about-card {
    opacity: 1;
    transform: translateY(0) rotate(-0.3deg);
}
.section.visible .about-card:nth-child(1) {
    transition-delay: 0.05s;
}
.section.visible .about-card:nth-child(2) {
    transition-delay: 0.18s;
}
.section.visible .about-card:nth-child(3) {
    transition-delay: 0.31s;
}
.section.visible .about-card:nth-child(4) {
    transition-delay: 0.44s;
}
.about-card:hover {
    transform: translateY(-4px) rotate(0deg) !important;
    box-shadow: 10px 14px 0 var(--shadow-strong);
}

/* ─── Rough section border ───────────────────────────────── */
.rough-section-border {
    position: absolute;
    pointer-events: none;
    overflow: visible;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.8s ease 0.5s;
}
.section.visible .rough-section-border {
    opacity: 1;
}

/* ─── Section floating doodles ───────────────────────────── */
.section-doodle {
    position: absolute;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.5s ease 0.6s;
}
.section.visible .section-doodle {
    opacity: 1;
}

.sd-cross {
    animation: doodleFloat1 6.5s ease-in-out 1.8s infinite;
}
.sd-circle {
    animation: doodleFloat2 8s ease-in-out 2.3s infinite;
}
.sd-asterisk {
    animation: doodleFloat3 5.5s ease-in-out 2.8s infinite;
}

@keyframes doodleFloat1 {
    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
    40% {
        transform: translate(3px, -6px) rotate(18deg);
    }
    70% {
        transform: translate(-2px, 3px) rotate(-9deg);
    }
}
@keyframes doodleFloat2 {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(-4px, -7px) scale(1.1);
    }
}
@keyframes doodleFloat3 {
    0%,
    100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(45deg);
    }
}

/* ─── Section title scribble underline ───────────────────── */
.title-scribble path {
    stroke-dasharray: 230;
    stroke-dashoffset: 230;
    transition: stroke-dashoffset 0.95s cubic-bezier(0.25, 0.46, 0.45, 0.94)
        0.45s;
}
.section.visible .title-scribble path {
    stroke-dashoffset: 0;
}

/* ─── Section title wobble entrance ─────────────────────── */
.section-title {
    opacity: 0;
}

@keyframes titleWobble {
    0% {
        opacity: 0;
        transform: translateX(-10px);
    }
    35% {
        opacity: 1;
        transform: translateX(5px);
    }
    55% {
        transform: translateX(-3px);
    }
    75% {
        transform: translateX(2px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}
.section.visible .section-title {
    animation: titleWobble 0.7s ease 0.2s both;
}

/* ─── Card "placed by hand" entrance ─────────────────────── */
@keyframes cardPlace {
    0% {
        opacity: 0;
        transform: rotate(-2.2deg) translateY(16px);
    }
    55% {
        transform: rotate(1.5deg) translateY(-3px);
    }
    75% {
        transform: rotate(-0.6deg) translateY(1px);
    }
    100% {
        opacity: 1;
        transform: rotate(0deg) translateY(0);
    }
}

#experience .card.sketch-card,
#projects .card.sketch-card,
#blog .card.sketch-card {
    opacity: 0;
}

#experience.section.visible .card.sketch-card,
#projects.section.visible .card.sketch-card,
#blog.section.visible .card.sketch-card {
    animation: cardPlace 0.55s ease both;
}

#experience.section.visible .grid > .card:nth-child(1),
#projects.section.visible .grid > .card:nth-child(1),
#blog.section.visible .grid > .card:nth-child(1) {
    animation-delay: 0.08s;
}

#experience.section.visible .grid > .card:nth-child(2),
#projects.section.visible .grid > .card:nth-child(2),
#blog.section.visible .grid > .card:nth-child(2) {
    animation-delay: 0.22s;
}

#projects.section.visible .grid > .card:nth-child(3),
#blog.section.visible .grid > .card:nth-child(3) {
    animation-delay: 0.36s;
}

#blog.section.visible .grid > .card:nth-child(4) {
    animation-delay: 0.5s;
}

/* ─── Dog-ear fold on sketch cards ──────────────────────── */
.sketch-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 18px 18px;
    border-color: transparent transparent var(--paper-dark) transparent;
    transition: border-width 0.3s ease;
    opacity: 0.75;
    pointer-events: none;
}
.sketch-card:hover::after {
    border-width: 0 0 30px 30px;
}

/* ─── Skill icon hover wiggle ────────────────────────────── */
@keyframes iconWiggle {
    0% {
        transform: rotate(0deg) scale(1);
    }
    30% {
        transform: rotate(-18deg) scale(1.15);
    }
    60% {
        transform: rotate(10deg) scale(1.08);
    }
    80% {
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(0deg) scale(1);
    }
}
.skill-tile:hover svg {
    animation: iconWiggle 0.45s ease;
}

/* ─── Stamp badge rotation variety ───────────────────────── */
.stamp-badge:nth-child(odd) {
    transform: rotate(-2.2deg);
}
.stamp-badge:nth-child(even) {
    transform: rotate(1.8deg);
}

/* ─── Interest item entrance stagger ─────────────────────── */
.interest-item {
    opacity: 0;
    transform: translateX(-10px);
    transition:
        opacity 0.4s ease,
        transform 0.4s ease,
        background 0.3s,
        border-color 0.3s;
}
.section.visible .interest-item {
    opacity: 1;
    transform: translateX(0);
}
.section.visible .interest-item:nth-child(1) {
    transition-delay: 0.1s;
}
.section.visible .interest-item:nth-child(2) {
    transition-delay: 0.2s;
}
.section.visible .interest-item:nth-child(3) {
    transition-delay: 0.3s;
}
.section.visible .interest-item:nth-child(4) {
    transition-delay: 0.4s;
}
.section.visible .interest-item:hover {
    transform: translateX(0) scale(1.03);
}

/* ─── Focus item entrance stagger ────────────────────────── */
.focus-item {
    opacity: 0;
    transition: opacity 0.45s ease;
}
.section.visible .focus-item {
    opacity: 1;
}
.section.visible .focus-item:nth-child(1) {
    transition-delay: 0.1s;
}
.section.visible .focus-item:nth-child(2) {
    transition-delay: 0.22s;
}
.section.visible .focus-item:nth-child(3) {
    transition-delay: 0.34s;
}
.section.visible .focus-item:nth-child(4) {
    transition-delay: 0.46s;
}

/* ─── Proj-icon bounce on card entry ─────────────────────── */
@keyframes iconBounce {
    0% {
        transform: scale(0) rotate(-15deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.15) rotate(5deg);
        opacity: 1;
    }
    80% {
        transform: scale(0.95) rotate(-2deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}
.section.visible .proj-icon {
    animation: iconBounce 0.6s ease 0.35s both;
}
