/* AZEA Design — 2026 web design trends bundle
   Targets: kinetic typography, view transitions, scroll-snap, bento grids,
   glassmorphism v2, animated gradient mesh, magnetic cursor, clip-path
   reveals, marquee ticker, variable font weight, parallax tilt cards. */

/* ─── 1. Kinetic typography ─────────────────────────────────────────────── */
.kinetic-headline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2em;
  overflow: hidden;
}
.kinetic-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%) rotate(8deg);
  animation: kineticIn 0.9s var(--ease) forwards;
}
@keyframes kineticIn {
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

/* ─── 2. View Transitions API (page-to-page slick fade) ─────────────────── */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 0.32s var(--ease) both vt-out; }
::view-transition-new(root) { animation: 0.42s var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-12px) scale(0.98); } }
@keyframes vt-in  { from { opacity: 0; transform: translateY(16px) scale(1.02); } }

/* ─── 3. Section snap-scroll (key sections) ─────────────────────────────── */
@media (min-width: 960px) {
  .snap-container { scroll-snap-type: y proximity; }
  .snap-section { scroll-snap-align: start; scroll-snap-stop: normal; }
}

/* ─── 4. Bento grid (asymmetric mosaic) ────────────────────────────────── */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 160px;
  gap: 14px;
}
.bento-cell {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-rise);
  border: 1px solid var(--line-faint);
  transition: transform 0.5s var(--ease), border-color 0.3s var(--ease);
}
.bento-cell:hover { transform: translateY(-3px); border-color: var(--gold-700); }
.bento-1 { grid-column: span 3; grid-row: span 2; }
.bento-2 { grid-column: span 3; grid-row: span 1; }
.bento-3 { grid-column: span 2; grid-row: span 1; }
.bento-4 { grid-column: span 4; grid-row: span 1; }
.bento-5 { grid-column: span 3; grid-row: span 2; }
.bento-6 { grid-column: span 3; grid-row: span 1; }
@media (max-width: 960px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 180px; }
  .bento-1, .bento-5 { grid-column: span 2; grid-row: span 2; }
  .bento-2, .bento-3, .bento-4, .bento-6 { grid-column: span 1; grid-row: span 1; }
}

/* ─── 5. Glass morphism v2 (frosted panels with chromatic edge) ────────── */
.glass {
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  position: relative;
  isolation: isolate;
}
.glass::before {
  content: '';
  position: absolute; inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(201,169,106,0.4), transparent 40%, transparent 60%, rgba(255,255,255,0.15));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

/* ─── 6. Animated gradient mesh blob ───────────────────────────────────── */
.mesh-blob {
  position: absolute;
  pointer-events: none;
  z-index: -1;
  width: 100%; height: 100%;
  filter: blur(60px);
  opacity: 0.4;
  background:
    radial-gradient(60% 50% at 30% 30%, rgba(201,169,106,0.45) 0%, transparent 60%),
    radial-gradient(50% 60% at 70% 60%, rgba(180,140,80,0.35) 0%, transparent 60%),
    radial-gradient(40% 40% at 50% 90%, rgba(140,100,60,0.3) 0%, transparent 60%);
  animation: meshDrift 18s var(--ease) infinite alternate;
}
@keyframes meshDrift {
  0%   { transform: translate3d(0,0,0) scale(1) rotate(0deg); }
  100% { transform: translate3d(-3%,2%,0) scale(1.15) rotate(8deg); }
}

/* ─── 7. Magnetic / tilt cards (cursor-react) ──────────────────────────── */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
  will-change: transform;
}
.tilt-card-inner {
  transform: translateZ(20px);
  transition: transform 0.6s var(--ease);
}

/* ─── 8. Clip-path image reveal on scroll ──────────────────────────────── */
.clip-reveal img,
.clip-reveal {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.4s cubic-bezier(0.86, 0, 0.07, 1);
}
.clip-reveal.is-visible img,
.clip-reveal.is-visible {
  clip-path: inset(0% 0 0 0);
}

/* ─── 9. Marquee ticker (project names scroll horizontally) ────────────── */
.marquee {
  overflow: hidden;
  position: relative;
  padding: 18px 0;
  border-top: 1px solid var(--line-faint);
  border-bottom: 1px solid var(--line-faint);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: inline-flex;
  gap: 56px;
  white-space: nowrap;
  animation: marqueeScroll 60s linear infinite;
  padding-right: 56px;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--ink-2);
  letter-spacing: -0.01em;
}
.marquee-item::after {
  content: '◆';
  margin-left: 56px;
  color: var(--gold-300);
  opacity: 0.5;
}
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ─── 10. Variable font weight on scroll (hero headline) ───────────────── */
.weight-shift {
  font-variation-settings: "wght" 200;
  transition: font-variation-settings 0.4s var(--ease);
}
.weight-shift.is-visible { font-variation-settings: "wght" 500; }

/* ─── 11. Magnetic button (cursor follows) ─────────────────────────────── */
.magnetic { transition: transform 0.3s var(--ease); }

/* ─── 12. Custom cursor (subtle dot follow on large screens) ───────────── */
@media (min-width: 1024px) and (hover: hover) {
  .custom-cursor-dot {
    position: fixed; top: 0; left: 0;
    width: 8px; height: 8px;
    background: var(--gold-300);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
    transition: transform 0.08s ease-out, width 0.3s var(--ease), height 0.3s var(--ease);
  }
  .custom-cursor-dot.is-hover {
    width: 36px; height: 36px;
    background: rgba(201,169,106,0.25);
  }
}

