:root {
    --bg: #050806;
    --bg-alt: rgba(8, 15, 10, 0.42);
    --text: #e6ede0;
    --text-muted: #a9b5a6;
    --accent: #a3b18a;
    --accent-alt: #cfdac1;
    --accent-soft: rgba(163, 177, 138, 0.22);
    --accent-contrast: #222b21;
    --border: rgba(203, 213, 186, 0.35);
    --card: rgba(10, 18, 12, 0.32);
    --shadow: 0 26px 70px rgba(2, 8, 4, 0.85);
    --section-padding: clamp(1.5rem, 5vw, 4.5rem);
    --section-padding-x: clamp(1.25rem, 4vw, 3rem);
    --gutter-left: max(var(--section-padding-x), env(safe-area-inset-left));
    --gutter-right: max(var(--section-padding-x), env(safe-area-inset-right));
    --touch-min: 44px;
}

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

html {
    min-height: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

main {
    min-height: 100vh;
    min-height: 100dvh;
}

*::selection {
    background: var(--accent-soft);
    color: var(--accent-contrast);
}

body {
    font-family: 'Fira Code', monospace;
    background-color: #020503;
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.5s ease, color 0.5s ease;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    cursor: none;
    word-wrap: break-word;
}

img,
svg,
video {
    max-width: 100%;
    height: auto;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: 12px;
    padding: 0.65rem 1rem;
    background: rgba(6, 14, 9, 0.92);
    border: 1px solid rgba(203, 213, 186, 0.45);
    color: var(--accent-alt);
    border-radius: 999px;
    text-decoration: none;
    transform: translateY(-150%);
    transition: transform 200ms ease;
    z-index: 2000;
}

.skip-link:focus {
    transform: translateY(0);
}

a {
    color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(163, 177, 138, 0.25);
    border-radius: 10px;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(163, 177, 138, 0.22), transparent 45%),
        radial-gradient(circle at 85% 10%, rgba(143, 169, 140, 0.2), transparent 45%),
        linear-gradient(135deg, #030604 0%, #111c15 50%, #050806 100%);
    z-index: -2;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), transparent 55%);
    mix-blend-mode: soft-light;
    opacity: 0.8;
    pointer-events: none;
    z-index: -1;
}

body.nfc-mode {
    background: radial-gradient(circle at 25% 15%, rgba(173, 221, 161, 0.18), transparent 26%),
                radial-gradient(circle at 80% 10%, rgba(152, 207, 142, 0.14), transparent 28%),
                linear-gradient(180deg, #071006 0%, #090b08 100%);
    color: #ecf7e9;
}

body.nfc-mode::before {
    filter: blur(1px);
}

body.nfc-mode::after {
    opacity: 1;
    mix-blend-mode: screen;
    filter: blur(1px);
}

.nfc-banner {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 2000;
    max-width: calc(100% - 2rem);
    padding: 0.95rem 1.15rem;
    border-radius: 22px;
    border: 1px solid rgba(188, 232, 178, 0.45);
    backdrop-filter: blur(16px);
    background: rgba(16, 35, 18, 0.78);
    color: #e8f4db;
    box-shadow: 0 0 0 rgba(163, 177, 138, 0);
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    transition: opacity 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
    font-size: 0.95rem;
    line-height: 1.4;
}

body.nfc-mode-active .nfc-banner {
    opacity: 1;
    transform: translateY(0) scale(1);
    box-shadow: 0 0 28px rgba(163, 177, 138, 0.34);
}

@keyframes nfc-pulse {
    from {
        box-shadow: 0 0 18px rgba(163, 177, 138, 0.18);
    }
    to {
        box-shadow: 0 0 32px rgba(163, 177, 138, 0.35);
    }
}

body.nfc-mode .nfc-banner {
    animation: nfc-pulse 2.4s ease-in-out infinite alternate;
}

/* Header & Nav */
header {
    background: linear-gradient(120deg, rgba(6, 13, 8, 0.8), rgba(14, 24, 17, 0.55));
    padding: max(1rem, env(safe-area-inset-top)) var(--gutter-right) max(1rem, env(safe-area-inset-bottom)) var(--gutter-left);
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 1px solid rgba(203, 213, 186, 0.32);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px) saturate(150%);
}


