:root {
    --bg: #080808;
    --surface: #121212;
    --surface-glass: rgba(20, 20, 20, 0.6);
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --accent: #FF3B30;
    --accent-glow: rgba(255, 59, 48, 0.3);
    --border: rgba(255, 255, 255, 0.08);

    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Newsreader', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

    --easing: cubic-bezier(0.16, 1, 0.3, 1);

    /* Safe area insets for notched devices */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

/* Default cursor - override on touch devices via media query */
@media (hover: hover) and (pointer: fine) {
    * {
        cursor: none;
    }
}

html {
    /* Prevent font scaling on orientation change in iOS */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* Smooth scrolling */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    line-height: 1.5;
    /* Prevent pull-to-refresh on mobile */
    overscroll-behavior-y: none;
    /* Respect safe areas */
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
}

/* Custom Cursor */
.cursor-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    /* transition: transform 0.1s; <-- This causes the lag/floaty feeling */
    will-change: transform;
}

/* Background Canvas */
#light-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    opacity: 0.4;
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    z-index: 100;
    transition: background 0.3s;
}

.glass-header {
    background: linear-gradient(to bottom, rgba(8, 8, 8, 0.8), rgba(8, 8, 8, 0));
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Scrolled header state */
.glass-header.scrolled {
    background: rgba(8, 8, 8, 0.95);
    border-bottom: 1px solid var(--border);
}

/* Logo Animation */
.logo-mark {
    display: flex;
    align-items: center;
}

.logo-animation {
    position: relative;
    height: 40px;
    width: 240px;
    /* Adjust based on text width */
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
}

.logo-layer {
    position: absolute;
    left: 0;
    white-space: nowrap;
}

.candle-layer {
    color: #444;
    /* Darker grey for initial state */
    filter: blur(0.5px);
}

.laser-layer {
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
    clip-path: inset(0 100% 0 0);
    /* Initially hidden from right */
    animation: wipeReveal 3s var(--easing) forwards;
    animation-delay: 1.5s;
    /* Wait for page load */
}

/* Red Laser Beam Line */
.laser-beam-wipe {
    position: absolute;
    top: -20%;
    left: 0;
    height: 140%;
    width: 2px;
    background: #ff0033;
    box-shadow: 0 0 10px #ff0033, 0 0 20px #ff0033;
    transform: rotate(10deg);
    opacity: 0;
    animation: beamMove 3s var(--easing) forwards;
    animation-delay: 1.5s;
    z-index: 10;
}

/* Spark/Fizzle effect at the tip of the beam */
.laser-beam-wipe::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -2px;
    width: 6px;
    height: 40px;
    background: white;
    transform: translateY(-50%);
    filter: blur(2px);
    opacity: 0.8;
    animation: sparkFlicker 0.1s infinite;
}

@keyframes wipeReveal {
    0% {
        clip-path: inset(0 100% 0 0);
    }

    100% {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes beamMove {
    0% {
        left: 0;
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        left: 100%;
        opacity: 0;
    }
}

@keyframes sparkFlicker {
    0% {
        opacity: 0.8;
        height: 30px;
    }

    50% {
        opacity: 1;
        height: 50px;
    }

    100% {
        opacity: 0.8;
        height: 30px;
    }
}

nav {
    display: flex;
    gap: 2rem;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

nav a:hover,
nav a.active {
    color: var(--text-primary);
}

/* Scroll margin for anchor links with fixed header */
[id] {
    scroll-margin-top: 100px;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    background: var(--text-primary);
    color: var(--bg);
    border: none;
    padding: 0.6rem 1.2rem;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 4px;
    text-decoration: none;
    transition: transform 0.2s var(--easing), box-shadow 0.2s var(--easing);
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
}

/* Premium Laser Button */
.btn-laser {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.3);
    padding: 0.8rem 2rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 0 20px rgba(255, 59, 48, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    backdrop-filter: blur(5px);
}

.btn-laser::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 59, 48, 0.4),
            transparent);
    transition: 0.5s;
    transform: skewX(-15deg);
}

