/* ==========================================================
   Cacti Pacti — site styles
   Fonts: Sora (headings) + Inter (body), used site-wide.
   ========================================================== */

:root {
  --bg: #07110e;
  --bg-2: #0b1a16;
  --surface: #10221d;
  --surface-2: #163029;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #ecf6f1;
  --text-muted: #9db4aa;
  --text-dim: #6f877d;

  --green: #34d399;
  --green-light: #86f0c0;
  --green-deep: #10b981;
  --sun: #ffb547;
  --sun-deep: #ff8a3d;
  --bloom: #ff6b8b;

  --grad-brand: linear-gradient(135deg, var(--green-light), var(--green-deep));
  --grad-sun: linear-gradient(135deg, #ffd27a, var(--sun-deep));

  --font-head: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  font-weight: 700;
}

p { margin: 0 0 1em; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-light); }
img, svg { display: block; max-width: 100%; }

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

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--green); color: var(--bg); padding: 8px 14px; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { left: 8px; }

/* ---------- Shared bits ---------- */

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-head);
  font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--green);
  margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--grad-brand); border-radius: 2px; }

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

.section { padding: clamp(72px, 10vw, 120px) 0; position: relative; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(30px, 4.2vw, 44px); }
.section-head p { color: var(--text-muted); font-size: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-head); font-weight: 600; font-size: 15px;
  padding: 14px 24px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--grad-brand); color: #04221a; box-shadow: 0 10px 30px -10px rgba(52, 211, 153, 0.6); }
