/* ============================================================
   MacxLabs — shared design system
   Static, no build step. Dark studio base + per-app accent.
   Set an app accent by adding a theme class to <body>:
     .theme-cascade | .theme-factfall | .theme-arcade
   or override --accent inline on a section.
   ============================================================ */

:root {
  /* studio base palette */
  --bg:        #0b0d13;
  --bg-2:      #11141d;
  --surface:   #161a26;
  --surface-2: #1c2130;
  --border:    #262c3d;
  --border-2:  #323a50;
  --text:      #eef1f7;
  --muted:     #9aa3b8;
  --muted-2:   #6f7891;

  /* default accent (studio violet) — apps override */
  --accent:      #8b7cff;
  --accent-2:    #b3a8ff;
  --accent-ink:  #0b0d13;     /* text drawn on top of accent fills */
  --accent-glow: rgba(139,124,255,.35);

  --radius:    18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --shadow:    0 10px 40px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 70px rgba(0,0,0,.55);
  --maxw:      1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
          Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

/* ---- per-app themes ---- */
.theme-cascade {
  --accent:      #ff4d8d;
  --accent-2:    #ff86b3;
  --accent-glow: rgba(255,77,141,.32);
  --bg:          #120a22;
  --bg-2:        #170c2c;
  --surface:     #1e1238;
  --surface-2:   #261546;
  --border:      #33215c;
  --border-2:    #432a73;
  --accent-ink:  #21102e;
}
.theme-factfall {
  --accent:      #ff3b8a;
  --accent-2:    #46e8b0;          /* mint */
  --accent-glow: rgba(70,232,176,.30);
  --bg:          #0e1418;
  --bg-2:        #121b20;
  --surface:     #17222a;
  --surface-2:   #1d2c35;
  --border:      #273a44;
  --border-2:    #33505d;
  --accent-ink:  #06120d;
}
.theme-arcade {
  --accent:      #ff4dff;          /* neon magenta */
  --accent-2:    #34e6ff;          /* neon cyan */
  --accent-glow: rgba(52,230,255,.30);
  --bg:          #07040f;
  --bg-2:        #0c0618;
  --surface:     #140a26;
  --surface-2:   #1b0e32;
  --border:      #2c1850;
  --border-2:    #3d2070;
  --accent-ink:  #0a0316;
}

/* ============================== base ============================== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 520px at 78% -8%, var(--accent-glow), transparent 60%),
    radial-gradient(700px 480px at 8% 4%, rgba(255,255,255,.045), transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 38%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .4em; font-weight: 800; }
h1 { font-size: clamp(2rem, 5.4vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.25rem); }
h3 { font-size: 1.18rem; }
p  { margin: 0 0 1rem; color: var(--muted); }
small { color: var(--muted-2); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.section { padding: 64px 0; }
.center { text-align: center; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .22em; font-size: .72rem;
  font-weight: 800; color: var(--accent-2); margin: 0 0 14px;
}
.lead { font-size: clamp(1.02rem, 2.1vw, 1.22rem); color: var(--muted); }
.text-grad {
  background: linear-gradient(120deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* skip link for a11y */
.skip {
  position: absolute; left: -999px; top: 0; background: var(--accent);
  color: var(--accent-ink); padding: 10px 16px; border-radius: 0 0 10px 0;
  font-weight: 700; z-index: 100;
}
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }

/* ============================== header ============================== */
.site-head {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(12px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800;
  letter-spacing: -.02em; color: var(--text); font-size: 1.06rem; }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: var(--accent-ink);
  font-weight: 900; font-size: 1rem; box-shadow: 0 4px 16px var(--accent-glow);
}
.brand .mark.img { background: none; box-shadow: none; overflow: hidden; }
.brand .mark.img img { width: 100%; height: 100%; }
.nav { display: flex; gap: 20px; align-items: center; font-size: .92rem; }
.nav a { color: var(--muted); font-weight: 600; }
.nav a:hover { color: var(--text); text-decoration: none; }
@media (max-width: 560px){ .nav .hide-sm { display: none; } }

