/* ============================================================
   UX ELEVATION — Layers 1, 2 & 3
   Added on top of existing design. No overrides to palette/fonts/layout.
   ============================================================ */

/* Prevent horizontal overflow from blobs and timeline */
html {
  overflow-x: hidden;
}

/* ===================== LAYER 1: FEEL ===================== */

/* ---------- Custom Cursor ---------- */
@media (hover: hover) {
  body { cursor: none; }
  a, button, [role="button"], input[type="submit"] { cursor: none; }
}

@media (hover: none) {
  .cursor { display: none !important; }
  body { cursor: auto !important; }
}

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10000;
  mix-blend-mode: difference;
  will-change: transform;
}

.cursor__dot {
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: -4px;
  left: -4px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cursor__ring {
  width: 48px;
  height: 48px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  position: absolute;
  top: -24px;
  left: -24px;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cursor__label {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #fff;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.cursor--active .cursor__ring {
  opacity: 1;
  transform: scale(1);
}

.cursor--active .cursor__dot {
  transform: scale(0.5);
}

.cursor--active .cursor__label {
  opacity: 1;
}

.cursor--hidden {
  opacity: 0;
}

/* Hide cursor when over form fields */
.cursor--form-input .cursor__dot,
.cursor--form-input .cursor__ring {
  opacity: 0 !important;
}

/* ---------- Magnetic Hover Sheen ---------- */
[data-magnetic] {
  --mx: 50%;
  --my: 50%;
  position: relative;
  overflow: hidden;
}

[data-magnetic]::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,0.06), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

[data-magnetic]:hover::before {
  opacity: 1;
}

/* ---------- Micro-Interactions ---------- */

/* Buttons hover lift + active push */
.btn {
  transition: all var(--duration-fast) var(--ease-out);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--color-card-shadow-hover);
}

.btn:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 2px 8px var(--color-card-shadow);
}

/* Nav link animated underline — scaleX approach */
.header__links a::after {
  width: 100% !important;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-fast) var(--ease-out) !important;
}

.header__links a:hover::after {
  transform: scaleX(1);
}

/* Theme toggle rotation */
.theme-toggle {
  transition: color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out),
              transform 0.3s ease !important;
}

.theme-toggle--rotated {
  transform: rotate(180deg);
}

/* Tags hover fill */
.tag {
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
  cursor: default;
}

.tag:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* Social icons hover */
.social-link {
  transition: color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out) !important;
}

.social-link:hover {
  transform: scale(1.15);
}

.footer__social a {
  transition: color var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out) !important;
}

.footer__social a:hover {
  transform: scale(1.15);
}

/* DS logo hover */
.header__logo {
  transition: color var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out) !important;
}

.header__logo:hover {
  transform: scale(1.05);
}

/* Scroll indicator fade-out */
.hero__scroll--faded {
  opacity: 0 !important;
  transition: opacity 0.6s ease !important;
}

/* ---------- Text Reveal (GSAP) ---------- */
/* Initial hidden state for GSAP-animated elements */
[data-reveal="lines"] .line-inner {
  display: inline-block;
  clip-path: inset(0 0 100% 0);
}

[data-reveal="fade"] {
  opacity: 0;
}

/* ===================== LAYER 2: STORY ===================== */

/* ---------- Parallax Blobs ---------- */
.parallax-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
  overflow: hidden;
}

.parallax-blob--1 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(26, 107, 92, 0.08) 0%, transparent 70%);
  top: 100vh;
  left: 0;
}

.parallax-blob--2 {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(196, 101, 58, 0.06) 0%, transparent 70%);
  top: 200vh;
  right: 0;
}

.parallax-blob--3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(212, 168, 85, 0.07) 0%, transparent 70%);
  top: 300vh;
  left: 20%;
}

@media (max-width: 767px) {
  .parallax-blob { display: none; }
}

