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

:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --pro: #7c3aed;
  --pro-soft: #f5f3ff;
  --border: #e5e5e5;
  --radius: 1.25rem;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.08), 0 8px 32px rgba(0,0,0,0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0f;
    --surface: #1a1a1a;
    --ink: #f0f0f0;
    --muted: #999;
    --accent: #60a5fa;
    --accent-soft: #1e293b;
    --pro: #a78bfa;
    --pro-soft: #1e1b2e;
    --border: #2a2a2a;
    --shadow: 0 1px 3px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.3), 0 8px 32px rgba(0,0,0,0.4);
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
header {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--ink);
}

.logo:hover { text-decoration: none; }
.logo span { color: var(--accent); }

nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

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

nav a:hover { color: var(--ink); text-decoration: none; }
nav a.active { color: var(--ink); }
nav a.pro-link { color: var(--pro); }
nav a.pro-link:hover { color: var(--pro); opacity: 0.8; }

/* Footer */
footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.footer-left p {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

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

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

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

/* Hero */
.hero {
  text-align: center;
  padding: 5rem 0 3.5rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin-bottom: 1.25rem;
}

.hero p {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Promise */
.promise {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  text-align: center;
  margin: 0 auto 4rem;
  max-width: 700px;
}

.promise strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.promise p {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Category filter */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Apps grid */
.apps-section {
  padding: 2rem 0 4rem;
}

.apps-section h2 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.apps-section > p {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

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

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.app-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  text-decoration: none;
}

.app-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.app-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.app-card .tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  width: fit-content;
}

.app-card p {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

.app-card .app-link {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: auto;
}

.app-card[hidden] { display: none; }

/* Page content */
.page-header {
  padding: 4rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.page-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.page-header p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 600px;
}

.page-content {
  padding: 0 0 4rem;
  max-width: 760px;
}

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

.page-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.page-content p {
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.7;
}

.page-content ul, .page-content ol {
  color: var(--muted);
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  line-height: 1.8;
}

.page-content li {
  margin-bottom: 0.35rem;
}

.page-content strong {
  color: var(--ink);
}

.page-content a {
  font-weight: 600;
}

/* Comparison */
.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 2rem 0;
}

@media (max-width: 600px) {
  .comparison { grid-template-columns: 1fr; }
}

.comparison-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.comparison-col h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.comparison-col.free h4 { color: var(--accent); }
.comparison-col.pro h4 { color: var(--pro); }

.comparison-col ul {
  list-style: none;
  padding: 0;
}

.comparison-col li {
  font-size: 0.88rem;
  color: var(--muted);
  padding: 0.35rem 0;
  padding-left: 1.25rem;
  position: relative;
}

.comparison-col.free li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.comparison-col.pro li::before {
  content: "+";
  position: absolute;
  left: 0;
  color: var(--pro);
  font-weight: 700;
}

/* Principles grid */
.principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.principle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.principle h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.principle p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Code/tech list */
.tech-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.tech-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.tech-item strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.25rem;
  color: var(--ink);
}

.tech-item p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

/* CTA box */
.cta-box {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2.5rem 0;
}

.cta-box h3 {
  margin-top: 0;
  color: var(--ink);
}

.cta-box p {
  margin-bottom: 0.5rem;
}

.cta-box a.btn {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.6rem 1.5rem;
  background: var(--accent);
  color: white;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: opacity 0.15s;
}

.cta-box a.btn:hover { opacity: 0.85; text-decoration: none; }

/* Pro box */
.pro-box {
  background: var(--pro-soft);
  border: 1px solid color-mix(in srgb, var(--pro) 30%, transparent);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2.5rem 0;
}

.pro-box h3 {
  margin-top: 0;
  color: var(--pro);
}

.pro-box p {
  margin-bottom: 0.5rem;
}

.pro-box a {
  color: var(--pro);
  font-weight: 600;
}

/* Legal pages */
.legal-date {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

/* Mobile nav toggle */
@media (max-width: 600px) {
  nav {
    gap: 1rem;
  }

  .hero {
    padding: 3.5rem 0 2.5rem;
  }

  .apps-grid {
    grid-template-columns: 1fr;
  }
}
