/* ============================================
   Juan Pablo Silva Alvarado — Research Site
   Dark academic theme with DAG-inspired visuals
   ============================================ */

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

:root {
    /* Palette */
    --bg-void:       #060a13;
    --bg-primary:    #0b1120;
    --bg-elevated:   #111a2e;
    --bg-card:       #0f1729;
    --bg-card-hover: #15203a;

    --text-primary:  #e1e7ef;
    --text-secondary:#8b97ad;
    --text-muted:    #556479;

    --accent:        #4f8ff7;
    --accent-bright: #6ea8ff;
    --accent-glow:   rgba(79, 143, 247, 0.12);
    --accent-glow-strong: rgba(79, 143, 247, 0.25);
    --gradient:      linear-gradient(135deg, #4f8ff7 0%, #a78bfa 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(79,143,247,0.08) 0%, rgba(167,139,250,0.08) 100%);

    --border:        rgba(79, 143, 247, 0.08);
    --border-card:   rgba(79, 143, 247, 0.1);
    --border-hover:  rgba(79, 143, 247, 0.25);

    --radius:        12px;
    --radius-lg:     18px;
    --max-w:         1080px;
    --transition:    0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Font stacks */
    --font-body:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:  'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* Noise texture overlay for depth */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-void);
    min-height: 100vh;
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
}

/* DAG Canvas */
#dag-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

/* Everything above canvas */
nav, main, footer {
    position: relative;
    z-index: 1;
}

a {
    color: var(--accent-bright);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: #93bbff; }

/* ---- Skip link ---- */
.skip-link {
    position: absolute;
    top: -60px;
    left: 8px;
    background: var(--accent);
    color: var(--bg-void);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    z-index: 9999;
}
.skip-link:focus { top: 8px; }

/* ============ NAVIGATION ============ */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 2rem;
    background: rgba(6, 10, 19, 0.7);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav .logo h1 {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.12em;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.nav-menu li a,
.nav-menu li button {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    transition: all var(--transition);
    white-space: nowrap;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    letter-spacing: 0.01em;
}

.nav-menu li a:hover,
.nav-menu li button:hover {
    color: var(--text-primary);
    background: rgba(79, 143, 247, 0.08);
}

.nav-menu li button {
    font-weight: 600;
    font-size: 0.78rem;
    min-width: 36px;
    text-align: center;
    border: 1px solid var(--border-card);
    letter-spacing: 0.05em;
}

.nav-menu li button.active {
    background: var(--gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 16px rgba(79, 143, 247, 0.3);
}

/* Mobile toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    background: none;
    border: none;
    z-index: 1001;
}

.menu-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============ HERO ============ */
.hero {
    padding: 6rem 2rem 5rem;
    max-width: var(--max-w);
    margin: 0 auto;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 3.5rem;
}

/* Photo with gradient ring */
.photo-ring {
    position: relative;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    padding: 3px;
    background: var(--gradient);
    flex-shrink: 0;
    box-shadow:
        0 0 40px rgba(79, 143, 247, 0.15),
        0 0 80px rgba(167, 139, 250, 0.08);
}

.photo-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 3px solid var(--bg-void);
}

.hero-text {
    flex: 1;
}

.hero-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.hero-text h1 {
    font-size: clamp(2rem, 4.5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.08;
    margin-bottom: 0.85rem;
    background: linear-gradient(135deg, #e1e7ef 30%, #8b97ad 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 0.98rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
    line-height: 1.5;
}

.hero-location {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.9rem;
}

.hero-tagline {
    font-size: 1.05rem;
    font-weight: 500;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.hero-links {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition);
    font-family: var(--font-body);
}

.btn-outline {
    border: 1px solid var(--border-card);
    color: var(--text-secondary);
    background: rgba(79, 143, 247, 0.04);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent-bright);
    background: var(--accent-glow);
    box-shadow: 0 0 20px rgba(79, 143, 247, 0.1);
    transform: translateY(-1px);
}

.btn-outline svg { opacity: 0.65; transition: opacity var(--transition); }
.btn-outline:hover svg { opacity: 1; }

/* ============ SECTIONS ============ */
.section {
    padding: 5rem 2rem;
    max-width: var(--max-w);
    margin: 0 auto;
}

.section-alt {
    background: linear-gradient(180deg, rgba(15, 23, 41, 0.5) 0%, rgba(6, 10, 19, 0.5) 100%);
    max-width: 100%;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 5rem 2rem;
}

.section-alt .section-title,
.section-alt .engine-block,
.section-alt .repo-grid {
    max-width: var(--max-w);
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title::before {
    content: '';
    width: 3px;
    height: 1.2em;
    background: var(--gradient);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ============ RESEARCH CARDS ============ */
.research-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all var(--transition);
    overflow: hidden;
}

.card-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity var(--transition);
}

.card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3), 0 0 30px var(--accent-glow);
    transform: translateY(-2px);
}

.card:hover .card-accent {
    opacity: 1;
}

.card-number {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-glow);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    letter-spacing: 0;
}

.card h3 {
    font-size: 1rem;
    font-weight: 650;
    margin-bottom: 0.7rem;
    color: var(--text-primary);
    line-height: 1.35;
}

.card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.card-wide {
    grid-column: 1 / -1;
}

.card-emerges {
    background: var(--gradient-subtle);
    border-color: rgba(79, 143, 247, 0.15);
}

.card-emerges:hover {
    border-color: rgba(79, 143, 247, 0.35);
}

/* ============ ENGINE ============ */
.engine-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

.engine-desc h3 {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.engine-desc > p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.engine-stats {
    display: flex;
    gap: 2.5rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.1;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.3rem;
    font-weight: 500;
}

/* Terminal-style code block */
.engine-code {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}

.engine-code:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.7rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-dot.red    { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green  { background: #28c840; }

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: auto;
    letter-spacing: 0.05em;
}

.engine-code pre {
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin: 0;
}

.engine-code code {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.engine-code .c {
    color: var(--text-muted);
    font-style: italic;
}

.engine-code .prompt {
    color: var(--accent);
    font-weight: 700;
    user-select: none;
}

/* ============ BOOK SHOWCASE ============ */
.book-showcase {
    display: flex;
    align-items: center;
    gap: 3rem;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 2.5rem 3rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}

.book-showcase::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient);
}

.book-showcase:hover {
    border-color: var(--border-hover);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35), 0 0 40px var(--accent-glow);
}

/* 3D Book */
.book-3d {
    flex-shrink: 0;
    perspective: 600px;
}

.book-cover {
    position: relative;
    width: 160px;
    height: 220px;
    transform-style: preserve-3d;
    transform: rotateY(-18deg);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.book-showcase:hover .book-cover {
    transform: rotateY(-10deg);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px 8px 8px 2px;
    display: block;
    box-shadow:
        6px 6px 18px rgba(0, 0, 0, 0.5);
    backface-visibility: hidden;
}

.book-spine {
    position: absolute;
    top: 0;
    left: -20px;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, #0a0e1f 0%, #141a30 100%);
    border: 1px solid rgba(79, 143, 247, 0.1);
    border-right: none;
    border-radius: 4px 0 0 4px;
    transform: rotateY(90deg) translateZ(0px);
    transform-origin: right center;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.4);
}

/* Book info */
.book-info {
    flex: 1;
    min-width: 0;
}

.book-info h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.45rem;
    line-height: 1.35;
}

