/* ═══════════════════════════════════════════════════════════════
   DIGITAL FABRICATION — Alejandro?
   Editorial Zine-Brutalism: dark base, electric teal accent, mono+serif
   ═══════════════════════════════════════════════════════════════ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

/* ── Design Tokens ── */
:root {
     /* Colors */
    --bg:           #0e0e0e;
    --bg-2:         #161616;
    --bg-3:         #1e1e1e;
    --surface:      #242424;
    --border:       #2e2e2e;
    --border-bright:#3e3e3e;
    --text:         #e8e4dc;
    --text-muted:   #7a7470;
    --text-dim:     #4a4542;
    --accent:       #00d4aa;      /* electric teal */
    --accent-dim:   rgba(0,212,170,0.10);
    --accent-glow:  rgba(0,212,170,0.22);
    --link:         #00d4aa;
    --link-hover:   #4deac2;
    --code-bg:      #111111;

    /* Typography */
    --font-display: 'Syne', system-ui, sans-serif;
    --font-mono:    'Space Mono', 'Fira Mono', 'Consolas', monospace;
    --font-body:    'Space Mono', 'Consolas', monospace;

    /* Type scale */
    --text-xs:   0.75rem;
    --text-sm:   0.875rem;
    --text-base: 0.9375rem;
    --text-lg:   1.0625rem;
    --text-xl:   1.25rem;
    --text-2xl:  1.75rem;
    --text-3xl:  2.25rem;
    --text-4xl:  3rem;
    --text-5xl:  4rem;

    /* Spacing */
    --sp-1:  0.25rem;
    --sp-2:  0.5rem;
    --sp-3:  0.75rem;
    --sp-4:  1rem;
    --sp-6:  1.5rem;
    --sp-8:  2rem;
    --sp-12: 3rem;
    --sp-16: 4rem;
    --sp-24: 6rem;

    /* Radii */
    --r-sm:   3px;
    --r-md:   6px;
    --r-lg:   10px;

    /* Transitions */
    --ease:         cubic-bezier(0.16, 1, 0.3, 1);
    --t-fast:       0.15s;
    --t-base:       0.25s;
    --t-slow:       0.4s;

    /* Layout */
    --max-w:   900px;
    --max-w-lg: 1200px;
}

/* ── Reset ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    background-color: var(--bg);
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--border-bright);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ── Focus Visible ── */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: var(--r-sm);
}

/* ── Grain Texture (pseudo-element on body) ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.55;
    mix-blend-mode: overlay;
}

/* ── Base ── */
body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--text);
    background-color: var(--bg);
    padding: var(--sp-8) var(--sp-4);
    cursor: crosshair;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Animations ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes borderGrow {
    from { width: 0; }
    to   { width: 100%; }
}

@keyframes accentPulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
    50%       { box-shadow: 0 0 0 6px transparent; }
}

/* ── Staggered page-load reveals ── */
.top-nav {
    animation: fadeIn var(--t-slow) var(--ease) both;
}

header {
    animation: fadeUp var(--t-slow) var(--ease) both;
    animation-delay: 0.08s;
}

.content,
.assignment-list {
    animation: fadeUp var(--t-slow) var(--ease) both;
    animation-delay: 0.2s;
}

.site-footer {
    animation: fadeIn var(--t-slow) var(--ease) both;
    animation-delay: 0.35s;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    animation: slideInLeft var(--t-slow) var(--ease) both;
}

/* Assignment section stagger */
.assignment-section {
    animation: fadeUp 0.5s var(--ease) both;
}
.assignment-section:nth-child(1) { animation-delay: 0.28s; }
.assignment-section:nth-child(2) { animation-delay: 0.36s; }
.assignment-section:nth-child(3) { animation-delay: 0.44s; }
.assignment-section:nth-child(4) { animation-delay: 0.52s; }
.assignment-section:nth-child(5) { animation-delay: 0.60s; }

/* Nav link stagger */
.nav-link {
    animation: fadeUp var(--t-slow) var(--ease) both;
}
.nav-link:nth-child(1) { animation-delay: 0.12s; }
.nav-link:nth-child(2) { animation-delay: 0.20s; }
.nav-link:nth-child(3) { animation-delay: 0.28s; }
.nav-link:nth-child(4) { animation-delay: 0.36s; }