body > header {
    margin-bottom: 2.5rem;
}

nav {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

nav h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    color: var(--accent);
    letter-spacing: 0.12em;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.25rem;
}

nav ul li {
    margin-left: 0;
}

nav ul li a {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    transition: color 0.3s, letter-spacing 0.3s, text-shadow 0.3s, background 0.3s;
    position: relative;
    padding-bottom: 0.35rem;
    letter-spacing: 0.04em;
}

nav ul li a:hover {
    color: var(--accent);
    letter-spacing: 0.08em;
    text-shadow: 0 0 12px rgba(163, 177, 138, 0.9);
}

nav ul li a.active {
    color: var(--accent);
    letter-spacing: 0.1em;
    text-shadow: 0 0 14px rgba(163, 177, 138, 0.95);
}

nav ul li a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
    opacity: 0.8;
}

nav ul li a:hover::after,
nav ul li a:focus-visible::after,
nav ul li a.active::after {
    transform: scaleX(1);
}

nav ul li a:focus-visible {
    outline: none;
    color: var(--accent);
}

/* Hamburger (for mobile nav) */
.hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: var(--touch-min);
    min-height: var(--touch-min);
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--accent);
    padding: 0;
    border: none;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
}

/* Sections */
section {
    padding-top: var(--section-padding);
    padding-bottom: var(--section-padding);
    padding-left: var(--gutter-left);
    padding-right: var(--gutter-right);
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    isolation: isolate;
    width: 100%;
}

section:not(#home) {
    background: radial-gradient(circle at top left, rgba(163, 177, 138, 0.16), transparent 55%) border-box,
        radial-gradient(circle at bottom right, rgba(163, 177, 138, 0.06), transparent 55%) border-box,
        linear-gradient(135deg, rgba(8, 15, 10, 0.75), rgba(10, 20, 13, 0.9)) padding-box;
    border-radius: clamp(16px, 4vw, 26px);
    border: 1px solid rgba(203, 213, 186, 0.45);
    box-shadow: var(--shadow);
    backdrop-filter: blur(26px) saturate(150%);
    padding-top: var(--section-padding);
    padding-bottom: var(--section-padding);
    padding-left: var(--gutter-left);
    padding-right: var(--gutter-right);
    overflow: hidden;
    animation: fadeUp 0.9s ease both;
}

section:not(#home)::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 10%, rgba(163, 177, 138, 0.1) 55%, transparent 100%);
    opacity: 0.8;
    pointer-events: none;
}

.intro {
    position: relative;
    text-align: center;
    margin-top: 2rem;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
    padding: 3.2rem 2.8rem;
    background:
        radial-gradient(circle at top, rgba(163, 177, 138, 0.2), transparent 65%) border-box,
        linear-gradient(135deg, rgba(6, 14, 9, 0.75), rgba(12, 22, 15, 0.95)) padding-box;
    border: 1px solid rgba(203, 213, 186, 0.55);
    border-radius: 30px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(28px) saturate(160%);
    animation: fadeUp 0.9s ease 0.1s both;
}

.hero-actions {
    margin-top: 1.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero-actions .btn-chip {
    min-height: var(--touch-min);
}

.glow {
    color: var(--accent);
    text-shadow: 0 0 5px var(--accent), 0 0 18px var(--accent-alt);
    display: inline-block;
    animation: glowPulse 3s ease-in-out infinite alternate;
}

#home {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
}

#home::before {
    content: "";
    position: absolute;
    inset: 15% 5% auto 5%;
    height: 60%;
    background: radial-gradient(circle at center, rgba(163, 177, 138, 0.12), transparent 70%);
    filter: blur(10px);
    z-index: -1;
}

.intro h2 {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    margin-bottom: 1rem;
}

.intro p {
    font-size: 1.1rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

section h2 {
    color: var(--accent);
    font-size: clamp(1.2rem, 3.5vw, 1.5rem);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

section h2::before {
    content: "";
    width: 44px;
    height: 2px;
    background: var(--accent-alt);
    opacity: 0.7;
}

section h2::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(163, 177, 138, 0.6);
}

/* About */
#about .about-card {
    position: relative;
    background:
        radial-gradient(circle at top left, rgba(163, 177, 138, 0.14), transparent 55%) border-box,
        linear-gradient(145deg, rgba(6, 14, 9, 0.78), rgba(12, 22, 15, 0.95)) padding-box;
    border: 1px solid rgba(203, 213, 186, 0.4);
    border-radius: 22px;
    padding: 2.5rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(24px) saturate(150%);
}