.btn-primary:hover { color: #04221a; transform: translateY(-2px); box-shadow: 0 16px 36px -10px rgba(52, 211, 153, 0.7); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { color: var(--text); border-color: var(--green); background: rgba(52, 211, 153, 0.08); }

/* ---------- Header ---------- */

.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .3s ease, border-color .3s ease, backdrop-filter .3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(7, 17, 14, 0.82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand img { width: 40px; height: 40px; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.brand-name span { color: var(--green); }

.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  font-family: var(--font-head); font-weight: 500; font-size: 15px;
  color: var(--text-muted); padding: 8px 14px; border-radius: 999px; transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-links .btn { margin-left: 10px; padding: 10px 20px; color: #04221a; }

.nav-toggle {
  display: none; width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-strong); color: var(--text); cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .25s, background .25s;
}
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */

.hero { padding: 150px 0 90px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 400px at 85% 15%, rgba(255, 138, 61, 0.16), transparent 70%),
    radial-gradient(700px 500px at 10% 80%, rgba(16, 185, 129, 0.16), transparent 70%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(40px, 6vw, 68px); font-weight: 800; letter-spacing: -0.035em; }
.hero-lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--text-muted); max-width: 540px; margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 40px; }

.hero-points { display: flex; flex-wrap: wrap; gap: 10px 26px; list-style: none; margin: 0; padding: 0; }
.hero-points li { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 15px; font-weight: 500; }
.hero-points svg { width: 18px; height: 18px; color: var(--green); flex: none; }

/* phone mockups */
.hero-visual { position: relative; height: 520px; }
.phone {
  position: absolute; width: 230px; height: 470px; border-radius: 38px; padding: 10px;
  background: linear-gradient(160deg, #24413a, #0d1d19);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.phone-screen { width: 100%; height: 100%; border-radius: 29px; overflow: hidden; position: relative; }
.phone::before {
  content: ""; position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  width: 70px; height: 20px; border-radius: 12px; background: #050c0a; z-index: 2;
}
.phone-a { left: 6%; top: 30px; transform: rotate(-7deg); animation: float 7s ease-in-out infinite; }
.phone-b { right: 4%; top: 0; transform: rotate(6deg); animation: float 7s ease-in-out -3.5s infinite; }

/* game screen */
.screen-game { background: linear-gradient(180deg, #ffcf86 0%, #ff9a5a 45%, #b9547a 100%); }
.screen-game .sun { position: absolute; width: 90px; height: 90px; border-radius: 50%; background: #fff2c8; top: 110px; left: 50%; transform: translateX(-50%); opacity: .9; }
.screen-game .dune { position: absolute; left: -20%; right: -20%; border-radius: 50% 50% 0 0; }
.screen-game .dune-1 { height: 200px; bottom: -40px; background: #7c3b5c; }
.screen-game .dune-2 { height: 150px; bottom: -60px; left: -40%; right: 10%; background: #4d2342; }
.screen-game .mini-cactus { position: absolute; bottom: 120px; right: 46px; width: 22px; height: 70px; background: #1e4d3c; border-radius: 12px; }
.screen-game .mini-cactus::before, .screen-game .mini-cactus::after { content: ""; position: absolute; width: 12px; height: 30px; border: 8px solid #1e4d3c; border-top: 0; }
.screen-game .mini-cactus::before { left: -16px; top: 14px; border-right: 0; border-radius: 0 0 0 10px; }
.screen-game .mini-cactus::after { right: -16px; top: 6px; border-left: 0; border-radius: 0 0 10px 0; }
.screen-game .hud { position: absolute; top: 50px; left: 16px; right: 16px; display: flex; justify-content: space-between; font-family: var(--font-head); font-weight: 700; font-size: 13px; color: #fff; }
.screen-game .hud span { background: rgba(0, 0, 0, 0.22); padding: 4px 10px; border-radius: 999px; }
.screen-game .play {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-head); font-weight: 700; font-size: 14px; color: #3a1530;
  background: #fff; padding: 10px 28px; border-radius: 999px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

/* app screen */
.screen-app { background: #0e1f1a; padding: 54px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.screen-app .app-title { font-family: var(--font-head); font-weight: 700; font-size: 18px; color: var(--text); }
.screen-app .app-sub { font-size: 11px; color: var(--text-muted); margin-top: -10px; }
.screen-app .ring { width: 120px; height: 120px; margin: 4px auto; border-radius: 50%; background: conic-gradient(var(--green) 0 72%, rgba(255,255,255,.08) 72% 100%); display: grid; place-items: center; }
.screen-app .ring::after { content: "72%"; width: 92px; height: 92px; border-radius: 50%; background: #0e1f1a; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 22px; color: var(--text); }
.screen-app .row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); }
.screen-app .dot { width: 26px; height: 26px; border-radius: 8px; flex: none; }
.screen-app .bar { flex: 1; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); position: relative; overflow: hidden; }
.screen-app .bar i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; }

@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -14px; }
}

/* ---------- Marquee strip ---------- */

.strip { border-block: 1px solid var(--border); background: var(--bg-2); overflow: hidden; }
.strip-track { display: flex; gap: 48px; padding: 18px 0; width: max-content; animation: marquee 32s linear infinite; }
.strip-track span { font-family: var(--font-head); font-weight: 600; font-size: 15px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.14em; display: inline-flex; align-items: center; gap: 48px; white-space: nowrap; }
.strip-track span::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); opacity: .6; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Portfolio ---------- */

.portfolio-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.portfolio-head .section-head { margin-bottom: 0; }

.filters { display: inline-flex; gap: 4px; padding: 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.filter {
  font-family: var(--font-head); font-weight: 600; font-size: 14px;
  padding: 9px 18px; border-radius: 999px; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; transition: color .2s, background .2s;
}
.filter:hover { color: var(--text); }
.filter.active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }

.card {
  position: relative; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.card[hidden] { display: none; }

.card-top { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.app-icon {
  width: 68px; height: 68px; border-radius: 18px; flex: none; display: grid; place-items: center;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.app-icon img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.app-icon svg { width: 32px; height: 32px; color: #fff; }
.card h3 { font-size: 20px; margin: 0 0 4px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  font-family: var(--font-head); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); color: var(--text-muted);
}
.badge.game { background: rgba(255, 138, 61, 0.14); color: var(--sun); }
.badge.app { background: rgba(52, 211, 153, 0.14); color: var(--green); }
.badge.status { background: rgba(255, 107, 139, 0.14); color: var(--bloom); }
.card p { color: var(--text-muted); font-size: 15px; flex: 1; }
.card-meta { font-size: 13px; color: var(--text-dim); margin-bottom: 18px; }

.store-links { display: flex; flex-wrap: wrap; gap: 10px; }
.store-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px;
  background: #000; border: 1px solid var(--border-strong); color: #fff; font-family: var(--font-head); font-size: 13px; font-weight: 600;
  transition: border-color .2s, transform .2s;
}
.store-btn:hover { color: #fff; border-color: var(--green); transform: translateY(-1px); }
.store-btn svg { width: 18px; height: 18px; }
.store-btn.disabled { background: transparent; color: var(--text-dim); border-style: dashed; pointer-events: none; }

.card-empty {
  border-style: dashed; background: transparent; align-items: center; justify-content: center; text-align: center; min-height: 260px;
}
.card-empty:hover { transform: none; box-shadow: none; }
.card-empty .plus { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(52, 211, 153, 0.1); color: var(--green); margin-bottom: 14px; font-size: 28px; font-family: var(--font-head); }
.card-empty h3 { font-size: 18px; }
.card-empty p { flex: none; margin: 0; max-width: 240px; }

/* ---------- Services / About ---------- */

.about { background: var(--bg-2); border-block: 1px solid var(--border); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature { padding: 30px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.feature-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 20px; }
.feature-icon svg { width: 26px; height: 26px; }
.feature-icon.green { background: rgba(52, 211, 153, 0.12); color: var(--green); }
.feature-icon.sun { background: rgba(255, 181, 71, 0.12); color: var(--sun); }
.feature-icon.bloom { background: rgba(255, 107, 139, 0.12); color: var(--bloom); }
.feature h3 { font-size: 20px; }
.feature p { color: var(--text-muted); margin: 0; font-size: 15px; }

.story { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 64px; align-items: center; margin-top: 96px; }
.story-art { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 4 / 3; background: linear-gradient(160deg, #143a30, #06110e); display: grid; place-items: center; }
.story-art img { width: 46%; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.5)); }
.story-art::before { content: ""; position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(52, 211, 153, 0.25), transparent 65%); }
.story h2 { font-size: clamp(28px, 3.6vw, 40px); }
.story p { color: var(--text-muted); font-size: 17px; }

.values { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.values li { display: flex; gap: 14px; align-items: flex-start; }
.values svg { width: 22px; height: 22px; color: var(--green); flex: none; margin-top: 3px; }
.values strong { font-family: var(--font-head); font-weight: 600; display: block; color: var(--text); }
.values span { color: var(--text-muted); font-size: 15px; }

/* ---------- Contact CTA ---------- */

.cta {
  position: relative; overflow: hidden; border-radius: 36px; padding: clamp(40px, 7vw, 80px);
  background: linear-gradient(135deg, #12392e 0%, #0b1f1a 60%, #2a1a14 100%);
  border: 1px solid var(--border-strong); text-align: center;
}
.cta::before { content: ""; position: absolute; width: 420px; height: 420px; right: -120px; top: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 138, 61, 0.35), transparent 65%); }
.cta::after { content: ""; position: absolute; width: 420px; height: 420px; left: -140px; bottom: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(52, 211, 153, 0.3), transparent 65%); }
.cta > * { position: relative; z-index: 1; }
.cta h2 { font-size: clamp(30px, 4.5vw, 50px); max-width: 720px; margin-inline: auto; }
.cta p { color: var(--text-muted); font-size: 18px; max-width: 560px; margin: 0 auto 32px; }
.cta .hero-actions { justify-content: center; margin: 0; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--border); padding: 64px 0 32px; background: var(--bg); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer-grid p { color: var(--text-muted); font-size: 15px; max-width: 320px; margin-top: 16px; }
.footer-col h4 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text); margin-bottom: 16px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-col a { color: var(--text-muted); font-size: 15px; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 28px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: 14px; }

/* ---------- Legal page ---------- */

.legal { padding: 140px 0 90px; }
.legal .container { max-width: 800px; }
.legal h1 { font-size: clamp(34px, 5vw, 48px); }
.legal h2 { font-size: 22px; margin-top: 40px; }
.legal p, .legal li { color: var(--text-muted); }
.legal .updated { color: var(--text-dim); font-size: 14px; margin-bottom: 32px; }

/* ---------- Reveal on scroll ---------- */

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

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

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .hero-grid, .story { grid-template-columns: 1fr; }
  .hero { padding-top: 130px; }
  .hero-visual { height: 480px; max-width: 520px; margin: 0 auto; width: 100%; }
  .features { grid-template-columns: 1fr; }
  .story { gap: 40px; margin-top: 72px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; top: 76px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 4px;
    padding: 12px var(--gutter) 20px; background: rgba(7, 17, 14, 0.97); border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav-open .nav-links { opacity: 1; visibility: visible; transform: none; }
  .nav-open .site-header { background: rgba(7, 17, 14, 0.97); }
  .nav-links a { padding: 12px 14px; font-size: 16px; }
  .nav-links .btn { margin: 8px 0 0; }
}

@media (max-width: 520px) {
  .hero-visual { height: 400px; }
  .phone { width: 180px; height: 370px; border-radius: 32px; }
  .phone-screen { border-radius: 24px; }
  .phone-a { left: 0; }
  .phone-b { right: 0; }
  .screen-game .sun { top: 90px; width: 70px; height: 70px; }
  .screen-app .ring { width: 96px; height: 96px; }
  .screen-app .ring::after { width: 72px; height: 72px; font-size: 18px; }
  .filters { width: 100%; }
  .filter { flex: 1; padding: 9px 10px; }
  .footer-grid { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .hero-actions { flex-direction: column; }
}