.btn-laser:hover {
    background: rgba(255, 59, 48, 0.2);
    border-color: #ff3b30;
    color: #fff;
    box-shadow: 0 0 40px rgba(255, 59, 48, 0.4), inset 0 0 10px rgba(255, 59, 48, 0.2);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

.btn-laser:hover::before {
    left: 100%;
    transition: 0.7s;
}

.btn-laser:active {
    transform: scale(0.96) translateY(0);
    box-shadow: 0 0 10px rgba(255, 59, 48, 0.6);
}

/* Laser button indicator (replaces emoji) */
.btn-laser-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    margin-right: 10px;
    box-shadow: 0 0 8px var(--accent), 0 0 16px var(--accent);
    animation: pulse-glow 1.5s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 8px var(--accent), 0 0 16px var(--accent);
    }
    50% {
        opacity: 0.6;
        box-shadow: 0 0 4px var(--accent), 0 0 8px var(--accent);
    }
}

/* Secondary Button Update */
.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.6rem 1.2rem;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: var(--border);
}

/* Hero */
.hero-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 3rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.hero-content {
    max-width: 700px;
}

.badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    padding: 0.4rem 0.8rem;
    border-radius: 100px;
    background: rgba(255, 59, 48, 0.05);
    position: relative;
    overflow: hidden;
}

.badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 59, 48, 0.1), transparent);
    animation: badge-shimmer 3s ease-in-out infinite;
    animation-delay: 2s;
}

@keyframes badge-shimmer {
    0% { left: -100%; }
    50%, 100% { left: 200%; }
}

.hero-title {
    font-size: clamp(3rem, 5vw, 5rem);
    font-weight: 500;
    /* Inter Medium look */
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(90deg, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 80px rgba(255, 255, 255, 0.1);
}

/* Animated stat values on hover */
.stat {
    transition: transform 0.3s var(--easing);
}

.stat:hover {
    transform: translateY(-2px);
}

.stat:hover .value {
    color: var(--accent);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.cta-group {
    display: flex;
    gap: 1rem;
}

.btn-primary.large,
.btn-secondary.large {
    padding: 0.8rem 1.6rem;
    font-size: 1rem;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 240px;
    gap: 1.5rem;
    padding: 2rem 3rem;
    max-width: 1400px;
    margin: 0 auto 5rem;
}

.bento-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color 0.3s, transform 0.3s var(--easing);
    position: relative;
    overflow: hidden;
}

.bento-item:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.bento-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(255, 59, 48, 0.03) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.bento-item:hover::before {
    opacity: 1;
}

.large-card {
    grid-column: span 2;
    grid-row: span 2;
}

.tall-card {
    grid-column: span 1;
    grid-row: span 2;
}

.card-content h3 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.card-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.serif-text {
    font-family: var(--font-serif);
    font-size: 1.5rem !important;
    font-weight: 300;
    font-style: italic;
    color: #dedede !important;
}

.role-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-row {
    display: flex;
    gap: 3rem;
    margin-top: 2rem;
}

.stat .value {
    display: block;
    font-size: 2.5rem;
    font-weight: 300;
    font-family: var(--font-mono);
    color: var(--text-primary);
    transition: color 0.3s var(--easing);
}

.stat .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Animation Utilities */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s var(--easing) forwards;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s var(--easing) forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.footer-note {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 5rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-links a::after {
    content: '';
    display: block;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s var(--easing);
}

.footer-links a:hover::after {
    width: 100%;
}

.dim {
    opacity: 0.5;
}

/* Company / Safety Sections */
.company-section,
.safety-section {
    padding: 8rem 2rem;
    border-top: 1px solid var(--border);
}

.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.subtitle-badge {
    text-transform: uppercase;
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.company-section h2,
.safety-section h2 {
    font-size: 3rem;
    font-weight: 500;
    margin-bottom: 2rem;
    line-height: 1.2;
    color: var(--text-secondary);
}

.white-text {
    color: var(--text-primary);
}

.mission-text {
    font-size: 1.5rem;
    font-family: var(--font-serif);
    font-weight: 300;
    line-height: 1.6;
    color: var(--text-secondary);
}

.highlight {
    color: var(--text-primary);
    border-bottom: 1px solid var(--accent);
}

/* Centered CTA container */
.cta-center {
    text-align: center;
    margin-top: 2.5rem;
}

/* Node graph visualization placeholder */
.visualization-placeholder {
    margin-top: 1.5rem;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.node-graph {
    width: 100%;
    height: 120px;
    position: relative;
    overflow: hidden;
}

.node-graph::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--text-secondary), var(--accent), transparent);
    opacity: 0.4;
}

.node-graph::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 20%;
    width: 60%;
    height: 60%;
    border: 1px dashed var(--border);
    border-radius: 8px;
}

