/* ============================================
   Duncan Barnes — Portfolio
   Purple + Gold + Glowing edges
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@300;400;500;600&display=swap');

/* ---- Variables ---- */
:root {
    --font-display: 'Chakra Petch', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --bg: #0c0118;
    --bg-alt: #110220;
    --surface: #180530;
    --text: #ede9f7;
    --text-dim: #9b8fb8;
    --gold: #ffd700;
    --gold-dim: #c9a800;
    --gold-glow: rgba(255, 215, 0, 0.15);
    --purple: #8b3dff;
    --purple-glow: rgba(139, 61, 255, 0.2);
    --border: rgba(139, 61, 255, 0.15);
    --border-bright: rgba(255, 215, 0, 0.25);
    --nav-bg: rgba(12, 1, 24, 0.92);
    --card-bg: rgba(24, 5, 48, 0.6);

    --radius: 10px;
    --radius-sm: 6px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg: #f8f6fc;
    --bg-alt: #efecf5;
    --surface: #ffffff;
    --text: #0c0118;
    --text-dim: #605878;
    --gold: #c49b00;
    --gold-dim: #9a7a00;
    --gold-glow: rgba(196, 155, 0, 0.12);
    --purple: #7b2ff2;
    --purple-glow: rgba(123, 47, 242, 0.1);
    --border: rgba(123, 47, 242, 0.12);
    --border-bright: rgba(196, 155, 0, 0.2);
    --nav-bg: rgba(248, 246, 252, 0.92);
    --card-bg: rgba(255, 255, 255, 0.8);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-mono);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Only animate theme transitions when actively switching (class added/removed by JS) */
body.theme-transitioning,
body.theme-transitioning * {
    transition: background 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease) !important;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---- Scanlines ---- */
.scanlines {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    opacity: 0.4;
    /* Chrome perf: promote to own layer so it doesn't force repaints underneath */
    will-change: opacity;
    transform: translateZ(0);
    contain: strict;
}

[data-theme="light"] .scanlines {
    opacity: 0.15;
}

/* ---- Navigation ---- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    transition: background 0.4s var(--ease);
    /* Chrome perf: promote to own compositor layer */
    will-change: transform;
    transform: translateZ(0);
}

header.scrolled {
    border-bottom-color: var(--border-bright);
    box-shadow: 0 0 40px rgba(139, 61, 255, 0.06);
}

