/*
  SimWorld homepage theme.
  Loaded after ue.css. Flat colors, one accent, Inter, consistent spacing.
  Sizes are scoped to desktop (min-width: 1001px) because ue.css carries
  separate enlarged mobile sizes for the 980px mobile layout.
  The html body prefix lets these rules win over the page's inline <style> blocks.
*/

:root {
  --sw-ink: #0f172a;
  --sw-text: #334155;
  --sw-muted: #64748b;
  --sw-line: #e2e8f0;
  --sw-surface: #f8fafc;
  --sw-white: #ffffff;
  --sw-accent: #334155;
  --sw-accent-soft: #f1f5f9;
  --sw-radius: 10px;
  --sw-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Re-point ue.css tokens so existing rules pick up the flat palette */
  --primary-color: var(--sw-accent);
  --primary-dark: #0f172a;
  --text-primary: var(--sw-ink);
  --text-secondary: var(--sw-text);
  --text-muted: var(--sw-muted);
  --border-color: var(--sw-line);
  --heading-color: var(--sw-ink);
  --bg-gradient-1: var(--sw-surface);
  --bg-gradient-2: var(--sw-surface);
  --bg-gradient-3: var(--sw-ink);
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
}

body,
.navbar,
.nav-link,
button,
input {
  font-family: var(--sw-font);
}

body {
  color: var(--sw-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  color: var(--sw-ink);
  text-shadow: none !important;
}

/* ---------- Navigation ---------- */
.hero-nav,
.hero-nav.scrolled {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
  border-bottom: 1px solid var(--sw-line);
}
.nav-link { color: var(--sw-ink); }
.nav-link:hover { color: var(--sw-muted); text-decoration: none; }
.navbar .logo-text { letter-spacing: -0.01em; }

/* ---------- Section backgrounds: flat, alternating ---------- */
html body .featured-section,
html body .intro-section,
html body .actions-section#open-ended-sim,
html body .actions-section#reasoning-scenarios,
html body .demos-section,
html body .team-section {
  background: var(--sw-surface) !important;
}
html body .spotlight-section,
html body .why-section,
html body .actions-section#rich-agent-interface,
html body .projects-section,
html body .research-section {
  background: var(--sw-white) !important;
}
html body .content-section {
  border-top: 1px solid var(--sw-line);
}
html body .demos-section { margin-top: 0; }

/* ---------- Hero ---------- */
.hero-title-area .hero-title-bg {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  background: rgba(255, 255, 255, 0.84);
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  z-index: -1;
}
.hero-title h1 {
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--sw-ink);
}
.hero-title h2 {
  color: var(--sw-text);
  letter-spacing: -0.01em;
}
.hero-feature-titles h3 {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--sw-ink);
  font-weight: 600;
}
.hero-feature-titles h3 i { color: var(--sw-accent); font-size: 0.85em; }

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

/* ---------- Buttons ---------- */
.sw-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding: 0 1rem;
  border-radius: 8px;
  font-family: var(--sw-font);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.sw-btn i { font-size: 0.95em; }
.sw-btn-dark {
  background: var(--sw-ink);
  border: 1px solid var(--sw-ink);
  color: #fff !important;
}
.sw-btn-dark:hover { background: #1e293b; }
.sw-btn-light {
  background: var(--sw-white);
  border: 1px solid #cbd5e1;
  color: var(--sw-ink) !important;
}
.sw-btn-light:hover { border-color: var(--sw-ink); }

/* Small uppercase label above a block */
.sw-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--sw-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.sw-eyebrow i { font-size: 0.9em; }

/* ---------- Impact band ---------- */
html body .impact-band {
  background: var(--sw-white);
  border-bottom: 1px solid var(--sw-line);
  padding: 2.5rem 20px 2rem;
}
.impact-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 960px;
  margin: 0 auto;
}
.impact-item {
  text-align: center;
  padding: 0 1rem;
  border-left: 1px solid var(--sw-line);
}
.impact-item:first-child { border-left: 0; }
.impact-num {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--sw-ink);
  font-variant-numeric: tabular-nums;
}
.impact-label {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--sw-muted);
}
.impact-venues {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 1100px;
  margin: 1.75rem auto 0;
}
.impact-venues span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--sw-line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--sw-text);
  background: var(--sw-surface);
}
.impact-venues span i { color: var(--sw-ink); }

