/* =============================================================================
   AppGrowify — Shared Design System
   Loaded on all pages via wp_enqueue_scripts in functions.php
   ============================================================================= */

/* --- Variables & Reset ---------------------------------------------------- */
:root {
  --bg: #0a0a0a;
  --bg2: #111111;
  --bg3: #161616;
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);
  --text: #f0ede8;
  --text-muted: #7a7670;
  --text-dim: #4a4845;
  --accent: #c8f060;
  --accent-dim: rgba(200,240,96,0.10);
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'DM Sans', sans-serif;
  --radius: 12px;
  --radius-lg: 20px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg) !important;
  color: var(--text) !important;
  font-family: var(--sans) !important;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Emoji fix: prevent WP emoji images rendering as giant circles --------- */
img.emoji {
  width: 1em !important;
  height: 1em !important;
  display: inline !important;
  vertical-align: text-bottom;
  margin: 0 !important;
}

/* --- Hide WordPress admin bar completely ----------------------------------- */
#wpadminbar, #wpfooter, .wp-admin-bar { display: none !important; }
html { margin-top: 0 !important; }

/* --- Kill ALL block-theme default output ----------------------------------- */
.wp-site-blocks, .site, .site-header, .site-footer,
.wp-block-template-part, header.wp-block-template-part,
footer.wp-block-template-part, .wp-block-group,
.entry-header, .entry-footer, .page-header,
.archive-header, .search-header,
.wp-block-post-title, .wp-block-post-date,
.wp-block-post-author, .wp-block-post-content { display: none !important; }

/* Show our custom wrappers */
#appgrowify-post, #appgrowify-404 { display: block !important; }

/* --- Navigation ----------------------------------------------------------- */
nav#ag-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  padding: 0 48px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,10,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.nav-logo {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-cta {
  background: var(--accent) !important;
  color: #0a0a0a !important;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 500 !important;
  transition: opacity 0.2s !important;
}
.nav-cta:hover { opacity: 0.85; }

/* --- Hamburger button ------------------------------------------------------ */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s, width 0.3s;
  transform-origin: center;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; width: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Mobile menu ----------------------------------------------------------- */
.mobile-menu {
  display: none;
  position: fixed;
  top: 64px; right: 0;
  width: 280px;
  height: calc(100vh - 64px);
  background: var(--bg2);
  border-left: 1px solid var(--border);
  z-index: 9998;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  padding: 32px 28px;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.mobile-menu li a {
  display: block;
  padding: 14px 0;
  font-size: 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}
.mobile-menu li a:hover, .mobile-menu li a.active { color: var(--text); }
.mobile-menu .mobile-cta {
  margin-top: 16px;
  background: var(--accent) !important;
  color: #0a0a0a !important;
  border-radius: var(--radius);
  text-align: center;
  font-weight: 500;
  border-bottom: none !important;
  padding: 14px 0 !important;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9997;
  opacity: 0;
  transition: opacity 0.3s;
}
.mobile-overlay.open { opacity: 1; }

/* --- Footer --------------------------------------------------------------- */
footer {
  border-top: 1px solid var(--border);
  padding: 36px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-logo { font-family: var(--serif); font-size: 18px; color: var(--text); text-decoration: none; }
.footer-logo span { color: var(--accent); }
.footer-links { display: flex; gap: 24px; list-style: none; }
.footer-links a { font-size: 13px; color: var(--text-dim); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--text-muted); }
.footer-copy { font-size: 12px; color: var(--text-dim); }

/* --- Scroll progress bar (single posts) ----------------------------------- */
#reading-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  z-index: 99999;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* --- Shared reveal animation ---------------------------------------------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.d1 { transition-delay: 0.1s; }
.d2 { transition-delay: 0.2s; }

/* --- Mobile responsive ----------------------------------------------------- */
@media (max-width: 900px) {
  nav#ag-nav { padding: 0 20px; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .mobile-menu { display: block; }
  .mobile-overlay { display: block; }
  footer { padding: 28px 20px; flex-direction: column; }
}
