@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

* {
  box-sizing: border-box;
}

:root {
  --ink: #030712;
  --panel: #0b1120;
  --panel-soft: #111b30;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f3f4f6;
  --muted: #9ca3af;
  --dim: #6b7280;
  --yellow: #fee500;
  --yellow-strong: #e6cb00;
  --yellow-glow: rgba(254, 229, 0, 0.15);
  --white: #ffffff;
  
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  --card-hover-bg: rgba(254, 229, 0, 0.06);
  --shadow: rgba(0, 0, 0, 0.6);
  --grid-color: rgba(254, 229, 0, 0.03);
  --aura-color: rgba(254, 229, 0, 0.12);
  --code-bg: rgba(10, 15, 30, 0.65);
  --code-header-bg: rgba(0, 0, 0, 0.4);
  --code-text: #e5e7eb;
  --visual-shadow: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] {
  --ink: #FAF6EE; /* Light warm beige background */
  --panel: #ffffff;
  --panel-soft: #f3edd9;
  --line: rgba(0, 0, 0, 0.08);
  --text: #1f2937;
  --muted: #4b5563;
  --dim: #9ca3af;
  --yellow: #fee500;
  --yellow-strong: #d9bf00;
  --yellow-glow: rgba(254, 229, 0, 0.35);
  --white: #111827; /* Inverse text color */
  
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.7));
  --card-hover-bg: rgba(254, 229, 0, 0.08);
  --shadow: rgba(120, 80, 0, 0.05);
  --grid-color: rgba(120, 80, 0, 0.05);
  --aura-color: rgba(254, 229, 0, 0.28);
  --code-bg: rgba(255, 255, 255, 0.85);
  --code-header-bg: rgba(243, 237, 217, 0.75);
  --code-text: #1f2937;
  --visual-shadow: rgba(120, 80, 0, 0.12);
}

html {
  min-height: 100%;
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background-color: var(--ink);
  background-image: 
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px),
    radial-gradient(ellipse 70% 50% at 50% -10%, var(--aura-color), transparent 70%);
  background-size: 64px 64px, 64px 64px, 100% 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header,
.site-footer,
.hero,
.section,
.policy-main {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
}

/* Header */
.site-header {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
}

