/* ╔══════════════════════════════════════════════╗
   ║  GRAHAM HENRY — TECHNO PUNK PSYCHEDELIA     ║
   ║  "The Breathe" — everything pulses alive     ║
   ╚══════════════════════════════════════════════╝ */

/* ── TOKENS ── */
:root {
    --void: #0a0a0f;
    --void-deep: #050508;
    --void-surface: #0f0f18;
    --void-elevated: #14142a;

    --neon-cyan: #00f0ff;
    --neon-magenta: #ff00aa;
    --neon-green: #39ff14;
    --neon-violet: #7b2ff7;
    --neon-orange: #ff6a00;
    --neon-pink: #ff2d95;

    --text-primary: #e0e0f0;
    --text-secondary: #8888aa;
    --text-muted: #55557a;

    --glass-bg: rgba(15, 15, 30, 0.6);
    --glass-border: rgba(0, 240, 255, 0.15);
    --glass-glow: rgba(0, 240, 255, 0.05);

    --font-display: 'Orbitron', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    --font-body: 'Rajdhani', sans-serif;

    --breathe-speed: 8s;
    --drift-speed: 20s;
}

/* ── RESET ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: var(--void);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none;
}

/* ── SCAN LINES ── */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    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);
    animation: scanlineFlicker 0.1s infinite;
}

@keyframes scanlineFlicker {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.35;
    }
}

/* ── CURSOR GLOW ── */
.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s;
    mix-blend-mode: screen;
}

/* ── PARTICLE CANVAS ── */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ── BREATHING BACKGROUND LAYERS ── */
.bg-layer {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: -1;
    pointer-events: none;
}

.bg-layer-1 {
    background: radial-gradient(ellipse at 20% 50%, rgba(123, 47, 247, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 240, 255, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(255, 0, 170, 0.08) 0%, transparent 50%);
    animation: breathe1 var(--breathe-speed) ease-in-out infinite, drift1 var(--drift-speed) ease-in-out infinite;
}

.bg-layer-2 {
    background: radial-gradient(ellipse at 70% 60%, rgba(255, 0, 170, 0.12) 0%, transparent 45%),
        radial-gradient(ellipse at 30% 30%, rgba(57, 255, 20, 0.06) 0%, transparent 50%);
    animation: breathe2 calc(var(--breathe-speed) * 1.3) ease-in-out infinite, drift2 calc(var(--drift-speed) * 1.2) ease-in-out infinite;
}

.bg-layer-3 {
    background: radial-gradient(ellipse at 50% 50%, rgba(0, 240, 255, 0.06) 0%, transparent 60%);
    animation: breathe3 calc(var(--breathe-speed) * 0.7) ease-in-out infinite;
}

@keyframes breathe1 {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.7;
    }
}

@keyframes breathe2 {

    0%,
    100% {
        transform: scale(1.02);
        opacity: 0.8;
    }

    50% {
        transform: scale(0.98);
        opacity: 1;
    }
}

@keyframes breathe3 {

    0%,
    100% {
        transform: scale(0.95);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.08);
        opacity: 0.9;
    }
}

@keyframes drift1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(2%, -1%) scale(1.03);
    }

    50% {
        transform: translate(-1%, 2%) scale(1.05);
    }

    75% {
        transform: translate(1%, 1%) scale(1.02);
    }
}

@keyframes drift2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1.02);
    }

    33% {
        transform: translate(-2%, 1%) scale(0.98);
    }

    66% {
        transform: translate(1%, -2%) scale(1.04);
    }
}

/* ── GRID WARP ── */
.grid-warp {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.04;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.3) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridPulse var(--breathe-speed) ease-in-out infinite;
    perspective: 500px;
    transform: perspective(500px) rotateX(60deg) translateY(-20%);
    transform-origin: center bottom;
}

@keyframes gridPulse {

    0%,
    100% {
        opacity: 0.04;
        background-size: 60px 60px;
    }

    50% {
        opacity: 0.07;
        background-size: 62px 62px;
    }
}

/* ════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════ */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.hero-content {
    text-align: center;
    position: relative;
}

/* ── GLITCH TEXT ── */
.glitch {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 7rem);
    font-weight: 900;
    letter-spacing: 0.08em;
    position: relative;
    color: var(--text-primary);
    text-shadow:
        0 0 10px rgba(0, 240, 255, 0.5),
        0 0 40px rgba(0, 240, 255, 0.2),
        0 0 80px rgba(123, 47, 247, 0.1);
    animation: glitchPulse 4s ease-in-out infinite;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
}

