/* ═══════════════════════════════════════
   CLAUDIO MEIRELES — PORTFOLIO
   Editorial design system
   ═══════════════════════════════════════ */

:root {
    --bg: #0c0c0e;
    --bg-raised: #131315;
    --bg-surface: #1a1a1d;

    --text: #f0ede8;
    --text-secondary: #9a9690;
    --text-muted: #5c5955;

    --accent: #e8a849;
    --accent-hover: #f0be6e;
    --accent-dim: rgba(232, 168, 73, 0.08);
    --accent-border: rgba(232, 168, 73, 0.2);

    --coral: #e06c4f;

    --border: #222224;
    --border-hover: #38383b;

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --container: 1140px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
}

/* ─── Reset ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.65; overflow-x: hidden; }
::selection { background: rgba(232, 168, 73, 0.2); color: var(--text); }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 32px; }

/* ─── Grain Overlay ─── */
.grain {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.4;
    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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

/* ─── Toast ─── */
.toast {
    position: fixed;
    bottom: 32px; left: 50%;
    transform: translateX(-50%) translateY(80px);
    padding: 12px 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.85rem;
    color: var(--text);
    z-index: 10003;
    opacity: 0;
    transition: all 0.4s var(--ease);
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Skip Link ─── */
.skip-link {
    position: fixed; top: -100%; left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: var(--accent);
    color: #000;
    border-radius: 8px;
    z-index: 100000;
    font-weight: 600;
    transition: top 0.3s;
}
.skip-link:focus { top: 12px; }

/* ═══════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════ */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    transition: all 0.4s var(--ease-out);
}
.navbar.scrolled {
    background: rgba(12, 12, 14, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}
.nav-logo {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -1px;
    transition: color 0.25s;
}
.nav-logo:hover { color: var(--accent); }
.nav-links { display: flex; gap: 4px; }
.nav-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.25s;
    position: relative;
}
.nav-link:hover { color: var(--text-secondary); }
.nav-link.active {
    color: var(--text);
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px; left: 16px; right: 16px;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.3s var(--ease);
}
.nav-link.active::after { transform: scaleX(1); }

.nav-right { display: flex; align-items: center; gap: 4px; }
.nav-icon {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 1.05rem;
    transition: all 0.2s;
}
.nav-icon:hover { color: var(--text); background: rgba(255,255,255,0.04); }

.menu-toggle { display: none; padding: 10px; position: relative; width: 40px; height: 40px; }
.menu-toggle span {
    position: absolute; left: 10px;
    width: 20px; height: 1.5px;
    background: var(--text);
    transition: all 0.3s var(--ease);
}
.menu-toggle span:first-child { top: 15px; }
.menu-toggle span:last-child { top: 23px; }
.menu-toggle.active span:first-child { top: 19px; transform: rotate(45deg); }
.menu-toggle.active span:last-child { top: 19px; transform: rotate(-45deg); }

/* Mobile Menu */
.mobile-menu {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100vh;
    background: var(--bg);
    z-index: 999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.4s;
}
.mobile-menu.active { opacity: 1; pointer-events: all; }
.mobile-menu-inner { text-align: center; }
.mobile-link {
    display: block;
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 8px 0;
    transition: color 0.2s;
    letter-spacing: -1px;
}
.mobile-link:hover { color: var(--accent); }
.mobile-socials { margin-top: 40px; display: flex; gap: 24px; justify-content: center; }
.mobile-socials a {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: color 0.2s;
}
.mobile-socials a:hover { color: var(--accent); }

/* ═══════════════════════════════════════
   HERO — Editorial oversized type
   ═══════════════════════════════════════ */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 120px 32px 60px;
    max-width: var(--container);
    margin: 0 auto;
    position: relative;
}
.hero-inner { width: 100%; }

