/* ════════════════════════════════════════════════════════
   RJReed Studios — shared stylesheet
   Used by index.html, apps/<slug>.html, and the legal pages.
   ════════════════════════════════════════════════════════ */

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

/* ── THEME TOKENS ── */
:root {
  --bg:          #ffffff;
  --bg2:         #f8fafc;
  --bg3:         #f1f5f9;
  --border:      #e2e8f0;
  --border-h:    #cbd5e1;
  --text:        #0f172a;
  --muted:       #64748b;
  --accent:      #16a34a;
  --accent2:     #0ea5e9;
  --accent-bg:   #f0fdf4;
  --accent-text: #15803d;
  --grad:        linear-gradient(120deg, #16a34a 0%, #0ea5e9 100%);
  --warn:        #d97706;
  --warn-bg:     #fffbeb;
  --warn-text:   #b45309;
  --radius:      16px;
  --font:        'Inter', system-ui, sans-serif;
  --shadow-sm:   0 1px 2px rgba(0,0,0,0.06);
  --shadow:      0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg:   0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
}

html.dark {
  --bg:          #0c0c0f;
  --bg2:         #111115;
  --bg3:         #18181e;
  --border:      rgba(255,255,255,0.08);
  --border-h:    rgba(255,255,255,0.14);
  --text:        #f1f5f9;
  --muted:       #94a3b8;
  --accent:      #22c55e;
  --accent2:     #38bdf8;
  --accent-bg:   rgba(34,197,94,0.1);
  --accent-text: #4ade80;
  --grad:        linear-gradient(120deg, #22c55e 0%, #38bdf8 100%);
  --warn:        #f59e0b;
  --warn-bg:     rgba(245,158,11,0.12);
  --warn-text:   #fbbf24;
  --shadow-sm:   0 1px 2px rgba(0,0,0,0.4);
  --shadow:      0 1px 3px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.25);
  --shadow-md:   0 4px 6px -1px rgba(0,0,0,0.35), 0 2px 4px -2px rgba(0,0,0,0.25);
  --shadow-lg:   0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -4px rgba(0,0,0,0.25);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
}

.nav-logo {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.nav-logo span { color: var(--accent); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.75rem;
}

nav ul a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

nav ul a:hover { color: var(--text); }

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.theme-toggle:hover { background: var(--bg3); color: var(--text); }

.icon-sun  { display: none; }
.icon-moon { display: none; }
html:not(.dark) .icon-sun  { display: block; }
html.dark       .icon-moon { display: block; }

/* ── LAYOUT ── */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2rem;
}

section { position: relative; }

.section-wrap { padding: 6rem 0; }

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent-text);
  margin-bottom: 0.6rem;
}

.section-wrap > .container > h2,
.section-wrap h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 2.75rem;
}

hr.divider {
  border: none;
  border-top: 1px solid var(--border);
}

/* ── HERO ── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 64px;
  position: relative;
  overflow: hidden;
}

/* soft gradient glow behind the hero */
#hero::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  width: 60rem;
  height: 60rem;
  max-width: 120vw;
  transform: translateX(-50%);
  background: radial-gradient(circle at center,
              color-mix(in srgb, var(--accent) 16%, transparent) 0%,
              transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  max-width: 660px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 4rem 0;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent-bg);
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
  width: fit-content;
}

.hero-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

h1 {
  font-size: clamp(2.6rem, 6vw, 4.25rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

h1 em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 460px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.25rem;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.35rem;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  border: none;
}

.btn-primary { background: var(--grad); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-ghost {
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover { background: var(--bg3); border-color: var(--border-h); }

/* ── APPS SECTION (carousel + filter + grid) ── */

/* Featured carousel */
.carousel {
  position: relative;
  margin-bottom: 3.5rem;
}

.carousel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.carousel-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.carousel-nav { display: flex; gap: 0.5rem; }

.carousel-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.carousel-btn:hover { background: var(--bg3); color: var(--text); border-color: var(--border-h); }

.carousel-track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0.5rem 0.25rem;
  margin: -0.5rem -0.25rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.carousel-track::-webkit-scrollbar { display: none; }

.carousel-track > .app-card {
  flex: 0 0 clamp(280px, 80vw, 360px);
  scroll-snap-align: start;
}

/* Filter tabs */
.filter-tabs {
  display: inline-flex;
  gap: 0.3rem;
  padding: 0.3rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 100px;
  margin-bottom: 1.75rem;
}

.filter-tab {
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 100px;
  padding: 0.45rem 1.1rem;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.filter-tab:hover { color: var(--text); }

.filter-tab.active {
  color: #fff;
  background: var(--grad);
}

/* Grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

/* ── APP CARD (shared by carousel + grid) ── */
.app-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}

.app-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-h);
  transform: translateY(-3px);
}

.app-card-top {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.app-icon img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  display: block;
}

.app-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
}