.glitch::before {
    color: var(--neon-cyan);
    z-index: -1;
    animation: glitchLeft 3s infinite;
    clip-path: inset(0 0 0 0);
}

.glitch::after {
    color: var(--neon-magenta);
    z-index: -2;
    animation: glitchRight 2.5s infinite;
    clip-path: inset(0 0 0 0);
}

@keyframes glitchPulse {

    0%,
    100% {
        text-shadow: 0 0 10px rgba(0, 240, 255, 0.5), 0 0 40px rgba(0, 240, 255, 0.2);
    }

    25% {
        text-shadow: 0 0 15px rgba(255, 0, 170, 0.4), 0 0 50px rgba(255, 0, 170, 0.15);
    }

    50% {
        text-shadow: 0 0 10px rgba(123, 47, 247, 0.5), 0 0 40px rgba(123, 47, 247, 0.2);
    }

    75% {
        text-shadow: 0 0 12px rgba(57, 255, 20, 0.4), 0 0 45px rgba(57, 255, 20, 0.15);
    }
}

@keyframes glitchLeft {

    0%,
    90%,
    100% {
        clip-path: inset(0 0 0 0);
        transform: translate(0);
    }

    91% {
        clip-path: inset(20% 0 60% 0);
        transform: translate(-4px, -2px);
    }

    93% {
        clip-path: inset(50% 0 20% 0);
        transform: translate(3px, 1px);
    }

    95% {
        clip-path: inset(10% 0 70% 0);
        transform: translate(-2px, 3px);
    }

    97% {
        clip-path: inset(40% 0 30% 0);
        transform: translate(4px, -1px);
    }
}

@keyframes glitchRight {

    0%,
    88%,
    100% {
        clip-path: inset(0 0 0 0);
        transform: translate(0);
    }

    89% {
        clip-path: inset(60% 0 10% 0);
        transform: translate(4px, 2px);
    }

    92% {
        clip-path: inset(15% 0 55% 0);
        transform: translate(-3px, -1px);
    }

    94% {
        clip-path: inset(45% 0 25% 0);
        transform: translate(2px, -3px);
    }

    96% {
        clip-path: inset(25% 0 45% 0);
        transform: translate(-4px, 1px);
    }
}

/* ── SUBTITLE / TYPEWRITER ── */
.subtitle {
    font-family: var(--font-mono);
    font-size: clamp(0.9rem, 2vw, 1.3rem);
    color: var(--text-secondary);
    margin-top: 1.5rem;
    min-height: 2rem;
    letter-spacing: 0.15em;
}

.type-cursor::after {
    content: '█';
    animation: blink 0.8s infinite;
    color: var(--neon-cyan);
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* ── HERO LINE ── */
.hero-line {
    width: 120px;
    height: 2px;
    margin: 2rem auto;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), var(--neon-magenta), transparent);
    animation: lineGlow 3s ease-in-out infinite;
}

@keyframes lineGlow {

    0%,
    100% {
        opacity: 0.6;
        width: 120px;
    }

    50% {
        opacity: 1;
        width: 200px;
    }
}

/* ── SCROLL INDICATOR ── */
.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    animation: floatDown 2s ease-in-out infinite;
}

.scroll-arrow {
    font-size: 1.5rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
}

.scroll-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    color: var(--text-muted);
}

@keyframes floatDown {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.6;
    }

    50% {
        transform: translateY(8px);
        opacity: 1;
    }
}

/* ════════════════════════════════════════════
   GLASS PANELS (About / Contact)
   ════════════════════════════════════════════ */

.glass-panel {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    padding: 3rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 2px;
    overflow: hidden;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), var(--neon-magenta), transparent);
    opacity: 0.6;
}

.panel-glow {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 200px;
    background: radial-gradient(ellipse, rgba(0, 240, 255, 0.06) 0%, transparent 70%);
    pointer-events: none;
    animation: panelBreathe 6s ease-in-out infinite;
}

@keyframes panelBreathe {

    0%,
    100% {
        opacity: 0.5;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.2);
    }
}

/* ── SECTION TITLES ── */
.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: 0.15em;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    margin-top: 0.75rem;
    background: linear-gradient(90deg, var(--neon-cyan), transparent);
    animation: titleLine 4s ease-in-out infinite;
}

