/* ============================================
   Sean Fagan - Personal Landing Page
   Luxury Minimalist Design
   ============================================ */

/* CSS Variables */
:root {
    /* Color Palette - Rich Dark with Gold */
    --color-bg: #0a0a0b;
    --color-bg-elevated: #141416;
    --color-surface: #1a1a1e;
    --color-border: rgba(212, 175, 125, 0.15);
    --color-border-hover: rgba(212, 175, 125, 0.35);

    --color-text-primary: #f5f0e8;
    --color-text-secondary: #a89f94;
    --color-text-muted: #6b6560;

    --color-accent: #d4af7d;
    --color-accent-light: #e8d4b8;
    --color-accent-dark: #b8956a;

    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Cormorant Garamond', Garamond, serif;
    --font-sans: 'DM Sans', system-ui, sans-serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-2xl: 6rem;

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --transition-fast: 0.2s var(--ease-out-quart);
    --transition-medium: 0.4s var(--ease-out-expo);
    --transition-slow: 0.8s var(--ease-out-expo);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Grain Overlay with subtle shimmer */
.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.04;
    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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

.grain-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 100% 100% at var(--grain-x, 50%) var(--grain-y, 50%),
            rgba(212, 175, 125, 0.03) 0%,
            transparent 50%);
    animation: grainShimmer 15s ease-in-out infinite;
}

@keyframes grainShimmer {

    0%,
    100% {
        --grain-x: 30%;
        --grain-y: 30%;
    }

    25% {
        --grain-x: 70%;
        --grain-y: 40%;
    }

    50% {
        --grain-x: 60%;
        --grain-y: 70%;
    }

    75% {
        --grain-x: 40%;
        --grain-y: 60%;
    }
}

/* Animated Background Motion */
.bg-motion {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 125, 0.08);
    opacity: 0;
    animation: circleFloat 20s ease-in-out infinite, circleFadeIn 2s ease-out forwards;
    /* Mouse interaction via CSS custom properties set by JS */
    --mouse-x: 0;
    --mouse-y: 0;
    transform: translate(calc(-50% + var(--mouse-x) * 1px), calc(-50% + var(--mouse-y) * 1px));
    transition: transform 0.3s ease-out;
}

.bg-circle--1 {
    width: 600px;
    height: 600px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 0s, 0.5s;
}

.bg-circle--2 {
    width: 450px;
    height: 450px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -7s, 0.8s;
}

.bg-circle--3 {
    width: 300px;
    height: 300px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s, 1.1s;
}

@keyframes circleFloat {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }

    25% {
        transform: translate(-48%, -52%) scale(1.02) rotate(2deg);
    }

    50% {
        transform: translate(-52%, -48%) scale(0.98) rotate(-1deg);
    }

    75% {
        transform: translate(-50%, -53%) scale(1.01) rotate(1deg);
    }
}

@keyframes circleFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Decorative Lines */
.deco-line {
    position: fixed;
    left: 50%;
    width: 1px;
    background: linear-gradient(to bottom,
            transparent,
            var(--color-accent),
            transparent);
    opacity: 0;
    animation: fadeInLine 1.5s var(--ease-out-expo) forwards;
}

.deco-line--top {
    top: 0;
    height: 80px;
    animation-delay: 0.8s;
}

.deco-line--bottom {
    bottom: 0;
    height: 80px;
    animation-delay: 1s;
}

/* Side lines base - hidden by default */
.deco-line--left,
.deco-line--right {
    display: none;
}

@keyframes fadeInLine {
    from {
        opacity: 0;
    }

    to {
        opacity: 0.4;
    }
}

/* Side Decorative Lines - Desktop Only */

@media (min-width: 768px) and (orientation: landscape) {

    .deco-line--left,
    .deco-line--right {
        display: block;
        position: fixed;
        top: 50%;
        width: 100px;
        height: 1px;
        background: linear-gradient(90deg,
                transparent,
                var(--color-accent),
                transparent);
        opacity: 0;
        animation: fadeInLine 1.5s var(--ease-out-expo) 1.2s forwards;
    }

    .deco-line--left {
        left: 0;
        transform: translateY(-50%);
    }

    .deco-line--right {
        right: 0;
        left: auto;
        /* Override default left: 50% */
        transform: translateY(-50%);
    }
}

