/* ==========================================================================
   GLOBAL STYLES - Shared across all pages
   ========================================================================== */

/* Design tokens */
:root {
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 50%;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #ffffff;
    color: #1D1D1D;
    line-height: 1.5;
    cursor: none;
}

/* Containers */
.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 2;
}

.header-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 0;
}

.section-content {
    max-width: 640px;
    margin: 0 auto;
}

/* Typography */
h1 {
    font-family: 'Inter', sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-size: 36px;
    line-height: 1.3em;
    color: #1D1D1D;
    margin-bottom: 80px;
}

h1 + .body-text {
    margin-top: -48px;
}

h2 {
    font-family: 'Inter', sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-size: 32px;
    line-height: 1.4em;
    color: #1D1D1D;
    margin-bottom: 8px;
}

h3 {
    font-family: 'Inter', sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-size: 25px;
    line-height: 1.5em;
    color: #1D1D1D;
    margin-bottom: 16px;
    margin-top: 80px;
}

h3:first-child {
    margin-top: 0;
}

h4 {
    font-family: 'Inter', sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-size: 20px;
    line-height: 1.5em;
    color: #1D1D1D;
    margin-bottom: 0;
}

.subtitle {
    font-family: 'Inter', sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-size: 20px;
    line-height: 1.5em;
    color: rgba(29, 29, 29, 0.5);
}

.body-text {
    font-family: 'Inter', sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-size: 20px;
    line-height: 1.5em;
    color: rgba(29, 29, 29, 0.5);
    margin-bottom: 32px;
}

.body-text a {
    color: #1D1D1D;
    text-decoration: none;
}

.body-text:last-child {
    margin-bottom: 0;
}

.caption {
    font-family: 'Inter', sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6em;
    color: rgba(29, 29, 29, 0.5);
}

/* Glitch effect for hyperlinked text - plays once on hover */
.glitch-link {
    position: relative;
    display: inline-block;
    overflow: visible;
}

.glitch-link::before,
.glitch-link::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
}

.glitch-link.glitch-active::before {
    color: #FF0040;
    text-shadow: 0 0 2px #FF0040;
    animation: glitch-link-rgb-before var(--glitch-duration, 0.3s) steps(6) forwards;
}

.glitch-link.glitch-active::after {
    color: #00D4FF;
    text-shadow: 0 0 2px #00D4FF;
    animation: glitch-link-rgb-after var(--glitch-duration, 0.3s) steps(6) forwards;
}

.glitch-link.glitch-active {
    animation: glitch-link-distort var(--glitch-duration, 0.3s) steps(6) forwards;
}

@keyframes glitch-link-rgb-before {
    0%, 100% { transform: translate(0, 0); opacity: 0; }
    16% { transform: translate(calc(-3px * var(--glitch-intensity, 0.7)), calc(1px * var(--glitch-intensity, 0.7))); opacity: 0.85; }
    33% { transform: translate(calc(2px * var(--glitch-intensity, 0.7)), calc(-2px * var(--glitch-intensity, 0.7))); opacity: 0.85; }
    50% { transform: translate(calc(-2px * var(--glitch-intensity, 0.7)), calc(2px * var(--glitch-intensity, 0.7))); opacity: 0.85; }
    66% { transform: translate(calc(3px * var(--glitch-intensity, 0.7)), calc(-1px * var(--glitch-intensity, 0.7))); opacity: 0.85; }
    83% { transform: translate(0, 0); opacity: 0; }
}

@keyframes glitch-link-rgb-after {
    0%, 100% { transform: translate(0, 0); opacity: 0; }
    16% { transform: translate(calc(3px * var(--glitch-intensity, 0.7)), calc(-1px * var(--glitch-intensity, 0.7))); opacity: 0.85; }
    33% { transform: translate(calc(-2px * var(--glitch-intensity, 0.7)), calc(2px * var(--glitch-intensity, 0.7))); opacity: 0.85; }
    50% { transform: translate(calc(2px * var(--glitch-intensity, 0.7)), calc(-2px * var(--glitch-intensity, 0.7))); opacity: 0.85; }
    66% { transform: translate(calc(-3px * var(--glitch-intensity, 0.7)), calc(1px * var(--glitch-intensity, 0.7))); opacity: 0.85; }
    83% { transform: translate(0, 0); opacity: 0; }
}

