/* ============================================================
   TriCode Studio — design system
   Dark + gradient theme. Shared by every page.
   ============================================================ */

:root {
  /* Surfaces */
  --bg:        #080b14;
  --bg-2:      #0c1020;
  --surface:   rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border:    rgba(255, 255, 255, 0.09);
  --border-2:  rgba(255, 255, 255, 0.16);

  /* Text */
  --text:   #e8eaf2;
  --muted:  #9aa3bd;
  --faint:  #6a7290;

  /* Brand */
  --indigo: #6366f1;
  --violet: #8b5cf6;
  --cyan:   #22d3ee;
  --magenta:#d946ef;
  --grad:   linear-gradient(135deg, #6366f1 0%, #8b5cf6 45%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, rgba(99,102,241,.16), rgba(34,211,238,.10));

  /* Shape */
  --r-sm: 12px;
  --r:    18px;
  --r-lg: 26px;
  --container: 1140px;

  /* Effects */
  --shadow:   0 18px 50px -20px rgba(0, 0, 0, .65);
  --shadow-lg:0 40px 90px -30px rgba(0, 0, 0, .8);

  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter",
               "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 17px;
  letter-spacing: .1px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Ambient gradient backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 15% -5%,  rgba(99,102,241,.22), transparent 60%),
    radial-gradient(800px 600px at 95% 0%,   rgba(34,211,238,.14), transparent 55%),
    radial-gradient(900px 700px at 60% 110%, rgba(217,70,239,.12), transparent 55%);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent, var(--bg) 92%);
  pointer-events: none;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

::selection { background: rgba(139, 92, 246, .35); color: #fff; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
  white-space: nowrap;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 100;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  padding: 10px 16px;
  border-radius: 10px;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 16px; }

/* ----------------------------------------------------------- Layout */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 22px;
}

section { position: relative; }

.section { padding-block: clamp(56px, 9vw, 110px); }

.section-head { max-width: 640px; margin-bottom: 46px; }
.section-head.center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 16px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}
.center .eyebrow::before { display: none; }

h1, h2, h3 { line-height: 1.12; letter-spacing: -.02em; font-weight: 800; }
h2.section-title { font-size: clamp(28px, 4.5vw, 44px); }
h3 { font-weight: 700; }

.lead { color: var(--muted); font-size: clamp(16px, 2vw, 19px); margin-top: 14px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

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

/* ----------------------------------------------------------- Buttons */
.btn {
  --pad-y: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: var(--pad-y) 22px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease),
              background .25s var(--ease), border-color .25s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 14px 34px -12px rgba(99, 102, 241, .8);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -12px rgba(99,102,241,.95); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--border-2);
  color: var(--text);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: var(--surface-2); transform: translateY(-2px); }

.btn-sm { --pad-y: 9px; padding-inline: 16px; font-size: 14px; }