/* Container */
.container {
    width: 100%;
    max-width: 600px;
    padding: var(--space-lg);
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Hero Section */
.hero {
    margin-bottom: var(--space-md);
}

/* hero__prefix removed - no longer used */

.hero__name {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--color-text-primary);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s var(--ease-out-expo) 0.2s forwards;
}

.hero__accent {
    width: 8px;
    height: 8px;
    background: transparent;
    border: 1px solid rgba(212, 175, 125, 0.2);
    /* Slightly clearer than rings (0.08) for visibility at small size */
    border-radius: 50%;
    margin: var(--space-sm) auto 0;
    opacity: 0;
    animation: dotFloat 8s ease-in-out infinite, dotFadeIn 0.8s var(--ease-out-expo) 0.7s forwards;
}

@keyframes dotFloat {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-4px) scale(1.1);
    }
}

@keyframes dotFadeIn {
    from {
        opacity: 0;
        transform: scale(0);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scaleX(0);
    }

    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

/* Actions / Buttons */
.actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    align-items: center;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s var(--ease-out-expo) 0.9s forwards;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-decoration: none;
    text-transform: uppercase;
    border-radius: 2px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    min-width: 240px;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    transform: translateX(-100%);
    transition: transform 0.6s var(--ease-out-expo);
}

.btn:hover::before {
    transform: translateX(100%);
}

.btn__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn__icon svg {
    width: 100%;
    height: 100%;
}

/* Primary Button - Filled */
.btn--primary {
    background: var(--color-accent);
    color: var(--color-bg);
    border: 1px solid var(--color-accent);
}

.btn--primary:hover {
    background: var(--color-accent-light);
    border-color: var(--color-accent-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(212, 175, 125, 0.25);
}

.btn--primary:active {
    transform: translateY(0);
}

/* Secondary Button - Outlined with matching animation */
.btn--secondary {
    background: transparent;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    font-size: 0.8rem;
    /* Slightly smaller than primary */
}

.btn--secondary:hover {
    background: rgba(212, 175, 125, 0.1);
    border-color: var(--color-accent);
    color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(212, 175, 125, 0.15);
}

.btn--secondary:active {
    transform: translateY(0);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 11, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-medium);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: var(--space-xl);
    text-align: center;
    position: relative;
    max-width: 90vw;
    min-width: 300px;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-medium);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal__close {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.modal__close:hover {
    color: var(--color-text-primary);
}

.modal__close svg {
    width: 20px;
    height: 20px;
}

.modal__label {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.modal__email {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-accent);
    cursor: pointer;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid transparent;
    border-radius: 2px;
    transition: all var(--transition-fast);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal__email:hover {
    background: rgba(212, 175, 125, 0.08);
    border-color: var(--color-border);
}

.modal__email.copied {
    color: #7dd49a;
}

.modal__hint {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

/* Loading Dots */
.loading-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--color-accent);
    border-radius: 50%;
    animation: loadingPulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loadingPulse {

    0%,
    80%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    40% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Footer */
.footer {
    position: fixed;
    bottom: var(--space-lg);
    left: var(--space-lg);
    opacity: 0;
    animation: fadeInUp 0.8s var(--ease-out-expo) 1.2s forwards;
}

.footer__initials {
    font-family: var(--font-display);
    font-size: 0.875rem;
    letter-spacing: 0.3em;
    color: var(--color-text-muted);
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: var(--space-md);
    }

    .btn {
        min-width: 200px;
        padding: var(--space-sm) var(--space-md);
        font-size: 0.875rem;
    }

    .modal {
        padding: var(--space-lg);
    }

    .modal__email {
        font-size: 1.25rem;
    }
}

/* Focus States */
.btn:focus-visible,
.modal__close:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--color-accent);
    color: var(--color-bg);
}