/* ─── 13. Hero overlay typography mark (huge editorial number) ─────────── */
.cine-hero-number {
  position: absolute;
  right: 8%; bottom: 8%;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(8rem, 18vw, 18rem);
  color: rgba(255,255,255,0.04);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

/* ─── 14. Hero stats sub-row ───────────────────────────────────────────── */
.hero-mini-stats {
  display: flex; gap: 28px; flex-wrap: wrap;
  margin-top: 24px;
  font-size: 0.78rem; letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}
.hero-mini-stats span { display: flex; align-items: center; gap: 8px; }
.hero-mini-stats strong {
  font-family: var(--font-display); font-style: italic;
  font-size: 1.2rem; color: var(--gold-300);
  letter-spacing: -0.02em;
  font-weight: 500;
}

/* ─── Image quality + responsive sizing ────────────────────────────────── */
img.lazy {
  filter: blur(15px);
  transform: scale(1.04);
  transition: filter 0.6s ease, transform 0.6s ease;
}
img.lazy.is-loaded {
  filter: blur(0);
  transform: scale(1);
}

/* ─── Refined logo container ───────────────────────────────────────────── */
.brand-logo { height: 40px; width: auto; color: var(--ink-1); }
@media (max-width: 540px) {
  .brand-logo { height: 32px; }
}

/* ─── Filter bar for /projects.php ─────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 8px;
  margin-bottom: 32px;
  background: var(--bg-rise);
  border: 1px solid var(--line-faint);
  border-radius: 999px;
  justify-content: center;
}
.filter-chip {
  padding: 8px 16px; border-radius: 999px;
  font-size: 0.82rem;
  color: var(--ink-2);
  background: transparent; border: 0; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.filter-chip:hover { background: var(--bg-glass); color: var(--ink-1); }
.filter-chip.is-active { background: var(--gold-300); color: #07070a; font-weight: 600; }

/* ─── Search input ─────────────────────────────────────────────────────── */
.search-bar {
  position: relative; max-width: 480px; margin: 0 auto 24px;
}
.search-bar input {
  width: 100%; padding: 14px 18px 14px 44px;
  background: var(--bg-rise); border: 1px solid var(--line-firm);
  border-radius: 999px; color: var(--ink-1); font-size: 0.95rem;
}
.search-bar input:focus { border-color: var(--gold-500); outline: none; }
.search-bar::before {
  content: '⌕';
  position: absolute; left: 18px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3); font-size: 1.2rem;
  pointer-events: none;
}

/* Pagination */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; margin-top: 40px;
  flex-wrap: wrap;
}
.pag-btn {
  padding: 10px 20px;
  background: var(--bg-rise);
  border: 1px solid var(--line-firm);
  border-radius: 999px;
  color: var(--ink-1); text-decoration: none;
  font-size: 0.88rem;
  transition: border-color 0.2s, background 0.2s;
}
.pag-btn:hover { border-color: var(--gold-500); background: var(--bg-glass); color: var(--gold-300); }
.pag-info { color: var(--ink-3); font-size: 0.84rem; }

/* Reduced motion override */
@media (prefers-reduced-motion: reduce) {
  .kinetic-word, .mesh-blob, .marquee-track, .weight-shift {
    animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important;
  }
  .clip-reveal, .clip-reveal img { clip-path: inset(0) !important; }
}

/* ════════════════════════════════════════════════════════════════════════
   Mobile / tablet refinements — proper density + spacing for trends
   ════════════════════════════════════════════════════════════════════════ */
@media (max-width: 720px) {
  /* Cinematic hero — shorter, lower bottom padding to avoid empty space */
  .cine-hero:not(.hero-rotator) { min-height: 78vh; padding: 0 0 56px; }

  /* Hero ghost number — fully hide on small screens (visual clutter) */
  .cine-hero-number { display: none; }

  /* Mini-stats — wrap with proper spacing so labels don't crash into numbers */
  .hero-mini-stats {
    flex-direction: column;
    gap: 12px;
    margin-top: 28px;
    font-size: 0.7rem;
    letter-spacing: 0.16em;
  }
  .hero-mini-stats span { gap: 12px; }
  .hero-mini-stats strong { font-size: 1.45rem; }

  /* Marquee — slower scroll + tighter font so it doesn't overwhelm */
  .marquee { padding: 12px 0; }
  .marquee-track { gap: 28px; animation-duration: 80s; padding-right: 28px; }
  .marquee-item { font-size: 1rem; }
  .marquee-item::after { margin-left: 28px; }

  /* Mesh blob — disable on mobile (performance + cleaner hero) */
  .mesh-blob { display: none; }

  /* Kinetic words — keep single-line behaviour, don't break mid-word */
  .kinetic-headline { display: block; }
  .kinetic-word { display: inline-block; }

  /* Custom cursor — already excluded via media query, but explicit safety */
  .custom-cursor-dot { display: none; }

  /* Bento grid — already collapses to 2-col, keep height auto */
  .bento-grid { grid-auto-rows: auto; }

  /* Filter bar — wrap cleanly, smaller chips */
  .filter-bar { padding: 6px; gap: 4px; border-radius: 18px; }
  .filter-chip { padding: 7px 12px; font-size: 0.72rem; }

  /* Search bar — full width, no awkward max-width */
  .search-bar { max-width: 100%; }
  .search-bar input { padding: 12px 16px 12px 40px; font-size: 0.9rem; }

  /* Pagination — wrap, smaller buttons */
  .pagination { gap: 10px; }
  .pag-btn { padding: 8px 14px; font-size: 0.82rem; }
  .pag-info { width: 100%; text-align: center; }

  /* Logo — slightly smaller on mobile */
  .brand-logo { height: 30px; }
}

/* Tighter narrow-mobile (iPhone SE) */
@media (max-width: 380px) {
  .hero-mini-stats strong { font-size: 1.25rem; }
  .marquee-item { font-size: 0.9rem; }
  .display-xxl { font-size: clamp(2rem, 9vw, 3rem); }
}
