/* ============================================================
   BGV — vibrant multi-color animated experience
   Full stylesheet (verified, no linter errors)
   ============================================================ */

/* Register custom property at the top so VSCode/Stylelint
   recognize it before use in .contact__glow */
   @property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
  }
  
  :root {
    --bg: #05070f;
    --bg-2: #0a0f1e;
    --panel: rgba(12, 18, 34, 0.72);
  
    --ink: #e2e8f0;
    --muted: #94a3b8;
    --dim: #475569;
  
    --orange: #f97316;
    --amber:  #f59e0b;
    --cyan:   #22d3ee;
    --violet: #a855f7;
    --emerald:#22c55e;
    --rose:   #f43f5e;
    --blue:   #3b82f6;
  }
  
  *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  html, body {
    height: 100%;
    overflow: hidden;
  }
  
  body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: crosshair;
  }
  
  .page {
    position: fixed;
    inset: 0;
    overflow: hidden;
  }
  
  /* ── Canvases ─────────────────────────────────────────────── */
  #bg-canvas,
  #particle-canvas,
  #fx-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
  }
  #bg-canvas       { z-index: 0; }
  #particle-canvas { z-index: 1; }
  #fx-canvas       { z-index: 6; pointer-events: none; mix-blend-mode: screen; }
  
  /* ── Overlays ─────────────────────────────────────────────── */
  .overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
  }
  
  .overlay--grid {
    background-image:
      linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
      linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, transparent 85%);
            mask-image: radial-gradient(ellipse at center, #000 0%, transparent 85%);
    animation: gridDrift 24s linear infinite;
  }
  
  @keyframes gridDrift {
    from { background-position: 0 0; }
    to   { background-position: 56px 56px; }
  }
  
  .overlay--scan::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #22d3ee 30%, #a855f7 50%, #f97316 70%, transparent);
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.7);
    animation: scanLine 5.5s linear infinite;
    mix-blend-mode: screen;
  }
  
  @keyframes scanLine {
    0%   { top: -5%; opacity: 0; }
    10%  { opacity: 0.9; }
    90%  { opacity: 0.9; }
    100% { top: 105%; opacity: 0; }
  }
  
  .overlay--grain {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
    opacity: 0.05;
    animation: grain 0.55s steps(2) infinite;
  }
  
  @keyframes grain {
    0%   { transform: translate(0, 0); }
    10%  { transform: translate(-5%, -5%); }
    20%  { transform: translate(-10%, 5%); }
    30%  { transform: translate(5%, -10%); }
    40%  { transform: translate(-5%, 15%); }
    50%  { transform: translate(-10%, 5%); }
    60%  { transform: translate(15%, 0); }
    70%  { transform: translate(0, 10%); }
    80%  { transform: translate(-15%, 0); }
    90%  { transform: translate(10%, 5%); }
    100% { transform: translate(5%, 0); }
  }
  
  .overlay--vignette {
    background:
      radial-gradient(ellipse at 50% 50%, transparent 0%, rgba(5, 7, 15, 0.5) 62%, rgba(5, 7, 15, 0.96) 100%),
      radial-gradient(circle at 20% 15%, rgba(249, 115, 22, 0.08), transparent 40%),
      radial-gradient(circle at 80% 85%, rgba(168, 85, 247, 0.10), transparent 45%),
      radial-gradient(circle at 50% 100%, rgba(34, 211, 238, 0.08), transparent 50%);
  }
  
  .overlay--aurora {
    background:
      conic-gradient(from 0deg at 30% 40%, transparent 0deg, rgba(34, 211, 238, 0.05) 60deg, transparent 120deg),
      conic-gradient(from 180deg at 70% 60%, transparent 0deg, rgba(168, 85, 247, 0.05) 60deg, transparent 120deg);
    animation: auroraRotate 30s linear infinite;
    mix-blend-mode: screen;
  }
  
  @keyframes auroraRotate {
    from { filter: hue-rotate(0deg); }
    to   { filter: hue-rotate(360deg); }
  }
  
  /* ── Fields ───────────────────────────────────────────────── */
  .icon-field,
  .box-field,
  .data-field {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
  }
  .icon-field { z-index: 1; }
  .box-field  { z-index: 3; }
  .data-field { z-index: 1; }
  
  /* ── Floating icons ──────────────────────────────────────── */
  .float-icon {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.32;
    will-change: transform;
    transform: translate3d(calc(var(--px, 0) * 1px), calc(var(--py, 0) * 1px), 0);
    transition: opacity 0.5s;
    filter: drop-shadow(0 0 10px currentColor);
  }
  
  .float-icon i {
    display: block;
    animation: floatIcon 6s ease-in-out infinite;
  }
  
  @keyframes floatIcon {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25%      { transform: translate(10px, -16px) rotate(9deg); }
    50%      { transform: translate(-6px, -26px) rotate(-6deg); }
    75%      { transform: translate(-16px, -10px) rotate(7deg); }
  }
  
  /* ── Floating UI boxes (fewer, safely inside frame) ──────── */
  .ui-box {
    position: absolute;
    width: 230px;
    min-height: 128px;
    padding: 18px 20px 16px;
    background: linear-gradient(155deg, rgba(17, 24, 42, 0.88), rgba(10, 15, 30, 0.72));
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 14px;
    -webkit-backdrop-filter: blur(14px) saturate(140%);
            backdrop-filter: blur(14px) saturate(140%);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.02),
      0 12px 40px rgba(0, 0, 0, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.04);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--muted);
    will-change: transform;
    animation: boxFloat 9s ease-in-out infinite;
    overflow: hidden;
    transform-origin: center;
    opacity: 0;
    transition: opacity 0.9s ease, box-shadow 0.4s ease;
  }
  
  .ui-box.is-visible { opacity: 1; }
  
  .ui-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--box-accent, #22d3ee), transparent);
    opacity: 0.9;
  }
  
  .ui-box::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 42px;
    height: 42px;
    background: radial-gradient(circle at 100% 100%, var(--box-accent, #22d3ee), transparent 70%);
    opacity: 0.28;
    border-radius: 0 0 14px 0;
    pointer-events: none;
  }
  
  @keyframes boxFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-16px) rotate(0.6deg); }
  }
  
  .ui-box__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.15);
  }
  
  .ui-box__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--box-accent, #22d3ee);
    box-shadow: 0 0 12px var(--box-accent, #22d3ee);
    animation: blink 1.4s ease-in-out infinite;
    flex-shrink: 0;
  }
  
  @keyframes blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.85); }
  }
  
  .ui-box__title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.86rem;
    color: #f1f5f9;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    flex: 1;
  }
  
  .ui-box__badge {
    font-size: 0.55rem;
    padding: 3px 7px;
    border-radius: 4px;
    background: rgba(34, 211, 238, 0.14);
    color: var(--box-accent, #22d3ee);
    font-weight: 700;
    letter-spacing: 0.1em;
    border: 1px solid rgba(34, 211, 238, 0.3);
  }
  
  .ui-box__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    padding: 4px 0;
    font-size: 0.72rem;
  }
  
  .ui-box__row span:first-child { color: #64748b; }
  .ui-box__row span:last-child  { color: var(--ink); font-weight: 500; }
  
  .ui-box__row i {
    color: var(--box-accent, #22d3ee);
    font-size: 0.7rem;
    margin-right: 6px;
  }
  
  .ui-box__bar {
    display: block;
    height: 4px;
    background: rgba(148, 163, 184, 0.12);
    border-radius: 3px;
    margin-top: 12px;
    overflow: hidden;
    position: relative;
  }
  
  .ui-box__bar > span {
    display: block;
    height: 100%;
    width: 40%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--box-accent, #22d3ee), #ffffff);
    box-shadow: 0 0 10px var(--box-accent, #22d3ee);
    animation: barFill 3.2s ease-in-out infinite;
  }
  
  @keyframes barFill {
    0%   { width: 20%; }
    50%  { width: 92%; }
    100% { width: 20%; }
  }
  
  /* Color themes */
  .box--cyan    { --box-accent: #22d3ee; }
  .box--violet  { --box-accent: #a855f7; }
  .box--orange  { --box-accent: #f97316; }
  .box--emerald { --box-accent: #22c55e; }
  .box--rose    { --box-accent: #f43f5e; }
  .box--amber   { --box-accent: #f59e0b; }
  .box--blue    { --box-accent: #3b82f6; }
  
  /* ── Data field (matrix columns) ─────────────────────────── */
  .data-col {
    position: absolute;
    top: -100%;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    line-height: 1.4;
    opacity: 0.16;
    writing-mode: vertical-rl;
    white-space: nowrap;
    animation: dataFall linear infinite;
    letter-spacing: 3px;
  }
  
  @keyframes dataFall {
    0%   { transform: translateY(0); }
    100% { transform: translateY(220vh); }
  }
  
  /* ── HUD ──────────────────────────────────────────────────── */
  .hud {
    position: fixed;
    z-index: 7;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: #94a3b8;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    pointer-events: none;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
  }
  
  .hud--tl { top: 1.4rem; left: 1.4rem; }
  .hud--tr { top: 1.4rem; right: 1.4rem; text-align: right; }
  .hud--bl { bottom: 1.4rem; left: 1.4rem; }
  .hud--br { bottom: 1.4rem; right: 1.4rem; text-align: right; }
  
  .hud__dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f97316;
    box-shadow: 0 0 10px #f97316;
    margin-right: 8px;
    vertical-align: middle;
    animation: blink 1.2s ease-in-out infinite;
  }
  
  /* ── Stage ────────────────────────────────────────────────── */
  .stage {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    padding: 0 1.5rem;
  }
  
  .brand-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 1.6rem;
  }
  
  #brand-canvas {
    display: block;
    width: 720px;
    max-width: 72vw;
    height: 260px;
  }
  
  .brand-underline {
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    width: 62%;
    height: 1px;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(34, 211, 238, 0.6) 20%,
      rgba(168, 85, 247, 0.7) 50%,
      rgba(249, 115, 22, 0.6) 80%,
      transparent
    );
    filter: blur(0.5px);
    animation: underlinePulse 3.5s ease-in-out infinite;
  }
  
  @keyframes underlinePulse {
    0%, 100% { opacity: 0.5; transform: translateX(-50%) scaleX(0.85); }
    50%      { opacity: 1;   transform: translateX(-50%) scaleX(1.05); }
  }
  
  /* ── Tagline ──────────────────────────────────────────────── */
  .tagline-wrap {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    margin-top: 0.4rem;
  }
  
  .tagline__line {
    width: 56px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #22d3ee, transparent);
    animation: linePulse 2.4s ease-in-out infinite;
  }
  
  .tagline__line--right {
    background: linear-gradient(90deg, transparent, #a855f7, transparent);
    animation-delay: 1.2s;
  }
  
  @keyframes linePulse {
    0%, 100% { opacity: 0.3; transform: scaleX(0.6); }
    50%      { opacity: 1;   transform: scaleX(1); }
  }
  
  .tagline {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(0.78rem, 1.8vw, 1rem);
    letter-spacing: 0.4em;
    text-transform: uppercase;
    background: linear-gradient(90deg, #22d3ee, #a855f7, #f97316);
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
    animation: taglineShift 6s ease-in-out infinite;
    background-size: 200% 100%;
  }
  
  @keyframes taglineShift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
  }
  
  .sub {
    margin-top: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.7rem, 1.5vw, 0.85rem);
    color: #64748b;
    letter-spacing: 0.1em;
  }
  
  .sub::after {
    content: '_';
    color: #22d3ee;
    margin-left: 4px;
    animation: caret 1s steps(1) infinite;
  }
  
  @keyframes caret {
    0%, 49%   { opacity: 1; }
    50%, 100% { opacity: 0; }
  }
  
  /* ── Contact ──────────────────────────────────────────────── */
  .footer {
    position: fixed;
    bottom: 2rem;
    left: 0;
    right: 0;
    z-index: 8;
    display: flex;
    justify-content: center;
    pointer-events: none;
  }
  
  .contact {
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem 0.85rem 0.85rem;
    background: linear-gradient(160deg, rgba(17, 24, 42, 0.92), rgba(10, 15, 30, 0.85));
    -webkit-backdrop-filter: blur(16px) saturate(160%);
            backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 14px;
    color: var(--ink);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.02),
      0 12px 40px rgba(0, 0, 0, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition:
      transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
      border-color 0.4s,
      box-shadow 0.4s;
    overflow: hidden;
    min-width: 320px;
  }
  
  .contact:hover {
    transform: translateY(-3px);
    border-color: rgba(34, 211, 238, 0.35);
    box-shadow:
      0 0 0 1px rgba(34, 211, 238, 0.1),
      0 18px 50px rgba(0, 0, 0, 0.65),
      0 0 40px rgba(34, 211, 238, 0.15),
      inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
  
  .contact__glow {
    position: absolute;
    inset: -1px;
    border-radius: 14px;
    background: conic-gradient(
      from var(--angle, 0deg),
      transparent 0deg,
      #22d3ee 60deg,
      transparent 120deg,
      #a855f7 240deg,
      transparent 300deg,
      #f97316 360deg
    );
    opacity: 0;
    transition: opacity 0.5s;
    animation: rotateAngle 6s linear infinite;
    z-index: 0;
    filter: blur(8px);
  }
  
  .contact:hover .contact__glow { opacity: 0.55; }
  
  @keyframes rotateAngle {
    from { --angle: 0deg; }
    to   { --angle: 360deg; }
  }
  
  .contact__badge {
    position: relative;
    z-index: 2;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(34, 211, 238, 0.16), rgba(168, 85, 247, 0.16));
    border: 1px solid rgba(34, 211, 238, 0.35);
    color: #22d3ee;
    font-size: 1.15rem;
    box-shadow: inset 0 0 20px rgba(34, 211, 238, 0.12);
    flex-shrink: 0;
  }
  
  .contact__body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    text-align: left;
  }
  
  .contact__label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    color: #64748b;
    text-transform: uppercase;
  }
  
  .contact__mail {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #f1f5f9;
    text-decoration: none;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s;
    position: relative;
  }
  
  .contact__mail-text {
    background: linear-gradient(90deg, #f1f5f9 0%, #f1f5f9 50%, #22d3ee 50%, #a855f7 100%);
    background-size: 200% 100%;
    background-position: 0% 50%;
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
    transition: background-position 0.6s;
  }
  
  .contact__mail:hover .contact__mail-text {
    background-position: 100% 50%;
  }
  
  .contact__caret {
    color: #22d3ee;
    margin-left: 2px;
    animation: caret 1s steps(1) infinite;
  }
  
  .contact__copy {
    position: relative;
    z-index: 2;
    width: 2.4rem;
    height: 2.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
  }
  
  .contact__copy:hover {
    background: rgba(34, 211, 238, 0.14);
    border-color: rgba(34, 211, 238, 0.45);
    color: #22d3ee;
    transform: translateY(-1px);
  }
  
  .contact__copy:active { transform: scale(0.94); }
  
  .contact__copy.copied {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(34, 197, 94, 0.5);
    color: #22c55e;
  }
  
  /* ── Toast ────────────────────────────────────────────────── */
  .toast {
    position: fixed;
    bottom: 7rem;
    left: 50%;
    transform: translateX(-50%) translateY(0.8rem);
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.92), rgba(168, 85, 247, 0.92));
    color: #fff;
    padding: 0.6rem 1.3rem;
    border-radius: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 20;
    box-shadow: 0 0 40px rgba(34, 211, 238, 0.5);
    font-weight: 500;
  }
  
  .toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  
  /* ── Responsive ───────────────────────────────────────────── */
  @media (max-width: 720px) {
    #brand-canvas {
      width: 90vw;
      height: 200px;
    }
    .ui-box {
      width: 200px;
      min-height: 110px;
      padding: 14px 16px;
    }
    .ui-box__title { font-size: 0.76rem; }
    .contact {
      min-width: 0;
      width: calc(100% - 2rem);
      max-width: 380px;
    }
    .contact__mail { font-size: 0.92rem; }
    .hud--tl, .hud--tr { font-size: 0.55rem; }
    .box-field { display: none; }
  }