/* ═══════════════════════════════════════════
   TwistGrid — Shared Styles
   ═══════════════════════════════════════════ */

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #08080d;
  --bg-raised: #0f0f18;
  --bg-card: #131320;
  --border: #1c1c30;
  --text: #b0afc4;
  --text-dim: #6b6a80;
  --text-heading: #eeedf5;
  --accent: #7c6df0;
  --accent-dim: rgba(124, 109, 240, 0.12);
  --accent-glow: rgba(124, 109, 240, 0.25);
  --radius: 14px;
  --radius-sm: 8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle grid background referencing the puzzle game */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 70% 50% at 50% 0%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 0%, black 20%, transparent 100%);
}

/* --- Layout --- */
.container {
  position: relative;
  z-index: 1;
  max-width: 660px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* --- Navigation --- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  margin-bottom: 16px;
}

.nav-logo {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading);
  text-decoration: none;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  overflow: hidden;
  flex-shrink: 0;
}

.nav-logo-icon img {
  width: 100%;
  height: 100%;
  display: block;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

/* --- Typography --- */
h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

h2 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 40px;
  margin-bottom: 14px;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-top: 24px;
  margin-bottom: 8px;
}

p {
  margin-bottom: 14px;
}

strong {
  color: var(--text-heading);
  font-weight: 600;
}

/* --- Links --- */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #9d91f5;
}

/* --- Hero (index page) --- */
.hero {
  padding: 56px 0 48px;
  text-align: center;
}

.hero-icon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  margin: 0 auto 24px;
  display: block;
  box-shadow:
    0 0 0 1px rgba(124, 109, 240, 0.15),
    0 8px 32px rgba(124, 109, 240, 0.18),
    0 2px 8px rgba(0,0,0,0.4);
}

.hero h1 {
  margin-bottom: 12px;
}

.hero h1 span {
  background: linear-gradient(135deg, #7c6df0, #a78bfa, #7c6df0);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 6s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero .tagline {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 380px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.store-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-heading);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.25s, background 0.25s, transform 0.15s;
}

.store-badge:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text-heading);
  transform: translateY(-1px);
}

.store-badge svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 16px;
  transition: border-color 0.3s;
}

.card:hover {
  border-color: rgba(124, 109, 240, 0.3);
}

.card h2 {
  margin-top: 0;
}

/* --- Feature Grid --- */
.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 500px) {
  .features { grid-template-columns: 1fr; }
}

.feature {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 16px;
  transition: border-color 0.3s, transform 0.15s;
}

.feature:hover {
  border-color: rgba(124, 109, 240, 0.25);
  transform: translateY(-1px);
}

.feature-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 1rem;
}

.feature-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.feature-desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0;
}

/* --- Lists (legal pages) --- */
.legal-content ul {
  list-style: none;
  padding: 0;
  margin-bottom: 16px;
}

.legal-content ul li {
  padding: 7px 0 7px 22px;
  position: relative;
  font-size: 0.95rem;
}

.legal-content ul li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 15px;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.7;
}

/* --- Legal page header --- */
.page-header {
  padding: 40px 0 8px;
}

.page-header h1 {
  margin-bottom: 6px;
}

.page-header .meta {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 32px;
}

/* --- Support card --- */
.support-card {
  background: linear-gradient(135deg, var(--bg-card), rgba(124, 109, 240, 0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 32px;
  text-align: center;
}

.support-card h2 {
  margin: 0 0 6px;
  color: var(--text-heading);
  font-size: 1rem;
  text-transform: none;
  letter-spacing: -0.01em;
}

.support-card p {
  color: var(--text-dim);
  margin-bottom: 14px;
  font-size: 0.92rem;
}

.support-card .email-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 9px;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s;
}

.support-card .email-btn:hover {
  opacity: 0.88;
  color: #fff;
  transform: translateY(-1px);
}

/* --- Footer --- */
footer {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

footer .copyright {
  color: var(--text-dim);
  font-size: 0.82rem;
}

footer .footer-links {
  display: flex;
  gap: 20px;
}

footer .footer-links a {
  color: var(--text-dim);
  font-size: 0.82rem;
  text-decoration: none;
  transition: color 0.2s;
}

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

/* --- Section divider --- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 40px 0;
}

/* --- Fade-in animation --- */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.5s ease forwards;
}

.fade-in:nth-child(2) { animation-delay: 0.08s; }
.fade-in:nth-child(3) { animation-delay: 0.16s; }
.fade-in:nth-child(4) { animation-delay: 0.24s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive --- */
@media (max-width: 480px) {
  .container { padding: 0 18px 48px; }
  .nav { padding: 16px 0; }
  .card { padding: 22px 18px; }
  .hero { padding: 40px 0 36px; }
  footer { flex-direction: column; align-items: flex-start; }
}
