/* ============================================================
   Nan Liu — Communication Design Portfolio
   Cute pastel redesign · cream + candy pink + lavender + mint
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
    /* surfaces */
    --paper:        #fff6f2;
    --paper-2:      #ffe9ee;
    --card:         #fffdfb;
    --ink:          #5a3d47;
    --ink-soft:     #7d5a63;
    --muted:        #ab8b94;

    /* brand accent — candy pink + friends */
    --accent:       #d94f82;
    --accent-deep:  #b83d6b;
    --accent-soft:  #ffa6c4;
    --accent-fill:  #ffd6e5;
    --lavender:     #c6abff;
    --mint:         #a9e0c6;
    --peach:        #ffc38b;

    /* dark panels — soft rose brown */
    --dark:         #3b2731;
    --dark-2:       #462f3a;
    --dark-3:       #533e49;

    /* line & shadow */
    --line:         rgba(90, 61, 71, 0.14);
    --line-dark:    rgba(255, 246, 242, 0.16);
    --shadow-sm:    0 6px 20px rgba(216, 128, 158, 0.16);
    --shadow-md:    0 20px 50px rgba(216, 128, 158, 0.22);

    /* type */
    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-body:    "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

    /* radius — rounded & sweet */
    --r-sm: 14px;
    --r-md: 22px;
    --r-lg: 30px;

    /* motion */
    --ease-out:     cubic-bezier(0.22, 1, 0.36, 1);
    --ease-quick:   cubic-bezier(0.25, 1, 0.5, 1);
    --dur:          0.6s;
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
}

body {
    font-family: var(--font-body);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    background:
        radial-gradient(1100px 760px at 88% -8%, rgba(255, 183, 210, 0.55), transparent 62%),
        radial-gradient(900px 860px at -8% 34%, rgba(255, 214, 190, 0.55), transparent 60%),
        radial-gradient(820px 820px at 96% 76%, rgba(198, 171, 255, 0.38), transparent 58%),
        radial-gradient(820px 820px at 6% 88%, rgba(169, 224, 198, 0.42), transparent 58%),
        var(--paper);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; }

/* Hide native cursor when custom cat cursor active (fine pointer only) */
body.has-cursor, body.has-cursor a, body.has-cursor button {
    cursor: none;
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 4px;
    z-index: 1200;
    background: transparent;
}
.scroll-progress span {
    display: block;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--accent), var(--lavender), var(--mint));
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 0.1s linear;
    border-radius: 0 4px 4px 0;
}

/* ---------- Custom cursor (dot + trailing ring) ---------- */
.cursor-dot {
    position: fixed;
    top: 0; left: 0;
    width: 10px; height: 10px;
    margin: -5px 0 0 -5px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1300;
    box-shadow: 0 0 10px rgba(217, 79, 130, 0.7);
}
.cursor-ring {
    position: fixed;
    top: 0; left: 0;
    width: 34px; height: 34px;
    margin: -17px 0 0 -17px;
    border: 1.5px solid var(--accent-soft);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1299;
    transition: width 0.28s ease, height 0.28s ease, margin 0.28s ease, border-color 0.28s ease, background 0.28s ease;
}
body.cursor-hover .cursor-ring {
    width: 46px; height: 46px;
    margin: -23px 0 0 -23px;
    background: rgba(217, 79, 130, 0.1);
    border-color: var(--accent);
}
@media (pointer: coarse) { .cursor-dot, .cursor-ring { display: none; } }

