/* ============================================
   ApptivWorks — Design System & Styles
   Pure CSS, zero dependencies, max speed
   ============================================ */

/* --- CSS Custom Properties (Light Theme) --- */
:root {
  --primary: #0f172a;
  --primary-hover: #1e293b;
  --bg: #f0f1f3;
  --bg-card: #ffffff;
  --bg-elevated: #e8e9ec;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e4e8;
  --border-hover: #cbd5e1;
  --accent: #94a3b8;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --planned-bg: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.08);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --nav-bg: rgba(240,241,243,.8);
  --transition: .2s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --- Dark Theme --- */
html.dark {
  --primary: #e2e8f0;
  --primary-hover: #cbd5e1;
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-elevated: #1a1a1a;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #1e1e1e;
  --border-hover: #2a2a2a;
  --accent: #64748b;
  --success-bg: #052e16;
  --warning-bg: #451a03;
  --planned-bg: #1e293b;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.2);
  --shadow: 0 4px 12px rgba(0,0,0,.3);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.4);
  --nav-bg: rgba(10,10,10,.8);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--transition), color var(--transition);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
ul { list-style: none; }

/* --- Typography --- */
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.hero-title { font-size: clamp(2.5rem, 7vw, 6rem); font-weight: 700; letter-spacing: -.03em; }
.hero-title .accent { color: var(--accent); }
.section-label {
  font-size: .7rem; font-weight: 700; letter-spacing: .25em;
  text-transform: uppercase; color: var(--text-muted);
}
.section-title { font-size: clamp(2rem, 4vw, 3.5rem); margin-top: .5rem; }
.section-title .accent { color: var(--accent); }

/* --- Layout --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 6rem 0; }
.text-center { text-align: center; }

/* --- Navbar --- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1rem 1.5rem;
  background: var(--nav-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: background var(--transition);
}
.navbar-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.navbar-brand {
  display: flex; align-items: center; gap: .75rem;
  font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em;
}
.brand-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--text); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: background var(--transition), color var(--transition);
}
html.dark .brand-icon { background: var(--text); color: var(--bg); }
.navbar-links {
  display: flex; align-items: center; gap: 2rem;
  font-size: .7rem; font-weight: 600; letter-spacing: .15em; text-transform: uppercase;
  color: var(--text-muted);
}
.navbar-links a { transition: color var(--transition); }
.navbar-links a:hover, .navbar-links a.active { color: var(--text); }
.navbar-actions { display: flex; align-items: center; gap: .75rem; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: var(--radius-full);
  border: none; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: background var(--transition), color var(--transition);
}
.theme-toggle:hover { background: var(--bg-elevated); color: var(--text); }
.theme-toggle .icon-light, html.dark .theme-toggle .icon-dark { display: none; }
html.dark .theme-toggle .icon-light { display: block; }
.hamburger {
  display: none; width: 38px; height: 38px; border-radius: var(--radius-full);
  border: none; background: transparent; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 8px;
}
.hamburger span {
  display: block; width: 20px; height: 2px; background: var(--text);
  border-radius: 2px; transition: transform .3s, opacity .3s;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(3px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(3px, -5px); }

/* Mobile Nav */
.mobile-nav {
  display: none; position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
  background: var(--bg); z-index: 99; padding: 2rem 1.5rem;
  flex-direction: column; gap: 1rem;
  opacity: 0; transform: translateY(-10px);
  transition: opacity .3s, transform .3s;
}
.mobile-nav.open { display: flex; opacity: 1; transform: translateY(0); }
.mobile-nav a {
  font-size: 1.1rem; font-weight: 600; padding: .75rem 0;
  border-bottom: 1px solid var(--border); color: var(--text);
}
.mobile-nav a:last-child { border-bottom: none; }

@media (max-width: 768px) {
  .navbar-links { display: none; }
  .hamburger { display: flex; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 2rem; border-radius: var(--radius-full);
  font-weight: 600; font-size: .9rem; border: none; cursor: pointer;
  transition: all var(--transition); white-space: nowrap;
}
.btn-primary {
  background: var(--text); color: var(--bg);
}
.btn-primary:hover { opacity: .85; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline {
  background: var(--bg-card); color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--border-hover); background: var(--bg-elevated); }
.btn-sm { padding: .5rem 1.25rem; font-size: .8rem; }
.btn-group { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* --- Cards --- */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem;
  transition: all var(--transition);
}
.card:hover { border-color: var(--border-hover); box-shadow: var(--shadow); }

/* --- App Cards (Portfolio) --- */
.app-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem; margin-top: 2.5rem;
}
@media (max-width: 1024px) { .app-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .app-grid { grid-template-columns: 1fr; } }
.app-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem;
  display: flex; flex-direction: column; gap: 1rem;
  transition: all .3s ease;
}
.app-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow); transform: translateY(-2px); }
.app-card.hidden { display: none; }
.app-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.app-header { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.app-name { font-size: 1.1rem; font-weight: 700; }
.badge {
  font-size: .6rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: .2rem .6rem; border-radius: var(--radius-full);
}
.badge-live { background: var(--success-bg); color: var(--success); }
.badge-dev { background: var(--warning-bg); color: var(--warning); }
.badge-planned { background: var(--planned-bg); color: var(--text-muted); }
.app-desc { font-size: .9rem; color: var(--text-secondary); line-height: 1.5; flex-grow: 1; }
.app-link {
  font-size: .75rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text);
  display: inline-flex; align-items: center; gap: .4rem;
  transition: gap var(--transition);
}
.app-link:hover { gap: .7rem; }

