/* Typography configured via parallel HTML link preconnects */

:root {
  /* System Typography */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Color Palette (Light Mode - Curated Soft Apple Greyscale) */
  --bg-primary: #fbfbfd;
  --bg-secondary: rgba(255, 255, 255, 0.7);
  --bg-card: #ffffff;
  --bg-tertiary: #f2f2f7;
  
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #a1a1a6;
  
  --accent: #000000;
  --accent-hover: #333333;
  --border-color: rgba(0, 0, 0, 0.06);
  --border-hover: rgba(0, 0, 0, 0.15);
  
  --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.04);
  --card-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.02);
  
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --max-width: 1000px;
}

[data-theme="dark"] {
  /* Color Palette (Dark Mode - Deep Premium Space Grey) */
  --bg-primary: #0a0a0c;
  --bg-secondary: rgba(22, 22, 23, 0.7);
  --bg-card: #161617;
  --bg-tertiary: #2c2c2e;
  
  --text-primary: #f5f5f7;
  --text-secondary: #86868b;
  --text-tertiary: #48484a;
  
  --accent: #ffffff;
  --accent-hover: #e8e8ed;
  --border-color: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.18);
  
  --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --card-shadow-hover: 0 24px 50px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(120, 120, 120, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(120, 120, 120, 0.02) 0%, transparent 50%);
  color: var(--text-primary);
  line-height: 1.6;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Base Layout & Layout Classes */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2.5rem;
}

/* Navigation Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-secondary);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition-smooth);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.logo {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.03em;
  transition: var(--transition-smooth);
}

.logo:hover {
  opacity: 0.8;
}

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

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-smooth);
  position: relative;
  padding: 0.25rem 0;
}

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

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

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
}

/* Theme Toggle Button */
.theme-btn {
  background: none;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  border-radius: 50px;
  color: var(--text-secondary);
  cursor: pointer;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.theme-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: scale(1.05);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.4rem;
}

/* Main Content Area */
main {
  flex: 1;
  padding-top: 4rem;
  padding-bottom: 5rem;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 5rem 0;
  max-width: 750px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
  line-height: 1.08;
  color: var(--text-primary);
  background: linear-gradient(180deg, var(--text-primary) 60%, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

/* App Grid */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  margin-top: 1rem;
}

.app-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2.5rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: radial-gradient(circle at 50% 0%, rgba(120, 120, 120, 0.015) 0%, transparent 60%);
  opacity: 0;
  transition: var(--transition-smooth);
}

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

.app-card:hover::before {
  opacity: 1;
}

.app-icon {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  background-color: var(--bg-tertiary);
  margin-bottom: 2rem;
  object-fit: cover;
  box-shadow: 
    0 10px 20px rgba(0,0,0,0.06), 
    0 2px 6px rgba(0,0,0,0.04),
    inset 0 -3px 0 rgba(0,0,0,0.05),
    inset 0 1px 0 rgba(255,255,255,0.1);
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: var(--transition-smooth);
}

[data-theme="dark"] .app-icon {
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.app-card:hover .app-icon {
  transform: scale(1.04);
}

.app-name {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
}

.app-tagline {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  flex-grow: 1;
  letter-spacing: -0.01em;
}

.app-link {
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-primary);
  transition: var(--transition-smooth);
}

.app-link svg {
  transition: var(--transition-smooth);
}

.app-card:hover .app-link svg {
  transform: translateX(4px);
}

/* Detail App Page */
.app-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
  margin-top: 1rem;
}

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

.app-header {
  display: flex;
  gap: 2rem;
  align-items: center;
  margin-bottom: 3rem;
}

.app-header-icon {
  width: 110px;
  height: 110px;
  border-radius: 24px;
  box-shadow: 
    0 12px 24px rgba(0,0,0,0.08), 
    0 2px 6px rgba(0,0,0,0.04);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .app-header-icon {
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.app-header-info h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}

.app-header-info p {
  color: var(--text-secondary);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.app-gallery {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding-bottom: 1.5rem;
  scrollbar-width: thin;
  scroll-snap-type: x mandatory;
}

.app-screenshot {
  width: 240px;
  height: auto;
  border-radius: 18px;
  border: 1px solid var(--border-color);
  scroll-snap-align: start;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

.app-meta-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2rem;
  height: fit-content;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.app-meta-item {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.app-meta-item:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.app-meta-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.app-meta-value {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Download Badge button */
.download-badge {
  display: inline-flex;
  margin-top: 0.5rem;
  transition: var(--transition-smooth);
}

.download-badge:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.1);
}

/* Forms (Contact Page) */
.contact-container {
  max-width: 550px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.75rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.6rem;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.98rem;
  transition: var(--transition-smooth);
  box-shadow: 0 1px 2px rgba(0,0,0,0.01);
}

.form-control:focus {
  outline: none;
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(var(--accent), 0.05);
}

textarea.form-control {
  min-height: 160px;
  resize: vertical;
}

.btn {
  display: inline-block;
  background-color: var(--accent);
  color: var(--bg-primary);
  padding: 0.9rem 1.8rem;
  border-radius: 14px;
  border: none;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}

/* Content Page (Policies) */
.policy-content {
  max-width: 750px;
  margin: 0 auto;
}

.policy-content h1 {
  font-size: 2.8rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.policy-content h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.policy-content p, .policy-content ul {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.65;
}

.policy-content ul {
  padding-left: 1.75rem;
}

.policy-content li {
  margin-bottom: 0.6rem;
}

/* Footer styling */
footer {
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 0;
  background-color: var(--bg-primary);
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  transition: var(--transition-smooth);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-smooth);
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.8rem;
  }
  
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.03);
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .menu-toggle {
    display: block;
  }
}