/* ---------- Navbar ---------- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    transition: background 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), border-color 0.4s ease;
    border-bottom: 1px solid transparent;
}
.navbar.is-scrolled {
    background: rgba(255, 246, 242, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: var(--line);
    box-shadow: 0 4px 24px rgba(216, 128, 158, 0.12);
}
.nav-inner {
    max-width: 1220px;
    margin: 0 auto;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.brand-mark {
    width: 40px; height: 40px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-soft));
    color: #fff;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(217, 79, 130, 0.35);
    transition: transform 0.3s var(--ease-out);
}
.brand:hover .brand-mark { transform: rotate(-12deg) scale(1.06); }
.brand-name {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}
.nav-link {
    position: relative;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--ink-soft);
    padding: 6px 1px;
    letter-spacing: 0.2px;
    transition: color 0.3s ease;
}
.nav-link::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    height: 3px;
    width: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), var(--lavender));
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 0.3s var(--ease-quick);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); }
.nav-link.is-active { color: var(--ink); }

.nav-toggle {
    display: none;
    width: 44px; height: 44px;
    background: none;
    border: none;
    position: relative;
    z-index: 1100;
}
.nav-toggle span {
    position: absolute;
    left: 10px; right: 10px;
    height: 3px;
    border-radius: 3px;
    background: var(--ink);
    transition: transform 0.3s var(--ease-out), top 0.3s var(--ease-out), opacity 0.3s ease;
}
.nav-toggle span:nth-child(1) { top: 16px; }
.nav-toggle span:nth-child(2) { top: 24px; }
.nav-toggle.is-open span:nth-child(1) { top: 20px; transform: rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { top: 20px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 32px 60px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    width: 560px; height: 560px;
    top: -150px; right: -100px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%,
        transparent 56%,
        rgba(255, 166, 196, 0.55) 58%, rgba(255, 166, 196, 0.55) 61%,
        transparent 62%);
    animation: orbit 22s linear infinite;
    pointer-events: none;
}
.hero::after {
    content: "";
    position: absolute;
    width: 300px; height: 300px;
    top: 20%; left: -120px;
    border-radius: 50%;
    background: rgba(198, 171, 255, 0.35);
    filter: blur(4px);
    animation: orbit 30s linear infinite reverse;
    pointer-events: none;
}
@keyframes orbit {
    to { transform: rotate(360deg); }
}
.hero-inner {
    max-width: 1220px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 60px;
    position: relative;
    z-index: 2;
}

.hero-kicker {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 24px;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 8px 18px;
    background: var(--accent-fill);
    border-radius: var(--r-lg);
    width: fit-content;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3.4rem, 11vw, 8.5rem);
    line-height: 0.92;
    font-weight: 320;
    letter-spacing: -0.02em;
    margin-bottom: 28px;
}
.hero-line {
    display: block;
    overflow: hidden;
}
.hero-name {
    display: inline-block;
}
.accent-dot {
    color: var(--accent);
    font-style: normal;
}

.hero-subtitle {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ink-soft);
}
.hero-subtitle-2 {
    font-size: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 22px;
}

.hero-tagline {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 21px;
    color: var(--ink);
    max-width: 22ch;
    line-height: 1.4;
    padding: 14px 20px;
    border-left: 4px solid var(--accent-soft);
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px var(--r-md) var(--r-md) var(--r-md);
    margin-bottom: 36px;
}

.hero-scroll {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    transition: gap 0.3s var(--ease-out), color 0.3s ease;
}
.hero-scroll .scroll-arrow {
    width: 26px; height: 26px;
    stroke: var(--accent);
    transition: transform 0.4s var(--ease-out);
}
.hero-scroll:hover { gap: 18px; color: var(--accent); }
.hero-scroll:hover .scroll-arrow { transform: translateX(6px); }

/* hero visual */
.hero-visual {
    position: relative;
    transition: transform 0.2s ease-out;
}
.portrait-frame {
    position: relative;
    width: min(400px, 82vw);
    margin: 0 auto;
    aspect-ratio: 1 / 1;
}
.portrait-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 3px dashed var(--accent-soft);
    border-radius: 50%;
    transform: translate(16px, 16px);
    transition: transform 0.5s var(--ease-out);
    pointer-events: none;
}
.portrait-frame:hover::before { transform: translate(10px, 10px) rotate(8deg); }
.portrait-inner {
    position: relative;
    width: 100%; height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: var(--card);
    box-shadow: var(--shadow-md);
    border: 6px solid #fff;
}
.portrait-img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.floating-badge {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 20px;
    background: #fff;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    border-radius: 60px;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--accent-fill);
    white-space: nowrap;
    animation: float 4s ease-in-out infinite;
    z-index: 5;
}
.badge-1 { top: 10%; right: -4%; background: #fff; }
.badge-2 { bottom: 16%; left: -6%; background: #fff; animation-delay: 2s; }
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ---------- Section base ---------- */
main { display: block; }

.section-head {
    display: flex;
    align-items: baseline;
    gap: 18px;
    margin-bottom: 14px;
}
.section-index {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}
.section-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: inherit;
    opacity: 0.85;
}

/* ---------- About ---------- */
.about {
    max-width: 1220px;
    margin: 0 auto;
    padding: 140px 32px 150px;
}
.about-wrapper {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 80px;
    align-items: start;
    margin-top: 40px;
}
.about-lead {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.05;
    font-weight: 340;
    letter-spacing: -0.01em;
    margin-bottom: 40px;
}
.about-lead {
    position: relative;
}
.about-lead::after {
    content: "☆";
    position: absolute;
    top: -16px; right: 8px;
    font-size: 34px;
    color: var(--lavender);
    animation: spin 9s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.about-text p {
    font-size: 17px;
    color: var(--ink-soft);
    max-width: 62ch;
    margin-bottom: 22px;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
}
.tag-badge {
    display: inline-block;
    padding: 12px 24px;
    background: #fff;
    border: 2px solid var(--accent-fill);
    border-radius: 60px;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--ink);
    transition: transform 0.35s var(--ease-out), box-shadow 0.35s ease, border-color 0.3s ease, background 0.3s ease;
}
.tag-badge:nth-child(2) { border-color: rgba(198,171,255,0.7); }
.tag-badge:nth-child(4) { border-color: rgba(169,224,198,0.85); }
.tag-badge:hover {
    transform: translateY(-4px) rotate(-2deg);
    box-shadow: var(--shadow-sm);
    border-color: var(--accent);
    background: var(--accent-fill);
}

.about-visual {
    position: sticky;
    top: 110px;
}
.portrait-crop {
    position: relative;
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 6px solid #fff;
}
.portrait-crop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(59, 39, 49, 0.35), transparent 32%);
}
.portrait-crop img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    transition: transform 0.8s var(--ease-out);
}
.about-visual:hover .portrait-crop img { transform: scale(1.04); }
.crop-caption {
    display: block;
    margin-top: 12px;
    font-size: 12.5px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    text-align: right;
}