.hero-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.hero-label {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent);
    letter-spacing: 0.5px;
}
.hero-location {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.hero-name {
    margin-bottom: 48px;
}
.hero-name-line {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 10vw, 8rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -4px;
    color: var(--text);
}
.hero-name-indent { padding-left: clamp(40px, 8vw, 120px); }
.hero-accent { color: var(--accent); }

.hero-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.hero-bio {
    max-width: 460px;
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.75;
}
.hero-bio em {
    color: var(--text);
    font-style: normal;
    font-weight: 500;
}
.hero-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.hero-scroll {
    position: absolute;
    bottom: 32px;
    left: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.hero-scroll span {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
    writing-mode: vertical-rl;
}
.hero-scroll::after {
    content: '';
    width: 1px;
    height: 48px;
    background: var(--border-hover);
    animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); transform-origin: top; }
    50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 14px 28px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.3s var(--ease);
    white-space: nowrap;
}
.btn svg { transition: transform 0.3s var(--ease); }
.btn:hover svg { transform: translate(2px, -2px); }

.btn-primary {
    background: var(--accent);
    color: #0c0c0e;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.97); }

.btn-ghost {
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text); }
.btn-ghost:active { transform: scale(0.97); }

/* Link arrow style */
.link-arrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.25s;
}
.link-arrow svg { transition: transform 0.3s var(--ease); }
.link-arrow:hover { color: var(--accent); }
.link-arrow:hover svg { transform: translate(2px, -2px); }

/* ═══════════════════════════════════════
   SECTIONS — Common
   ═══════════════════════════════════════ */
.section { padding: 120px 0; }

.section-heading {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -1.5px;
    margin-bottom: 48px;
    color: var(--text);
}
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.section-header-row .section-heading { margin-bottom: 0; }
.section-count {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════
   ABOUT — Asymmetric layout
   ═══════════════════════════════════════ */
.about { background: var(--bg-raised); }

.about-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 80px;
    align-items: start;
}
.about-left { position: sticky; top: 100px; }

.about-photo-block {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 28px;
    position: relative;
}
.about-photo {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: grayscale(15%) contrast(1.05);
    transition: filter 0.6s var(--ease);
}
.about-photo-block:hover .about-photo {
    filter: grayscale(0%) contrast(1);
}
.about-photo-block::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent);
}
.about-photo-fallback {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-surface);
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
}

.about-info-strip {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.info-item:first-child { border-top: none; }
.info-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.info-value {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.about-right { padding-top: 8px; }

.about-text p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 16px;
}

.about-highlights {
    margin-top: 36px;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.highlight {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    transition: padding-left 0.3s var(--ease);
}
.highlight:first-child { border-top: 1px solid var(--border); }
.highlight:hover { padding-left: 8px; }
.highlight:hover .highlight-title { color: var(--accent); }
.highlight-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s var(--ease);
}
.highlight-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: right;
}

.about-links {
    margin-top: 32px;
    display: flex;
    gap: 28px;
}

/* ═══════════════════════════════════════
   PROJECTS — Numbered list with hover
   ═══════════════════════════════════════ */
.projects { background: var(--bg); }

.projects-list {
    display: flex;
    flex-direction: column;
}

.project-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 32px;
    padding: 48px 0;
    border-bottom: 1px solid var(--border);
    transition: all 0.4s var(--ease);
    position: relative;
}
/* No top border on first project - section-header-row already has border-bottom */
.project-item:hover {
    padding-left: 16px;
    border-bottom-color: var(--accent-border);
}

.project-number {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    color: var(--border-hover);
    line-height: 1;
    transition: color 0.4s var(--ease);
    letter-spacing: -2px;
}
.project-item:hover .project-number { color: var(--accent); }