.about-content {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.about-photo {
    flex-shrink: 0;
    position: relative;
    perspective: 900px;
    --rx: 0deg;
    --ry: 0deg;
    --mx: 50%;
    --my: 40%;
    transform: rotateX(var(--rx)) rotateY(var(--ry));
    transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform;
}

.about-photo::before {
    content: "";
    position: absolute;
    inset: -18px;
    background:
        radial-gradient(circle at var(--mx) var(--my), rgba(163, 177, 138, 0.22), transparent 55%);
    filter: blur(10px);
    opacity: 0.75;
    pointer-events: none;
    z-index: 0;
    transition: opacity 250ms ease;
}

.about-photo:hover::before {
    opacity: 1;
}

.about-photo img {
    position: relative;
    z-index: 1;
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 14px;
    border: 2px solid var(--accent);
    box-shadow: 0 12px 32px rgba(12, 20, 15, 0.4);
    background: rgba(0, 0, 0, 0.12);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    transform: translateZ(0);
    animation: floaty 6.5s ease-in-out infinite;
    will-change: transform;
}

.about-photo img:hover {
    animation-play-state: paused;
    box-shadow: 0 16px 40px rgba(163, 177, 138, 0.3);
}

@keyframes floaty {
    0%,
    100% {
        transform: translateY(0) rotateZ(-0.35deg);
    }

    50% {
        transform: translateY(-12px) rotateZ(0.55deg);
    }
}

.about-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.about-lead,
.about-content p {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.85;
    letter-spacing: 0.02em;
}

.about-lead strong,
.about-content p strong {
    color: var(--text);
}

.about-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}

.btn-resume {
    padding: 0.7rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(207, 218, 193, 0.98), rgba(163, 177, 138, 0.98));
    color: var(--accent-contrast);
    border: 1px solid rgba(207, 218, 193, 0.8);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    margin-bottom: 0.25rem;
}

.btn-resume:hover {
    background: linear-gradient(135deg, rgba(220, 228, 208, 0.98), rgba(180, 192, 155, 0.98));
    box-shadow: 0 12px 32px rgba(163, 177, 138, 0.35);
}

.btn-resume:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(163, 177, 138, 0.4);
}

.social-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    opacity: 0.9;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(203, 213, 186, 0.45);
    background: linear-gradient(145deg, rgba(6, 13, 8, 0.82), rgba(12, 22, 15, 0.96));
    color: var(--text-muted);
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.social-icon svg {
    width: 22px;
    height: 22px;
}

.social-icon:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(163, 177, 138, 0.25);
}

.social-icon:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(163, 177, 138, 0.2);
}

/* Projects */
.project-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: clamp(1.25rem, 4vw, 2.5rem);
}

.project {
    background:
        radial-gradient(circle at top left, rgba(163, 177, 138, 0.22), transparent 60%) border-box,
        linear-gradient(145deg, rgba(6, 13, 8, 0.82), rgba(12, 22, 15, 0.96)) padding-box;
    border: 1px solid rgba(203, 213, 186, 0.45);
    border-radius: 18px;
    padding: 1.5rem;
    position: relative;
    backdrop-filter: blur(24px) saturate(160%);
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: fadeUp 0.9s ease both;
}

.project::after,
#about .about-card::after,
.contact-form::after,
.intro::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(207, 218, 193, 0.55), rgba(163, 177, 138, 0.15), rgba(10, 20, 13, 0));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.55;
}

.project:hover::after,
#about .about-card:hover::after,
.contact-form:hover::after,
.intro:hover::after {
    opacity: 0.85;
}

.project:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 22px 50px rgba(163, 177, 138, 0.28);
}

.project::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(163, 177, 138, 0.2), transparent 60%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.project:hover::before {
    opacity: 1;
}

.project img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.project h3 {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-size: clamp(0.9rem, 2vw, 1rem);
    word-break: break-word;
}

.project p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.project-meta {
    list-style: none;
    margin: 0.7rem 0 0;
    padding-left: 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.6;
}