@keyframes glitch-link-distort {
    0%, 100% {
        text-shadow: none;
        transform: translate(0) skew(0deg);
        font-style: normal;
        filter: none;
        opacity: 1;
    }
    8% {
        text-shadow: calc(-4px * var(--glitch-intensity, 0.7)) 0 2px #FF0040, calc(4px * var(--glitch-intensity, 0.7)) 0 2px #00D4FF, calc(-2px * var(--glitch-intensity, 0.7)) calc(2px * var(--glitch-intensity, 0.7)) 3px #FF0040;
        transform: translate(calc(-4px * var(--glitch-intensity, 0.7)), calc(3px * var(--glitch-intensity, 0.7))) skew(calc(-12deg * var(--glitch-intensity, 0.7)));
        font-style: italic;
        filter: brightness(1.3) blur(0.5px);
    }
    16% {
        text-shadow: calc(4px * var(--glitch-intensity, 0.7)) 0 2px #00D4FF, calc(-4px * var(--glitch-intensity, 0.7)) 0 2px #FF0040, calc(2px * var(--glitch-intensity, 0.7)) calc(-2px * var(--glitch-intensity, 0.7)) 3px #00D4FF;
        transform: translate(calc(4px * var(--glitch-intensity, 0.7)), calc(-3px * var(--glitch-intensity, 0.7))) skew(calc(12deg * var(--glitch-intensity, 0.7)));
        font-style: italic;
        filter: blur(0.5px);
    }
    24% {
        text-shadow: calc(-3px * var(--glitch-intensity, 0.7)) calc(2px * var(--glitch-intensity, 0.7)) 2px #FF0040, calc(3px * var(--glitch-intensity, 0.7)) calc(-2px * var(--glitch-intensity, 0.7)) 2px #00D4FF;
        transform: translate(calc(-3px * var(--glitch-intensity, 0.7)), calc(-4px * var(--glitch-intensity, 0.7))) skew(calc(-8deg * var(--glitch-intensity, 0.7)));
        font-style: italic;
        filter: brightness(1.2) blur(0.5px);
    }
    32% {
        text-shadow: calc(3px * var(--glitch-intensity, 0.7)) calc(-2px * var(--glitch-intensity, 0.7)) 2px #00D4FF, calc(-3px * var(--glitch-intensity, 0.7)) calc(2px * var(--glitch-intensity, 0.7)) 2px #FF0040;
        transform: translate(calc(3px * var(--glitch-intensity, 0.7)), calc(4px * var(--glitch-intensity, 0.7))) skew(calc(8deg * var(--glitch-intensity, 0.7)));
        font-style: normal;
        filter: blur(0.5px);
    }
    42% {
        text-shadow: calc(-5px * var(--glitch-intensity, 0.7)) 0 3px #FF0040, calc(5px * var(--glitch-intensity, 0.7)) 0 3px #00D4FF;
        transform: translate(calc(-2px * var(--glitch-intensity, 0.7)), calc(2px * var(--glitch-intensity, 0.7))) skew(calc(-15deg * var(--glitch-intensity, 0.7)));
        font-style: italic;
        filter: brightness(1.35) blur(0.5px);
    }
    52% {
        text-shadow: calc(5px * var(--glitch-intensity, 0.7)) 0 3px #00D4FF, calc(-5px * var(--glitch-intensity, 0.7)) 0 3px #FF0040;
        transform: translate(calc(2px * var(--glitch-intensity, 0.7)), calc(-2px * var(--glitch-intensity, 0.7))) skew(calc(15deg * var(--glitch-intensity, 0.7)));
        font-style: italic;
        filter: blur(0.5px);
    }
    62% {
        text-shadow: calc(-1px * var(--glitch-intensity, 0.7)) calc(1px * var(--glitch-intensity, 0.7)) 1px rgba(255, 0, 64, 0.4), calc(1px * var(--glitch-intensity, 0.7)) calc(-1px * var(--glitch-intensity, 0.7)) 1px rgba(0, 212, 255, 0.4);
        transform: translate(calc(-1px * var(--glitch-intensity, 0.7)), calc(1px * var(--glitch-intensity, 0.7))) skew(calc(-5deg * var(--glitch-intensity, 0.7)));
        font-style: italic;
        filter: brightness(1.15) blur(0.4px);
    }
    72% {
        text-shadow: calc(-2px * var(--glitch-intensity, 0.7)) 0 2px #FF0040, calc(2px * var(--glitch-intensity, 0.7)) 0 2px #00D4FF;
        transform: translate(calc(1px * var(--glitch-intensity, 0.7)), calc(-1px * var(--glitch-intensity, 0.7))) skew(calc(5deg * var(--glitch-intensity, 0.7)));
        font-style: normal;
        filter: blur(0.5px);
    }
    85% {
        text-shadow: none;
        transform: translate(0) skew(0deg);
        font-style: normal;
        filter: none;
        opacity: 1;
    }
}