/* Content children stagger */
.content > p,
.content > h2 {
    animation: fadeUp 0.45s var(--ease) both;
}
.content > *:nth-child(1) { animation-delay: 0.28s; }
.content > *:nth-child(2) { animation-delay: 0.36s; }
.content > *:nth-child(3) { animation-delay: 0.44s; }
.content > *:nth-child(4) { animation-delay: 0.52s; }
.content > *:nth-child(5) { animation-delay: 0.60s; }

/* Page title underline reveal */
.page-title {
    position: relative;
    padding-bottom: var(--sp-4);
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--accent);
    animation: borderGrow 0.7s var(--ease) both;
    animation-delay: 0.3s;
    width: 100%;
}

/* Figure / media hover lift */
figure img,
figure video,
.screenshot img,
.screenshot video,
.video-container video {
    transition: transform var(--t-base) var(--ease),
                box-shadow var(--t-base) var(--ease);
}

figure img:hover,
figure video:hover,
.screenshot img:hover,
.screenshot video:hover,
.video-container video:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.5), 0 0 0 1px var(--accent-dim);
}

/* ── Custom Cursor ── */
.cursor-dot {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: transform var(--t-fast) var(--ease), opacity 0.3s ease;
    mix-blend-mode: difference;
    opacity: 0;
}

.cursor-ring {
    position: fixed;
    width: 38px;
    height: 38px;
    border: 1.5px solid var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width var(--t-base) var(--ease),
                height var(--t-base) var(--ease),
                border-color var(--t-base) ease,
                opacity var(--t-base) ease;
    opacity: 0;
    mix-blend-mode: difference;
}

body:hover .cursor-dot,
body:hover .cursor-ring {
    opacity: 1;
}

/* ── Layout ── */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: var(--sp-8) var(--sp-4);
}

/* ── Typography ── */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
    line-height: 1.15;
}

h1 {
    font-size: var(--text-3xl);
    font-weight: 800;
    margin-bottom: var(--sp-4);
}

h2 {
    font-size: var(--text-xl);
    font-weight: 700;
    margin-top: var(--sp-8);
    margin-bottom: var(--sp-4);
    color: var(--text);
}

h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-top: var(--sp-6);
    margin-bottom: var(--sp-3);
}

/* ── Homepage Name ── */
.name {
    font-family: var(--font-display);
    font-size: var(--text-5xl);
    font-weight: 800;
    line-height: 0.95;
    margin-bottom: var(--sp-6);
    letter-spacing: -0.03em;
    /* subtle amber left gutter accent */
    padding-left: var(--sp-4);
    border-left: 4px solid var(--accent);
}

/* ── Page Title (assignment pages) ── */
.page-title {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 800;
    margin-bottom: var(--sp-8);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

/* ── Bio ── */
.bio {
    font-size: var(--text-base);
    line-height: 1.9;
    color: var(--text-muted);
    margin-bottom: var(--sp-12);
    max-width: 560px;
    font-family: var(--font-mono);
}

/* ── Navigation ── */
.nav-links {
    display: flex;
    gap: var(--sp-6);
    flex-wrap: wrap;
    margin-top: var(--sp-8);
    padding-top: var(--sp-6);
    border-top: 1px solid var(--border);
}

.nav-link {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-decoration: none;
    padding: var(--sp-2) 0;
    text-transform: lowercase;
    letter-spacing: 0.04em;
    position: relative;
    transition: color var(--t-base) ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width var(--t-base) var(--ease);
}

.nav-link:hover {
    color: var(--accent);
}

.nav-link:hover::after {
    width: 100%;
}

/* ── Top Navigation (back link) ── */
.top-nav {
    margin-bottom: var(--sp-8);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--border);
}

.back-link {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-decoration: none;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color var(--t-base) ease;
    padding: var(--sp-2) 0;
}

.back-link:hover {
    color: var(--accent);
}

/* ── Content ── */
.content {
    margin-top: var(--sp-8);
}

.content p {
    margin-bottom: var(--sp-6);
    line-height: 1.85;
    font-size: var(--text-base);
    color: var(--text-muted);
}