/* Google Play button */
.btn-play {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 22px 11px 18px;
  border-radius: 14px;
  background: #fff;
  color: #0b0d14;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
  box-shadow: 0 16px 40px -16px rgba(0,0,0,.7);
}
.btn-play:hover { transform: translateY(-2px); box-shadow: 0 22px 50px -16px rgba(0,0,0,.85); }
.btn-play svg { width: 26px; height: 26px; flex: none; }
.btn-play .pl { display: flex; flex-direction: column; line-height: 1.05; text-align: left; }
.btn-play .pl small { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #5b6172; }
.btn-play .pl b { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }

/* ----------------------------------------------------------- Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(8, 11, 20, .55);
  border-bottom: 1px solid transparent;
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.site-header.scrolled {
  background: rgba(8, 11, 20, .82);
  border-bottom-color: var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  letter-spacing: -.02em;
  font-size: 18px;
}
.brand .logo {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--grad);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px -8px rgba(99,102,241,.9);
  flex: none;
}
.brand .logo svg { width: 19px; height: 19px; }
.brand span { color: var(--muted); font-weight: 600; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 0;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 550;
  font-size: 15px;
  transition: color .2s, background .2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); background: var(--surface); }

.nav-right { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: transform .28s var(--ease), opacity .2s;
}
.nav-toggle span { top: 50%; margin-top: -1px; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after  { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateX(-50%) translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after  { transform: translateX(-50%) translateY(-6px) rotate(-45deg); }

/* ----------------------------------------------------------- Hero */
.hero { padding-top: clamp(54px, 9vw, 96px); padding-bottom: clamp(40px, 7vw, 80px); }
.hero-inner { max-width: 760px; }
.hero h1 {
  font-size: clamp(38px, 7vw, 70px);
  font-weight: 850;
  letter-spacing: -.03em;
}
.hero p { margin-top: 22px; font-size: clamp(17px, 2.3vw, 21px); color: var(--muted); max-width: 600px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px 7px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 26px;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }

/* ----------------------------------------------------------- Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 56px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px;
  backdrop-filter: blur(6px);
}
.stat b { display: block; font-size: clamp(26px, 4vw, 38px); font-weight: 800; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 14px; }

/* ----------------------------------------------------------- App grid */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s var(--ease), background .35s var(--ease);
  backdrop-filter: blur(8px);
}
.app-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--grad-soft);
  opacity: 0;
  transition: opacity .35s var(--ease);
  pointer-events: none;
}
.app-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-2);
  background: var(--surface-2);
}
.app-card:hover::after { opacity: 1; }
.app-card > * { position: relative; z-index: 1; }

.app-card .icon {
  width: 72px; height: 72px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.app-card .app-top { display: flex; align-items: center; gap: 16px; }
.app-card h3 { font-size: 20px; }
.app-card .tag { color: var(--muted); font-size: 14px; margin-top: 2px; }
.app-card .desc { color: var(--muted); margin-top: 16px; font-size: 15px; flex: 1; }
.app-card .card-actions { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.app-card .more {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 14.5px; color: var(--text);
}
.app-card .more svg { width: 15px; height: 15px; transition: transform .25s var(--ease); }
.app-card:hover .more svg { transform: translateX(3px); }
.stretched-link::before { content: ""; position: absolute; inset: 0; z-index: 2; }

/* Badges */
.badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.badge.free  { color: #34d399; border-color: rgba(52,211,153,.3); background: rgba(52,211,153,.08); }
.badge.noads { color: #22d3ee; border-color: rgba(34,211,238,.3); background: rgba(34,211,238,.08); }
.badge.ads   { color: #fbbf24; border-color: rgba(251,191,36,.28); background: rgba(251,191,36,.07); }

/* ----------------------------------------------------------- App detail */
.app-hero {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 34px;
  align-items: center;
  padding-top: clamp(36px, 6vw, 64px);
}
.app-hero .icon-lg {
  width: 150px; height: 150px;
  border-radius: 34px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-2);
}
.app-hero h1 { font-size: clamp(30px, 5vw, 46px); }
.app-hero .tag { color: var(--muted); font-size: clamp(16px, 2.2vw, 20px); margin-top: 10px; }
.app-hero .hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 24px; }

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--faint); margin-bottom: 6px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--muted); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 28px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px;
}
.feature .fi {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  margin-bottom: 14px;
}
.feature .fi svg { width: 21px; height: 21px; color: var(--cyan); }
.feature h3 { font-size: 17px; }
.feature p { color: var(--muted); font-size: 14.5px; margin-top: 6px; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-top: 26px;
}
.info-grid .cell { background: var(--bg-2); padding: 18px 20px; }
.info-grid .cell span { display: block; font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.info-grid .cell b { font-weight: 650; font-size: 15px; margin-top: 4px; display: block; }

/* Generic panel */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(24px, 4vw, 40px);
}