.book-info .pub-meta {
    margin-bottom: 0.85rem;
}

.book-info > p:nth-of-type(2) {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 1.25rem;
}

.btn-amazon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.3rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 153, 0, 0.1);
    border: 1px solid rgba(255, 153, 0, 0.25);
    transition: all var(--transition);
    font-family: var(--font-body);
    text-decoration: none;
}

.btn-amazon:hover {
    background: rgba(255, 153, 0, 0.18);
    border-color: rgba(255, 153, 0, 0.5);
    color: #ffb84d;
    box-shadow: 0 0 20px rgba(255, 153, 0, 0.1);
    transform: translateY(-1px);
}

.btn-amazon svg {
    opacity: 0.7;
    color: #ff9900;
}

.btn-amazon:hover svg {
    opacity: 1;
}

/* ============ PUBLICATIONS ============ */
.pub-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.pub-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 1.85rem;
    transition: all var(--transition);
    overflow: hidden;
}

.pub-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity var(--transition);
}

.pub-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3), 0 0 30px var(--accent-glow);
    transform: translateY(-2px);
}

.pub-card:hover::before {
    opacity: 1;
}

.pub-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 0.2rem 0.65rem;
    border-radius: 5px;
    margin-bottom: 0.85rem;
    border: 1px solid rgba(79, 143, 247, 0.15);
}

.pub-card h3 {
    font-size: 0.98rem;
    font-weight: 650;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.pub-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
    font-family: var(--font-mono);
    font-weight: 400;
}

