:root {
  color-scheme: light dark;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-alt: #f8f9fc;
  --text: #1c1f26;
  --muted: #5b6472;
  --border: #e3e6ee;
  --primary: #4f46e5;
  --primary-dark: #3f37c9;
  --primary-soft: #eef0ff;
  --accent: #0ea5e9;
  --header-bg: rgba(255, 255, 255, 0.85);
  --hero-gradient: linear-gradient(135deg, #4f46e5 0%, #6d28d9 55%, #0ea5e9 100%);
  --btn-solid-bg: #4f46e5;
  --btn-solid-bg-hover: #4338ca;
  --code-bg: #1c1f26;
  --code-text: #e6e8ef;
  --note-bg: #fff8e1;
  --note-border: #ffe6a8;
  --badge-soon-bg: #fff4e5;
  --badge-soon-text: #b45309;
  --placeholder-a: #fbfbfe;
  --placeholder-b: #f3f4fa;
  --placeholder-border: #c7ccd8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, 0.12);
  --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1016;
    --surface: #171a22;
    --surface-alt: #1e222c;
    --text: #e7e9ef;
    --muted: #9aa3b2;
    --border: #272c38;
    --primary: #8b93f8;
    --primary-dark: #b4b9fb;
    --primary-soft: #1d2130;
    --accent: #38bdf8;
    --header-bg: rgba(14, 16, 22, 0.85);
    --hero-gradient: linear-gradient(135deg, #312e81 0%, #4c1d95 55%, #075985 100%);
    --btn-solid-bg: #4f46e5;
    --btn-solid-bg-hover: #6366f1;
    --code-bg: #0b0d12;
    --code-text: #e6e8ef;
    --note-bg: #2a2410;
    --note-border: #4a3f1a;
    --badge-soon-bg: #2a2010;
    --badge-soon-text: #fbbf24;
    --placeholder-a: #171a22;
    --placeholder-b: #1d212b;
    --placeholder-border: #333a48;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--muted);
  font-weight: 500;
}

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

/* Hero */
.hero {
  background: var(--hero-gradient);
  color: #fff;
  padding: 5rem 0 4.5rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.15;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  max-width: 640px;
  margin: 0 auto 2rem;
  color: rgba(255, 255, 255, 0.9);
}

.hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  margin: 0 auto 1rem;
  display: block;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.hero .eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.14);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: #fff;
  color: #3f37c9;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.btn-primary:hover {
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.22);
}

.btn-solid {
  background: var(--btn-solid-bg);
  color: #fff;
}

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

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

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

.btn[aria-disabled="true"],
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-tight {
  padding: 2.5rem 0;
}

.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 2.5rem;
}

.section-head h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  margin: 0 0 0.6rem;
  letter-spacing: -0.01em;
}

.section-head p {
  color: var(--muted);
  margin: 0;
}

/* App cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.app-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.app-card .card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.app-card .card-links a:not(.card-link) {
  position: relative;
  z-index: 2;
}

.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.app-card .app-icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  margin-bottom: 1rem;
}

.app-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
}

.app-card .tagline {
  color: var(--muted);
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.app-card .card-links {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.92rem;
  font-weight: 600;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.badge-soon {
  background: var(--badge-soon-bg);
  color: var(--badge-soon-text);
}

/* Feature rows */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 3.5rem;
}

.feature:last-child {
  margin-bottom: 0;
}

.feature.reverse .feature-media {
  order: 2;
}

.feature-media img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  width: 80%;
  display: block;
  margin: 0 auto;
}

.feature-media .placeholder {
  border-radius: var(--radius);
  border: 1px dashed var(--placeholder-border);
  background: repeating-linear-gradient(
    45deg,
    var(--placeholder-a),
    var(--placeholder-a) 12px,
    var(--placeholder-b) 12px,
    var(--placeholder-b) 24px
  );
  color: var(--muted);
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 260px;
  padding: 1.5rem;
  font-size: 0.9rem;
}

.feature-body h3 {
  font-size: 1.4rem;
  margin: 0 0 0.6rem;
}

.feature-body p {
  color: var(--muted);
  margin: 0 0 1rem;
}

.feature-body ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.feature-body li {
  margin-bottom: 0.4rem;
}

/* Changelog */
.changelog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.changelog h3 {
  margin-top: 0;
}

.changelog ul {
  padding-left: 1.1rem;
  margin: 0;
}

.changelog li {
  margin-bottom: 0.75rem;
}

.changelog li strong {
  display: block;
}

.changelog li span {
  color: var(--muted);
}

/* Panel (list sections) */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  max-width: 820px;
  margin: 0 auto;
}

.panel ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.panel li {
  margin-bottom: 0.6rem;
}

.panel li:last-child {
  margin-bottom: 0;
}

.panel li strong {
  color: var(--text);
}

/* Docs */
.doc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.25rem;
}

.doc h2 {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.doc h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.doc h3 {
  margin-top: 1.75rem;
}

.doc h4 {
  margin-bottom: 0.4rem;
}

.doc .table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0;
  -webkit-overflow-scrolling: touch;
}

.doc .table-wrap table {
  margin: 0;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.94rem;
}

.doc th,
.doc td {
  border: 1px solid var(--border);
  padding: 0.65rem 0.8rem;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}

.doc th {
  background: var(--surface-alt);
  font-weight: 600;
}

.doc code {
  background: var(--surface-alt);
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    monospace;
  font-size: 0.88em;
}

.doc pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 1.1rem 1.25rem;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.5;
  border: 1px solid var(--border);
}

.doc pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.doc .note {
  background: var(--note-bg);
  border: 1px solid var(--note-border);
  padding: 1rem 1.15rem;
  border-radius: 10px;
  margin: 1.25rem 0;
}

/* Policy */
.policy {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem;
  max-width: 820px;
  margin: 0 auto;
}

.policy h1 {
  margin-top: 0;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.policy h2 {
  margin-top: 2rem;
  font-size: 1.2rem;
}

.policy .effective {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: -0.5rem;
}

.policy ul {
  padding-left: 1.2rem;
}

.policy li {
  margin-bottom: 0.5rem;
}

.policy .callout {
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  padding: 1rem 1.15rem;
  border-radius: 0 10px 10px 0;
  margin: 1.25rem 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 2.5rem 0;
  margin-top: 3rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer a {
  color: var(--muted);
}

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

/* Utility */
.text-center {
  text-align: center;
}

.mt-2 {
  margin-top: 2rem;
}

.lead {
  font-size: 1.08rem;
  color: var(--muted);
}

@media (max-width: 760px) {
  .feature {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .feature.reverse .feature-media {
    order: 0;
  }

  .hero {
    padding: 3.5rem 0 3rem;
  }

  .doc,
  .policy,
  .changelog,
  .panel {
    padding: 1.5rem;
  }

  .site-nav {
    gap: 0.9rem;
    font-size: 0.88rem;
  }
}

@media (max-width: 600px) {
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    min-height: 0;
  }

  .brand {
    white-space: nowrap;
  }

  .site-nav {
    gap: 1rem;
    font-size: 0.9rem;
  }
}
