/* ==========================================
   hperez.dev — Developer Portfolio
   ========================================== */

/* Self-hosted fonts (OFL licenses in /fonts) */
@font-face {
    font-family: 'Inter';
    src: url('../fonts/InterVariable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('../fonts/JetBrainsMono-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('../fonts/JetBrainsMono-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* Variables */
:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #1c2129;
    --bg-terminal: #0a0d13;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #79b8ff;
    --accent-tint: rgba(88, 166, 255, 0.1);
    --white: #f0f6fc;
    --green: #3fb950;
    --border: #30363d;
    --shadow-lg: 0 16px 48px rgba(1, 4, 9, 0.55);
    --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 4px 16px rgba(1, 4, 9, 0.3);
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    /* Role-based font tokens — themes remap these (e.g. phosphor goes all-mono) */
    --font-display: var(--font-sans);
    --font-body: var(--font-sans);
    --accent-dim: #1f6feb;
    --glow-accent: rgba(88, 166, 255, 0.3);
    --glow-soft: rgba(88, 166, 255, 0.07);
    --nav-bg: rgba(13, 17, 23, 0.85);
    --nav-bg-solid: rgba(13, 17, 23, 0.95);
    --max-width: 1000px;
    --nav-height: 70px;

    /* Type scale */
    --fs-h2: 1.75rem;
    --fs-body-lg: 1.125rem;
    --fs-body: 1rem;
    --fs-small: 0.875rem;
    --fs-mono-label: 0.8125rem;
    --fs-micro: 0.75rem;

    /* Radii */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;

    /* Hover/interaction easing: ease-out so the UI responds immediately */
    --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
    --transition: color 0.2s var(--ease-out),
                  background-color 0.2s var(--ease-out),
                  border-color 0.2s var(--ease-out),
                  transform 0.2s var(--ease-out),
                  opacity 0.2s var(--ease-out);
}

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

html {
    scroll-padding-top: var(--nav-height);
    scrollbar-color: var(--border) var(--bg-primary);
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4 {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.1;
}

/* Negative tracking is a display-size treatment — large headings only */
h1, h2 {
    letter-spacing: -0.02em;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

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

code, pre {
    font-family: var(--font-mono);
}

/* External-link marker */
.ext-mark {
    font-size: 0.7em;
    vertical-align: 0.15em;
}

/* Detail polish */
::selection {
    background: rgba(88, 166, 255, 0.3);
    color: var(--white);
}

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

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--accent);
    color: var(--bg-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    z-index: 200;
    font-size: var(--fs-mono-label);
    font-family: var(--font-mono);
}

.skip-link:focus {
    top: 0.5rem;
    color: var(--bg-primary);
}

/* Layout */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.nav-logo {
    /* 500, not 700: only Regular/Medium mono is shipped — 700 would be
       synthesized faux-bold */
    font-weight: 500;
    font-size: 1.25rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.nav-logo span {
    color: var(--accent);
}

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

.nav-links a {
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: var(--fs-mono-label);
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
}

/* Mobile Menu */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--accent);
    transition: var(--transition);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ==========================================
   Hero
   ========================================== */
.hero {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding-top: var(--nav-height);
    position: relative;
    overflow: hidden;
}

/* The 2-column hero needs more air than prose sections */
.hero .container {
    max-width: 1140px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(to bottom, rgba(13, 17, 23, 0.55) 0%, rgba(13, 17, 23, 0.96) 90%),
        url('../images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.3;
    z-index: 0;
}

.hero::after {
    /* Soft accent glow behind the terminal */
    content: '';
    position: absolute;
    top: 20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--glow-soft) 0%, transparent 65%);
    z-index: 0;
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 3.5rem;
    align-items: center;
}

.hero-subtitle {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: var(--fs-body);
    margin-bottom: 1.25rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    color: var(--white);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.hero-headline {
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: var(--fs-body-lg);
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 500px;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: 1rem;
}

/* Hero entrance animation (JS adds .js to <html>; static without it) */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

html.js .hero [data-stagger] {
    opacity: 0;
    animation: fade-up 0.55s var(--ease-out) forwards;
}

html.js .hero [data-stagger="1"] { animation-delay: 0.05s; }
html.js .hero [data-stagger="2"] { animation-delay: 0.15s; }
html.js .hero [data-stagger="3"] { animation-delay: 0.25s; }
html.js .hero [data-stagger="4"] { animation-delay: 0.35s; }
html.js .hero [data-stagger="5"] { animation-delay: 0.45s; }
html.js .hero [data-stagger="6"] { animation-delay: 0.6s; }

/* ==========================================
   Terminal window
   ========================================== */
.terminal {
    background: var(--bg-terminal);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: var(--fs-mono-label);
    text-align: left;
}

/* 1fr auto 1fr keeps the title truly centered regardless of dot width */
.terminal-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0.65rem 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.terminal-bar::after {
    content: '';
}

.terminal-dots {
    display: flex;
    gap: 0.5rem;
    justify-self: start;
}

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

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

.terminal-title {
    justify-self: center;
    color: var(--text-secondary);
    font-size: var(--fs-micro);
}

.terminal-body {
    padding: 1.1rem 1.25rem;
    line-height: 2;
    min-height: 200px;
}

/* Reserve the full session height so replaying the animation doesn't
   shift the layout below (heights match each demo's line count) */
.hero .terminal-body {
    min-height: 245px;
}

.terminal-demo .terminal-body {
    min-height: 275px;
}

.t-line {
    white-space: pre-wrap;
    word-break: break-word;
}

.t-line.t-hidden {
    display: none;
}

.t-prompt {
    color: var(--accent);
    user-select: none;
}

.t-cmd {
    color: var(--text-primary);
}

.t-out {
    color: var(--text-secondary);
}

.t-ok {
    color: var(--green);
}

.t-cursor {
    display: inline-block;
    width: 8px;
    height: 1.05em;
    background: var(--accent);
    vertical-align: text-bottom;
    margin-left: 2px;
}

html.js .t-cursor {
    animation: blink 1.1s steps(1) infinite;
}

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

/* Centered standalone terminal (Cryptek page demo) */
.terminal-demo {
    max-width: 620px;
    margin: 2.5rem auto 0;
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: var(--fs-small);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--accent);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--accent-tint);
    color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ==========================================
   Sections
   ========================================== */
.section {
    padding: 6rem 0;
}

.section-alt {
    background: var(--bg-secondary);
}

main {
    counter-reset: section;
}

.numbered-heading {
    display: flex;
    align-items: baseline;
    font-size: var(--fs-h2);
    color: var(--text-primary);
    margin-bottom: 2.5rem;
}

.numbered-heading::before {
    counter-increment: section;
    content: "0" counter(section) ".";
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 400;
    margin-right: 0.75rem;
}

.numbered-heading::after {
    content: '';
    display: block;
    width: 200px;
    height: 1px;
    margin-left: 1.25rem;
    background: var(--border);
    align-self: center;
}

/* Centered variant (contact) — numbered, no rule line */
.numbered-heading.centered {
    justify-content: center;
}

.numbered-heading.centered::after {
    display: none;
}

/* Scroll reveal (JS adds .visible; static without JS or with reduced motion) */
html.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.55s var(--ease-out),
                transform 0.55s var(--ease-out);
}

html.js .reveal.visible {
    opacity: 1;
    transform: none;
}

/* Card-grid reveals stagger their children instead of popping as one slab */
html.js .stagger-children.reveal {
    transform: none;
}

html.js .stagger-children.reveal > * {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s var(--ease-out),
                transform 0.5s var(--ease-out);
}

html.js .stagger-children.reveal.visible > * {
    opacity: 1;
    transform: none;
}

html.js .stagger-children.reveal.visible > *:nth-child(2) { transition-delay: 0.05s; }
html.js .stagger-children.reveal.visible > *:nth-child(3) { transition-delay: 0.1s; }
html.js .stagger-children.reveal.visible > *:nth-child(4) { transition-delay: 0.15s; }
html.js .stagger-children.reveal.visible > *:nth-child(5) { transition-delay: 0.2s; }
html.js .stagger-children.reveal.visible > *:nth-child(6) { transition-delay: 0.25s; }
html.js .stagger-children.reveal.visible > *:nth-child(7) { transition-delay: 0.3s; }
html.js .stagger-children.reveal.visible > *:nth-child(8) { transition-delay: 0.35s; }

/* ==========================================
   About
   ========================================== */
.about-content {
    max-width: 560px;
}

.about-content p {
    margin-bottom: 1rem;
    font-size: var(--fs-body);
    line-height: 1.7;
}

/* Animated underline on inline content links */
.about-content a,
.contact-section > p a {
    position: relative;
}

.about-content a::after,
.contact-section > p a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s var(--ease-out);
}

