:root {
  --bg:        #0d0818;
  --bg2:       #150e28;
  --a1:        #e8364f;
  --a2:        #9b2ff7;
  --a3:        #ff3d6b;
  --a4:        #d44eff;
  --glass:     rgba(255,255,255,0.06);
  --border:    rgba(255,255,255,0.1);
  --border-hl: rgba(255,94,158,0.45);
  --text:      #f0e8ff;
  --text2:     rgba(240,232,255,0.6);
  --text3:     rgba(240,232,255,0.35);
  --t:         0.28s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 48px;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(155,47,247,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(232,54,79,0.08) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 100% 80%, rgba(212,78,255,0.04) 0%, transparent 50%);
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.7;
}

.grad {
  background: linear-gradient(135deg, var(--a1), var(--a2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.anim-grad {
  background-size: 200% 200%;
  animation: gradShift 4s ease infinite;
}

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

/* ───── NAVBAR ───── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 64px;
  background: rgba(13,8,24,0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.logo-star {
  font-size: 1.1rem;
  display: inline-block;
  will-change: transform;
}

/* TON Connect button overrides */
#tc-btn-root tc-root button,
#tc-btn-root button {
  background: linear-gradient(135deg, var(--a1), var(--a2)) !important;
  border: none !important;
  border-radius: 12px !important;
  color: #fff !important;
  font-family: 'Inter', sans-serif !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  padding: 9px 20px !important;
  cursor: pointer !important;
  transition: opacity var(--t), transform var(--t) !important;
}

#tc-btn-root tc-root button:hover,
#tc-btn-root button:hover {
  opacity: 0.85 !important;
  transform: translateY(-1px) !important;
}

#tc-btn-root {
  flex-shrink: 0;
}

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

/* ───── LANDING MAIN ───── */
main.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  padding: 60px 24px;
  text-align: center;
  width: 100%;
}

.deco-stars {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 0.9rem;
  color: var(--a4);
  opacity: 0.3;
  letter-spacing: 0.15em;
}

.deco-stars span:nth-child(odd) {
  animation: twinkle 2s ease infinite;
}

.deco-stars span:nth-child(even) {
  animation: twinkle 2s 1s ease infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50%       { opacity: 0.8; transform: scale(1.3); }
}

.top-stars { margin-bottom: 32px; animation: fadeUp 0.6s ease both; }
.bottom-stars { margin-top: 40px; animation: fadeUp 0.6s 0.3s ease both; }

.landing-title {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  animation: fadeUp 0.7s ease both;
  display: flex;
  align-items: center;
  gap: 16px;
}

.title-deco {
  font-size: 0.5em;
  color: var(--a1);
  animation: twinkle 2.5s ease infinite;
}

.title-deco:last-child {
  animation-delay: 1.2s;
  color: var(--a2);
}

.landing-sub {
  font-size: 1.1rem;
  color: var(--text2);
  margin-bottom: 52px;
  animation: fadeUp 0.7s 0.1s ease both;
  letter-spacing: 0.08em;
}

/* ───── TOOLS GRID ───── */
.tools-grid {
  display: flex;
  justify-content: center;
  gap: 36px;
  animation: fadeUp 0.7s 0.2s ease both;
}

/* ───── TOOL CARD ───── */
.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 250px;
  height: 260px;
  border-radius: 28px;
  text-decoration: none;
  color: var(--text);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  cursor: pointer;
  overflow: hidden;
}

.card-gloss {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  background: linear-gradient(
    160deg,
    rgba(255,255,255,0.12) 0%,
    rgba(255,255,255,0.04) 30%,
    transparent 50%
  );
  pointer-events: none;
  z-index: 1;
}

.tool-active {
  background: linear-gradient(145deg, rgba(232,54,79,0.1), rgba(155,47,247,0.08));
  border: 1.5px solid rgba(232,54,79,0.25);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.tool-active:hover {
  transform: scale(1.08);
  box-shadow:
    0 8px 40px rgba(232,54,79,0.18),
    0 0 60px rgba(155,47,247,0.1),
    inset 0 0 30px rgba(255,255,255,0.03);
  border-color: rgba(232,54,79,0.45);
}

.tool-soon {
  background: linear-gradient(145deg, rgba(155,47,247,0.04), rgba(232,54,79,0.04));
  border: 1.5px dashed rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: default;
}

.tool-soon:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 24px rgba(232,54,79,0.1);
}

.tool-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  z-index: 2;
  animation: float-icon 4s ease infinite;
}

@keyframes float-icon {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

.tool-name {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  z-index: 2;
}

.tool-desc {
  font-size: 0.82rem;
  color: var(--text3);
  z-index: 2;
}

.card-sparkle {
  margin-top: 12px;
  font-size: 0.7rem;
  color: var(--a4);
  opacity: 0.5;
  letter-spacing: 0.25em;
  z-index: 2;
  animation: twinkle 3s ease infinite;
}

.tool-soon .tool-icon {
  opacity: 0.35;
}

.tool-soon .tool-name {
  color: var(--text3);
}

.tool-soon .tool-desc {
  color: rgba(240,232,255,0.2);
}

.tool-soon .card-sparkle {
  color: var(--text3);
  opacity: 0.2;
}

.landing-hint {
  margin-top: 56px;
  font-size: 0.68rem;
  color: rgba(232,54,79,0.2);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  animation: fadeUp 0.7s 0.4s ease both;
  user-select: none;
}

/* ───── SCROLLBAR ───── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ───── RESPONSIVE ───── */
.made-by {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 16px 0;
  font-size: 13px;
  color: var(--text3);
  z-index: 100;
  background: linear-gradient(to top, var(--bg) 60%, transparent);
}
.made-by a {
  color: var(--a1);
  text-decoration: none;
  transition: color var(--t);
}
.made-by a:hover {
  color: var(--a2);
}

.lang-switch {
  display: flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-left: 12px;
}
.lang-btn {
  background: transparent;
  color: var(--text3);
  border: none;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.03em;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active {
  background: var(--a1);
  color: #fff;
}

.lang-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lang-modal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeUp 0.4s ease both;
}
.lang-modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}
.lang-modal-btns {
  display: flex;
  gap: 16px;
}
.lang-modal-btn {
  padding: 14px 28px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.lang-modal-btn:hover {
  border-color: var(--a1);
  background: rgba(232,54,79,0.1);
  transform: scale(1.05);
}

@media (max-width: 600px) {
  .tools-grid { flex-direction: column; gap: 24px; }
  .tool-card { width: 210px; height: 210px; }
  .navbar { padding: 0 20px; }
}