.project-meta li {
    margin-bottom: 0.25rem;
}

.project-meta strong {
    color: var(--accent-alt);
    font-weight: 600;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: space-between;
    margin-top: 1.2rem;
}

.btn-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border: 1px solid rgba(207, 218, 193, 0.6);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.btn-chip.demo {
    background: linear-gradient(135deg, rgba(22, 33, 26, 0.95), rgba(14, 24, 18, 0.95));
    color: var(--accent-alt);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
}

.btn-chip.code {
    background: linear-gradient(135deg, rgba(207, 218, 193, 0.95), rgba(163, 177, 138, 0.95));
    color: var(--accent-contrast);
}

.btn-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(163, 177, 138, 0.4);
}

.btn-chip:active {
    transform: translateY(0);
    box-shadow: 0 8px 18px rgba(163, 177, 138, 0.35);
}

.project:nth-child(2) {
    animation-delay: 0.12s;
}

.project:nth-child(3) {
    animation-delay: 0.24s;
}

.project:nth-child(4) {
    animation-delay: 0.36s;
}

/* Contact */
.contact-form {
    position: relative;
    background:
        radial-gradient(circle at top left, rgba(163, 177, 138, 0.14), transparent 55%) border-box,
        linear-gradient(145deg, rgba(6, 14, 9, 0.78), rgba(12, 22, 15, 0.95)) padding-box;
    border: 1px solid rgba(203, 213, 186, 0.4);
    border-radius: 22px;
    padding: 2.5rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(24px) saturate(150%);
}

.contact-intro {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 1.75rem;
    max-width: 480px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.contact-form {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.contact-form input,
.contact-form textarea {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(203, 213, 186, 0.4);
    background: rgba(6, 14, 9, 0.6);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(163, 177, 138, 0.2);
}

.contact-form textarea {
    min-height: 140px;
    resize: vertical;
}

.btn-submit {
    align-self: flex-start;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: linear-gradient(135deg, rgba(207, 218, 193, 0.98), rgba(163, 177, 138, 0.98));
    color: var(--accent-contrast);
    border: 1px solid rgba(207, 218, 193, 0.8);
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(163, 177, 138, 0.35);
    filter: brightness(1.05);
}

.btn-submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(163, 177, 138, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

.form-response {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--accent-alt);
    min-height: 1.5em;
}

/* Legacy form (e.g. other pages) */
form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background:
        radial-gradient(circle at top left, rgba(163, 177, 138, 0.18), transparent 60%) border-box,
        linear-gradient(150deg, rgba(6, 13, 8, 0.82), rgba(10, 20, 13, 0.96)) padding-box;
    padding: 2.5rem;
    border-radius: 22px;
    border: 1px solid rgba(203, 213, 186, 0.45);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(26px) saturate(160%);
}

form input,
form textarea {
    padding: 0.8rem;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(6, 13, 8, 0.9), rgba(10, 20, 13, 0.9));
    color: var(--text);
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

form input:focus,
form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(163, 177, 138, 0.15);
}

form textarea {
    min-height: 160px;
    resize: vertical;
}

form button {
    background:
        linear-gradient(135deg, rgba(207, 218, 193, 0.95), rgba(163, 177, 138, 0.96));
    color: var(--accent-contrast);
    border: none;
    padding: 0.9rem;
    border-radius: 999px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
    letter-spacing: 0.08em;
}

form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 46px rgba(163, 177, 138, 0.48);
    filter: brightness(1.05);
}

form button:focus-visible {
    outline: none;
    transform: translateY(-2px);
    box-shadow: 0 0 0 4px rgba(163, 177, 138, 0.25);
}