/* ---------- Featured: SimWorld Studio ---------- */
html body .featured {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 3rem;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  text-align: left;
}
html body .featured-media {
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--sw-radius);
  overflow: hidden;
  border: 1px solid var(--sw-line);
}
html body .featured-media iframe { width: 100%; height: 100%; border: 0; display: block; }
html body .featured .featured-title {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  text-align: left;
  margin: 0 0 0.5rem;
}
html body .featured .featured-tagline {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--sw-ink);
  line-height: 1.5;
  margin: 0 0 1rem;
}
html body .featured .featured-desc {
  color: var(--sw-text);
  font-size: 1rem;
  line-height: 1.7;
  margin: 0 0 1.25rem;
}
html body .featured-loop { list-style: none; padding: 0; margin: 0 0 1.5rem; }
html body .featured-loop li {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  color: var(--sw-text);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}
html body .featured-loop li i {
  flex: none;
  width: 1.1rem;
  text-align: center;
  color: var(--sw-accent);
}
html body .featured-loop strong { color: var(--sw-ink); font-weight: 600; }
html body .featured-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--sw-line);
  border-bottom: 1px solid var(--sw-line);
  margin-bottom: 1.5rem;
}
html body .featured-stats div {
  padding: 0.9rem 0.75rem;
  border-left: 1px solid var(--sw-line);
}
html body .featured-stats div:first-child { border-left: 0; padding-left: 0; }
html body .featured-stats b {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--sw-ink);
  font-variant-numeric: tabular-nums;
}
html body .featured-stats small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--sw-muted);
}
html body .featured-links { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
html body .featured-venue {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sw-muted);
  margin-left: 0.4rem;
}

/* ---------- Recent work ---------- */
html body .spotlight { text-align: center; width: 100%; }
html body .spotlight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}
html body .spotlight-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  background: var(--sw-white);
  border: 1px solid var(--sw-line);
  border-radius: var(--sw-radius);
  padding: 1rem 1rem 1.25rem;
}
html body .spotlight-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1rem;
}
html body .spotlight-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
html body .spotlight .spotlight-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-align: left;
  margin: 0 0 0.4rem;
  padding: 0;
  border: 0;
}
html body .spotlight .spotlight-item > p {
  color: var(--sw-text);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 1.1rem;
  flex: 1;
}
html body .spotlight-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
html body .spotlight-links { gap: 0.4rem; }
html body .spotlight-links .sw-btn { height: 2.25rem; padding: 0 0.7rem; gap: 0.4rem; font-size: 0.85rem; }

/* ---------- Generic cards ---------- */
html body .feature-card,
html body .project-card,
html body .demo-card,
html body .research-item {
  background: var(--sw-white);
  border: 1px solid var(--sw-line);
  border-radius: var(--sw-radius);
  box-shadow: none;
  transform: none;
  transition: border-color .15s ease;
}
html body .feature-card:hover,
html body .project-card:hover,
html body .demo-card:hover,
html body .research-item:hover {
  transform: none;
  box-shadow: none;
  border-color: #94a3b8;
}

/* Key features */
html body .feature-card h3 {
  display: block;
  text-align: center;
  color: var(--sw-ink);
  font-weight: 600;
}
html body .feature-card h3 i { color: var(--sw-accent); font-size: 0.9em; margin-right: 0.5rem; }
html body .feature-subitem img { box-shadow: none; border: 1px solid var(--sw-line); border-radius: 6px; }

/* Comparison table */
html body .table-wrapper {
  box-shadow: none;
  border: 1px solid var(--sw-line);
  border-radius: var(--sw-radius);
}
html body .comparison-table thead { background: var(--sw-surface); color: var(--sw-ink); }
html body .comparison-table thead .group-head:not(.group-sim)::after { background: var(--sw-line); }
html body .comparison-table tbody tr:nth-child(even) { background: var(--sw-white); }
html body .comparison-table tbody tr:hover { background: var(--sw-surface); }
html body .comparison-table .highlight-row,
html body .comparison-table .highlight-row:hover {
  background: var(--sw-accent-soft) !important;
}
html body .comparison-table .check { color: var(--sw-accent); }
html body .comparison-table .rating { color: var(--sw-ink); }

/* Media */
html body .overview-image,
html body .media-container,
html body .video-card,
html body .hero-video-container {
  box-shadow: none;
}

/* Projects */
html body .project-title { color: var(--sw-ink); font-weight: 700; letter-spacing: -0.015em; }
html body .project-desc { color: var(--sw-text); }

/* Links used as small buttons (projects + papers) */
html body .research-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.5rem 0.4rem 0 0;
  padding: 0.4rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: var(--sw-ink);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  transition: border-color .15s ease;
}
html body .research-link:hover { border-color: var(--sw-ink); color: var(--sw-ink); text-decoration: none; }
html body .research-link i { font-size: 0.95em; }
html body .project-links .research-link { margin: 0; }

/* Papers */
html body .research-thumbnail { background: var(--sw-surface); }
html body .research-content h3 { color: var(--sw-ink); line-height: 1.45; }
html body .research-authors,
html body .research-venue { color: var(--sw-muted); }
html body .research-authors strong,
html body .research-venue strong { color: var(--sw-ink); }
html body .research-item-whitepaper { background: var(--sw-white); border-color: var(--sw-ink); }
html body .research-item-whitepaper::before { display: none; }
html body .research-item-whitepaper .research-tag {
  background: var(--sw-ink);
  border: 0;
  color: #fff;
  border-radius: 4px;
  letter-spacing: 0.08em;
}
.venue-award {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.25rem;
  color: var(--sw-ink);
  font-weight: 600;
}