@keyframes titleLine {

    0%,
    100% {
        width: 60px;
        opacity: 0.7;
    }

    50% {
        width: 100px;
        opacity: 1;
    }
}

/* ════════════════════════════════════════════
   ABOUT SECTION
   ════════════════════════════════════════════ */

.about {
    position: relative;
    z-index: 2;
    padding: 8rem 2rem;
}

.bio-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.bio-text:last-child {
    margin-bottom: 0;
}

.neon-accent {
    color: var(--neon-cyan);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
    font-weight: 500;
}

.neon-accent-alt {
    color: var(--neon-magenta);
    text-shadow: 0 0 8px rgba(255, 0, 170, 0.4);
    font-weight: 500;
}

.neon-accent-green {
    color: var(--neon-green);
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.4);
    font-weight: 500;
}

/* ════════════════════════════════════════════
   PROJECTS SECTION
   ════════════════════════════════════════════ */

.projects {
    position: relative;
    z-index: 2;
    padding: 4rem 2rem 8rem;
    text-align: center;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.project-card {
    position: relative;
    padding: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    text-align: left;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        border-color 0.4s ease;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: hsla(var(--card-hue), 100%, 60%, 0.3);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, hsla(var(--card-hue), 100%, 60%, 0.8), transparent);
    opacity: 0;
    transition: opacity 0.4s;
}

.project-card:hover::before {
    opacity: 1;
}

.card-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.5'/%3E%3C/svg%3E");
    pointer-events: none;
}

.card-border {
    position: absolute;
    inset: 0;
    border-radius: 2px;
    pointer-events: none;
    background: linear-gradient(135deg,
            hsla(var(--card-hue), 100%, 60%, 0.1) 0%,
            transparent 50%,
            hsla(var(--card-hue), 100%, 60%, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s;
}

.project-card:hover .card-border {
    opacity: 1;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.card-link {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: hsla(var(--card-hue), 100%, 65%, 0.8);
    transition: color 0.3s;
}

.project-card:hover .card-link {
    color: hsla(var(--card-hue), 100%, 70%, 1);
    text-shadow: 0 0 10px hsla(var(--card-hue), 100%, 60%, 0.5);
}

/* ════════════════════════════════════════════
   CONTACT SECTION
   ════════════════════════════════════════════ */

.contact {
    position: relative;
    z-index: 2;
    padding: 4rem 2rem 8rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    border-radius: 2px;
    transition: all 0.3s ease;
    font-weight: 300;
}

.contact-item:hover {
    color: var(--neon-cyan);
    border-color: var(--glass-border);
    background: rgba(0, 240, 255, 0.03);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.contact-icon {
    font-size: 1.2rem;
    width: 2rem;
    text-align: center;
    color: var(--neon-cyan);
    opacity: 0.6;
    transition: opacity 0.3s;
}

.contact-item:hover .contact-icon {
    opacity: 1;
}

.contact-text {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

/* ════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════ */

.footer {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.footer-line {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
    margin-bottom: 1.5rem;
}

.footer-text {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    color: var(--text-muted);
    animation: footerPulse 4s ease-in-out infinite;
}

@keyframes footerPulse {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.7;
    }
}

/* ════════════════════════════════════════════
   SCROLL REVEAL
   ════════════════════════════════════════════ */

.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* stagger children in the grid */
.project-grid .reveal-element:nth-child(1) {
    transition-delay: 0s;
}

.project-grid .reveal-element:nth-child(2) {
    transition-delay: 0.1s;
}

.project-grid .reveal-element:nth-child(3) {
    transition-delay: 0.2s;
}

.project-grid .reveal-element:nth-child(4) {
    transition-delay: 0.3s;
}

/* ════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════ */

@media (max-width: 768px) {
    body {
        cursor: auto;
    }

    .cursor-glow {
        display: none;
    }

    .scanlines {
        opacity: 0.2;
    }

    .glass-panel {
        padding: 2rem 1.5rem;
        margin: 0 1rem;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .hero-content {
        padding: 0 1rem;
    }

    .glitch {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }
}

@media (max-width: 480px) {

    .about,
    .projects,
    .contact {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .glass-panel {
        padding: 1.5rem 1rem;
    }
}

/* ── CUSTOM SCROLLBAR ── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--void);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 240, 255, 0.3);
}

/* ── SELECTION ── */
::selection {
    background: rgba(0, 240, 255, 0.2);
    color: var(--neon-cyan);
}