/* ── Section Number Decoration ── */
.assignment-section {
    position: relative;
    margin-bottom: var(--sp-12);
    padding-bottom: var(--sp-8);
    border-bottom: 1px solid var(--border);
}

.assignment-section:last-child {
    border-bottom: none;
}

/* Section h2: styled with accent accent marker */
.assignment-section > h2 {
    display: flex;
    align-items: baseline;
    gap: var(--sp-3);
    color: var(--text);
    margin-top: 0;
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--sp-6);
}

/* ── Assignment List (index) ── */
.assignment-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    margin-top: var(--sp-8);
}

.assignment-card {
    display: grid;
    grid-template-columns: 3rem 1fr auto;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-6);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    text-decoration: none;
    color: var(--text);
    background: var(--bg-2);
    transition: border-color var(--t-base) ease,
                background var(--t-base) ease,
                transform var(--t-base) var(--ease),
                box-shadow var(--t-base) ease;
    animation: fadeUp 0.5s var(--ease) both;
}

.assignment-card:nth-child(1) { animation-delay: 0.28s; }
.assignment-card:nth-child(2) { animation-delay: 0.34s; }
.assignment-card:nth-child(3) { animation-delay: 0.40s; }
.assignment-card:nth-child(4) { animation-delay: 0.46s; }
.assignment-card:nth-child(5) { animation-delay: 0.52s; }
.assignment-card:nth-child(6) { animation-delay: 0.58s; }
.assignment-card:nth-child(7) { animation-delay: 0.64s; }
.assignment-card:nth-child(8) { animation-delay: 0.70s; }

.assignment-card:hover {
    border-color: var(--accent);
    background: var(--bg-3);
    transform: translateY(-2px) translateX(3px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.4), inset 0 0 0 1px var(--accent-dim);
}

.assignment-number {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    letter-spacing: -0.04em;
}

.assignment-info h2 {
    margin: 0 0 var(--sp-1);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text);
    border: none;
    padding: 0;
}

.assignment-info p {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-family: var(--font-mono);
    line-height: 1.5;
    animation: none;
}

.assignment-arrow {
    font-size: var(--text-lg);
    color: var(--text-dim);
    transition: color var(--t-base) ease, transform var(--t-base) var(--ease);
}

.assignment-card:hover .assignment-arrow {
    color: var(--accent);
    transform: translateX(5px);
}

/* ── Figure / Screenshot ── */
figure,
.screenshot {
    margin: var(--sp-6) 0 var(--sp-8);
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
}

figure img,
.screenshot img {
    max-width: 100%;
    max-height: 70vh;
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

figcaption,
.caption {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-muted);
    padding: var(--sp-3) var(--sp-4);
    border-top: 1px solid var(--border);
    line-height: 1.5;
    font-style: normal;
}

/* Legacy .screenshot > p.caption */
.screenshot > p.caption {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-muted);
    padding: var(--sp-3) var(--sp-4);
    border-top: 1px solid var(--border);
    line-height: 1.5;
    margin: 0;
}

/* ── Video ── */
figure video,
.video-container video,
.screenshot video {
    max-width: 100%;
    max-height: 70vh;
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    background: #000;
}

.video-container {
    margin: var(--sp-6) 0 var(--sp-8);
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
}

.video-container > p.caption {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-muted);
    padding: var(--sp-3) var(--sp-4);
    border-top: 1px solid var(--border);
    line-height: 1.5;
    margin: 0;
}

/* ── Links ── */
.content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--t-base) ease, color var(--t-base) ease;
}

.content a:hover {
    color: var(--link-hover);
    border-bottom-color: var(--link-hover);
}

/* Download links */
.content a[download],
.content a[href$=".zip"],
.content a[href$=".svg"],
.content a[href$=".py"] {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid rgba(245,166,35,0.3);
    border-radius: var(--r-sm);
    padding: var(--sp-2) var(--sp-3);
    transition: background var(--t-base) ease,
                border-color var(--t-base) ease;
    margin-top: var(--sp-2);
}

.content a[download]:hover,
.content a[href$=".zip"]:hover,
.content a[href$=".svg"]:hover,
.content a[href$=".py"]:hover {
    background: rgba(245,166,35,0.2);
    border-color: var(--accent);
    color: var(--link-hover);
    border-bottom-color: transparent;
}