form button:active {
    transform: translateY(0);
    box-shadow: 0 6px 18px rgba(163, 177, 138, 0.3);
}

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(35px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glowPulse {
    0% {
        text-shadow: 0 0 4px var(--accent), 0 0 14px var(--accent-alt);
    }

    100% {
        text-shadow: 0 0 10px var(--accent), 0 0 26px rgba(163, 177, 138, 0.9);
    }
}

/* Scroll reveal (advanced but lightweight) */
.reveal {
    opacity: 0;
    transform: translateY(26px);
    filter: blur(6px);
    transition:
        opacity 800ms cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1),
        filter 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform, filter;
    animation: none !important;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.reveal.reveal-scale {
    transform: translateY(26px) scale(0.98);
}

.reveal.reveal-scale.is-visible {
    transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Footer */
footer {
    text-align: left;
    padding: clamp(1.25rem, 4vw, 2rem) var(--gutter-right) clamp(1.25rem, 4vw, 2rem) var(--gutter-left);
    padding-bottom: max(clamp(1.25rem, 4vw, 2rem), env(safe-area-inset-bottom));
    background: linear-gradient(135deg, rgba(8, 15, 10, 0.78), rgba(10, 20, 13, 0.9));
    border-top: 1px solid rgba(203, 213, 186, 0.32);
    box-shadow: 0 -18px 45px rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(18px) saturate(150%);
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

body > footer {
    margin-top: 2.5rem;
}

.site-footer .footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: clamp(1.25rem, 4vw, 2.25rem);
    align-items: start;
}

.site-footer h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.12em;
    color: var(--accent);
    text-transform: lowercase;
}

.site-footer h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent-alt);
    margin: 0.25rem 0 0.9rem;
}

.site-footer .footer-brand p {
    margin-top: 0.75rem;
    max-width: 34ch;
    line-height: 1.7;
    color: var(--text-muted);
}

.site-footer .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.site-footer .footer-links h4 {
    flex: 0 0 100%;
}

.site-footer .footer-links a {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    min-height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(203, 213, 186, 0.35);
    background: rgba(6, 14, 9, 0.45);
    letter-spacing: 0.14em;
    text-transform: lowercase;
    font-size: 0.72rem;
    transition: color 0.25s ease, transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.site-footer .footer-links a:hover,
.site-footer .footer-links a:focus-visible {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(163, 177, 138, 0.18);
    outline: none;
}

.site-footer .footer-social .social-links {
    gap: 0.65rem;
}

.site-footer .footer-social .social-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.site-footer .footer-social .social-icon svg {
    width: 20px;
    height: 20px;
}

.site-footer .footer-bottom {
    max-width: 1100px;
    margin: clamp(1.25rem, 4vw, 2rem) auto 0;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(203, 213, 186, 0.22);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.site-footer .footer-bottom p {
    margin: 0;
}

.site-footer .back-to-top {
    text-decoration: none;
    color: var(--text-muted);
    border: 1px solid rgba(203, 213, 186, 0.35);
    background: rgba(6, 14, 9, 0.45);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.75rem;
    transition: transform 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    min-height: var(--touch-min);
    display: inline-flex;
    align-items: center;
}

.site-footer .back-to-top:hover,
.site-footer .back-to-top:focus-visible {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(163, 177, 138, 0.18);
    outline: none;
}



/* Matrix Canvas */
#matrix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    display: block;
}

/* Custom cursor */
.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(207, 218, 193, 0.8);
    box-shadow:
        0 0 12px rgba(163, 177, 138, 0.9),
        0 0 32px rgba(163, 177, 138, 0.35);
    background: radial-gradient(circle at center, rgba(207, 218, 193, 0.25), transparent 60%);
    pointer-events: none;
    mix-blend-mode: screen;
    z-index: 1000;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.cursor-dot.hidden {
    opacity: 0;
}

/* Touch devices: use default cursor, hide custom cursor, simplify hover effects */
@media (hover: none) and (pointer: coarse) {
    body {
        cursor: auto;
    }
    .cursor-dot {
        display: none !important;
    }
    .intro:hover,
    .project:hover,
    .contact-form:hover {
        transform: none;
    }

    .site-footer .footer-links a {
        min-height: var(--touch-min);
    }

    .about-photo {
        transform: none !important;
    }
}

/* Subtle 3D hover on hero and cards */
.intro,
.project,
.contact-form {
    transform-style: preserve-3d;
    transform-origin: center;
}

.intro:hover,
.project:hover,
.contact-form:hover {
    transform: translateY(-8px) rotateX(6deg) rotateY(-4deg);
}

/* Responsive: tablets and smaller */
@media (max-width: 1024px) {
    .project-list {
        grid-template-columns: 1fr;
    }

    .project {
        padding: 1.5rem;
    }

    .site-footer .footer-inner {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .site-footer {
        text-align: center;
    }
}

/* Responsive: tablet and below */
@media (max-width: 768px) {
    nav ul {
        display: flex;
        flex-direction: column;
        background: var(--bg-alt);
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        padding: 0.5rem 0;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
        z-index: 1000;
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-8px);
        border-top: 1px solid rgba(203, 213, 186, 0.18);
        backdrop-filter: blur(16px) saturate(150%);
        transition:
            max-height 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
            opacity 200ms ease,
            transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
            visibility 0s linear 280ms;
    }

    nav ul.show {
        max-height: 420px;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
        transition:
            max-height 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
            opacity 220ms ease,
            transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
            visibility 0s linear 0s;
    }

    nav ul li {
        margin: 0;
    }

    nav ul li a {
        display: block;
        padding: 0.75rem var(--section-padding-x);
        min-height: var(--touch-min);
        display: flex;
        align-items: center;
        -webkit-tap-highlight-color: transparent;
    }

    .hamburger {
        display: flex;
    }

    nav h1 {
        font-size: clamp(1.25rem, 5vw, 1.5rem);
        letter-spacing: 0.08em;
    }

    #home {
        min-height: auto;
        padding: clamp(3rem, 10vw, 5rem) var(--section-padding-x);
    }

    .intro {
        padding: clamp(1.5rem, 5vw, 2.5rem) var(--section-padding-x);
        border-radius: 22px;
    }

    section:not(#home) {
        border-radius: 18px;
    }

    .project-list {
        gap: 1.8rem;
    }

    .project-meta {
        font-size: 0.8rem;
        line-height: 1.5;
    }

    form {
        padding: 2rem 1.5rem;
    }

    #contact .contact-form {
        padding: 1.75rem;
        border-radius: 18px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .contact-intro {
        margin-bottom: 1.5rem;
    }

    #about .about-card {
        padding: 1.75rem;
        border-radius: 18px;
    }

    .about-content {
        flex-direction: column;
        align-items: center;
        gap: 1.75rem;
    }

    .about-photo img {
        width: 160px;
        height: 160px;
    }

    .about-text {
        text-align: center;
    }

    .about-actions {
        align-items: center;
    }

    .social-label {
        margin-top: 0.25rem;
    }
}