nav {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-glyph {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 20px;
    color: var(--gold);
    text-shadow: 0 0 12px var(--gold-glow);
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 17px;
    color: var(--text);
    letter-spacing: 0.02em;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 4px;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 400;
    color: var(--text-dim);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: color 0.3s, background 0.3s;
    letter-spacing: 0.02em;
}

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

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Theme Dropdown */
.theme-dropdown {
    position: relative;
}

.theme-dropdown-btn {
    background: none;
    border: 1px solid var(--border);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 18px;
    transition: color 0.3s, border-color 0.3s, background 0.3s;
}

.theme-dropdown-btn:hover {
    color: var(--gold);
    border-color: var(--gold);
    background: var(--gold-glow);
}

/* Icon visibility based on current selection */
.toggle-icon.sun,
.toggle-icon.moon,
.toggle-icon.system { display: none; }

[data-theme-mode="light"] .toggle-icon.sun { display: inline; }
[data-theme-mode="dark"] .toggle-icon.moon { display: inline; }
[data-theme-mode="system"] .toggle-icon.system { display: inline; }

.theme-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    min-width: 140px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

.theme-menu.open {
    display: flex;
}

.theme-menu button {
    font-family: var(--font-mono);
    font-size: 13px;
    background: none;
    border: none;
    color: var(--text-dim);
    padding: 10px 14px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}

.theme-menu button span {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.theme-menu button:hover {
    color: var(--gold);
    background: var(--gold-glow);
}

.theme-menu button.active {
    color: var(--gold);
}

.nav-cta {
    font-size: 13px !important;
    padding: 8px 20px !important;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.hamburger span {
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s var(--ease), opacity 0.3s;
}

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

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 14px;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    letter-spacing: 0.04em;
    text-decoration: none;
}

.btn-glow {
    background: var(--gold);
    color: var(--bg);
    box-shadow: 0 0 20px var(--gold-glow), inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.btn-glow:hover {
    background: #ffe44d;
    transform: translateY(-2px);
    box-shadow: 0 0 36px rgba(255, 215, 0, 0.35), inset 0 0 20px rgba(255, 255, 255, 0.15);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
}

.btn-outline:hover {
    background: var(--gold-glow);
    transform: translateY(-2px);
}

.btn-full { width: 100%; }

/* ---- Hero ---- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 120px 24px 80px;
    overflow: hidden;
}

/* Perspective grid background */
.hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 70% 50% at 50% 50%, black 20%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 50%, black 20%, transparent 100%);
    opacity: 0.5;
    animation: gridPulse 6s ease-in-out infinite alternate;
    /* Chrome perf: isolate layer so opacity animation doesn't re-rasterize mask */
    will-change: opacity;
    transform: translateZ(0);
    contain: layout style;
}

@keyframes gridPulse {
    0% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

/* Radial glow behind hero */
.hero::before {
    content: '';
    position: absolute;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 900px;
    background: radial-gradient(circle, var(--purple-glow) 0%, rgba(255, 215, 0, 0.03) 50%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 780px;
}

.hero-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.2em;
    color: var(--gold);
    margin-bottom: 28px;
    opacity: 0.85;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 700;
    line-height: 1.05;
    margin-bottom: 24px;
    color: var(--text);
}

.hero h1 .line {
    display: block;
}

.hero h1 .accent {
    background: linear-gradient(90deg, var(--gold), #ff9500, var(--purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.cursor {
    display: inline-block;
    color: var(--gold);
    -webkit-text-fill-color: var(--gold);
    animation: blink 1s step-end infinite;
    font-weight: 300;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-sub {
    font-size: 15px;
    color: var(--text-dim);
    margin-bottom: 40px;
    letter-spacing: 0.06em;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-scroll {
    position: absolute;
    bottom: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.scroll-text {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.3em;
    color: var(--text-dim);
}

.scroll-bar {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--gold), transparent);
    animation: scrollDrop 2s ease-in-out infinite;
    will-change: transform, opacity;
}

@keyframes scrollDrop {
    0%, 100% { opacity: 1; transform: scaleY(1); }
    50% { opacity: 0.3; transform: scaleY(0.5); }
}

/* ---- Sections ---- */
.section {
    padding: 110px 24px;
    position: relative;
    /* Chrome perf: skip rendering of off-screen sections until needed */
    content-visibility: auto;
    contain-intrinsic-size: auto 800px;
}

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

.container {
    max-width: 1060px;
    margin: 0 auto;
}

.section-tag {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--purple);
    opacity: 0.5;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.15;
}

.section-sub {
    color: var(--text-dim);
    font-size: 15px;
    margin-bottom: 40px;
}

/* ---- About ---- */
.about-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 60px;
    align-items: center;
    margin: 40px 0;
}

.about-left {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.headshot-wrapper {
    display: flex;
    justify-content: flex-start;
}

.headshot-placeholder {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px dashed var(--border-bright);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-dim);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.headshot-placeholder svg {
    width: 40px;
    height: 40px;
    opacity: 0.5;
}

.headshot-placeholder span {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.05em;
    opacity: 0.5;
}

.headshot-placeholder:hover {
    border-color: var(--gold);
    box-shadow: 0 0 24px var(--gold-glow);
}

/* When you add a real image, use this class instead:
.headshot-img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-bright);
    box-shadow: 0 0 24px var(--gold-glow);
}
*/

.about-text h2 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

.about-text p {
    font-size: 15px;
    color: var(--text-dim);
    line-height: 1.8;
}

.about-stats {
    display: flex;
    gap: 20px;
}

.stat {
    flex: 1;
    text-align: center;
    padding: 28px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.3s;
}

.stat:hover {
    border-color: var(--gold);
}

.stat-num {
    font-family: var(--font-display);
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
    text-shadow: 0 0 20px var(--gold-glow);
}

.stat-num::after {
    content: '+';
    font-size: 0.6em;
}

.stat-label {
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 8px;
}

/* ---- Services ---- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 40px 0;
}

.service-card {
    padding: 36px 28px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s var(--ease), border-color 0.3s;
}

.service-card:hover {
    transform: translateY(-6px);
    border-color: var(--gold);
}

.service-card:hover .card-line {
    width: 100%;
    background: var(--gold);
    box-shadow: 0 0 16px var(--gold-glow);
}

.card-number {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 700;
    color: var(--purple);
    opacity: 0.12;
    position: absolute;
    top: 16px;
    right: 20px;
    line-height: 1;
}

.service-card h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.service-card p {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.7;
}

.card-line {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--purple);
    transition: width 0.5s var(--ease), background 0.3s;
}

/* ---- Tech Stack ---- */
.stack-search {
    margin: 32px 0 8px;
    max-width: 400px;
}

.stack-search input {
    width: 100%;
    font-family: var(--font-mono);
    font-size: 14px;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.stack-search input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.stack-search input::placeholder {
    color: var(--text-dim);
    opacity: 0.5;
}

.stack-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin: 24px 0 40px;
}

.stack-category {
    padding: 24px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.3s, opacity 0.3s;
}

.stack-category:hover {
    border-color: var(--gold);
}

.stack-category.hidden {
    display: none;
}

.stack-category h4 {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 16px;
}

/* Scrolling tags inside each card */
.stack-scroll {
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
}

.stack-track {
    display: flex;
    gap: 8px;
    width: max-content;
    animation: stackScroll 20s linear infinite;
    /* Chrome perf: promote each track to its own GPU layer */
    will-change: transform;
    transform: translateZ(0);
}

.stack-category:nth-child(2) .stack-track { animation-duration: 24s; }
.stack-category:nth-child(3) .stack-track { animation-duration: 16s; }
.stack-category:nth-child(4) .stack-track { animation-duration: 18s; }
.stack-category:nth-child(5) .stack-track { animation-duration: 15s; }

/* Pause scroll on hover */
.stack-category:hover .stack-track {
    animation-play-state: paused;
}

@keyframes stackScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.stack-track span {
    flex-shrink: 0;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-dim);
    white-space: nowrap;
    transition: color 0.3s, border-color 0.3s, background 0.3s;
}

.stack-track span:hover {
    color: var(--gold);
    border-color: var(--gold);
}

.stack-track span.match {
    color: var(--gold);
    border-color: var(--gold);
    background: var(--gold-glow);
}

/* When searching, stop all animations and show as wrapped tags */
.stack-category.searching .stack-scroll {
    mask-image: none;
    -webkit-mask-image: none;
}

.stack-category.searching .stack-track {
    animation: none;
    flex-wrap: wrap;
    width: auto;
}

.stack-category.searching .stack-track span.duplicate {
    display: none;
}

/* ---- Projects ---- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 8px;
}

.project-card {
    padding: 28px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s var(--ease), border-color 0.3s;
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
}

.project-card h3 {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
}

.project-card p {
    font-size: 13px;
    color: var(--text-dim);
    flex-grow: 1;
    margin-bottom: 16px;
    line-height: 1.6;
}

.project-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.project-card .btn-outline {
    align-self: flex-start;
    font-size: 12px;
    padding: 7px 16px;
}

/* Skeleton */
.skeleton-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    height: 190px;
    animation: pulse 1.4s ease-in-out infinite alternate;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    100% { opacity: 0.15; }
}

/* ---- Experience Timeline ---- */
.timeline {
    position: relative;
    margin: 40px 0;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, var(--purple), var(--gold), transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 48px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -40px;
    top: 6px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--gold);
    box-shadow: 0 0 12px var(--gold-glow);
    z-index: 1;
    transition: background 0.3s, box-shadow 0.3s;
}