.about-content a:hover::after,
.contact-section > p a:hover::after {
    transform: scaleX(1);
}

.tech-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 200px));
    gap: 0.5rem 1rem;
    list-style: none;
    margin-top: 1.25rem;
    font-family: var(--font-mono);
    font-size: var(--fs-mono-label);
}

.tech-list li::before {
    content: "▹ ";
    color: var(--accent);
}

/* Experience strip */
.experience {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 3rem;
}

.experience-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 2px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    box-shadow: var(--shadow-card);
    padding: 1.25rem 1.5rem;
}

.experience-item .company {
    color: var(--white);
    font-weight: 600;
    font-size: var(--fs-body);
    margin-bottom: 0.25rem;
}

.experience-item .role {
    font-family: var(--font-mono);
    font-size: var(--fs-mono-label);
    color: var(--text-secondary);
}

/* ==========================================
   Projects
   ========================================== */
.project-featured {
    margin-bottom: 3rem;
}

.project-featured-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 2.5rem;
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 2.5rem;
    align-items: center;
}

.project-overline {
    font-family: var(--font-mono);
    font-size: var(--fs-mono-label);
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.project-featured-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    color: var(--white);
}

.project-description {
    margin-bottom: 1.25rem;
}

.project-description p {
    line-height: 1.7;
}