/* Responsive: small phones */
@media (max-width: 480px) {
    section h2 {
        letter-spacing: 0.1em;
    }

    section h2::before {
        width: 28px;
    }

    .intro h2 {
        font-size: clamp(1.75rem, 10vw, 2.5rem);
    }

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

    .btn-chip {
        padding: 0.6rem 1rem;
        font-size: 0.75rem;
    }

    .btn-resume {
        padding: 0.65rem 1.25rem;
        font-size: 0.8rem;
    }

    .social-icon {
        width: 40px;
        height: 40px;
    }

    .social-icon svg {
        width: 20px;
        height: 20px;
    }

    .hero-actions {
        gap: 0.6rem;
    }

    #about .about-card,
    .contact-form {
        padding: 1.25rem;
    }

    .about-photo img {
        width: 140px;
        height: 140px;
    }
}

@media (max-width: 768px) {
    .site-footer .footer-inner {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .site-footer {
        text-align: center;
    }

    .site-footer .footer-links {
        justify-content: center;
    }

    .site-footer .footer-social .social-links {
        justify-content: center;
    }

    .site-footer .footer-bottom {
        justify-content: center;
        text-align: center;
    }

    .site-footer .footer-brand p {
        max-width: none;
    }
}

/* Responsive: tablets (avoid cramped 3-column footer) */
@media (max-width: 1024px) and (min-width: 769px) {
    .site-footer .footer-inner {
        grid-template-columns: 1fr 1fr;
    }

    .site-footer .footer-social {
        grid-column: 1 / -1;
    }
}

/* Responsive: very small phones */
@media (max-width: 360px) {
    nav h1 {
        font-size: 1.15rem;
        letter-spacing: 0.06em;
    }

    .btn-chip {
        padding: 0.55rem 0.9rem;
        font-size: 0.72rem;
    }

    .site-footer .back-to-top {
        padding: 0.45rem 0.85rem;
        font-size: 0.7rem;
    }
}