/* --- Filter Pills --- */
.filters {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
}
.filter-btn {
  padding: .5rem 1.25rem; border-radius: var(--radius-full);
  font-size: .75rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  border: 1.5px solid var(--border); background: transparent;
  color: var(--text-secondary); cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--border-hover); color: var(--text); }
.filter-btn.active {
  background: var(--text); color: var(--bg); border-color: var(--text);
}

/* --- App Icon Grid (Home Preview) --- */
.icon-grid {
  display: grid; grid-template-columns: repeat(6, 64px); gap: 1.5rem;
  justify-content: center; margin-top: 4rem;
  mask-image: radial-gradient(circle, black 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle, black 0%, transparent 75%);
}
.icon-grid-item {
  width: 64px; height: 64px; border-radius: 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 24px;
}
@media (max-width: 640px) {
  .icon-grid { grid-template-columns: repeat(4, 56px); gap: 1rem; }
  .icon-grid-item { width: 56px; height: 56px; }
}

/* --- Hero --- */
.hero {
  min-height: 90vh; display: flex; align-items: center;
  justify-content: center; text-align: center;
  padding-top: 5rem; position: relative; overflow: hidden;
}
.hero-content { max-width: 800px; margin: 0 auto; padding: 0 1.5rem; }
.hero-subtitle {
  max-width: 560px; margin: 1.5rem auto 0;
  font-size: 1.1rem; color: var(--text-secondary); line-height: 1.7;
}
.hero .btn-group { justify-content: center; margin-top: 2.5rem; }

/* Mini hero for inner pages */
.hero-mini {
  padding: 8rem 0 3rem; text-align: center;
}

/* --- About Page --- */
.values-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}
.value-card { text-align: left; }
.value-card .value-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--bg-elevated); display: flex; align-items: center;
  justify-content: center; font-size: 22px; color: var(--text-muted);
  margin-bottom: 1rem;
}
.value-card h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.value-card p { font-size: .9rem; color: var(--text-secondary); line-height: 1.6; }
@media (max-width: 1024px) { .values-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .values-grid { grid-template-columns: 1fr; } }

.process-steps { display: flex; flex-direction: column; gap: 3rem; max-width: 700px; margin: 3rem auto 0; }
.process-step { display: flex; gap: 1.5rem; align-items: flex-start; }
.step-num {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: var(--radius-full);
  background: var(--text); color: var(--bg); display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: .9rem;
}
.step-content h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.step-content p { font-size: .9rem; color: var(--text-secondary); line-height: 1.6; }

/* --- Forms --- */
.form-card {
  max-width: 520px; margin: 0 auto;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2.5rem;
}
.form-group { margin-bottom: 1.5rem; }
.form-label {
  display: block; font-size: .7rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: .5rem;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: .85rem 1rem;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: .95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--text); box-shadow: 0 0 0 3px rgba(15,23,42,.06);
}
html.dark .form-input:focus, html.dark .form-select:focus, html.dark .form-textarea:focus {
  box-shadow: 0 0 0 3px rgba(226,232,240,.06);
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-select { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: 1.5rem; text-align: center; line-height: 1.5; }

/* --- Login Page --- */
.login-page {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 2rem;
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 3rem 2.5rem;
  text-align: center;
}
.login-card .brand-icon { margin: 0 auto 1.5rem; width: 48px; height: 48px; border-radius: 12px; font-size: 18px; }
.login-card h1 { font-size: 1.5rem; margin-bottom: .35rem; }
.login-card .subtitle { color: var(--text-muted); font-size: .9rem; margin-bottom: 2rem; }
.login-card .form-group { text-align: left; }
.login-card .btn { width: 100%; justify-content: center; margin-top: .5rem; }
.login-card .back-link {
  display: inline-block; margin-top: 1.5rem;
  font-size: .85rem; color: var(--text-muted);
  transition: color var(--transition);
}
.login-card .back-link:hover { color: var(--text); }

/* --- Footer --- */
.footer {
  padding: 3rem 0; border-top: 1px solid var(--border);
  margin-top: 4rem;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}
.footer-brand { display: flex; align-items: center; gap: .75rem; }
.footer-brand .brand-icon { width: 28px; height: 28px; border-radius: 6px; font-size: 12px; }
.footer-brand span { font-weight: 600; font-size: .9rem; }
.footer-copy { font-size: .75rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a {
  font-size: .7rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-muted);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--text); }
@media (max-width: 640px) {
  .footer-inner { flex-direction: column; text-align: center; }
}

/* --- Scroll Animations --- */
.animate-in {
  opacity: 0; transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.animate-in.visible { opacity: 1; transform: translateY(0); }
.animate-in:nth-child(2) { transition-delay: .1s; }
.animate-in:nth-child(3) { transition-delay: .2s; }
.animate-in:nth-child(4) { transition-delay: .3s; }
.animate-in:nth-child(5) { transition-delay: .4s; }
.animate-in:nth-child(6) { transition-delay: .5s; }

/* --- Utilities --- */
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.max-w-lg { max-width: 640px; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* --- Impact Link --- */
.impact-link {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .7rem; font-weight: 700; letter-spacing: .15em;
  text-transform: uppercase; color: var(--text-muted);
  margin-top: 3rem; transition: color var(--transition), gap var(--transition);
}
.impact-link:hover { color: var(--text); gap: .75rem; }