/* ── Code Blocks ── */
pre {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.7;
    background: var(--code-bg) !important;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--r-md);
    padding: var(--sp-6) var(--sp-8);
    overflow-x: auto;
    margin: var(--sp-6) 0;
    tab-size: 2;
    -webkit-overflow-scrolling: touch;
}

/* Prism: let the theme color tokens, don't double-box the inner code element */
pre > code,
pre > code[class*="language-"] {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: inherit !important;
    font-family: inherit !important;
    line-height: inherit !important;
    white-space: pre !important;
    word-spacing: normal;
    word-break: normal;
    overflow: visible !important;
    display: block;
}

/* ── Inline code ── */
code:not([class]) {
    font-family: var(--font-mono);
    background: var(--surface);
    color: var(--accent);
    padding: 0.12em 0.4em;
    border-radius: var(--r-sm);
    font-size: 0.875em;
    border: 1px solid var(--border);
}

/* ── Lists ── */
.content ul,
.content ol {
    margin: 0 0 var(--sp-6) var(--sp-6);
    color: var(--text-muted);
}

.content li {
    margin-bottom: var(--sp-2);
    line-height: 1.75;
}

/* ── Strong ── */
strong {
    color: var(--text);
    font-weight: 700;
}

/* ── Footer ── */
.site-footer {
    margin-top: var(--sp-16);
    padding-top: var(--sp-6);
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-dim);
    letter-spacing: 0.04em;
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--t-base) ease;
}

.site-footer a:hover {
    color: var(--accent);
}

/* ── WIP page (09) ── */
.wip-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--sp-8) 0 var(--sp-16);
    gap: var(--sp-6);
}

.wip-wrap h2 {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0;
    border: none;
    padding: 0;
}

.wip-wrap p {
    color: var(--text-muted);
    font-size: var(--text-sm);
    text-align: center;
    max-width: 380px;
    line-height: 1.7;
    margin: 0;
    animation: none;
}

#wip-canvas {
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    display: block;
}

/* ── Pixel Cat ── */
.pixel-cat {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9000;
    pointer-events: none;
    transition: left 0.05s linear;
    filter: drop-shadow(0 0 6px var(--accent-dim));
}

.cat-body {
    position: relative;
    width: 40px;
    height: 32px;
    image-rendering: pixelated;
}

.cat-head {
    position: absolute;
    top: 0;
    left: 8px;
    width: 24px;
    height: 16px;
    background: linear-gradient(135deg, #d4cfca 20%, #8B4513 50%, #5c3317 80%);
    border-radius: 2px;
}

.cat-ear {
    position: absolute;
    top: -6px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
}

.cat-ear-left {
    left: 8px;
    border-bottom: 8px solid #8B4513;
}

.cat-ear-right {
    left: 22px;
    border-bottom: 8px solid #5c3317;
}

.cat-ear::after {
    content: '';
    position: absolute;
    top: 3px;
    left: -3px;
    width: 0;
    height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-bottom: 5px solid rgba(255,153,153,0.7);
}

.cat-eye {
    position: absolute;
    top: 4px;
    width: 6px;
    height: 6px;
    background: #e8e4dc;
    border-radius: 50%;
}

.cat-eye::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 2px;
    width: 3px;
    height: 4px;
    background: #0e0e0e;
    border-radius: 50%;
}

.cat-eye-left  { left: 12px; }
.cat-eye-right { left: 22px; }

.cat-nose {
    position: absolute;
    top: 10px;
    left: 18px;
    width: 4px;
    height: 3px;
    background: var(--accent);
    border-radius: 1px;
}

.cat-mouth {
    position: absolute;
    top: 12px;
    left: 16px;
    width: 8px;
    height: 3px;
    border-bottom: 2px solid #4a4542;
    border-radius: 0 0 4px 4px;
}

.cat-whiskers {
    position: absolute;
    top: 10px;
    width: 10px;
    height: 1px;
    background: #4a4542;
}

.cat-whiskers::before,
.cat-whiskers::after {
    content: '';
    position: absolute;
    left: 0;
    width: 10px;
    height: 1px;
    background: #4a4542;
}

