/* ====================================================
   Adibiz.in — Base Styles, Resets & System Cursor
   ==================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  overscroll-behavior-y: auto;
  overscroll-behavior-x: none;
}

/* Prevent native smooth scroll from fighting Lenis when active */
html.lenis,
html.lenis-smooth {
  scroll-behavior: auto !important;
}

body {
  background-color: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  overscroll-behavior-y: auto;
  overscroll-behavior-x: none;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Accessible Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--color-accent);
  color: oklch(0.985 0.005 245);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 100000;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* ----------------------------------------------------
   Restraint & Reduced Motion Overrides
   ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .signature-indicator-dot {
    animation: none !important;
  }

  .scroll-reveal {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  .hero-animate-1,
  .hero-animate-2,
  .hero-animate-3,
  .hero-animate-4 {
    animation: none !important;
    opacity: 1;
  }
}

/* ----------------------------------------------------
   Film Grain Subtle Living Texture
   ---------------------------------------------------- */
.film-grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.026;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  will-change: auto;
  contain: strict;
}

@media (prefers-color-scheme: dark) {
  .film-grain {
    opacity: 0.038;
  }
}

/* ----------------------------------------------------
   Custom Precision Cursor (Desktop Fine Pointer Only)
   ---------------------------------------------------- */
@media (hover: hover) and (pointer: fine) {
  body.has-custom-cursor {
    cursor: none;
  }

  /* Interactive links, buttons, and custom tabs get custom cursor when active */
  body.has-custom-cursor a,
  body.has-custom-cursor button,
  body.has-custom-cursor .cal-tab {
    cursor: none;
  }

  /* Native form inputs and textareas MUST preserve native text caret */
  input,
  textarea {
    cursor: text !important;
  }

  select {
    cursor: pointer !important;
  }

  /* Inside the calendar scheduler, modal HUD dialog, and embedded iframe, show native cursor */
  .cal-embed-wrapper,
  .cal-embed-wrapper *,
  .telemetry-modal,
  .telemetry-modal * {
    cursor: auto !important;
  }

  .cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background-color: var(--color-accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10002;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease;
    will-change: transform;
  }

  .cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 28px;
    height: 28px;
    border: 1.5px solid var(--color-accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10002;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: width 0.18s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.18s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.18s ease,
                opacity 0.2s ease,
                border-color 0.18s ease;
    will-change: transform;
  }

  body.cursor-hover .cursor-ring {
    width: 44px;
    height: 44px;
    background-color: var(--color-accent-soft);
  }

  body.cursor-active .cursor-ring {
    width: 20px;
    height: 20px;
    background-color: var(--color-accent-soft);
  }
}

@media (hover: none),
(pointer: coarse),
(prefers-reduced-motion: reduce) {
  .cursor-dot,
  .cursor-ring,
  .film-grain {
    display: none !important;
  }

  body {
    cursor: auto !important;
  }
}