/* Animated nodes */
.node-graph .node {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: node-pulse 2s ease-in-out infinite;
}

.node-graph .node:nth-child(1) { top: 30%; left: 25%; animation-delay: 0s; }
.node-graph .node:nth-child(2) { top: 50%; left: 50%; background: var(--accent); animation-delay: 0.3s; }
.node-graph .node:nth-child(3) { top: 70%; left: 75%; animation-delay: 0.6s; }
.node-graph .node:nth-child(4) { top: 40%; left: 65%; animation-delay: 0.9s; }

@keyframes node-pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.3); opacity: 1; }
}

/* Feature Grid for Safety Section */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    transition: border-color 0.3s, transform 0.3s var(--easing);
}

.feature-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.feature-card h4 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Academic / Research Paper Styles */
@media print {
    body {
        background-color: white !important;
        color: black !important;
    }

    .back-link,
    .back-to-top {
        display: none !important;
    }

    .paper-container {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
    }

    a {
        text-decoration: none !important;
        color: black !important;
    }
}

.paper-table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
    font-size: 0.9rem;
    font-family: var(--font-sans);
}

.paper-table th {
    text-align: left;
    border-top: 2px solid #000;
    border-bottom: 1px solid #000;
    padding: 0.5rem;
    font-weight: 600;
}

.paper-table td {
    border-bottom: 1px solid #ddd;
    padding: 0.5rem;
}

.paper-table tr:last-child td {
    border-bottom: 2px solid #000;
}

.sidenote {
    float: right;
    clear: right;
    margin-right: -12rem;
    width: 10rem;
    font-size: 0.8rem;
    line-height: 1.3;
    color: #666;
    margin-bottom: 1rem;
}

@media (max-width: 1100px) {
    .sidenote {
        float: none;
        margin: 1rem 0;
        width: 100%;
        color: #444;
        background: #f9f9f9;
        padding: 0.5rem;
        border-left: 2px solid var(--accent);
    }
}

/* ============================================
   MOBILE & TABLET RESPONSIVE STYLES
   ============================================ */