/* Legal link row */
.legal-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.legal-links a {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 18px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 600; font-size: 14.5px;
  transition: border-color .2s, background .2s, transform .2s;
}
.legal-links a:hover { border-color: var(--border-2); background: var(--surface-2); transform: translateY(-2px); }
.legal-links a svg { width: 17px; height: 17px; color: var(--cyan); }

/* ----------------------------------------------------------- Value props */
.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.value {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 30px;
  transition: transform .3s var(--ease), border-color .3s var(--ease);
}
.value:hover { transform: translateY(-4px); border-color: var(--border-2); }
.value .vi {
  width: 50px; height: 50px;
  border-radius: 14px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  margin-bottom: 18px;
}
.value .vi svg { width: 24px; height: 24px; color: var(--cyan); }
.value h3 { font-size: 19px; }
.value p { color: var(--muted); margin-top: 8px; font-size: 15px; }

/* ----------------------------------------------------------- CTA band */
.cta-band {
  text-align: center;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(40px, 7vw, 72px) 26px;
  position: relative;
  overflow: hidden;
}
.cta-band h2 { font-size: clamp(26px, 4.5vw, 42px); }
.cta-band p { color: var(--muted); margin-top: 14px; max-width: 520px; margin-inline: auto; }
.cta-band .hero-cta { justify-content: center; }

/* ----------------------------------------------------------- Legal / prose */
.prose { max-width: 820px; }
.prose .doc-meta { color: var(--faint); font-size: 14.5px; margin: 10px 0 0; }
.prose h2 { font-size: 22px; margin-top: 40px; padding-top: 6px; letter-spacing: -.01em; }
.prose h3 { font-size: 18px; margin-top: 26px; color: var(--text); }
.prose p { color: #c4cadb; margin-top: 14px; }
.prose ul { margin: 14px 0 0; padding-left: 22px; color: #c4cadb; }
.prose li { margin-top: 8px; }
.prose a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; word-break: break-word; }
.prose a:hover { color: #67e8f9; }
.prose strong { color: var(--text); }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }

.note {
  display: flex;
  gap: 14px;
  background: rgba(251, 191, 36, .07);
  border: 1px solid rgba(251, 191, 36, .25);
  border-radius: var(--r);
  padding: 18px 20px;
  margin: 22px 0;
  font-size: 15px;
  color: #f3d99a;
}
.note svg { width: 22px; height: 22px; flex: none; color: #fbbf24; margin-top: 2px; }
.note b { color: #fde68a; }

/* ----------------------------------------------------------- Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding-block: 56px 34px;
  background: rgba(255,255,255,.012);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
}
.footer-brand p { color: var(--muted); margin-top: 14px; max-width: 320px; font-size: 14.5px; }
.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); margin-bottom: 14px; }
.footer-col ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.footer-col a { color: var(--muted); font-size: 14.5px; transition: color .2s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 14px;
}
.footer-bottom .socials { display: flex; gap: 10px; }
.footer-bottom .socials a {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  transition: border-color .2s, transform .2s;
}
.footer-bottom .socials a:hover { border-color: var(--border-2); transform: translateY(-2px); }
.footer-bottom .socials svg { width: 18px; height: 18px; color: var(--muted); }

/* ----------------------------------------------------------- Reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ----------------------------------------------------------- Responsive */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-links {
    position: fixed;
    inset: 70px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px 22px 24px;
    background: rgba(10, 13, 22, .96);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s var(--ease), transform .25s var(--ease);
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 13px 14px; font-size: 16px; }
  .nav-toggle { display: block; }
  .nav-cta-desktop { display: none; }

  .app-hero { grid-template-columns: 1fr; text-align: center; gap: 22px; justify-items: center; }
  .app-hero .hero-actions { justify-content: center; }
  .app-hero .breadcrumb { justify-content: center; }
  .app-hero .icon-lg { width: 120px; height: 120px; }

  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 460px) {
  .stats { grid-template-columns: 1fr; }
  .app-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ----------------------------------------------------------- Print */
@media print {
  body::before, body::after, .site-header, .site-footer, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .prose a { color: #000; }
}