.pub-meta a {
    color: var(--text-muted);
    transition: color var(--transition);
}
.pub-meta a:hover { color: var(--accent-bright); }

.pub-card > p:last-child {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* ============ REPO GRID ============ */
.repo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.repo-card {
    display: block;
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    transition: all var(--transition);
    text-decoration: none;
    overflow: hidden;
}

.repo-card::after {
    content: '\2197';
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    opacity: 0;
    transition: all var(--transition);
}

.repo-card:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3), 0 0 24px var(--accent-glow);
    transform: translateY(-2px);
}

.repo-card:hover::after {
    opacity: 1;
    color: var(--accent);
}

.repo-card h3 {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent-bright);
    margin-bottom: 0.3rem;
    transition: color var(--transition);
}

.repo-card:hover h3 { color: #fff; }

.repo-card > p {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.55rem;
    letter-spacing: 0.02em;
}

.repo-desc {
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* ============ FOOTER ============ */
footer {
    text-align: center;
    padding: 3.5rem 2rem;
    border-top: 1px solid var(--border);
    background: rgba(6, 10, 19, 0.5);
}

.footer-inner {
    max-width: 600px;
    margin: 0 auto;
}

.footer-quote {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.footer-copy {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: normal;
    letter-spacing: 0.02em;
}

/* ============ REVEAL ANIMATIONS ============ */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Stagger children within grids */
.research-grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.research-grid .reveal:nth-child(3) { transition-delay: 0.16s; }

.pub-grid .reveal:nth-child(2) { transition-delay: 0.06s; }
.pub-grid .reveal:nth-child(3) { transition-delay: 0.12s; }
.pub-grid .reveal:nth-child(4) { transition-delay: 0.18s; }

.repo-grid .reveal:nth-child(2) { transition-delay: 0.06s; }
.repo-grid .reveal:nth-child(3) { transition-delay: 0.12s; }
.repo-grid .reveal:nth-child(4) { transition-delay: 0.18s; }

.engine-stats .reveal:nth-child(2) { transition-delay: 0.08s; }
.engine-stats .reveal:nth-child(3) { transition-delay: 0.16s; }

/* Translation fade */
.translating {
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

/* Focus */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============ RESPONSIVE ============ */
@media screen and (max-width: 768px) {
    .menu-toggle { display: flex; }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100dvh;
        background: rgba(6, 10, 19, 0.98);
        backdrop-filter: blur(24px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        gap: 0.5rem;
    }

    .nav-menu.active { right: 0; }

    .nav-menu li a,
    .nav-menu li button {
        font-size: 1.05rem;
        padding: 0.8rem 2rem;
        min-width: 180px;
        text-align: center;
    }

    .hero { padding: 3.5rem 1.5rem 2.5rem; }

    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 1.75rem;
    }

    .photo-ring { width: 150px; height: 150px; }

    .hero-links { justify-content: center; }

    .hero-label { margin-bottom: 0.5rem; }

    .hero-text h1 { font-size: 2rem; }

    .research-grid,
    .pub-grid,
    .repo-grid,
    .engine-block {
        grid-template-columns: 1fr;
    }

    .card-wide { grid-column: 1; }

    .book-showcase {
        flex-direction: column;
        padding: 2rem 1.5rem;
        gap: 1.75rem;
        text-align: center;
    }

    .book-cover { width: 130px; height: 180px; }

    .btn-amazon { width: 100%; justify-content: center; }

    .engine-stats { gap: 1.5rem; }

    .section, .section-alt { padding: 3.5rem 1.5rem; }

    .stat-value { font-size: 1.5rem; }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
    .photo-ring { width: 160px; height: 160px; }
    .engine-block { grid-template-columns: 1fr; }
    .hero { padding: 4.5rem 2rem 3.5rem; }
}

/* Large screens */
@media screen and (min-width: 1441px) {
    :root { --max-w: 1160px; }
}

/* ============ PRINT ============ */
@media print {
    #dag-canvas, nav, footer, .hero-links, .menu-toggle, body::before { display: none !important; }
    body { background: #fff; color: #111; }
    .section, .hero { padding: 1rem; }
    .card, .pub-card, .repo-card { border-color: #ddd; background: #fafafa; }
    .reveal { opacity: 1 !important; transform: none !important; }
    h1, h3, .hero-tagline, .stat-value, .engine-desc h3, nav .logo h1 {
        -webkit-text-fill-color: initial;
        background: none;
        color: #111;
    }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}
