/* ==================== Tokens ==================== */
:root {
  --bg: #1b1f3d;
  --bg-alt: #20244a;
  --surface: #272c58;
  --surface-2: #2e3366;
  --border: #40447a;
  --text: #f4f4ff;
  --text-dim: #a9acd6;
  --text-dimmer: #7b7fac;

  --i: #22d3ee;
  --o: #fde047;
  --t: #c084fc;
  --s: #4ade80;
  --z: #fb7185;
  --j: #60a5fa;
  --l: #fb923c;

  --grad: linear-gradient(135deg, var(--i), var(--t));
  --ig-grad: linear-gradient(135deg, #f9ce34, #ee2a7b, #6228d7);

  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 20px 45px -20px rgba(0,0,0,0.6);

  --font-display: 'Fredoka', 'Baloo 2', system-ui, sans-serif;
  --font-body: 'Baloo 2', 'Fredoka', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 16px;
}

p { margin: 0 0 16px; color: var(--text-dim); }

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

.text-gradient {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ==================== Falling piece background ==================== */
.piece-field {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.tetromino {
  position: absolute;
  top: -120px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  animation-name: fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
  opacity: 0.85;
}

.tetromino .cell {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.25), 0 0 14px currentColor;
}

@keyframes fall {
  0% { transform: translateY(-10vh) rotate(0deg); }
  100% { transform: translateY(115vh) rotate(360deg); }
}

/* ==================== Blocks (single square icons) ==================== */
.blk {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.3);
}
.blk.i { background: var(--i); }
.blk.o { background: var(--o); }
.blk.t { background: var(--t); }
.blk.s { background: var(--s); }
.blk.z { background: var(--z); }
.blk.j { background: var(--j); }
.blk.l { background: var(--l); }

/* ==================== Header ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(27, 31, 61, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 76px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.logo-blocks {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  background: var(--surface);
  border-radius: 8px;
}
.logo-blocks .blk { width: 10px; height: 10px; }

.logo-accent { color: var(--i); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
  font-weight: 600;
}
.main-nav a { color: var(--text-dim); transition: color 0.2s; }
.main-nav a:hover { color: var(--text); }
.main-nav a.btn-instagram { color: #fff; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ==================== Buttons ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 0.98rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn-instagram {
  background: var(--ig-grad);
  color: #fff;
  box-shadow: 0 12px 30px -10px rgba(238, 42, 123, 0.6);
}
.btn-instagram:hover { box-shadow: 0 16px 36px -8px rgba(238, 42, 123, 0.8); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}
.btn-ghost:hover { border-color: var(--i); color: var(--i); }

.btn-small { padding: 9px 18px; font-size: 0.85rem; }
.btn-large { padding: 18px 36px; font-size: 1.1rem; }

.ig-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* ==================== Hero ==================== */
.hero {
  position: relative;
  z-index: 1;
  padding: 110px 0 90px;
  text-align: center;
}

.hero-inner { max-width: 820px; }

.eyebrow {
  display: inline-block;
  color: var(--i);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  margin-bottom: 22px;
}

.hero-sub {
  font-size: 1.15rem;
  max-width: 620px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.hero-handle a { color: var(--i); font-weight: 700; }
.hero-handle a:hover { text-decoration: underline; }

/* ==================== Sections ==================== */
.section {
  position: relative;
  z-index: 1;
  padding: 90px 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-eyebrow {
  color: var(--t);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  max-width: 720px;
}

.section-lead {
  font-size: 1.08rem;
  max-width: 680px;
  margin-bottom: 44px;
}

/* ==================== Benefit cards ==================== */
.benefit-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.benefit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.benefit-card:hover {
  transform: translateY(-6px);
  border-color: var(--i);
}

.benefit-card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.benefit-card p { margin: 0; font-size: 0.95rem; }

.benefit-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 3px;
  padding: 6px;
}
.benefit-icon span,
.benefit-icon::before,
.benefit-icon::after { content: ""; border-radius: 4px; }

.icon-balance { background: rgba(34, 211, 238, 0.12); }
.icon-balance::before { background: var(--i); box-shadow: 8px 0 0 var(--i); grid-column: 1 / -1; }
.icon-balance::after { background: var(--i); opacity: 0.4; box-shadow: 8px 0 0 var(--i); grid-column: 1 / -1; }

.icon-logic { background: rgba(192, 132, 252, 0.12); }
.icon-logic::before { background: var(--t); grid-row: 1; }
.icon-logic::after { background: var(--t); opacity: 0.5; box-shadow: 8px 0 0 var(--t), 8px -8px 0 var(--t); grid-column: 2; grid-row: 2; }

.icon-solve { background: rgba(74, 222, 128, 0.12); }
.icon-solve::before { background: var(--s); grid-column: 1; grid-row: 1 / span 2; box-shadow: 0 26px 0 -6px var(--s); }
.icon-solve::after { background: var(--s); opacity: 0.5; grid-column: 2; grid-row: 1; }

.icon-layers { background: rgba(251, 146, 60, 0.12); }
.icon-layers::before { background: var(--l); grid-column: 1 / -1; grid-row: 2; }
.icon-layers::after { background: var(--l); opacity: 0.5; grid-column: 1 / -1; grid-row: 1; }

.callout {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--i);
  border-radius: var(--radius-sm);
  padding: 26px 28px;
}
.callout p { margin: 0; color: var(--text); }
.callout strong { color: var(--i); }

/* ==================== Products ==================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 36px;
}

.product-card {
  position: relative;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
  overflow: hidden;
}

.product-thumb {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.mini-piece {
  display: grid;
  gap: 4px;
  opacity: 0.5;
}
.mini-piece span {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.25);
}
.mini-piece span.on { background: var(--piece-color, var(--i)); }
.mini-piece span.off { visibility: hidden; }

.badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--grad);
  color: #0c0d1f;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 5px 12px;
  border-radius: 999px;
}

.product-card h3 { font-size: 1.05rem; margin-bottom: 6px; color: var(--text-dimmer); }
.product-card p { font-size: 0.9rem; margin: 0; color: var(--text-dimmer); }

.products-cta { text-align: center; }

/* ==================== CTA / Contact ==================== */
.cta-section { text-align: center; }
.cta-inner { max-width: 700px; }

.cta-blocks {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 26px;
}
.cta-blocks .blk { width: 22px; height: 22px; animation: bounce 1.6s ease-in-out infinite; }
.cta-blocks .blk:nth-child(2) { animation-delay: 0.1s; }
.cta-blocks .blk:nth-child(3) { animation-delay: 0.2s; }
.cta-blocks .blk:nth-child(4) { animation-delay: 0.3s; }
.cta-blocks .blk:nth-child(5) { animation-delay: 0.4s; }
.cta-blocks .blk:nth-child(6) { animation-delay: 0.5s; }
.cta-blocks .blk:nth-child(7) { animation-delay: 0.6s; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

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

.footer-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-ig {
  margin-left: auto;
  color: var(--i);
  font-weight: 700;
}
.footer-ig:hover { text-decoration: underline; }

.footer-note {
  width: 100%;
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dimmer);
}

/* ==================== Responsive ==================== */
@media (max-width: 900px) {
  .benefit-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }

  .site-header.nav-open .main-nav {
    display: flex;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 24px 24px;
    gap: 16px;
  }
  .site-header.nav-open .main-nav .btn-instagram {
    margin-top: 4px;
  }

  .benefit-grid { grid-template-columns: 1fr; }
  .hero { padding: 80px 0 60px; }
  .section { padding: 64px 0; }
  .footer-ig { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .tetromino, .cta-blocks .blk, html { animation: none !important; scroll-behavior: auto; }
}