/* ---------- Panels (semester sections) ---------- */
.panel {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 140px 32px;
    overflow: hidden;
}
.panel--dark {
    color: var(--paper);
    background-image: linear-gradient(180deg,
        rgba(59, 39, 49, 0.93), rgba(59, 39, 49, 0.88));
}
.panel--light {
    color: var(--ink);
    background-image: linear-gradient(180deg,
        rgba(255, 246, 242, 0.95), rgba(255, 230, 238, 0.92));
}
.panel-inner {
    max-width: 1220px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}
.panel-inner--center {
    display: grid;
    place-items: center;
    min-height: 62vh;
}
.panel-subtitle {
    font-size: 18px;
    margin-bottom: 54px;
    opacity: 0.85;
}
.panel--light .panel-subtitle { color: var(--ink-soft); }
.panel--light .section-index { color: var(--accent); }
.panel--light .section-label { color: var(--ink); }

/* Semester backgrounds */
.semester-1 { background-image:
    linear-gradient(180deg, rgba(59,39,49,0.93), rgba(59,39,49,0.86)),
    url('semester1-bg.jpg'); }
.semester-3 { background-image:
    linear-gradient(180deg, rgba(59,39,49,0.94), rgba(59,39,49,0.9)),
    url('semester3-bg.jpg'); }
.semester-4 { background-image:
    linear-gradient(180deg, rgba(59,39,49,0.95), rgba(59,39,49,0.9)),
    url('semester4-bg.jpg'); }
.semester-2 { background-image:
    linear-gradient(180deg, rgba(255,246,242,0.95), rgba(255,230,238,0.92)),
    url('semester2-bg.jpg'); }

/* ---------- Project rows (Semester 1) ---------- */
.project-links { display: flex; flex-direction: column; }
.project-row {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 26px 6px;
    border-top: 1px solid var(--line-dark);
    transition: padding-left 0.4s var(--ease-out), background 0.4s ease;
    border-radius: var(--r-sm);
}
.project-row:last-child { border-bottom: 1px solid var(--line-dark); }
.row-index {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--accent-soft);
    font-variant-numeric: tabular-nums;
}
.row-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3.4vw, 2.5rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.01em;
}
.row-title em { color: var(--accent-soft); }
.row-arrow {
    font-size: 26px;
    color: var(--paper);
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity 0.35s ease, transform 0.4s var(--ease-out);
}
.project-row:hover {
    padding-left: 22px;
    background: rgba(255, 214, 229, 0.12);
}
.project-row:hover .row-arrow {
    opacity: 1;
    transform: translateX(0);
}
.project-row:hover .row-title { font-style: italic; }
.project-row--ghost .row-title em { font-style: italic; }