.timeline-item:hover .timeline-dot {
    background: var(--gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.12em;
    color: var(--gold);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.timeline-content {
    padding: 24px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.3s;
}

.timeline-item:hover .timeline-content {
    border-color: var(--gold);
}

.timeline-content h3 {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-company {
    font-size: 13px;
    color: var(--gold-dim);
    margin-bottom: 10px;
    font-weight: 500;
}

.timeline-content p {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.7;
}

@media (max-width: 768px) {
    .timeline {
        padding-left: 32px;
    }
    .timeline::before {
        left: 5px;
    }
    .timeline-dot {
        left: -32px;
        width: 12px;
        height: 12px;
    }
    .timeline-content {
        padding: 18px;
    }
}

/* ---- Contact ---- */
.contact-layout {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 56px;
    margin: 40px 0;
    align-items: start;
}

.contact-form {
    padding: 36px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.field input,
.field textarea {
    font-family: var(--font-mono);
    font-size: 14px;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.field input:focus,
.field textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--text-dim);
    opacity: 0.5;
}

.field textarea {
    resize: vertical;
    min-height: 110px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.detail-block h4 {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.detail-block a {
    font-size: 16px;
    color: var(--text);
    transition: color 0.3s;
}

.detail-block a:hover {
    color: var(--gold);
}

.socials {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.socials a {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    transition: color 0.3s, border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

.socials a svg {
    width: 20px;
    height: 20px;
}

.socials a:hover {
    color: var(--gold);
    border-color: var(--gold);
    background: var(--gold-glow);
    box-shadow: 0 0 16px var(--gold-glow);
}

/* ---- Form Status ---- */
.form-status {
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    text-align: center;
    letter-spacing: 0.02em;
    animation: fadeIn 0.3s var(--ease);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-status.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.form-status.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

#submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ---- Footer ---- */
footer {
    border-top: 1px solid var(--border);
    padding: 28px 24px;
    text-align: center;
}

footer p {
    font-size: 13px;
    color: var(--text-dim);
}

/* ---- Reveal Animations ---- */
.reveal {
    opacity: 0;
    transform: translateY(28px) translateZ(0);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
    will-change: transform, opacity;
}

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

/* Stagger children */
.services-grid .reveal:nth-child(2) { transition-delay: 0.1s; }
.services-grid .reveal:nth-child(3) { transition-delay: 0.2s; }
.about-stats .stat:nth-child(2) { transition-delay: 0.1s; }
.about-stats .stat:nth-child(3) { transition-delay: 0.2s; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .about-layout {
        grid-template-columns: 1fr;
        gap: 36px;
    }
    .headshot-wrapper {
        justify-content: center;
    }
    .services-grid {
        grid-template-columns: 1fr;
    }
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 36px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: fixed;
        inset: 68px 0 0 0;
        background: var(--bg);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 12px;
        z-index: 999;
    }
    .nav-links.show { display: flex; }
    .nav-links a { font-size: 18px; padding: 12px 24px; }
    .nav-cta { display: none !important; }
    .hamburger { display: flex; }

    .hero { padding: 100px 20px 60px; }
    .hero h1 { font-size: clamp(2.4rem, 9vw, 3.6rem); }

    .about-stats { flex-direction: column; gap: 16px; }

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

    .section { padding: 80px 20px; }

    .contact-form { padding: 24px; }
}

/* ---- Blog Page ---- */
.blog-hero {
    padding: 140px 24px 60px;
    text-align: center;
}

.blog-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 700;
    color: var(--text);
}

.blog-hero p {
    color: var(--text-dim);
    font-size: 15px;
    margin-top: 12px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 24px 120px;
}

.blog-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.3s var(--ease), border-color 0.3s;
}

.blog-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
}

.blog-card-img {
    width: 100%;
    height: 180px;
    background: var(--surface);
}

.blog-card-body {
    padding: 24px;
}

.blog-card-body h3 {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 10px;
}

.blog-card-body p {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 18px;
}

.blog-card-body .btn {
    font-size: 13px;
    padding: 8px 18px;
}

/* ---- Page Loader ---- */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s var(--ease), visibility 0.5s;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-glyph {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 32px;
    color: var(--gold);
    text-shadow: 0 0 24px var(--gold-glow);
    animation: loaderPulse 1s ease-in-out infinite alternate;
}

@keyframes loaderPulse {
    0% { opacity: 0.4; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1.05); }
}

/* ---- Back to Top ---- */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 900;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) translateZ(0);
    transition: opacity 0.3s var(--ease), visibility 0.3s, transform 0.3s var(--ease), background 0.3s, border-color 0.3s, box-shadow 0.3s;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    /* Chrome perf: own compositor layer */
    will-change: transform, opacity;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) translateZ(0);
}

.back-to-top:hover {
    background: var(--gold);
    color: var(--bg);
    border-color: var(--gold);
    box-shadow: 0 0 24px var(--gold-glow);
    transform: translateY(-2px) translateZ(0);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}