/* Michaelson Moving Company — styles.css v2
   SKILL.md compliant: DESIGN_VARIANCE:8 / MOTION_INTENSITY:6 / VISUAL_DENSITY:4
   Only what Tailwind cannot express: @keyframes, grain, marquee, btn-dir, custom sizing.
   Hardware acceleration: transform + opacity ONLY (SKILL.md §5). */

/* ─── Base ────────────────────────────────────────────────────────────────── */

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

html { -webkit-text-size-adjust: 100%; }

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ─── Grain overlay ───────────────────────────────────────────────────────── */
/* SKILL.md §5: grain applied ONLY to a fixed, pointer-events-none element.
   NEVER on a scrolling container — prevents continuous GPU repaints. */

.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ─── Header blur ──────────────────────────────────────────────────────────── */

.header-blur {
  background-color: rgba(13, 23, 32, 0.88);
}

@supports (backdrop-filter: blur(12px)) {
  .header-blur {
    background-color: rgba(13, 23, 32, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

/* ─── Hero entrance animations ─────────────────────────────────────────────── */
/* MOTION_INTENSITY:6 — cubic-bezier(0.16, 1, 0.3, 1), transform+opacity only.
   Staggered via CSS custom property --i (SKILL.md §4 staggered orchestration). */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-item {
  opacity: 0;
  animation: fadeUp 700ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--i, 0) * 120ms + 80ms);
}

/* ─── Hero headline sizing ─────────────────────────────────────────────────── */
/* Fluid type — SKILL.md Rule 1: tracking-tighter leading-none */

.hero-headline {
  font-size: clamp(3.8rem, 11vw, 7.5rem);
  letter-spacing: -0.03em;
  line-height: 0.92;
}

/* Hollow/outline style for second line — creates typographic tension */
.headline-outline {
  -webkit-text-stroke: 1.5px rgba(237, 232, 225, 0.45);
  color: transparent;
}

@media (min-width: 640px) {
  .headline-outline {
    -webkit-text-stroke-width: 2px;
  }
}

/* ─── Watermark numeral ─────────────────────────────────────────────────────── */

.watermark-numeral {
  font-size: clamp(12rem, 32vw, 26rem);
}

/* ─── Kinetic marquee ──────────────────────────────────────────────────────── */
/* SKILL.md §8 typography — Kinetic Marquee. CSS-only infinite loop.
   Hardware-accelerated via transform: translateX (SKILL.md §5). */

@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.marquee-track {
  will-change: transform;
  animation: marqueeScroll 32s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused;
}

.marquee-content {
  display: inline-block;
  padding-right: 0;
}

/* ─── Service row hover ─────────────────────────────────────────────────────── */
/* MOTION_INTENSITY:6 — transition on transform+opacity, not width/height/top/left */

.service-row {
  transition: background-color 200ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* ─── Stat figure sizing ────────────────────────────────────────────────────── */

.stat-figure {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  letter-spacing: -0.04em;
  line-height: 1;
}

/* Staggered entrance for stat blocks */
.stat-block {
  opacity: 0;
  animation: fadeUp 650ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--i, 0) * 90ms + 100ms);
}

/* ─── Directional hover-aware button ─────────────────────────────────────────── */
/* SKILL.md §8: "Directional Hover Aware Button — Hover fill entering from the
   exact side the mouse entered." Pure CSS + Alpine for direction detection.
   Hardware-accelerated via transform: scaleX/scaleY (SKILL.md §5). */

.btn-dir {
  cursor: pointer;
}

.btn-fill {
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* ─── Tactile feedback ──────────────────────────────────────────────────────── */
/* SKILL.md Rule 5: :active uses scale-[0.98] to simulate physical push.
   Applied via Alpine :class binding; transition defined on the element itself. */

/* ─── Focus styles ─────────────────────────────────────────────────────────── */

a:focus-visible,
button:focus-visible {
  outline: 2px solid #b8392b;
  outline-offset: 3px;
}

/* ─── Mobile collapse ───────────────────────────────────────────────────────── */
/* SKILL.md §6 DESIGN_VARIANCE:8 — any asymmetric layout above md: MUST
   collapse to single-column on < 768px. Tailwind handles this via responsive
   prefixes in markup. This rule is a safety net for inherited overflows. */

@media (max-width: 767px) {
  .hero-headline {
    letter-spacing: -0.025em;
  }

  .watermark-numeral {
    font-size: 11rem;
    opacity: 0.025;
  }
}

/* ─── prefers-reduced-motion ────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .hero-item,
  .stat-block {
    animation: none;
    opacity: 1;
  }

  .marquee-track {
    animation: none;
  }

  .btn-fill {
    transition: none;
  }
}