/* ---------- Semester 2 cards ---------- */
.s2-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 26px;
}
.s2-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 38px;
    min-height: 250px;
    padding: 28px 30px;
    border: 2px solid var(--accent-fill);
    border-radius: var(--r-lg);
    position: relative;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-sm);
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s ease, border-color 0.3s ease, background 0.4s ease;
    overflow: hidden;
}
.s2-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--accent), var(--lavender));
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 0.4s var(--ease-quick);
}
.s2-card:hover {
    transform: translateY(-8px);
    background: #fff;
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}
.s2-card:hover::before { transform: scaleX(1); }
.s2-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.s2-num {
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 600;
    color: var(--accent);
    transition: color 0.3s ease;
}
.s2-open {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.3s ease, transform 0.4s var(--ease-out), color 0.3s ease;
}
.s2-card:hover .s2-open {
    opacity: 1;
    transform: translateX(0);
    color: var(--accent);
}
.s2-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.s2-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--ink);
}
.s2-desc {
    font-size: 14.5px;
    color: var(--ink-soft);
    line-height: 1.55;
}
.s2-pdf {
    align-self: flex-start;
    margin-top: 6px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-fill);
    padding: 5px 12px;
    border-radius: 30px;
}

/* ---------- Report card (S3) ---------- */
.report-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    text-align: left;
    padding: 10px 0;
    position: relative;
}
.report-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 9vw, 7rem);
    font-weight: 340;
    line-height: 0.94;
    letter-spacing: -0.02em;
}
.report-title em { color: var(--accent-soft); font-style: italic; }
.report-meta {
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.7;
}
.report-arrow {
    font-size: 40px;
    color: var(--accent-soft);
    transition: transform 0.5s var(--ease-out);
}
.report-card:hover .report-title { font-style: italic; }
.report-card:hover .report-arrow { transform: translateX(18px) rotate(-8deg); }

/* ---------- Tasks grid (S4) ---------- */
.tasks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}
.task-item {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.task-cover {
    position: relative;
    display: block;
    border-radius: var(--r-md);
    overflow: hidden;
    aspect-ratio: 4 / 5;
    background: var(--dark-3);
    box-shadow: var(--shadow-sm);
    border: 4px solid rgba(255, 255, 255, 0.22);
    transition: transform 0.45s var(--ease-out), box-shadow 0.45s ease, border-color 0.3s ease;
}
.task-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(59,39,49,0.5), transparent 42%);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.task-cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.7s var(--ease-out), filter 0.5s ease;
}
/* zoom badge on hover */
.task-cover .zoom-hint {
    position: absolute;
    right: 14px; bottom: 14px;
    z-index: 2;
    width: 42px; height: 42px;
    display: grid; place-items: center;
    font-size: 18px;
    color: #fff;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 6px 16px rgba(217, 79, 130, 0.5);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.35s ease, transform 0.4s var(--ease-out);
}
.task-item:hover .task-cover {
    transform: translateY(-10px);
    border-color: var(--accent-soft);
    box-shadow: 0 26px 50px rgba(217, 79, 130, 0.35);
}
.task-item:hover .task-cover img {
    transform: scale(1.14);
    filter: saturate(1.2) brightness(1.04);
}
.task-item:hover .task-cover::after { opacity: 1; }
.task-item:hover .task-cover .zoom-hint {
    opacity: 1;
    transform: scale(1);
}
.task-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--paper);
    transition: color 0.3s ease, transform 0.3s var(--ease-out);
}
.task-item:hover .task-label { color: var(--accent); padding-left: 4px; }
.task-num {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 500;
    color: var(--accent-soft);
    line-height: 1;
    transition: color 0.3s ease;
}
.task-item:hover .task-num { color: var(--accent); }
.tasks-final {
    display: flex;
    justify-content: center;
    margin-top: 56px;
}
.task-item--final { width: min(320px, 60%); }
.task-item--final .task-cover { aspect-ratio: 4 / 5.2; }

/* ---------- Footer ---------- */
.site-footer {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    padding: 56px 32px;
    max-width: 1220px;
    margin: 0 auto;
    border-top: 1px solid var(--line);
}
.footer-name {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 2px;
    background: linear-gradient(90deg, var(--accent), var(--lavender));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.footer-year {
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- Back to top — little paw ---------- */
.back-to-top {
    position: fixed;
    right: 26px;
    bottom: 26px;
    width: 54px; height: 54px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-soft));
    color: #fff;
    font-size: 20px;
    box-shadow: 0 8px 22px rgba(217, 79, 130, 0.4);
    cursor: pointer;
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s var(--ease-out), box-shadow 0.3s ease;
    z-index: 900;
}
.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.back-to-top:hover {
    transform: translateY(-4px) ;
    box-shadow: 0 12px 28px rgba(217, 79, 130, 0.5);
}
.back-to-top:hover::after {
    content: "🐾";
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    font-size: 20px;
    animation: pop 0.4s var(--ease-out);
}
.back-to-top > span, .back-to-top:not(:hover)::after { display: block; }
@keyframes pop { 0% { transform: translate(-50%,-50%) scale(0.4); opacity: 0; } 100% { transform: translate(-50%,-50%) scale(1); opacity: 1; } }