.project-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.project-visual svg {
    width: 100%;
    max-width: 210px;
    height: auto;
    filter: drop-shadow(0 0 24px var(--glow-accent));
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-mono);
    font-size: var(--fs-mono-label);
}

.project-tech span {
    color: var(--text-secondary);
}

.project-tech span:not(:last-child)::after {
    content: " · ";
    color: var(--text-secondary);
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-other {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 1rem;
}

/* Cards.
   Hover lift/glow is opt-in for actual links only — static info cards must
   not advertise clickability they don't have. */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 2rem;
    transition: var(--transition);
}

a.card:hover,
.card-link:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--white);
}

.card p {
    font-size: var(--fs-body);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.card p:last-child,
.card .project-tech:last-child {
    margin-bottom: 0;
}

/* ==========================================
   Contact
   ========================================== */
.contact-section {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.contact-section h2 {
    font-size: var(--fs-h2);
    margin-bottom: 1.25rem;
    color: var(--white);
}

.contact-section p {
    margin-bottom: 2rem;
    line-height: 1.7;
}

.contact-section .hero-cta {
    justify-content: center;
}

/* ==========================================
   Cryptek Product Page
   ========================================== */
.cryptek-hero {
    text-align: center;
    padding: 8rem 0 4rem;
}

.cryptek-logo {
    width: 84px;
    height: auto;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 20px var(--glow-accent));
}

.cryptek-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1rem;
    color: var(--white);
}

.cryptek-hero .tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.download-buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.download-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: var(--transition);
    min-width: 150px;
    font-size: var(--fs-small);
}

.download-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.download-btn small {
    display: block;
    color: var(--text-secondary);
    font-size: var(--fs-micro);
    margin-top: 0.25rem;
}

.install-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 1rem;
}

.install-command {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    overflow-x: auto;
}

.install-command code {
    color: var(--accent);
    font-size: var(--fs-small);
}

.install-command button {
    background: var(--bg-primary);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    flex-shrink: 0;
    /* Stay visible while the long command scrolls underneath */
    position: sticky;
    right: 0;
}

.install-command button:hover {
    color: var(--text-primary);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
    gap: 1rem;
}

.feature-card {
    text-align: left;
    padding: 1.5rem;
    border-left: 2px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    cursor: default;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    font-size: var(--fs-body);
    color: var(--white);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: var(--fs-mono-label);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Code Block */
.code-block {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 1.5rem 0;
}

.code-block-flush {
    margin: 0;
}

.code-header {
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border);
}

.code-header span {
    color: var(--text-secondary);
    font-size: var(--fs-mono-label);
    font-family: var(--font-mono);
}

.code-block pre {
    padding: 1.25rem;
    overflow-x: auto;
}

.code-block code {
    color: var(--text-primary);
    font-size: var(--fs-mono-label);
    line-height: 1.6;
}

/* CSP-safe replacements for former inline styles */
.ok {
    color: var(--green);
}

.code-accent {
    color: var(--accent);
}

.qs-note {
    margin-top: 1.5rem;
}

/* Section utilities */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: var(--fs-h2);
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* Utilities */
.text-muted { color: var(--text-secondary); }
.text-small { font-size: var(--fs-mono-label); }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }

/* Cryptek logo — single traced mark, themeable (CSS overrides the SVG fill attr) */
.logo-mark { fill: var(--accent); }

/* ==========================================
   Footer
   ========================================== */
footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: var(--fs-mono-label);
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: var(--fs-mono-label);
}

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

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .hero-terminal {
        max-width: 560px;
        margin-inline: auto;
        width: 100%;
    }

    .project-featured-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .project-visual {
        order: -1;
        padding: 0.5rem;
    }

    .project-visual svg {
        max-width: 140px;
    }

    .experience {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero { min-height: auto; padding: 8rem 0 4rem; }
    .hero-headline { font-size: 1.5rem; }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--nav-bg-solid);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 1rem 2rem 2rem;
        gap: 0;
        border-bottom: 1px solid var(--border);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li a {
        display: block;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border);
    }

    .nav-links li:last-child a {
        border-bottom: none;
    }

    .numbered-heading::after {
        width: 100%;
    }

    .tech-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-cta {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Full-width rows instead of a column of shrunk chips */
    .download-buttons {
        flex-direction: column;
        align-items: stretch;
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
    }

    .download-btn {
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
    }

    .download-btn small {
        margin-top: 0;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .project-other {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    /* Wrapped demo commands need more room; avoids layout shift mid-typing */
    .hero .terminal-body {
        min-height: 300px;
    }

    .terminal-demo .terminal-body {
        min-height: 340px;
    }
}

/* ==========================================
   Reduced motion — kill all animation
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    html.js .hero [data-stagger] {
        opacity: 1;
        animation: none;
    }

    html.js .reveal,
    html.js .stagger-children.reveal > * {
        opacity: 1;
        transform: none;
        transition: none;
    }

    html.js .t-cursor {
        animation: none;
    }

    a.card:hover,
    .card-link:hover,
    .download-btn:hover {
        transform: none;
    }

    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
