/* ═══════════════════════════════════════════════════════════════════
   TEEEM.IT — ULTRA LAYER
   Cinematic pass over the Blueprint Luxe base: custom cursor, grain,
   preloader, canvas hero, scroll choreography, magnetic CTAs.
   ═══════════════════════════════════════════════════════════════════ */

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* Grain over everything — film, not flatness */
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 999; pointer-events: none;
  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.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.035; animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); } 10% { transform: translate(-5%,-8%); }
  30% { transform: translate(4%,-3%); } 50% { transform: translate(-6%,6%); }
  70% { transform: translate(6%,2%); } 90% { transform: translate(-2%,7%); }
}

/* Custom cursor — drafting dot + compass ring */
@media (pointer: fine) {
  .cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 1000; border-radius: 50%; }
  .cursor-dot { width: 6px; height: 6px; background: var(--copper); transform: translate(-50%,-50%); }
  .cursor-ring {
    width: 34px; height: 34px; border: 1px solid rgba(192,131,71,0.55);
    transform: translate(-50%,-50%); transition: width 0.25s, height 0.25s, border-color 0.25s, background 0.25s;
  }
  .cursor-ring.hovering { width: 58px; height: 58px; background: rgba(192,131,71,0.1); border-color: var(--copper); }
}

/* Preloader — the compass draws the t */
.preloader {
  position: fixed; inset: 0; z-index: 1001; background: var(--ink);
  display: grid; place-items: center; transition: opacity 0.6s, visibility 0.6s;
}
.preloader.done { opacity: 0; visibility: hidden; }
.preloader svg { width: 90px; height: 90px; }
.preloader .pl-rect { stroke: var(--copper); stroke-width: 3; fill: none; stroke-dasharray: 220; stroke-dashoffset: 220; animation: draw 1s ease forwards; }
.preloader .pl-t { font-family: var(--font-display); font-size: 40px; fill: var(--copper); opacity: 0; animation: fadein 0.4s 0.8s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }

/* Hero canvas — the house draws itself behind the headline */
.hero { position: relative; }
#blueprint {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; opacity: 0.85;
}
.hero .wrap { position: relative; z-index: 2; }

/* Headline word-reveal */
.hero h1 .w { display: inline-block; overflow: hidden; vertical-align: bottom; }
.hero h1 .w > span { display: inline-block; transform: translateY(110%); }

/* Scroll progress — a copper draughting line up top */
.progress { position: fixed; top: 0; left: 0; height: 2px; background: var(--copper); width: 0; z-index: 1002; }

/* Magnetic buttons get GPU */
.btn { will-change: transform; }

/* World presence map */
.world {
  position: relative; margin-top: 70px; border: 1px solid var(--line-dark);
  border-radius: var(--radius); padding: 40px; overflow: hidden;
  background: color-mix(in srgb, var(--forest) 22%, var(--ink));
}
.world svg { width: 100%; height: auto; display: block; opacity: 0.9; }
.world .dot { fill: var(--copper); }
.world .halo { fill: none; stroke: var(--copper); opacity: 0; transform-origin: center; animation: halo 3s ease-out infinite; }
.world .lbl { font-family: var(--font-mono); font-size: 11px; fill: var(--mist); letter-spacing: 0.1em; text-transform: uppercase; }
@keyframes halo { 0% { opacity: 0.7; transform: scale(0.4); } 100% { opacity: 0; transform: scale(2.6); } }
.world .arc { fill: none; stroke: rgba(192,131,71,0.35); stroke-dasharray: 4 6; }

/* Section headline slide-splits */
.section h2 { will-change: transform; }

@media (max-width: 900px) {
  .cursor-dot, .cursor-ring { display: none; }
}