/* ---------- Modal ---------- */
.modal {
    display: grid;
    place-items: center;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(59, 39, 49, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.35s ease, visibility 0s 0.35s;
}
.modal.is-open {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.35s ease;
}
.modal-content {
    position: relative;
    width: min(460px, 90vw);
    padding: 46px 42px 40px;
    background: var(--card);
    border-radius: var(--r-lg);
    border: 3px solid var(--accent-fill);
    text-align: center;
    box-shadow: 0 30px 80px rgba(217, 79, 130, 0.28);
    transform: translateY(24px) scale(0.96);
    transition: transform 0.4s var(--ease-out);
}
.modal.is-open .modal-content { transform: translateY(0) scale(1); }
.modal-content h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--ink);
}
.modal-content p {
    font-size: 16px;
    color: var(--ink-soft);
    margin-bottom: 30px;
}
.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 30px;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-soft));
    border-radius: var(--r-md);
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease, filter 0.3s ease;
}
.modal-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(217, 79, 130, 0.4);
    filter: brightness(1.05);
}
.modal-btn--alt {
    background: linear-gradient(135deg, var(--lavender), #a879e8);
}
.modal-btn--alt:hover { box-shadow: 0 12px 30px rgba(160, 120, 232, 0.45); }
.btn-icon { font-size: 22px; line-height: 1; }
.close-modal {
    position: absolute;
    top: 12px; right: 14px;
    font-size: 28px;
    line-height: 1;
    font-weight: 400;
    color: var(--muted);
    background: none;
    border: none;
    cursor: pointer;
    width: 44px; height: 44px;
    border-radius: 50%;
    transition: color 0.3s ease, transform 0.3s var(--ease-out), background 0.3s ease;
}
.close-modal:hover { color: var(--accent); background: var(--accent-fill); transform: rotate(90deg); }

body.modal-open { overflow: hidden; }

/* ============================================================
   Scroll reveal (only active when .js present — fail-open)
   ============================================================ */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition:
        opacity 0.8s var(--ease-out),
        transform 0.8s var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}
.js [data-reveal].in {
    opacity: 1;
    transform: none;
}

/* ============================================================
   Mobile menu (overlay)
   ============================================================ */
@media (max-width: 900px) {
    .nav-toggle { display: block; }

    .nav-links {
        position: fixed;
        inset: 0;
        flex-direction: column;
        justify-content: center;
        gap: 8px;
        padding: 40px 24px;
        background: var(--paper);
        transform: translateX(100%);
        transition: transform 0.5s var(--ease-out);
        z-index: 1050;
    }
    .nav-toggle.is-open ~ .nav-links,
    body.menu-open .nav-links { transform: translateX(0); }
    .nav-link {
        font-size: 30px;
        font-family: var(--font-display);
        font-weight: 400;
        padding: 8px 4px;
    }
    .nav-link::after { display: none; }
    .nav-toggle.is-open span { background: var(--ink); }
    body.menu-open { overflow: hidden; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 70px;
        text-align: center;
    }
    .hero-text { display: flex; flex-direction: column; align-items: center; }
    .hero-kicker { }
    .hero-tagline { border-left: none; padding: 16px 22px; margin-left: 0; text-align: left; }
    .hero-scroll { justify-content: center; }

    .about-wrapper {
        grid-template-columns: 1fr;
        gap: 60px;
    }
    .about-visual { position: static; }
    .portrait-crop { max-width: 420px; margin: 0 auto; }
    .crop-caption { text-align: center; }

    .tasks-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    .nav-inner { padding: 14px 20px; }
    .hero { padding: 100px 22px 50px; }
    .about { padding: 90px 22px; }
    .panel { padding: 90px 22px; }

    .hero-subtitle, .hero-subtitle-2 { text-align: center; }
    .portrait-frame { width: min(300px, 84vw); }
    .badge-1 { right: -2%; }
    .badge-2 { left: -4%; }

    .project-row {
        grid-template-columns: 36px 1fr auto;
        gap: 14px;
        padding: 22px 4px;
    }
    .row-arrow { display: none; }

    .s2-grid { grid-template-columns: 1fr; }
    .tasks-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
    .task-item--final { width: 100%; }
    .site-footer { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Reduced motion — honor the preference
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .js [data-reveal] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .hero-visual { transform: none !important; }
    .floating-badge { animation: none !important; }
    .cursor-dot, .cursor-ring { display: none; }
}