.cat-whiskers::before { top: -3px; transform: rotate(-10deg); }
.cat-whiskers::after  { top: 3px;  transform: rotate(10deg);  }

.cat-whiskers-left  { left: 2px;  transform: scaleX(-1); }
.cat-whiskers-right { left: 28px; }

.cat-torso {
    position: absolute;
    top: 14px;
    left: 4px;
    width: 32px;
    height: 14px;
    background: linear-gradient(90deg, #d4cfca 0%, #8B4513 25%, #5c3317 50%, #8B4513 75%, #d4cfca 100%);
    border-radius: 4px 4px 2px 2px;
}

.cat-leg {
    position: absolute;
    bottom: 0;
    width: 6px;
    height: 8px;
    border-radius: 0 0 2px 2px;
}

.cat-leg-front-left  { left: 6px;  background: #d4cfca; }
.cat-leg-front-right { left: 14px; background: #8B4513; }
.cat-leg-back-left   { left: 22px; background: #d4cfca; }
.cat-leg-back-right  { left: 30px; background: #5c3317; }

.cat-tail {
    position: absolute;
    top: 12px;
    left: -8px;
    width: 12px;
    height: 6px;
    background: linear-gradient(90deg, #5c3317 0%, #8B4513 60%);
    border-radius: 4px 0 0 4px;
    transform-origin: right center;
    animation: tailIdle 2s ease-in-out infinite;
}

/* ── Cat animations ── */
@keyframes tailIdle {
    0%, 100% { transform: rotate(-5deg); }
    50%       { transform: rotate(10deg); }
}

@keyframes tailWalk {
    0%, 100% { transform: rotate(-15deg); }
    50%       { transform: rotate(15deg); }
}

@keyframes walkLegs {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-2px); }
}

@keyframes blink {
    0%, 90%, 100% { transform: scaleY(1); }
    95%            { transform: scaleY(0.1); }
}

@keyframes sleep {
    0%, 100% { transform: scaleY(0.2); }
    50%       { transform: scaleY(0.3); }
}

.pixel-cat.walking .cat-tail {
    animation: tailWalk 0.3s ease-in-out infinite;
}

.pixel-cat.walking .cat-leg-front-left,
.pixel-cat.walking .cat-leg-back-right {
    animation: walkLegs 0.2s ease-in-out infinite;
}

.pixel-cat.walking .cat-leg-front-right,
.pixel-cat.walking .cat-leg-back-left {
    animation: walkLegs 0.2s ease-in-out infinite 0.1s;
}

.pixel-cat.idle .cat-eye::after {
    animation: blink 4s ease-in-out infinite;
}

.pixel-cat.sleeping .cat-eye::after {
    animation: sleep 2s ease-in-out infinite;
}

.pixel-cat.sleeping .cat-tail {
    animation: tailIdle 3s ease-in-out infinite;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    body {
        padding: var(--sp-4) var(--sp-3);
    }

    .container {
        padding: var(--sp-4) var(--sp-3);
    }

    .name {
        font-size: var(--text-4xl);
        padding-left: var(--sp-3);
    }

    h1 {
        font-size: var(--text-3xl);
    }

    .page-title {
        font-size: var(--text-3xl);
    }

    .bio {
        font-size: var(--text-sm);
    }

    .nav-links {
        gap: var(--sp-4);
    }

    .assignment-card {
        padding: var(--sp-4);
        gap: var(--sp-3);
    }

    pre[class*="language-"],
    pre code {
        font-size: 0.7rem;
        padding: var(--sp-4);
    }
}

@media (max-width: 480px) {
    .name {
        font-size: var(--text-3xl);
    }

    h1 {
        font-size: var(--text-2xl);
    }

    .page-title {
        font-size: var(--text-2xl);
    }

    .nav-links {
        flex-direction: column;
        gap: var(--sp-3);
    }

    .cursor-dot,
    .cursor-ring {
        display: none;
    }

    .pixel-cat {
        bottom: 10px;
        left: auto;
        right: 10px;
        transform: scale(0.7);
        transform-origin: bottom right;
    }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .cursor-dot,
    .cursor-ring,
    .pixel-cat {
        display: none;
    }
}
