
:root {
  --bg-primary: #0f172a;
  --bg-secondary: #172137;
  --text-primary: #e5e7eb;
  --text-secondary: #cbd5e1;
  --card-bg: #172137;
  --header-bg: rgba(15, 23, 42, 0.85);
  --border-soft: rgba(255,255,255,0.08);
  --button-bg: #e5e7eb;
  --button-text: #0f172a;
}

body.light {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --card-bg: #e8eef3;
  --header-bg: rgba(255,255,255,0.92);
  --border-soft: rgba(15,23,42,0.08);
  --button-bg: #172137;
  --button-text: #ffffff;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
}

img {
  display: block;
}

.container {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(8px);
}

.header-inner {
  min-height: 72px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
}

.logo {
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.nav a {
  text-decoration: none;
  color: var(--text-primary);
  opacity: 0.9;
}

.nav a:hover {
  opacity: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

.theme-toggle {
  min-width: 42px;
  height: 42px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 0 10px;
  cursor: pointer;
}

.burger {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.hero,
.cards,
.text-block,
.explain {
  width: min(1100px, calc(100% - 40px));
  margin-left: auto;
  margin-right: auto;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
  padding-top: 56px;
}

.left {
  max-width: 620px;
}

h1 {
  font-size: 32px;
  line-height: 1.2;
  margin: 0 0 18px 0;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1.6;
  margin: 0 0 12px 0;
}

.convy-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 360px;
}

.hero img {
  max-width: 100%;
  height: auto;
}

.bubble {
  margin-top: 16px;
  font-size: 20px;
  font-style: italic;
}

.cta-main {
  display: inline-block;
  margin-top: 24px;
  padding: 14px 28px;
  border-radius: 10px;
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: bold;
  text-decoration: none;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  align-items: stretch;
  margin-top: 80px;
}

.card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.card h3 {
  min-height: 56px;
  margin: 0 0 8px 0;
}

.card img {
  width: 280px;
  height: 280px;
  max-width: 100%;
  object-fit: contain;
  margin: 20px auto;
}

.card p {
  color: var(--text-secondary);
  margin-top: auto;
  margin-bottom: 0;
}

.text-block {
  margin-top: 120px;
  max-width: 700px;
}

.text-block h2 {
  margin-top: 0;
}

.text-block p {
  margin-bottom: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.explain {
  margin-top: 120px;
  display: grid;
  gap: 80px;
  padding-bottom: 80px;
}

.explain-col {
  text-align: center;
}

.explain-col h2 {
  margin-bottom: 10px;
}

.explain-col p {
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.7;
}

.explain-col img {
  width: 260px;
  max-width: 100%;
  margin: 20px auto 0;
}

.subpage-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 60px 20px 100px;
}

.subpage-hero {
  margin-bottom: 40px;
}

.eyebrow {
  color: var(--text-secondary);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
  opacity: 0.85;
}

.subpage-wrap h1 {
  margin: 0 0 20px 0;
  font-size: 38px;
  line-height: 1.15;
}

.lead {
  font-size: 20px;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 38px;
}

.subpage-wrap h2 {
  margin: 46px 0 14px;
  font-size: 28px;
  line-height: 1.2;
}

.subpage-wrap p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0 0 16px 0;
}

.quote {
  margin: 18px 0;
  padding-left: 18px;
  border-left: 3px solid rgba(229,231,235,0.35);
  color: var(--text-primary);
  font-style: italic;
}

.subpage-wrap ul,
.subpage-wrap ol {
  color: var(--text-secondary);
  line-height: 1.8;
  padding-left: 22px;
  margin: 12px 0 18px;
}

.subpage-wrap li {
  margin-bottom: 10px;
}

.closing {
  margin-top: 22px;
  font-size: 18px;
  color: var(--text-primary);
}

.subpage-actions {
  margin-top: 34px;
}

.subpage-actions a {
  display: inline-block;
  text-decoration: none;
}

@media (max-width: 768px) {
  .header-inner {
    min-height: 64px;
    grid-template-columns: auto auto;
  }

  .logo {
    min-width: 0;
  }

  .header-actions {
    gap: 8px;
  }

  .burger {
    display: inline-flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 20px;
    width: min(220px, calc(100vw - 40px));
    padding: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .nav a {
    padding: 8px 10px;
    border-radius: 8px;
  }

  .nav.active {
    display: flex;
  }

  .hero {
    flex-direction: column;
    text-align: center;
    gap: 36px;
    padding-top: 36px;
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 56px;
  }

  .subtitle {
    font-size: 16px;
  }

  .text-block,
  .explain {
    margin-top: 72px;
  }

  .subpage-wrap {
    padding-top: 36px;
  }

  .subpage-wrap h1 {
    font-size: 30px;
  }

  .lead {
    font-size: 18px;
  }

  .subpage-wrap h2 {
    font-size: 24px;
  }
}

.logo { text-decoration: none; color: inherit; }


/* markdown-content styles */
.markdown-content h1 {
  margin: 0 0 18px;
}

.markdown-content h2 {
  margin: 34px 0 14px;
}

.markdown-content p {
  font-size: 18px;
  line-height: 1.6;
  margin: 0 0 12px 0;
}

.markdown-content ul {
  margin: 0 0 18px 22px;
  padding: 0;
}

.markdown-content li {
  margin: 0 0 12px;
}

.markdown-content hr {
  border: 0;
  border-top: 1px solid rgba(229, 231, 235, 0.22);
  margin: 28px 0;
}

.markdown-content strong {
  color: var(--text-primary);
}

.markdown-content img { max-width:100%; height:auto; }

.after-cards-space { margin-top: 80px; }

.homepage-title { font-size: 28px; }

.instrument-line { font-size: 22px; display:block; }

.research-link { font-size: 18px; text-decoration: underline; }






.modal input.input-field{
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.modal-actions{
  margin-top:20px;
  display:flex;
  gap:10px;
}

.secondary-button{
  padding:10px 16px;
  border-radius:8px;
  border:none;
  background:#ccc;
  cursor:pointer;
}

.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.5);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:999;
}

.modal{
  background:var(--card-bg);
  color:var(--text-primary);
  padding:32px;
  border-radius:16px;
  max-width:600px;
  width:90%;
  box-shadow:0 10px 30px rgba(0,0,0,0.2);
}

.modal h2{
  margin-bottom:16px;
}

.modal p{
  margin-bottom:12px;
  font-size:16px;
  line-height:1.6;
}

.modal input{
  width:100%;
  padding:10px;
  border-radius:8px;
  border:1px solid var(--border-color, #ccc);
  background:transparent;
  color:inherit;
}

.modal-actions{
  margin-top:20px;
  display:flex;
  gap:12px;
}

.modal .cta-button{
  /* reuse existing style */
}

.modal .secondary-button{
  padding:10px 16px;
  border-radius:10px;
  background:transparent;
  border:1px solid var(--text-primary);
  color:var(--text-primary);
  cursor:pointer;
}

.modal.markdown-content p{
  font-size:18px;
  line-height:1.6;
  margin:0 0 12px 0;
}

.icon {
  font-size: 18px;
  margin-right: 8px;
  vertical-align: middle;
}