.project-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.project-category {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.project-separator { color: var(--border-hover); }

.project-name {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 14px;
    line-height: 1.25;
    transition: color 0.3s;
}
.project-item:hover .project-name { color: var(--accent); }

.project-desc {
    color: var(--text-secondary);
    font-size: 0.93rem;
    line-height: 1.75;
    max-width: 640px;
    margin-bottom: 20px;
}

.project-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.project-stack span {
    font-family: var(--font-mono);
    font-size: 0.73rem;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    transition: all 0.2s;
}
.project-item:hover .project-stack span {
    border-color: var(--accent-border);
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════
   SKILLS — Mixed layout
   ═══════════════════════════════════════ */
.skills { background: var(--bg-raised); }

.skills-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 64px;
    align-items: start;
}

.skill-group { margin-bottom: 32px; }
.skill-group:last-child { margin-bottom: 0; }
.skill-group-title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* Skill bars */
.skill-list { display: flex; flex-direction: column; gap: 16px; }
.skill-row {
    display: flex;
    align-items: center;
    gap: 16px;
}
.skill-name {
    font-size: 0.88rem;
    color: var(--text-secondary);
    min-width: 160px;
    flex-shrink: 0;
}
.skill-bar {
    flex: 1;
    height: 3px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.skill-fill {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
    border-radius: 3px;
    transition: width 1s var(--ease);
}
.skill-fill.animate { width: var(--w); }

/* Skill tags */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.skill-tags span {
    font-size: 0.82rem;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all 0.25s;
}
.skill-tags span:hover {
    border-color: var(--accent-border);
    color: var(--text);
    background: var(--accent-dim);
}

.skill-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 40px;
}

/* ═══════════════════════════════════════
   EXPERIENCE — Horizontal split
   ═══════════════════════════════════════ */
.experience { background: var(--bg); }

.exp-list {
    max-width: 860px;
    margin: 0 auto;
}
.exp-item {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 40px;
    padding: 40px 0;
    border-bottom: 1px solid var(--border);
    align-items: start;
}
.exp-item:first-child { border-top: 1px solid var(--border); }

.exp-date {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    padding-top: 6px;
    line-height: 1.5;
}

.exp-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--accent-dim);
    color: var(--accent);
    margin-bottom: 12px;
}
.badge-edu {
    background: rgba(99, 179, 237, 0.08);
    color: #63b3ed;
}
.badge-cert {
    background: rgba(244, 114, 182, 0.08);
    color: #f472b6;
}

.exp-content h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}
.exp-content h4 {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 14px;
}
.exp-content ul { margin-bottom: 14px; }
.exp-content li {
    position: relative;
    padding-left: 14px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 6px;
    line-height: 1.6;
}
.exp-content li::before {
    content: '';
    position: absolute;
    left: 0; top: 10px;
    width: 4px; height: 4px;
    background: var(--text-muted);
    border-radius: 50%;
}

.exp-tags {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.exp-tags span {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    transition: all 0.25s;
}
.exp-tags span:hover {
    border-color: var(--accent-border);
    color: var(--text);
    background: var(--accent-dim);
}

.cert-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 32px;
    margin-top: 8px;
}

/* ═══════════════════════════════════════
   CONTACT
   ═══════════════════════════════════════ */
.contact { background: var(--bg-raised); }

.contact-intro {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-top: -24px;
    margin-bottom: 48px;
    max-width: 480px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 64px;
    align-items: start;
}

.contact-form-card {
    padding: 40px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}
.contact-form-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 80px; height: 2px;
    background: var(--accent);
}
.contact-form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.form-group input,
.form-group textarea {
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: border-color 0.25s;
    outline: none;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--accent); }
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }
.form-group textarea { resize: vertical; min-height: 120px; }

.btn-submit { width: 100%; justify-content: center; margin-top: 4px; }

.form-error {
    font-size: 0.72rem; color: var(--coral);
    min-height: 0; overflow: hidden;
    transition: all 0.2s; opacity: 0;
}
.form-error.visible { min-height: 16px; opacity: 1; }
.form-group input.invalid,
.form-group textarea.invalid { border-color: var(--coral); }
.form-group input.valid,
.form-group textarea.valid { border-color: #4ade80; }
.required { color: var(--coral); }
.char-count {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 2px;
}

/* Contact links */
.contact-links {
    display: flex;
    flex-direction: column;
}
.contact-link-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    transition: padding-left 0.3s var(--ease);
}
.contact-link-item:first-child { border-top: 1px solid var(--border); }
.contact-link-item:hover { padding-left: 12px; }
.contact-link-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.contact-link-value {
    font-size: 0.92rem;
    color: var(--text-secondary);
    transition: color 0.2s;
    overflow-wrap: break-word;
}
.contact-link-item:hover .contact-link-value { color: var(--accent); }

