/* ============================================================
   Cyra Landing Page — style.css
   Dark-first design with light theme override
   ============================================================ */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300..700;1,9..40,300..700&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- Dark theme (default) --- */
:root,
[data-theme="dark"] {
  --void: #07090f;
  --surface: #0c1321;
  --elevated: #152038;
  --border: #1e2d4a;

  --blue-base: #2e7cf6;
  --blue-bright: #5a9dff;
  --blue-pale: #90c2ff;
  --blue-deep: #0d1f3c;

  --text-primary: #e2eaf4;
  --text-secondary: #8494ad;
  --text-muted: #4d5d75;

  --amber: #d4952a;
  --green: #34b076;
  --red: #dc4545;
  --purple: #a78bfa;

  /* syntax highlighting */
  --syn-kw: #5a9dff;
  --syn-type: #a78bfa;
  --syn-fn: #34b076;
  --syn-str: #d4952a;
  --syn-num: #90c2ff;
  --syn-comment: #4d5d75;
  --syn-annotation: #dc4545;
  --syn-plain: #e2eaf4;

  --glow-color: rgba(46, 124, 246, 0.15);
  --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  --nav-bg: rgba(7, 9, 15, 0.85);
}

/* --- Light theme --- */
[data-theme="light"] {
  --void: #ffffff;
  --surface: #f5f7fa;
  --elevated: #edf0f5;
  --border: #d8dfe8;

  --blue-deep: #e8f0fe;

  --text-primary: #1a1f2e;
  --text-secondary: #5a6577;
  --text-muted: #8b95a6;

  --syn-kw: #2e7cf6;
  --syn-type: #7c3aed;
  --syn-fn: #16874d;
  --syn-str: #b07318;
  --syn-num: #2563eb;
  --syn-comment: #8b95a6;
  --syn-annotation: #c53030;
  --syn-plain: #1a1f2e;

  --glow-color: rgba(46, 124, 246, 0.08);
  --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --nav-bg: rgba(255, 255, 255, 0.85);
}

/* --- Reset & base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 7.5rem;
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--void);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--blue-bright);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--blue-pale);
}

code, pre {
  font-family: 'JetBrains Mono', monospace;
}

/* --- Layout --- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 5rem 0;
}

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.nav-logo span {
  color: var(--blue-base);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  border: none;
}

.btn-primary {
  background: var(--blue-base);
  color: #fff;
}

.btn-primary:hover {
  background: var(--blue-bright);
  color: #fff;
  box-shadow: 0 0 20px rgba(46, 124, 246, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  font-size: 1.1rem;
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* --- Sub-navigation (on-page sections) --- */
.subnav {
  position: sticky;
  top: 4rem;
  z-index: 99;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.subnav .container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.subnav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  height: 2.75rem;
  white-space: nowrap;
}

.subnav-links a {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.subnav-links a:hover {
  color: var(--text-primary);
  background: var(--elevated);
}

/* mobile menu */
.nav-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* --- Hero --- */
.hero {
  text-align: center;
  padding: 8rem 0 6rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.hero h1 .accent {
  color: var(--blue-bright);
}

.hero .subline {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Features (What is Cyra?) --- */
.features {
  background: var(--surface);
}

.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--blue-base);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.section-desc {
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 3rem;
  font-size: 1.05rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem 1.75rem;
  transition: box-shadow 0.25s, border-color 0.25s;
}

.feature-card:hover {
  border-color: var(--blue-base);
  box-shadow: var(--card-shadow);
}

.feature-icon {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  display: block;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.65;
}

/* --- Code example --- */
.code-section {
  padding: 5rem 0;
}

.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 2rem;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--elevated);
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
}

.code-dot:nth-child(1) { background: var(--red); }
.code-dot:nth-child(2) { background: var(--amber); }
.code-dot:nth-child(3) { background: var(--green); }

.code-filename {
  margin-left: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.code-block pre {
  padding: 1.5rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.7;
  tab-size: 4;
}

.code-block pre code {
  color: var(--syn-plain);
}

/* syntax classes */
.kw   { color: var(--syn-kw); }
.type { color: var(--syn-type); }
.fn   { color: var(--syn-fn); }
.str  { color: var(--syn-str); }
.num  { color: var(--syn-num); }
.cmt  { color: var(--syn-comment); font-style: italic; }
.ann  { color: var(--syn-annotation); }

/* --- Use Cases --- */
.usecases {
  background: var(--surface);
}

.usecases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.usecase-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.usecase-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(46, 124, 246, 0.1);
  color: var(--blue-bright);
  font-weight: 700;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
}

.usecase-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.usecase-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* --- Not section --- */
.not-section {
  /* void — alternates after usecases (surface) */
}

.not-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.not-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.not-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(220, 69, 69, 0.1);
  color: var(--red);
  font-weight: 700;
  font-size: 1rem;
}

.not-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.not-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* --- Philosophy --- */
.philosophy {
  text-align: center;
  background: var(--surface);
}

.philosophy-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
  text-align: left;
}

.philosophy-card {
  padding: 2rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.philosophy-card .quote {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--blue-bright);
}

.philosophy-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.65;
}

/* --- Philosophy page: hero compact --- */
.hero-compact {
  padding: 5rem 0 3rem;
}

/* --- Council groups --- */
.council-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.council-group {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem 1.75rem;
}

.group-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.group-number {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--blue-deep);
  color: var(--blue-bright);
  font-weight: 700;
  font-size: 0.9rem;
  font-family: 'JetBrains Mono', monospace;
}

.group-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.group-question {
  color: var(--blue-bright);
  font-size: 0.85rem;
  font-style: italic;
  margin-top: 0.15rem;
}

.council-group > p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.group-members {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* --- Philosophers grid --- */
.philosophers-section {
  background: var(--surface);
}

.philosophers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.philosopher-card {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
  border-top: 3px solid var(--blue-base);
}

.philosopher-card.card-accent-amber { border-top-color: var(--amber); }
.philosopher-card.card-accent-purple { border-top-color: var(--purple); }
.philosopher-card.card-accent-green { border-top-color: var(--green); }
.philosopher-card.card-accent-red { border-top-color: var(--red); }

.phil-era {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 0.35rem;
}

.philosopher-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.phil-role {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.phil-principles {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.phil-principles li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-left: 1rem;
  position: relative;
}

.phil-principles li::before {
  content: '\203A';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.phil-principles li strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* --- Protocol --- */
.protocol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.protocol-phase {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
}

.phase-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.phase-number {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--blue-base);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

.phase-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.phase-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.phase-steps li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.phase-steps li strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* --- Closing quote --- */
.closing-quote {
  text-align: center;
  background: var(--surface);
  padding: 5rem 0;
}

.big-quote {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 720px;
  margin: 0 auto 2.5rem;
  font-style: italic;
  border-left: none;
}

.closing-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Responsive additions for philosophy page --- */
@media (max-width: 768px) {
  .council-groups,
  .philosophers-grid,
  .protocol-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}

.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--text-secondary);
}

.footer-version {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 4rem;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-menu-btn {
    display: block;
  }

  .hero {
    padding: 5rem 0 4rem;
  }

  .features-grid,
  .usecases-grid,
  .not-grid,
  .philosophy-cards {
    grid-template-columns: 1fr;
  }

  .footer .container {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  section {
    padding: 3.5rem 0;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }

  .hero-ctas .btn {
    width: 100%;
    justify-content: center;
  }
}
