/* ============================================================
   ZENTAVOR — Base, typography, layout primitives
   ============================================================ */

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

::selection { background: var(--accent); color: #fff; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img, svg { display: block; }
img { height: auto; } /* width/height attrs stay an aspect-ratio hint, not a fixed size */

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
section { position: relative; }
.section-pad { padding: var(--section-y) 0; }

/* ---------- Typography scale ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-soft);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.04;
  text-wrap: balance;
}

.h-display {
  font-size: clamp(44px, 5.6vw, 82px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.98;
}
.h-section {
  font-size: clamp(32px, 3.6vw, 52px);
  letter-spacing: -0.03em;
}
.h-sub {
  font-size: clamp(22px, 2vw, 30px);
}

.lead {
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 56ch;
  text-wrap: pretty;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.section-head { max-width: 760px; margin-bottom: 64px; }
.section-head .h-section { margin: 18px 0 0; }
.section-head .lead { margin-top: 22px; }

.text-grad {
  background: linear-gradient(100deg, var(--accent-soft), var(--text) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 50px;
  padding: 0 26px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: transform 0.4s var(--ease), background 0.3s var(--ease),
              border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), color 0.3s;
  will-change: transform;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 30px -8px var(--accent);
}
.btn-primary:hover { box-shadow: 0 14px 40px -8px var(--accent); }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  backdrop-filter: blur(var(--card-blur));
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--text-faint); }
.btn-lg { height: 58px; padding: 0 34px; font-size: 16px; }
.btn .arrow { transition: transform 0.4s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: 0.6; pointer-events: none; }


.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-soft);
  letter-spacing: -0.01em;
}
.link-arrow .arrow { transition: transform 0.35s var(--ease); }
.link-arrow:hover .arrow { transform: translateX(4px); }

/* ---------- Card primitive ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(var(--card-blur));
  -webkit-backdrop-filter: blur(var(--card-blur));
  box-shadow: var(--shadow-card);
  transition: transform 0.5s var(--ease-spring), border-color 0.4s var(--ease),
              box-shadow 0.5s var(--ease), background 0.4s var(--ease);
}

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }
.reveal.from-right { transform: translateX(70px); }

/* word-by-word text reveal */
.rw .rw-w {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.5em);
  filter: blur(5px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), filter 0.7s var(--ease);
  will-change: opacity, transform, filter;
}
.rw.rw-on .rw-w { opacity: 1; transform: none; filter: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .rw .rw-w { opacity: 1; transform: none; filter: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Ambient wave-field backdrop (global; canvas injected by js/shell.js) ----------
   z-index:-1 paints the wave above the body background but beneath all in-flow
   content, so no per-section z-index is needed. Animation + reduced-motion +
   tab-visibility pause are handled in js/shell.js. */
#waveBg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ---------- Decorative grid backdrop (disabled site-wide) ---------- */
.grid-bg {
  display: none;
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Isometric pulsing-tile backdrop — "Let's talk" + footer (concept A only) ---------- */
.iso-bg {
  position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
}
/* CTA + footer share one continuous backdrop.
   Opaque bg covers the fixed #waveBg so the wave stops at "Let's talk" and below. */
.endcap { position: relative; background: var(--bg); }
/* fade the effect in gradually so the upper blocks melt into the closing block */
.endcap > .iso-bg {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 6%, #000 30%);
  mask-image: linear-gradient(to bottom, transparent 0%, transparent 6%, #000 30%);
}
.iso-grid {
  position: absolute; top: 50%; left: 50%;
  width: 3200px; height: 2400px; transform-origin: center;
  transform: translate(-50%, -50%) rotateX(58deg) rotateZ(45deg) scale(1.5);
  /* continuous grid lines fill the whole plane — no empty corners */
  background-image:
    linear-gradient(color-mix(in srgb, var(--accent) 7%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 7%, transparent) 1px, transparent 1px);
  background-size: 80px 80px;
}
.iso-tile {
  position: absolute; width: 80px; height: 80px; box-sizing: border-box;
}
.iso-tile.lit {
  animation: iso-pulse var(--d, 7s) ease-in-out var(--dl, 0s) infinite;
  will-change: background, box-shadow;
}
@keyframes iso-pulse {
  0%, 100% { background: color-mix(in srgb, var(--accent) 4%, transparent); box-shadow: none; }
  50% {
    background: color-mix(in srgb, var(--accent) calc(var(--pk, 0.4) * 100%), transparent);
    box-shadow:
      0 0 16px 1px color-mix(in srgb, var(--accent) 34%, transparent),
      inset 0 0 12px color-mix(in srgb, var(--accent-soft) 26%, transparent);
  }
}
[data-concept="b"] .iso-bg, [data-concept="c"] .iso-bg { display: none; }
@media (prefers-reduced-motion: reduce) {
  .iso-tile.lit { animation: none; background: color-mix(in srgb, var(--accent) 14%, transparent); }
}