/* ═══════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════ */
.footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.footer-brand {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: -1px;
}
.footer-copy {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.footer-socials { display: flex; gap: 8px; }
.footer-socials a {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: all 0.2s;
}
.footer-socials a:hover { color: var(--text); background: rgba(255,255,255,0.04); }

/* ─── Back to Top ─── */
.back-to-top {
    position: fixed;
    bottom: 24px; right: 24px;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-muted);
    z-index: 1001;
    opacity: 0; visibility: hidden;
    transform: translateY(12px);
    transition: all 0.35s var(--ease);
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { color: var(--text); border-color: var(--border-hover); }
.back-to-top:active { transform: scale(0.95); }

/* ─── Scroll Reveal ─── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

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

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 1024px) {
    .about-layout {
        grid-template-columns: 280px 1fr;
        gap: 48px;
    }
    .skills-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .skill-cols {
        grid-template-columns: 1fr 1fr;
    }
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .container { padding: 0 20px; }
    .nav-links { display: none; }
    .menu-toggle { display: block; }
    .nav-inner { height: 60px; padding: 0 20px; }

    .hero {
        padding: 100px 20px 48px;
        min-height: calc(100vh - 40px);
    }
    .hero-name-line {
        font-size: clamp(2.8rem, 13vw, 4.5rem);
        letter-spacing: -2px;
    }
    .hero-name-indent { padding-left: 24px; }
    .hero-bottom { flex-direction: column; align-items: flex-start; gap: 28px; }
    .hero-actions { flex-direction: column; width: 100%; }
    .hero-actions .btn { width: 100%; justify-content: center; }
    .hero-scroll { display: none; }

    .section { padding: 80px 0; }
    .section-heading { font-size: 1.8rem; margin-bottom: 36px; }

    .about-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .about-left {
        position: static;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .about-photo-block {
        width: 220px;
        margin-bottom: 24px;
    }
    .about-info-strip {
        width: 100%;
        max-width: 400px;
    }

    .project-item {
        grid-template-columns: 48px 1fr;
        gap: 20px;
        padding: 32px 0;
    }
    .project-number { font-size: 2rem; }
    .project-name { font-size: 1.25rem; }

    .skill-cols { grid-template-columns: 1fr; }
    .skill-name { min-width: 120px; }

    .exp-item {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 28px 0;
    }
    .exp-date {
        padding-top: 0;
        font-size: 0.72rem;
    }

    .cert-cols { grid-template-columns: 1fr; }

    .contact-grid { grid-template-columns: 1fr; }
    .contact-form-card { padding: 28px; }
    .form-row { grid-template-columns: 1fr; }

    .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
}

@media (max-width: 480px) {
    .hero { padding: 90px 20px 40px; }
    .hero-name-line { font-size: 2.6rem; letter-spacing: -1.5px; }
    .hero-name-indent { padding-left: 16px; }
    .hero-top { flex-direction: column; align-items: flex-start; gap: 8px; }
    .hero-bio { font-size: 0.92rem; }

    .about-photo-block { width: 200px; margin: 0 auto 24px; }
    .about-info-strip { max-width: 100%; }
    .info-item { flex-direction: column; gap: 2px; }
    .info-value { font-size: 0.82rem; }

    .highlight {
        flex-direction: column;
        gap: 4px;
    }
    .highlight-sub { text-align: left; }

    .project-item { grid-template-columns: 1fr; }
    .project-number { font-size: 1.5rem; }

    .section-header-row { flex-direction: column; gap: 8px; }

    .contact-form-card { padding: 22px; }
}

/* ─── Print ─── */
@media print {
    .grain, .toast, .navbar, .mobile-menu, .back-to-top, .hero-scroll { display: none !important; }
    body { background: #fff; color: #000; }
    .section { padding: 32px 0; }
    .hero { min-height: auto; padding: 32px; }
    .reveal { opacity: 1; transform: none; }
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
    .skill-fill { transition: none; width: var(--w); }
}