/* ============================== buttons ============================== */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 1rem; line-height: 1;
  padding: 14px 22px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .2s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); box-shadow: 0 10px 30px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 14px 40px var(--accent-glow); }
.btn-ghost {
  background: var(--surface-2); color: var(--text); border-color: var(--border-2);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--accent-2); }
.btn-lg { padding: 17px 28px; font-size: 1.06rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
.btn-row.center-row { justify-content: center; }

/* App Store badge button */
.appstore {
  display: inline-flex; align-items: center; gap: 12px;
  background: #000; color: #fff; border: 1px solid #2c2c2e;
  padding: 11px 20px 11px 18px; border-radius: 14px; font-weight: 600;
  transition: transform .12s ease, border-color .2s;
}
.appstore:hover { text-decoration: none; transform: translateY(-2px); border-color: #4a4a4e; }
.appstore svg { width: 26px; height: 26px; flex: none; }
.appstore .t { display: flex; flex-direction: column; line-height: 1.05; text-align: left; }
.appstore .t small { font-size: .62rem; letter-spacing: .04em; color: #c7c7cc; text-transform: uppercase; }
.appstore .t b { font-size: 1.18rem; font-weight: 600; }

/* ============================== hero ============================== */
.hero { padding: 72px 0 48px; }
.hero .eyebrow { justify-content: center; }
.badge-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border-2);
  color: var(--muted); padding: 6px 14px; border-radius: 999px;
  font-size: .82rem; font-weight: 600; margin-bottom: 20px;
}
.badge-pill .dot { width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2); }
.badge-pill.live .dot { background: #36d97a; box-shadow: 0 0 10px #36d97a; }

.hero-app {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center;
}
.hero-app .copy { max-width: 560px; }
.hero-app h1 { margin-bottom: 18px; }
.hero-icon-row { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.hero-icon-row img { width: 78px; height: 78px; border-radius: 19px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(255,255,255,.06) inset; }
.hero-icon-row .name { font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em; }
.hero-icon-row .name span { display: block; font-size: .82rem; font-weight: 600;
  color: var(--muted); letter-spacing: 0; }

/* phone frame for hero shot */
.phone {
  position: relative; width: 280px; max-width: 78%; margin: 0 auto;
  border-radius: 42px; padding: 9px;
  background: linear-gradient(160deg, #2a2f3e, #14171f);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.05) inset;
}
.phone::after {
  content: ""; position: absolute; top: 17px; left: 50%; transform: translateX(-50%);
  width: 86px; height: 22px; background: #05060a; border-radius: 0 0 14px 14px; z-index: 2;
}
.phone img { border-radius: 34px; width: 100%; }

@media (max-width: 820px){
  .hero-app { grid-template-columns: 1fr; text-align: center; }
  .hero-app .copy { margin: 0 auto; }
  .hero-icon-row { justify-content: center; }
  .btn-row { justify-content: center; }
  .phone { order: -1; }
}

/* ============================== app cards (home) ============================== */
.app-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 880px){ .app-grid { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; } }

.app-card {
  position: relative; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px; overflow: hidden; transition: transform .16s ease, border-color .2s;
}
.app-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--c1, var(--accent)), var(--c2, var(--accent-2)));
  opacity: .9;
}
.app-card:hover { transform: translateY(-4px); border-color: var(--border-2); }
.app-card .ico { width: 72px; height: 72px; border-radius: 17px; margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.06) inset; }
.app-card h3 { margin-bottom: 4px; font-size: 1.28rem; }
.app-card .tag { font-size: .78rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted-2); margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.app-card .status { display: inline-flex; align-items: center; gap: 6px; }
.app-card .status .d { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); }
.app-card .status.live .d { background: #36d97a; box-shadow: 0 0 8px #36d97a; }
.app-card p { flex: 1; font-size: .96rem; color: var(--muted); }
.app-card .card-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* ============================== feature blocks ============================== */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 720px){ .features { grid-template-columns: 1fr; } }
.feature {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 24px; transition: border-color .2s;
}
.feature:hover { border-color: var(--border-2); }
.feature .fi {
  width: 46px; height: 46px; border-radius: 12px; margin-bottom: 16px;
  display: grid; place-items: center; font-size: 1.4rem;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.feature h3 { margin-bottom: 8px; }
.feature p { margin: 0; font-size: .96rem; }

/* stat strip */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 620px){ .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 20px 16px; text-align: center; }
.stat b { display: block; font-size: 1.9rem; font-weight: 800;
  letter-spacing: -.02em; color: var(--text);
  background: linear-gradient(120deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text; background-clip: text; }
.stat span { font-size: .82rem; color: var(--muted); }

/* ============================== gallery ============================== */
.gallery {
  display: flex; gap: 16px; overflow-x: auto; padding: 6px 2px 18px;
  align-items: flex-start;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: var(--border-2) transparent;
}
.gallery::-webkit-scrollbar { height: 8px; }
.gallery::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
.shot {
  flex: 0 0 auto; width: 230px; scroll-snap-align: center;
  border-radius: 26px; overflow: hidden; border: 1px solid var(--border-2);
  background: var(--surface); box-shadow: var(--shadow);
}
.shot img { width: 100%; aspect-ratio: 590 / 1280; object-fit: cover; }
.shot-wide { width: min(520px, 84vw); }
.shot-wide img { aspect-ratio: 1280 / 590; object-fit: cover; }
.shot .cap { font-size: .8rem; color: var(--muted); padding: 10px 12px 13px; text-align: center; }
.gallery-hint { font-size: .82rem; color: var(--muted-2); text-align: center; margin-top: 4px; }

/* ============================== CTA band ============================== */
.cta-band {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 20%, var(--surface)),
    var(--surface));
  border: 1px solid var(--border-2); border-radius: var(--radius-lg);
  padding: 44px 32px; text-align: center;
}
.cta-band h2 { margin-bottom: 10px; }
.cta-band p { max-width: 540px; margin: 0 auto 22px; }

