/* =============================================
   BEST APP IDEAS — Design Tokens + Component Styles
   Dark techy aesthetic — cyan/magenta accents
   ============================================= */

/* --- Fonts --- */
@import url('https://api.fontshare.com/v2/css?f[]=cabinet-grotesk@400,500,700,800&f[]=satoshi@300,400,500,700&display=swap');

/* --- Type Scale --- */
:root {
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);

  /* --- Spacing (4px base) --- */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* --- Radius --- */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* --- Transitions --- */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* --- Content widths --- */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;

  /* --- Fonts --- */
  --font-display: 'Cabinet Grotesk', 'Inter', sans-serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;
}

/* =============================================
   DARK MODE (Default for this site)
   ============================================= */
:root, [data-theme="dark"] {
  --color-bg:             #0a0a0f;
  --color-surface:        #111118;
  --color-surface-2:      #18181f;
  --color-surface-offset: #1a1a22;
  --color-surface-dynamic:#222230;
  --color-divider:        #2a2a38;
  --color-border:         #333345;

  --color-text:           #e4e4ed;
  --color-text-muted:     #8888a0;
  --color-text-faint:     #55556a;

  /* Primary — Cyan */
  --color-primary:        #00d4ff;
  --color-primary-hover:  #00b8e0;
  --color-primary-active: #009cc0;
  --color-primary-glow:   rgba(0, 212, 255, 0.15);

  /* Secondary — Magenta */
  --color-secondary:      #e040a0;
  --color-secondary-hover:#c83090;
  --color-secondary-glow: rgba(224, 64, 160, 0.12);

  /* Functional */
  --color-success:        #34d399;
  --color-warning:        #fbbf24;
  --color-error:          #f87171;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
}

/* --- Light mode override --- */
[data-theme="light"] {
  --color-bg:             #f5f5f8;
  --color-surface:        #ffffff;
  --color-surface-2:      #f9f9fc;
  --color-surface-offset: #eeeeF3;
  --color-surface-dynamic:#e4e4ec;
  --color-divider:        #d4d4dd;
  --color-border:         #c4c4d0;

  --color-text:           #16161d;
  --color-text-muted:     #6a6a7a;
  --color-text-faint:     #a0a0b0;

  --color-primary:        #0090b0;
  --color-primary-hover:  #007898;
  --color-primary-active: #006080;
  --color-primary-glow:   rgba(0, 144, 176, 0.1);

  --color-secondary:      #c03080;
  --color-secondary-hover:#a02070;
  --color-secondary-glow: rgba(192, 48, 128, 0.08);

  --color-success:        #16a34a;
  --color-warning:        #d97706;
  --color-error:          #dc2626;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.14);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --color-bg:             #f5f5f8;
    --color-surface:        #ffffff;
    --color-surface-2:      #f9f9fc;
    --color-surface-offset: #eeeeF3;
    --color-surface-dynamic:#e4e4ec;
    --color-divider:        #d4d4dd;
    --color-border:         #c4c4d0;
    --color-text:           #16161d;
    --color-text-muted:     #6a6a7a;
    --color-text-faint:     #a0a0b0;
    --color-primary:        #0090b0;
    --color-primary-hover:  #007898;
    --color-primary-active: #006080;
    --color-primary-glow:   rgba(0, 144, 176, 0.1);
    --color-secondary:      #c03080;
    --color-secondary-hover:#a02070;
    --color-secondary-glow: rgba(192, 48, 128, 0.08);
    --color-success:        #16a34a;
    --color-warning:        #d97706;
    --color-error:          #dc2626;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.14);
  }
}

/* =============================================
   LAYOUT
   ============================================= */
.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 768px) {
  .container { padding-inline: var(--space-8); }
}

/* =============================================
   HEADER / NAV
   ============================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-divider);
  padding: var(--space-3) 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-text);
}

.logo-link:hover { color: var(--color-primary); }

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}

.nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--color-primary);
}

.theme-toggle {
  color: var(--color-text-muted);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
}

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

/* =============================================
   HERO
   ============================================= */
.hero {
  padding: clamp(var(--space-16), 10vw, var(--space-32)) 0 clamp(var(--space-12), 8vw, var(--space-24));
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 30% 20%, var(--color-primary-glow), transparent),
    radial-gradient(ellipse 50% 40% at 70% 60%, var(--color-secondary-glow), transparent);
  pointer-events: none;
  z-index: 0;
}

.hero > * { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  font-weight: 500;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-success);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: var(--space-6);
  color: var(--color-text);
}

.hero h1 .accent {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 540px;
  margin-inline: auto;
  margin-bottom: var(--space-8);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-bg);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 0 24px var(--color-primary-glow);
}

.btn-primary:active {
  background: var(--color-primary-active);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-surface-offset);
  border-color: var(--color-text-faint);
}

/* =============================================
   APP SHOWCASE SECTION
   ============================================= */
.section-showcase {
  padding: clamp(var(--space-12), 6vw, var(--space-24)) 0;
}

.section-header {
  margin-bottom: var(--space-10);
}

.section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.section-desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 560px;
}

/* --- App Grid --- */
.app-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .app-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .app-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Featured card spans 2 cols on larger screens */
@media (min-width: 640px) {
  .app-card.featured { grid-column: span 2; }
}

@media (min-width: 1024px) {
  .app-card.featured { grid-column: span 2; }
}

/* --- App Card --- */
.app-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: border-color var(--transition-interactive),
              box-shadow var(--transition-interactive),
              transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

.app-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.app-card-icon.cyan    { background: rgba(0, 212, 255, 0.12); color: var(--color-primary); }
.app-card-icon.magenta { background: rgba(224, 64, 160, 0.12); color: var(--color-secondary); }
.app-card-icon.green   { background: rgba(52, 211, 153, 0.12); color: var(--color-success); }
.app-card-icon.amber   { background: rgba(251, 191, 36, 0.12); color: var(--color-warning); }

.app-card-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.app-card-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  flex-grow: 1;
}

.app-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tag {
  padding: var(--space-1) var(--space-3);
  background: var(--color-surface-offset);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
}

.app-card-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
}

.status-active .status-dot  { background: var(--color-success); }
.status-active              { color: var(--color-success); }
.status-dev .status-dot     { background: var(--color-warning); }
.status-dev                 { color: var(--color-warning); }
.status-concept .status-dot { background: var(--color-primary); }
.status-concept             { color: var(--color-primary); }

/* Featured card extra styles */
.app-card.featured {
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-surface-offset) 100%);
  border-color: var(--color-border);
}



.app-card.featured .app-card-icon {
  width: 56px;
  height: 56px;
  font-size: 1.5rem;
}

.app-card.featured .app-card-name {
  font-size: var(--text-xl);
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  border-top: 1px solid var(--color-divider);
  padding: var(--space-8) 0 var(--space-6);
  margin-top: clamp(var(--space-12), 6vw, var(--space-24));
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.footer-brand-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text);
}

.footer-copy {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.footer-links {
  display: flex;
  gap: var(--space-6);
}

.footer-links a {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: none;
}

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

.footer-attribution {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.footer-attribution a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer-attribution a:hover {
  color: var(--color-primary);
}

/* =============================================
   SCROLL REVEAL
   ============================================= */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 60ms; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 120ms; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 180ms; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 240ms; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 300ms; }
.reveal-stagger > .reveal:nth-child(7) { transition-delay: 360ms; }