/* Demos */
html body .demo-title { color: var(--sw-ink); }
html body .demo-meta { color: var(--sw-muted); }

/* Footer */
.copyright-section { background: var(--sw-white); }

/* ---------- Desktop typography and spacing ---------- */
@media (min-width: 1001px) {
  html body .content-section { padding: 4.5rem 0; }

  html body h2 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin-bottom: 1.25rem;
  }
  html body h3 { letter-spacing: -0.015em; line-height: 1.35; }

  html body .intro-text {
    max-width: 760px;
    font-size: 1.075rem;
    line-height: 1.75;
    color: var(--sw-text);
  }

  .hero-title h2 { font-size: clamp(1.4rem, 2.3vw, 2rem); line-height: 1.45; max-width: 1000px; margin-left: auto; margin-right: auto; }
  .hero-feature-titles { gap: 2.5rem; }
  .hero-feature-titles h3 { font-size: 1.15rem; }

  html body .feature-card { padding: 1.5rem; }
  html body .feature-card h3 { font-size: 1.1rem; margin-bottom: 0.75rem; }
  html body .feature-card p.feature-text {
    font-size: 0.98rem;
    line-height: 1.65;
    min-height: 0;
    color: var(--sw-text);
  }

  html body .project-card { padding: 1.5rem; }
  html body .project-title { font-size: 1.4rem; margin-bottom: 0.6rem; }
  html body .project-desc { font-size: 0.97rem; line-height: 1.65; }
  html body .research-link { font-size: 0.85rem !important; }

  html body .demo-title { font-size: 0.98rem; line-height: 1.45; font-weight: 600; }
  html body .demo-meta { font-size: 0.85rem; line-height: 1.5; }
}

/* ---------- Narrow layouts ---------- */
@media (max-width: 1000px) {
  .impact-num { font-size: 3rem; }
  .impact-label { font-size: 1.15rem; }
  .impact-venues span { font-size: 1.05rem; }
  .sw-btn { height: 3rem; font-size: 1.1rem; }

  html body .featured { grid-template-columns: 1fr; gap: 1.75rem; }
  html body .featured .featured-title { font-size: 2.6rem; }
  html body .featured .featured-tagline { font-size: 1.35rem; }
  html body .featured .featured-desc,
  html body .featured-loop li { font-size: 1.15rem; }
  html body .featured-stats small { font-size: 0.95rem; }

  html body .spotlight-grid { grid-template-columns: 1fr; max-width: 640px; }
  html body .spotlight .spotlight-title { font-size: 1.8rem; }
  html body .spotlight .spotlight-item > p { font-size: 1.15rem; }
}

/* ---------- Desktop: override ue.css blanket !important sizes ----------
   ue.css forces every h2/h3/p/a/li to one size on desktop, which flattens the
   hierarchy. Each component gets its own size here. */
@media (min-width: 1001px) {
  html body .hero-title h2 { font-size: 1.85rem !important; line-height: 1.45 !important; }
  html body .hero-feature-titles h3 { font-size: 1.1rem !important; }
  html body .hero-actions .sw-btn,
  html body .sw-btn { font-size: 0.9rem !important; line-height: 1 !important; }
  html body .spotlight-links .sw-btn { font-size: 0.82rem !important; }

  html body .featured .featured-title { font-size: 2.5rem !important; line-height: 1.1 !important; }
  html body .featured .featured-tagline { font-size: 1.15rem !important; line-height: 1.5 !important; }
  html body .featured .featured-desc { font-size: 1rem !important; line-height: 1.7 !important; }
  html body .featured-loop li { font-size: 0.95rem !important; line-height: 1.6 !important; }

  html body .spotlight .spotlight-title { font-size: 1.35rem !important; line-height: 1.3 !important; }
  html body .spotlight .spotlight-item > p { font-size: 0.95rem !important; line-height: 1.6 !important; }

  html body .intro-text { font-size: 1.075rem !important; line-height: 1.75 !important; }
  html body .feature-card h3 { font-size: 1.1rem !important; }
  html body .feature-card p.feature-text { font-size: 0.98rem !important; line-height: 1.65 !important; }

  html body .project-title { font-size: 1.4rem !important; line-height: 1.3 !important; }
  html body .project-desc { font-size: 0.97rem !important; line-height: 1.65 !important; }
  html body .research-link { font-size: 0.85rem !important; }

  html body .video-caption,
  html body .gif-caption,
  html body .img-caption { font-size: 0.92rem !important; line-height: 1.5 !important; }
}

/* Papers: left-aligned cards, buttons at natural width */
html body #papers .research-content { align-items: flex-start; text-align: left; }
html body #papers .research-content h3 { text-align: left; }
html body #papers .research-tag { align-self: flex-start; }
html body #papers .research-content > .research-link,
html body #papers .research-content > span { align-self: flex-start; }