.badge-live {
  background: var(--accent-bg);
  color: var(--accent-text);
}

.badge-wip {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.badge-soon {
  background: var(--bg3);
  color: var(--muted);
  border: 1px solid var(--border);
}

.badge-platform {
  background: var(--bg3);
  color: var(--muted);
  border: 1px solid var(--border);
}

.app-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  display: block;
}

.app-name:hover { color: var(--accent-text); }

.app-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
  flex: 1;
}

.store-btns {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.3;
  transition: opacity 0.15s, transform 0.15s;
}

.store-btn:hover { opacity: 0.82; transform: translateY(-1px); }

.store-btn svg { flex-shrink: 0; }

.store-btn small {
  display: block;
  font-size: 0.62rem;
  font-weight: 400;
  opacity: 0.7;
}

/* ── POLICIES ── */
.policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.policy-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}

.policy-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-h);
  transform: translateY(-2px);
}

.policy-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.policy-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.policy-card p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
}

.policy-card a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-text);
  text-decoration: none;
  margin-top: 0.25rem;
}

.policy-card a:hover { text-decoration: underline; }

/* ── ABOUT ── */
#about { background: var(--bg2); }

.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text p {
  font-size: 0.975rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.about-text p:last-child { margin-bottom: 0; }

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
}

.stat-num {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── CONTACT ── */
.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact-info p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent-text);
  text-decoration: none;
}

.contact-email:hover { text-decoration: underline; }

form { display: flex; flex-direction: column; gap: 0.85rem; }

input, textarea, select {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 0.8rem 1rem;
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

input::placeholder, textarea::placeholder { color: var(--muted); }

textarea { resize: vertical; min-height: 120px; }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

footer p { font-size: 0.82rem; color: var(--muted); }

.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }

.footer-links a {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}

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

/* ── LEGAL / APP PAGES ── */
.legal-page { padding: 7rem 0 5rem; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-text);
  text-decoration: none;
  margin-bottom: 2rem;
  cursor: pointer;
}

.back-link:hover { text-decoration: underline; }

.legal-page h1,
.legal-page h2 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}

.legal-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.legal-body h3 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 2rem 0 0.5rem;
}

.legal-body p, .legal-body ul {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.8;
}

.legal-body ul { padding-left: 1.25rem; }
.legal-body ul li { margin-bottom: 0.4rem; }
.legal-body a { color: var(--accent-text); }

/* ── APP DETAIL PAGE ── */
.app-page-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 3rem;
}

.app-page-hero img {
  width: 128px;
  height: 128px;
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  display: block;
}

.app-page-hero h1,
.app-page-hero h2 { margin-bottom: 0.6rem; }

.app-page-tagline {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 540px;
}

.app-page-section { margin-top: 2.5rem; }

.deletion-form { max-width: 520px; margin-top: 2.5rem; }

#deletion-confirm {
  display: none;
  font-size: 0.85rem;
  color: var(--accent-text);
  margin-top: 1rem;
}

#deletion-error {
  display: none;
  font-size: 0.85rem;
  color: #ef4444;
  margin-top: 1rem;
}

/* ── SCROLL REVEAL ── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-badge::before { animation: none; }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  nav ul { display: none; }

  .app-page-hero { grid-template-columns: 1fr; gap: 1.25rem; }
  .app-page-hero img { width: 96px; height: 96px; border-radius: 22px; }

  .about-inner,
  .contact-inner { grid-template-columns: 1fr; gap: 2.5rem; }

  footer { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .container { padding: 0 1.25rem; }
  .section-wrap { padding: 4rem 0; }
  h1 { font-size: 2.4rem; }
  .apps-grid { grid-template-columns: 1fr; }
  .app-icon img { width: 64px; height: 64px; }
}
