/* ============================================================
   RESET & TOKENS
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:             #080808;
  --surface:        #0d0d0d;
  --surface-2:      #131313;
  --gap-color:      #161616;
  --border:         rgba(255,255,255,0.06);
  --border-bright:  rgba(139,92,246,0.45);

  --violet:         #8B5CF6;
  --violet-dim:     #6D28D9;
  --violet-light:   #A78BFA;
  --violet-pale:    #C4B5FD;
  --violet-glow:    rgba(139,92,246,0.18);
  --magenta:        #EC4899;
  --cyan:           #06B6D4;

  --text-0: #ffffff;
  --text-1: #E5E7EB;
  --text-2: #9CA3AF;
  --text-3: #4B5563;

  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --container: min(1280px, 100% - 3rem);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-0);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

/* ============================================================
   CANVAS (WebGL layer)
   ============================================================ */
#canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.9;
}

/* ============================================================
   TILE — shared between hero grid & studio mosaic
   ============================================================ */
.tile {
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

.tile--glow {
  background: linear-gradient(135deg, #0f0a1f 0%, #0a0a10 100%);
}

.tile--glow::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 60%, rgba(139,92,246,0.28) 0%, transparent 70%);
  animation: tile-pulse var(--duration, 4s) ease-in-out var(--delay, 0s) infinite;
}

@keyframes tile-pulse {
  0%, 100% { opacity: 0.2; }
  50%       { opacity: 1;   }
}

/* ============================================================
   SHARED
   ============================================================ */
.container {
  width: var(--container);
  margin: 0 auto;
}

.section-label {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--violet-light);
  margin-bottom: 1rem;
}

/* ============================================================
   PRODUCTS
   ============================================================ */
.products {
  position: relative;
  z-index: 1;
  padding: 4rem 0 8rem;
}


.products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--gap-color);
}

/* Card */
.product-card {
  position: relative;
  background: var(--surface);
  display: flex;
  overflow: hidden;
  cursor: pointer;
  transform-style: preserve-3d;
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  will-change: transform;
}

/* Reactive glow that follows cursor */
.product-card-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at var(--mx, 50%) var(--my, 50%),
    rgba(139,92,246,0.14) 0%,
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.product-card:hover .product-card-glow { opacity: 1; }

/* Inset glow border on hover */
.product-card::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow 0.35s;
  pointer-events: none;
  z-index: 5;
}

.product-card:hover::after {
  box-shadow: inset 0 0 0 1px rgba(139,92,246,0.5);
}

.product-card-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: clamp(2rem, 4vw, 3.5rem);
  min-height: 520px;
  width: 100%;
}

/* Product icon */
.product-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: auto;
}

.product-icon svg {
  width: 26px;
  height: 26px;
}

[data-product="timemagic"] .product-icon {
  background: linear-gradient(135deg, #4C1D95, #7C3AED);
  box-shadow: 0 0 28px rgba(124,58,237,0.5), 0 0 60px rgba(124,58,237,0.15);
  color: #fff;
}

[data-product="journal"] .product-icon {
  background: linear-gradient(135deg, #1E3A5F, #1D4ED8);
  box-shadow: 0 0 28px rgba(29,78,216,0.5), 0 0 60px rgba(29,78,216,0.15);
  color: #fff;
}

/* Large decorative letter behind content */
.product-card-content::before {
  content: attr(data-glyph);
  position: absolute;
  right: -0.1em;
  bottom: -0.15em;
  font-size: 14rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  opacity: 0.028;
  user-select: none;
  pointer-events: none;
  transition: opacity 0.5s;
}

.product-card:hover .product-card-content::before { opacity: 0.05; }

[data-product="timemagic"] .product-card-content  { --glyph: "T"; }
[data-product="timemagic"] .product-card-content::before  { content: "TM"; }
[data-product="journal"]   .product-card-content::before  { content: "IH"; }

.product-meta {
  margin-top: 2rem;
}

.product-name {
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  line-height: 1.1;
}

.product-desc {
  font-size: 1rem;
  color: var(--text-2);
  line-height: 1.65;
  max-width: 340px;
}

.product-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.product-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--violet-light);
  transition: gap 0.25s var(--ease-out), color 0.2s;
}

.product-cta .arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.25s var(--ease-out);
}

.product-card:hover .product-cta { gap: 0.75rem; color: var(--violet-pale); }
.product-card:hover .product-cta .arrow { transform: translateX(3px); }


/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 2.25rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.875rem;
}

.footer-logo {
  color: var(--violet-light);
  filter: drop-shadow(0 0 6px var(--violet));
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--text-1); }

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-3);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Scroll reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity  0.75s var(--ease-out),
    transform 0.75s var(--ease-out);
}

[data-reveal].visible {
  opacity: 1;
  transform: none;
}

[data-delay="1"] { transition-delay: 0.10s; }
[data-delay="2"] { transition-delay: 0.22s; }
[data-delay="3"] { transition-delay: 0.34s; }

/* ============================================================
   PRINT / STATIC RENDER
   Reveal all animated content so PDFs and screenshots are complete
   ============================================================ */
@media print {
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  #canvas { display: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  .product-card-content {
    min-height: 420px;
  }


}

@media (max-width: 600px) {
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