.brand-link img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.brand-kicker {
  display: block;
  color: var(--yellow);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 1.2;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.button-link {
  min-height: 42px;
  padding: 8px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
}

.button-link:hover {
  border-color: rgba(254, 229, 0, 0.4);
  background: rgba(254, 229, 0, 0.05);
  transform: translateY(-1px);
}

.button-link.primary {
  color: #0b1015;
  background: linear-gradient(135deg, #fff380 0%, var(--yellow) 60%, var(--yellow-strong) 100%);
  border: 1px solid rgba(254, 229, 0, 0.5);
  box-shadow: 0 4px 14px rgba(254, 229, 0, 0.25);
  font-weight: 700;
}

.button-link.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(254, 229, 0, 0.4);
  background: linear-gradient(135deg, #fff380 0%, var(--yellow) 50%, var(--yellow-strong) 100%);
}

/* Hero Section */
.hero {
  min-height: calc(85vh - 90px);
  padding: 60px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(400px, 0.9fr);
  align-items: center;
  gap: 60px;
}

.hero-copy {
  max-width: 650px;
}

.hero-immersive {
  width: 100%;
  min-height: calc(88vh - 90px);
  margin: 0;
  padding: 52px max(24px, calc((100vw - 1200px) / 2)) 40px;
  grid-template-columns: minmax(0, 760px);
  justify-content: start;
  background-image:
    linear-gradient(90deg, rgba(3, 7, 18, 0.94) 0%, rgba(3, 7, 18, 0.78) 46%, rgba(3, 7, 18, 0.3) 100%),
    linear-gradient(0deg, rgba(3, 7, 18, 0.76), rgba(3, 7, 18, 0.08) 50%, rgba(3, 7, 18, 0.72)),
    url('/static/firefly-landing.jpg?v=20260615');
  background-position: center;
  background-size: cover;
  border-bottom: 1px solid var(--line);
}

.hero-immersive .hero-copy {
  max-width: 760px;
}

.hero-immersive .hero h1,
.hero-immersive h1 {
  max-width: 820px;
}

.hero-immersive .hero-lead {
  max-width: 760px;
  color: rgba(243, 244, 246, 0.84);
}

.hero-immersive .hero-proof li {
  background: rgba(7, 11, 20, 0.72);
  border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="light"] .hero-immersive {
  background-image:
    linear-gradient(90deg, rgba(17, 24, 39, 0.86) 0%, rgba(17, 24, 39, 0.58) 50%, rgba(17, 24, 39, 0.12) 100%),
    linear-gradient(0deg, rgba(17, 24, 39, 0.5), rgba(17, 24, 39, 0.02) 52%, rgba(17, 24, 39, 0.44)),
    url('/static/firefly-landing.jpg?v=20260615');
}

[data-theme="light"] .hero-immersive h1,
[data-theme="light"] .hero-immersive .hero-lead,
[data-theme="light"] .hero-immersive .hero-proof strong,
[data-theme="light"] .hero-immersive .hero-proof span {
  color: #ffffff;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--yellow);
  font-size: 14px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(254, 229, 0, 0.2);
}

[data-theme="light"] .eyebrow {
  color: var(--yellow-strong);
}

.hero h1 {
  margin: 0;
  color: var(--white);
  font-size: 60px;
  font-family: 'Outfit', sans-serif;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 0;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--white) 40%, var(--yellow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .hero h1 span {
  background: linear-gradient(135deg, var(--white) 30%, var(--yellow-strong) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.hero-actions {
  margin-top: 36px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-proof {
  margin: 48px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  list-style: none;
}

.hero-proof li {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  backdrop-filter: blur(8px);
  transition: border-color 0.3s ease;
}

.hero-proof li:hover {
  border-color: rgba(254, 229, 0, 0.2);
}

.hero-proof strong {
  display: block;
  color: var(--white);
  font-size: 16px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
}

.hero-proof span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.hero-visual {
  min-width: 0;
  position: relative;
}

.hero-visual::after {
  content: '';
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(254, 229, 0, 0.1) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.hero-visual img {
  width: 100%;
  display: block;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 30px 70px var(--visual-shadow);
  transition: transform 0.5s ease;
}

[data-theme="light"] .hero-visual img {
  border-color: rgba(0, 0, 0, 0.05);
}

.hero-visual img:hover {
  transform: scale(1.01) translateY(-2px);
}

/* Sections */
.section {
  padding: 80px 0;
  border-top: 1px solid var(--line);
}

.section h2 {
  margin: 0;
  color: var(--white);
  font-size: 36px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
}

.section h2 span {
  color: var(--yellow-strong);
}

.section-lead {
  max-width: 700px;
  margin: 16px auto 0;
  color: var(--muted);
  text-align: center;
  font-size: 16px;
  line-height: 1.7;
}

/* Feature Grid & Cards */
.feature-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.feature-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 36px;
  backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(400px circle at var(--x, 0px) var(--y, 0px), rgba(254, 229, 0, 0.06), transparent 50%);
  z-index: 1;
  pointer-events: none;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(254, 229, 0, 0.3);
  box-shadow: 0 12px 30px var(--shadow);
}

.feature-card h3 {
  margin: 0 0 14px;
  font-size: 20px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 12px;
}

.feature-card h3 span {
  color: var(--yellow-strong);
  font-size: 24px;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  position: relative;
  z-index: 2;
}

/* Code Playground */
.code-playground {
  margin-top: 48px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  overflow: hidden;
  box-shadow: 0 30px 60px var(--shadow);
}

.code-header {
  display: flex;
  background: var(--code-header-bg);
  border-bottom: 1px solid var(--line);
  padding: 0 20px;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
}

.code-tabs {
  display: flex;
  gap: 6px;
}

.code-tab {
  background: transparent;
  border: none;
  color: var(--dim);
  padding: 14px 18px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
}

.code-tab.active {
  color: var(--white);
  border-bottom-color: var(--yellow-strong);
}

.code-tab:hover:not(.active) {
  color: var(--white);
}

.code-window-controls {
  display: flex;
  gap: 8px;
}

.code-window-controls span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.15);
}

.code-window-controls span:nth-child(1) { background: #ef4444; }
.code-window-controls span:nth-child(2) { background: #f59e0b; }
.code-window-controls span:nth-child(3) { background: #10b981; }

.code-bodies {
  position: relative;
}

.code-body {
  display: none;
  padding: 24px 32px;
  margin: 0;
  overflow-x: auto;
}

.code-body.active {
  display: block;
}

.code-body pre {
  margin: 0;
}

.code-body code {
  font-family: 'Consolas', 'Fira Code', 'Courier New', Courier, monospace;
  font-size: 14px;
  color: var(--code-text);
  line-height: 1.6;
}

.code-body .keyword { color: #f472b6; }
.code-body .string { color: #34d399; }
.code-body .number { color: #fbbf24; }
.code-body .comment { color: #6b7280; }
.code-body .function { color: #60a5fa; }
.code-body .parameter { color: #fb923c; }

/* Code styles overrides for light theme */
[data-theme="light"] .code-body .keyword { color: #a21caf; }
[data-theme="light"] .code-body .string { color: #15803d; }
[data-theme="light"] .code-body .number { color: #b45309; }
[data-theme="light"] .code-body .comment { color: #6b7280; }
[data-theme="light"] .code-body .function { color: #1d4ed8; }
[data-theme="light"] .code-body .parameter { color: #c2410c; }

/* Workflow Steps */
.workflow-steps {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.workflow-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.3s ease;
}

.workflow-card:hover {
  border-color: rgba(254, 229, 0, 0.2);
}

.step-num {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: rgba(254, 229, 0, 0.2);
  line-height: 1;
  margin-bottom: 12px;
}

[data-theme="light"] .step-num {
  color: rgba(217, 191, 0, 0.35);
}

.workflow-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--white);
}

.workflow-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.quality-list {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.quality-list div {
  padding: 22px;
  min-height: 150px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.quality-list strong {
  display: block;
  color: var(--white);
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
}

.quality-list span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  align-items: center;
  gap: 36px;
}

.split-section h2 {
  text-align: left;
}

.section-lead.aligned {
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}

.notice-strip {
  padding: 28px;
  background: rgba(254, 229, 0, 0.07);
  border: 1px solid rgba(254, 229, 0, 0.18);
  border-radius: 12px;
}

[data-theme="light"] .notice-strip {
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(217, 191, 0, 0.28);
}

.notice-strip strong {
  display: block;
  color: var(--white);
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 800;
}

.notice-strip p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.use-case-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

/* Policy Pages Layout (Ensure backwards compatibility & beauty) */
.policy-main {
  padding: 40px 0 100px;
}

.policy-hero {
  padding: 60px 0 40px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.policy-hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(32px, 5vw, 54px);
  margin: 0;
  font-weight: 800;
  color: var(--white);
}

.policy-lead {
  margin: 20px auto 0;
  max-width: 800px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.policy-meta {
  margin: 20px 0 0;
  color: var(--dim);
  font-size: 14px;
}

.policy-section {
  margin-top: 24px;
  padding: 36px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(8px);
}

.policy-section h2 {
  margin: 0 0 20px;
  color: var(--white);
  font-size: 24px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  border-left: 3px solid var(--yellow-strong);
  padding-left: 14px;
  line-height: 1.2;
}

.policy-section h3 {
  margin: 28px 0 12px;
  color: var(--yellow-strong);
  font-size: 16px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
}

.policy-section p,
.policy-section li,
.notice-box p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.policy-section p {
  margin: 12px 0 0;
}

.policy-section ul {
  margin: 12px 0 0;
  padding-left: 24px;
}

.policy-section li {
  margin-top: 6px;
}

.notice-box {
  margin-top: 24px;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(254, 229, 0, 0.2);
  background: rgba(254, 229, 0, 0.04);
  backdrop-filter: blur(8px);
}

[data-theme="light"] .notice-box {
  border-color: rgba(217, 191, 0, 0.3);
  background: rgba(254, 229, 0, 0.08);
}

.notice-box p {
  margin: 0;
  color: var(--text);
}

/* Footer */
.site-footer {
  margin-top: auto;
  min-height: 100px;
  padding: 40px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--dim);
  font-size: 14px;
  border-top: 1px solid var(--line);
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

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

/* Theme Toggle Button Specific Styling */
#themeToggle {
  cursor: pointer;
  user-select: none;
}

/* Responsiveness */
@media (max-width: 1024px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero-copy {
    margin: 0 auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    order: -1;
    max-width: 600px;
    margin: 0 auto;
  }

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

  .workflow-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-immersive {
    min-height: auto;
    padding: 64px 24px;
    text-align: center;
    justify-content: center;
    background-image:
      linear-gradient(0deg, rgba(3, 7, 18, 0.88), rgba(3, 7, 18, 0.62)),
      url('/static/firefly-landing.jpg?v=20260615');
  }

  .hero-immersive .hero-copy {
    margin: 0 auto;
  }

  .quality-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-section {
    grid-template-columns: 1fr;
  }

  .split-section h2,
  .section-lead.aligned {
    text-align: center;
  }

  .section-lead.aligned {
    margin-left: auto;
    margin-right: auto;
  }

  .use-case-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    padding: 20px 0;
    min-height: auto;
    align-items: center;
    gap: 14px;
  }

  .site-footer {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 16px;
    padding: 30px 0;
  }

  .workflow-steps {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 34px;
    line-height: 1.16;
  }

  .hero-immersive {
    padding: 34px 24px 28px;
  }

  .hero-lead {
    margin-top: 18px;
    font-size: 15px;
    line-height: 1.55;
  }

  .hero-actions {
    margin-top: 22px;
  }

  .hero-proof {
    margin-top: 22px;
    gap: 8px;
  }

  .hero-proof li {
    padding: 10px 12px;
  }

  .hero-proof strong {
    font-size: 14px;
  }

  .hero-proof span {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.35;
  }

  .quality-list,
  .use-case-grid {
    grid-template-columns: 1fr;
  }

  .section h2 {
    font-size: 30px;
  }
}