/* Custom Cursor */
#custom-cursor {
    width: 15px;
    height: 15px;
    border: none;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%) scale(1.1);
    transition: opacity 0.2s, transform 0.2s, background-color 0.2s, box-shadow 0.2s, color 0.2s;
    opacity: 0; /* Hidden until first mousemove to avoid jump on refresh */
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    padding: 0;
}

#custom-cursor.cursor-visible {
    opacity: 1;
}

#custom-cursor.cursor-visible.hover {
    transform: translate(-50%, -50%) scale(1.32);
    opacity: 0.6;
}

#custom-cursor.active {
    transform: translate(-50%, -50%) scale(0.88);
}

#custom-cursor.cursor-visible.hover.active {
    transform: translate(-50%, -50%) scale(0.88);
}

#custom-cursor.copy-mode.active {
    transform: translate(-50%, -50%) scale(0.88);
}

#custom-cursor.copy-mode {
    width: auto;
    height: auto;
    border-radius: 20px;
    padding: 8px 16px;
    transform: translate(-50%, -50%) scale(1.1);
    background-color: rgba(0, 0, 0, 0.5);
}

#custom-cursor .cursor-text {
    display: none;
}

#custom-cursor.copy-mode .cursor-text {
    display: block;
}

#custom-cursor.dark-section {
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

#custom-cursor.copy-mode.dark-section {
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
    color: #1d1d1d;
}

a, button, .email-copy {
    cursor: none;
}

/* Time Display */
.time {
    font-size: 16px;
    font-weight: 400;
    color: #1d1d1d;
    opacity: 0.3;
}

/* Email Copy */
.email-copy {
    color: #1D1D1D;
    position: relative;
    cursor: none;
}

/* Contact Section */
.contact-section {
    background-color: #F7F7F9;
    padding: 80px 24px;
    margin-top: 0;
}

.contact-content {
    max-width: 640px;
    margin: 0 auto;
}

.contact-content h3 {
    margin-bottom: 24px;
}

.contact-content .body-text {
    color: rgba(29, 29, 29, 0.5);
}

.contact-content .body-text a {
    color: #1D1D1D;
    text-decoration: none;
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 26px;
    }

    h3 {
        font-size: 22px;
    }

    .body-text, h4 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 22px;
    }

    h3 {
        font-size: 20px;
    }

    .body-text, h4 {
        font-size: 16px;
    }
}

/* Hide cursor on mobile/touch devices */
@media (hover: none) and (pointer: coarse) {
    #custom-cursor {
        display: none !important;
    }

    body, a, button, .email-copy {
        cursor: auto !important;
    }
}
