@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  body {
    @apply bg-background text-on-background min-h-screen selection:bg-primary selection:text-background font-body-md text-body-md antialiased overflow-x-hidden;
  }

  /* Precision focus rings — keyboard navigation gets a yellow frame */
  :focus-visible {
    outline: 2px solid #F5C542;
    outline-offset: 3px;
  }
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* ── Scroll reveal system ────────────────────────────────────────────────
   Elements marked [data-reveal] start shifted + transparent; reveal.js adds
   .revealed when they enter the viewport. Stagger via --reveal-delay. */
[data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}

[data-reveal].revealed {
    opacity: 1;
    transform: none;
}

/* ── Keyframes ─────────────────────────────────────────────────────────── */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.8); }
}

@keyframes scroll-cue {
    0%   { transform: translateY(0); opacity: 1; }
    70%  { transform: translateY(12px); opacity: 0; }
    100% { transform: translateY(0); opacity: 0; }
}

@keyframes shine-sweep {
    0%   { transform: translateX(-120%) skewX(-18deg); }
    100% { transform: translateX(240%) skewX(-18deg); }
}

/* Pulsing status dot */
.pulse-dot {
    animation: pulse-dot 2.2s ease-in-out infinite;
}

/* Scroll cue line inside hero */
.scroll-cue-line {
    animation: scroll-cue 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

/* Shine sweep for primary buttons — add .btn-shine to any relative overflow-hidden button */
.btn-shine {
    position: relative;
    overflow: hidden;
}
.btn-shine::after {
    content: '';
    position: absolute;
    top: -20%;
    bottom: -20%;
    left: 0;
    width: 40%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    transform: translateX(-120%) skewX(-18deg);
    pointer-events: none;
}
.btn-shine:hover::after {
    animation: shine-sweep 0.7s ease forwards;
}

/* Subtle Dot Grid Background */
.bg-dot-grid {
    background-image: radial-gradient(#1E1E20 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Editorial layout utilities */
.hairline-r { border-right: 1px solid #1E1E20; }
.hairline-b { border-bottom: 1px solid #1E1E20; }
.hairline-t { border-top: 1px solid #1E1E20; }
.hairline-l { border-left: 1px solid #1E1E20; }

html {
    scroll-behavior: smooth;
}

.editorial-grid {
    @apply grid grid-cols-1 md:grid-cols-12 gap-6 md:gap-x-8 md:gap-y-0;
}

/* Nav active indicator bar */
.nav-indicator {
    height: 2px;
    transition: background-color 0.2s ease;
}

/* Navbar elevation once the page scrolls */
nav.nav-scrolled {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

/* ── Custom Cursor ─────────────────────────────────────────────────────── */
body.hide-default-cursor,
body.hide-default-cursor * {
    cursor: none !important;
}

.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 0;
    height: 0;
    will-change: transform;
}

.custom-cursor-visual {
    width: 10px;
    height: 10px;
    background-color: #F5C542;
    border-radius: 0;
    box-shadow: 0 0 10px rgba(245, 197, 66, 0.45);
    transition:
        width 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        height 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        background-color 0.2s ease,
        border 0.2s ease,
        box-shadow 0.25s ease,
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.3s ease;
    position: absolute;
}

.custom-cursor.hidden .custom-cursor-visual {
    opacity: 0;
}

/* Text hover state — expansive precision frame */
.custom-cursor.hovering-text .custom-cursor-visual {
    width: 44px;
    height: 44px;
    background-color: rgba(245, 197, 66, 0.04);
    border: 1px solid rgba(245, 197, 66, 0.6);
    box-shadow: 0 0 14px rgba(245, 197, 66, 0.22), inset 0 0 8px rgba(245, 197, 66, 0.12);
    mix-blend-mode: normal;
}

/* Clickable hover state — solid rotated diamond "bit" */
.custom-cursor.hovering-clickable .custom-cursor-visual {
    width: 26px;
    height: 26px;
    background-color: #F5C542;
    transform: rotate(45deg) scale(0.55);
    box-shadow: 0 0 20px rgba(245, 197, 66, 0.75);
}

/* Clicking state */
.custom-cursor.clicking .custom-cursor-visual {
    transform: scale(0.75);
    background-color: rgba(245, 197, 66, 0.85);
}

.custom-cursor.hovering-clickable.clicking .custom-cursor-visual {
    transform: rotate(45deg) scale(0.35);
}

/* ── Reduced motion: kill reveals, cursor, pulses ──────────────────────── */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .pulse-dot,
    .scroll-cue-line,
    .btn-shine::after {
        animation: none;
    }
    body.hide-default-cursor,
    body.hide-default-cursor * {
        cursor: auto !important;
    }
    .custom-cursor {
        display: none;
    }
}