/* ============================== subject SEO pages ============================== */
.subj-list { display: flex; flex-wrap: wrap; gap: 10px; }
.subj-list a {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); padding: 8px 14px; border-radius: 999px;
  font-size: .9rem; font-weight: 600;
}
.subj-list a:hover { border-color: var(--accent-2); color: var(--text); text-decoration: none; }
.prose { max-width: 760px; }
.prose p { color: var(--muted); font-size: 1.04rem; }
.prose ul { color: var(--muted); padding-left: 20px; }
.prose li { margin-bottom: 8px; }
.crumbs { font-size: .85rem; color: var(--muted-2); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }

/* play placeholder page */
.play-wrap { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 60px 22px; }
.play-card { max-width: 520px; }
.spinner {
  width: 46px; height: 46px; margin: 0 auto 26px; border-radius: 50%;
  border: 4px solid var(--border-2); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce){
  .spinner { animation: none; }
  html { scroll-behavior: auto; }
  .btn:hover, .app-card:hover, .appstore:hover { transform: none; }
}

/* ============================== footer ============================== */
.site-foot {
  border-top: 1px solid var(--border); margin-top: 40px;
  padding: 40px 0 56px; color: var(--muted-2); font-size: .9rem;
}
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.site-foot .col h4 { font-size: .76rem; text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted); margin: 0 0 12px; }
.site-foot a { color: var(--muted-2); display: block; margin-bottom: 7px; }
.site-foot a:hover { color: var(--text); }
.site-foot .fine { width: 100%; border-top: 1px solid var(--border); padding-top: 20px;
  margin-top: 8px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