/* Disable custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
    * {
        cursor: auto !important;
    }

    .cursor-dot {
        display: none !important;
    }
}

/* Tablet breakpoint */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: auto;
        padding: 2rem;
    }

    .large-card {
        grid-column: span 2;
        grid-row: span 1;
    }

    .tall-card {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* Mobile breakpoint */
@media (max-width: 768px) {
    /* Header */
    header {
        padding: 1rem 1.25rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .glass-header {
        background: rgba(8, 8, 8, 0.95);
    }

    /* Logo */
    .logo-animation {
        width: 160px;
        font-size: 0.9rem;
        height: 32px;
    }

    /* Navigation - horizontal scroll on mobile */
    nav {
        order: 3;
        width: 100%;
        gap: 1.25rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 0.25rem;
    }

    nav::-webkit-scrollbar {
        display: none;
    }

    nav a {
        font-size: 0.8rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .header-cta {
        order: 2;
    }

    .header-cta .btn-primary {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    /* Hero Section */
    .hero-section {
        min-height: auto;
        padding: 6rem 1.25rem 3rem;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-title {
        font-size: 2.25rem;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .badge {
        font-size: 0.65rem;
        padding: 0.3rem 0.6rem;
        margin-bottom: 1rem;
    }

    /* CTA Buttons */
    .cta-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn-primary.large,
    .btn-secondary.large {
        width: 100%;
        text-align: center;
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .btn-laser {
        width: 100%;
        padding: 0.7rem 1.5rem;
        font-size: 0.85rem;
    }

    /* Bento Grid - Single column on mobile */
    .bento-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 1rem;
        padding: 1.5rem 1.25rem;
        margin-bottom: 3rem;
    }

    .large-card,
    .tall-card {
        grid-column: span 1;
        grid-row: span 1;
    }

    .bento-item {
        padding: 1.5rem;
        min-height: auto;
    }

    .card-content h3 {
        font-size: 1rem;
    }

    .card-content p {
        font-size: 0.9rem;
    }

    .serif-text {
        font-size: 1.15rem !important;
    }

    .stat-row {
        gap: 2rem;
        margin-top: 1.5rem;
    }

    .stat .value {
        font-size: 1.75rem;
    }

    .stat .label {
        font-size: 0.7rem;
    }

    /* Company & Safety Sections */
    .company-section,
    .safety-section {
        padding: 4rem 1.25rem;
    }

    .company-section h2,
    .safety-section h2 {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }

    .mission-text {
        font-size: 1.1rem;
    }

    .subtitle-badge {
        font-size: 0.7rem;
    }

    /* Feature Grid (Safety Section) */
    .feature-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .feature-card {
        padding: 1.25rem;
    }

    .feature-card h4 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .feature-card p {
        font-size: 0.9rem;
    }

    /* Footer */
    .footer-note {
        padding: 3rem 1.25rem;
        margin-top: 3rem;
    }

    .footer-links {
        flex-wrap: wrap;
        gap: 1rem 1.5rem;
        justify-content: center;
    }

    .footer-links a {
        font-size: 0.75rem;
    }

    .footer-note p {
        font-size: 0.7rem;
    }
}

/* Small mobile breakpoint */
@media (max-width: 480px) {
    header {
        padding: 0.75rem 1rem;
    }

    .logo-animation {
        width: 140px;
        font-size: 0.8rem;
    }

    .hero-section {
        padding: 5rem 1rem 2.5rem;
    }

    .hero-title {
        font-size: 1.85rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .bento-grid {
        padding: 1rem;
        gap: 0.75rem;
    }

    .bento-item {
        padding: 1.25rem;
    }

    .company-section,
    .safety-section {
        padding: 3rem 1rem;
    }

    .company-section h2,
    .safety-section h2 {
        font-size: 1.5rem;
    }

    .mission-text {
        font-size: 1rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Focus states for keyboard navigation */
a:focus-visible,
button:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-laser:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
@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;
    }

    .laser-beam-wipe,
    .laser-layer {
        animation: none !important;
        clip-path: inset(0 0 0 0) !important;
        opacity: 1 !important;
    }

    .candle-layer {
        display: none;
    }
}

/* Skip to content link (hidden until focused) */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: var(--bg);
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    z-index: 10000;
    transition: top 0.2s;
}

.skip-to-content:focus {
    top: 1rem;
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s var(--easing), border-color 0.3s;
    z-index: 99;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.back-to-top::before {
    content: '';
    width: 8px;
    height: 8px;
    border-left: 2px solid currentColor;
    border-top: 2px solid currentColor;
    transform: rotate(45deg) translateY(2px);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: calc(1.5rem + var(--safe-bottom));
        right: 1.25rem;
        width: 40px;
        height: 40px;
    }
}