:root {
  --primary: #8a2be2;
  --primary-hover: #7b20ce;
  --dark: #0f172a;
  --darker: #020617;
  --light: #f8fafc;
  --white: #ffffff;
  --gray: #64748b;
  --border: #e2e8f0;
  --font-base: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font-base);
  color: var(--dark);
  background: var(--light);
  line-height: 1.6;
}

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

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
}

.site-nav a {
  text-decoration: none;
  color: var(--gray);
  margin-left: 1.5rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

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

.bg-dark {
  background: var(--darker);
  color: var(--white);
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero .subtitle {
  font-size: 1.25rem;
  color: #cbd5e1;
  max-width: 700px;
  margin: 0 auto;
}

/* App Section */
.app-section {
  margin-top: -3rem;
  margin-bottom: 4rem;
}

.app-container {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  overflow: hidden;
}

.app-sidebar {
  padding: 2.5rem;
  background: #f1f5f9;
  border-right: 1px solid var(--border);
}

.app-sidebar h2 {
  margin-bottom: 0.5rem;
}

.app-sidebar p {
  color: var(--gray);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

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

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

input, select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
}

input:focus, select:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}

.btn-primary {
  width: 100%;
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

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

.app-results {
  padding: 2.5rem;
  overflow-y: auto;
  max-height: 600px;
}

.placeholder-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--gray);
  text-align: center;
}

.placeholder-state svg {
  margin-bottom: 1rem;
  color: #cbd5e1;
}

.hook-card {
  background: var(--light);
  border: 1px solid var(--border);
  padding: 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  animation: fadeIn 0.4s ease-out;
}

.hook-card span.badge {
  display: inline-block;
  background: #e0e7ff;
  color: #4338ca;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hook-card p {
  font-size: 1.1rem;
  font-weight: 500;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Ads */
.ad-container {
  margin: 2rem auto;
  text-align: center;
  min-height: 120px;
}

/* Education & Anatomy Sections */
.education-section {
  padding: 4rem 1.5rem;
}

.education-section h2 {
  text-align: center;
  margin-bottom: 3rem;
  font-size: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--white);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.card h3 {
  margin-bottom: 1rem;
  color: var(--primary);
}

.anatomy-section {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}

.anatomy-section h2 {
  margin-bottom: 1rem;
  font-size: 2rem;
}

.lead-text {
  font-size: 1.1rem;
  color: var(--gray);
  margin-bottom: 2rem;
  max-width: 800px;
}

.anatomy-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.detail-item h4 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  border-left: 3px solid var(--primary);
  padding-left: 0.75rem;
}

.closing-note {
  font-weight: 500;
  background: var(--white);
  padding: 1.5rem;
  border-radius: 6px;
  border-left: 4px solid var(--primary);
}

/* Generic layout pages (About, Terms, Privacy) */
.page-container {
  padding: 4rem 1.5rem;
  max-width: 800px;
  margin: 0 auto;
  min-height: 60vh;
}

.page-container h1 {
  margin-bottom: 1.5rem;
  font-size: 2.5rem;
}

.page-container p {
  margin-bottom: 1rem;
  color: #334155;
}

/* Footer */
.site-footer {
  background: var(--darker);
  color: var(--white);
  padding: 2rem 0;
  margin-top: 4rem;
  text-align: center;
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  margin: 0 0.75rem;
  font-size: 0.9rem;
}

.footer-links a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .app-container {
    grid-template-columns: 1fr;
  }
  .site-footer .container {
    flex-direction: column;
  }
}


/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