[data-theme="dark"] .parallax-blob--1 {
  background: radial-gradient(circle, rgba(61, 168, 144, 0.1) 0%, transparent 70%);
}

[data-theme="dark"] .parallax-blob--2 {
  background: radial-gradient(circle, rgba(224, 122, 79, 0.08) 0%, transparent 70%);
}

[data-theme="dark"] .parallax-blob--3 {
  background: radial-gradient(circle, rgba(224, 184, 101, 0.09) 0%, transparent 70%);
}

/* ===================== LAYER 3: DEPTH ===================== */

/* ---------- Venture Modal ---------- */
.venture-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
}

.venture-modal.is-open {
  pointer-events: auto;
  opacity: 1;
}

.venture-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 24, 20, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

[data-theme="dark"] .venture-modal__overlay {
  background: rgba(10, 8, 6, 0.7);
}

.venture-modal.is-open .venture-modal__overlay {
  opacity: 1;
}

.venture-modal__content {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-8);
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 1;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.3s ease;
}

.venture-modal.is-open .venture-modal__content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.venture-modal__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
  line-height: 1;
}

.venture-modal__close:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.venture-modal__name {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 3vw, var(--text-3xl));
  font-weight: 700;
  margin-bottom: var(--space-4);
  padding-right: var(--space-10);
}

.venture-modal__role {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  margin-bottom: var(--space-6);
}

.venture-modal__desc {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.75;
  margin-bottom: var(--space-6);
}

.venture-modal__link {
  display: inline-flex;
  margin-top: var(--space-2);
}

/* ---------- Newsletter Confetti ---------- */
.newsletter__form {
  position: relative;
}

.newsletter__form .btn--secondary {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.newsletter__form .btn--secondary.btn--morphed {
  width: 44px !important;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-size: 0;
}

.newsletter__form .btn--secondary.btn--morphed::after {
  content: '✓';
  font-size: 18px;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confetti-canvas {
  position: absolute;
  pointer-events: none;
  z-index: 100;
}

/* ---------- Terminal Easter Egg Theme ---------- */
[data-theme="terminal"] {
  --color-bg: #0a0a0a;
  --color-surface: #111;
  --color-text: #00ff41;
  --color-text-muted: #00cc33;
  --color-primary: #00ff41;
  --color-primary-hover: #33ff66;
  --color-secondary: #00ff41;
  --color-secondary-hover: #33ff66;
  --color-highlight: #00ff41;
  --color-border: rgba(0, 255, 65, 0.2);
  --color-divider: rgba(0, 255, 65, 0.1);
  --color-card-shadow: rgba(0, 255, 65, 0.1);
  --color-card-shadow-hover: rgba(0, 255, 65, 0.2);
  --color-writing-bg: #0c0c0c;
  --color-overlay: rgba(10, 10, 10, 0.9);
}

[data-theme="terminal"] * {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace !important;
}

[data-theme="terminal"] .hero__canvas {
  filter: hue-rotate(120deg) saturate(2);
}

.terminal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.terminal-overlay.is-visible {
  opacity: 1;
}

.terminal-overlay__message {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: clamp(1.5rem, 4vw, 3rem);
  color: #00ff41;
  text-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
  letter-spacing: 0.05em;
}

/* ===================== REDUCED MOTION ===================== */
@media (prefers-reduced-motion: reduce) {
  .cursor { display: none !important; }
  body { cursor: auto !important; }
  a, button, [role="button"] { cursor: auto !important; }

  [data-reveal="lines"] .line-inner {
    clip-path: none !important;
  }

  [data-reveal="fade"] {
    opacity: 1 !important;
    transform: none !important;
  }

  .parallax-blob { display: none !important; }

  .timeline-horizontal__station {
    transition: none !important;
  }

  .venture-modal__content,
  .venture-modal__overlay {
    transition: none !important;
  }

  .confetti-canvas { display: none !important; }

  [data-magnetic]::before { display: none !important; }
  [data-magnetic] { transform: none !important; }
}
