:root {
  --bg: #f3f6fb;
  --bg-strong: #e8eef8;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-strong: #ffffff;
  --surface-muted: #edf2fa;
  --text: #162034;
  --muted: #56657f;
  --line: rgba(22, 32, 52, 0.1);
  --line-strong: rgba(22, 32, 52, 0.16);
  --primary: #315fae;
  --primary-strong: #274d91;
  --accent: #2a9d8f;
  --accent-soft: rgba(42, 157, 143, 0.14);
  --shadow-lg: 0 28px 70px rgba(17, 26, 44, 0.08);
  --shadow-md: 0 18px 44px rgba(17, 26, 44, 0.06);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --container: 1180px;
}

html {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09111d;
  --bg-strong: #10192a;
  --surface: rgba(14, 22, 36, 0.82);
  --surface-strong: #101a2b;
  --surface-muted: #162235;
  --text: #ecf2ff;
  --muted: #9cadc8;
  --line: rgba(151, 170, 205, 0.14);
  --line-strong: rgba(151, 170, 205, 0.24);
  --primary: #79a9ff;
  --primary-strong: #5b8ff0;
  --accent: #58c9ba;
  --accent-soft: rgba(88, 201, 186, 0.16);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.36);
  --shadow-md: 0 18px 44px rgba(0, 0, 0, 0.26);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(49, 95, 174, 0.11), transparent 28%),
    radial-gradient(circle at top right, rgba(42, 157, 143, 0.1), transparent 20%),
    linear-gradient(180deg, #fbfdff 0%, var(--bg) 100%);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(121, 169, 255, 0.14), transparent 26%),
    radial-gradient(circle at top right, rgba(88, 201, 186, 0.1), transparent 20%),
    linear-gradient(180deg, #07101b 0%, var(--bg) 100%);
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(49, 95, 174, 0.24);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 18px;
  top: -56px;
  z-index: 100;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 18px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
  background: rgba(243, 246, 251, 0.88);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  border-color: var(--line);
  box-shadow: 0 12px 30px rgba(17, 26, 44, 0.05);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 84px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: var(--primary);
  background: linear-gradient(135deg, rgba(49, 95, 174, 0.16), rgba(255, 255, 255, 0.96));
  box-shadow: inset 0 0 0 1px rgba(49, 95, 174, 0.1);
}

html[data-theme="dark"] .brand-mark {
  background: linear-gradient(135deg, rgba(121, 169, 255, 0.18), rgba(16, 26, 43, 0.96));
  box-shadow: inset 0 0 0 1px rgba(121, 169, 255, 0.14);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
}

.brand-text {
  font-size: 1.03rem;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.98rem;
  transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: var(--text);
}

html[data-theme="dark"] .site-header {
  background: rgba(9, 17, 29, 0.84);
}

html[data-theme="dark"] .site-header.is-scrolled {
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] .menu-toggle {
  background: rgba(16, 26, 43, 0.86);
}

.theme-toggle {
  display: inline-grid;
  grid-template-columns: 46px 44px;
  align-items: center;
  gap: 10px;
  width: 118px;
  min-height: 46px;
  padding: 0 10px 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  box-shadow: var(--shadow-md);
}

.theme-toggle-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 46px;
  height: 28px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(49, 95, 174, 0.12);
  box-shadow: inset 0 0 0 1px rgba(49, 95, 174, 0.12);
}

.theme-toggle-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff3b0, #ffc66e);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.16);
  transform: translateX(0);
  transition: transform 0.2s ease, background 0.2s ease;
}

.theme-toggle-label {
  display: inline-block;
  min-width: 44px;
  font-size: 0.92rem;
  font-weight: 700;
  text-align: left;
}

html[data-theme="dark"] .theme-toggle {
  background: rgba(16, 26, 43, 0.9);
}

html[data-theme="dark"] .theme-toggle-track {
  background: rgba(121, 169, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(121, 169, 255, 0.16);
}

html[data-theme="dark"] .theme-toggle-thumb {
  background: linear-gradient(135deg, #dbe6ff, #8aacff);
  transform: translateX(18px);
}

.hero {
  padding: 72px 0 48px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 42px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.03em;
}

h1 {
  max-width: 13ch;
  font-size: clamp(2.8rem, 7vw, 4.8rem);
  line-height: 0.96;
}

h2 {
  max-width: 16ch;
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  line-height: 1.04;
}

h3 {
  font-size: 1.15rem;
  line-height: 1.2;
}

.hero-text,
.section-heading p,
.info-panel p,
.feature-card p,
.use-card p,
.doc-card p,
.faq-item p,
.footer-copy,
.hero-note {
  color: var(--muted);
  line-height: 1.75;
}

.hero-text {
  max-width: 62ch;
  margin: 22px 0 0;
  font-size: 1.06rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 16px 30px rgba(49, 95, 174, 0.24);
}

.button-secondary {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.7);
}

html[data-theme="dark"] .button-secondary {
  background: rgba(16, 26, 43, 0.82);
}

.hero-note {
  max-width: 62ch;
  margin: 26px 0 0;
  padding: 16px 18px;
  border: 1px solid rgba(42, 157, 143, 0.18);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(42, 157, 143, 0.08), rgba(255, 255, 255, 0.7));
}

html[data-theme="dark"] .hero-note {
  border-color: rgba(88, 201, 186, 0.24);
  background: linear-gradient(135deg, rgba(88, 201, 186, 0.12), rgba(16, 26, 43, 0.8));
}

.hero-visual {
  position: relative;
}

.diagram-shell {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 247, 252, 0.92)),
    linear-gradient(135deg, rgba(49, 95, 174, 0.12), rgba(42, 157, 143, 0.08));
  box-shadow: var(--shadow-lg);
}

html[data-theme="dark"] .diagram-shell {
  background:
    linear-gradient(180deg, rgba(16, 26, 43, 0.98), rgba(10, 18, 30, 0.94)),
    linear-gradient(135deg, rgba(121, 169, 255, 0.12), rgba(88, 201, 186, 0.08));
}

.diagram-shell::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: calc(var(--radius-xl) - 10px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

html[data-theme="dark"] .diagram-shell::after {
  border-color: rgba(121, 169, 255, 0.1);
}

.diagram-card {
  position: relative;
  min-height: 180px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-md);
}

html[data-theme="dark"] .diagram-card,
html[data-theme="dark"] .info-panel,
html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .use-card,
html[data-theme="dark"] .doc-card,
html[data-theme="dark"] .faq-item,
html[data-theme="dark"] .error-card {
  background: rgba(15, 24, 39, 0.84);
}

.diagram-card-large {
  grid-column: 1 / -1;
}

.diagram-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.diagram-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.diagram-chip {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(49, 95, 174, 0.1);
  color: var(--primary);
  font-size: 0.77rem;
  font-weight: 700;
}

html[data-theme="dark"] .diagram-chip,
html[data-theme="dark"] .icon-box {
  background: rgba(121, 169, 255, 0.16);
}

.tree-list {
  display: grid;
  gap: 12px;
}

.tree-list div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(22, 32, 52, 0.08);
}

html[data-theme="dark"] .tree-list div {
  border-bottom-color: rgba(151, 170, 205, 0.12);
}

.tree-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.tree-folder {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  color: var(--text);
  font-size: 0.94rem;
}

.tree-meta,
.stack-lines span,
.architecture-list span {
  color: var(--muted);
  font-size: 0.92rem;
}

.tag-group,
.architecture-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-group span,
.architecture-list span {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
}

html[data-theme="dark"] .tag-group span,
html[data-theme="dark"] .architecture-list span {
  background: rgba(19, 30, 48, 0.92);
}

.stack-lines {
  display: grid;
  gap: 11px;
}

.stack-lines span {
  position: relative;
  padding-left: 18px;
}

.stack-lines span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
}

.waveform-panel {
  overflow: hidden;
}

.wave-strip {
  position: relative;
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  align-items: center;
  gap: 6px;
  height: 72px;
}

.wave-strip + .wave-strip {
  margin-top: 14px;
}

.wave-strip::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(49, 95, 174, 0.14);
  transform: translateY(-50%);
}

html[data-theme="dark"] .wave-strip::before {
  background: rgba(121, 169, 255, 0.2);
}

.wave-strip span {
  position: relative;
  z-index: 1;
  width: 100%;
  height: calc(var(--level) * 1px);
  align-self: center;
  justify-self: center;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(49, 95, 174, 0.2), rgba(49, 95, 174, 0.78));
  transform-origin: center;
  animation: pulse-wave 4.6s ease-in-out infinite;
  animation-delay: calc(var(--level) * -0.04s);
}

html[data-theme="dark"] .wave-strip span {
  background: linear-gradient(180deg, rgba(121, 169, 255, 0.18), rgba(121, 169, 255, 0.9));
}

.wave-strip-b span {
  background: linear-gradient(180deg, rgba(42, 157, 143, 0.18), rgba(42, 157, 143, 0.76));
  animation-duration: 5.1s;
}

html[data-theme="dark"] .wave-strip-b span {
  background: linear-gradient(180deg, rgba(88, 201, 186, 0.16), rgba(88, 201, 186, 0.88));
}

@keyframes pulse-wave {
  0%,
  100% {
    transform: scaleY(0.92);
    opacity: 0.72;
  }

  50% {
    transform: scaleY(1.14);
    opacity: 1;
  }
}

.section {
  padding: 88px 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(232, 238, 248, 0.28), rgba(255, 255, 255, 0));
}

html[data-theme="dark"] .section-alt {
  background: linear-gradient(180deg, rgba(16, 25, 42, 0.6), rgba(9, 17, 29, 0));
}

.section-heading {
  max-width: 760px;
  margin-bottom: 32px;
}

.section-heading p {
  margin: 18px 0 0;
}

.overview-grid,
.infra-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card-grid,
.doc-grid {
  display: grid;
  gap: 18px;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.doc-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.info-panel,
.feature-card,
.use-card,
.doc-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-md);
}

.disclaimer-panel {
  background: linear-gradient(135deg, rgba(42, 157, 143, 0.1), rgba(255, 255, 255, 0.86));
}

html[data-theme="dark"] .disclaimer-panel {
  background: linear-gradient(135deg, rgba(88, 201, 186, 0.12), rgba(15, 24, 39, 0.9));
}

.bullet-list {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.75;
}

.icon-box {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: 16px;
  color: var(--primary);
  background: rgba(49, 95, 174, 0.1);
}

.icon-box svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-card p,
.use-card p,
.doc-card p,
.info-panel p {
  margin: 14px 0 0;
}

.architecture-panel {
  background:
    linear-gradient(135deg, rgba(49, 95, 174, 0.08), rgba(255, 255, 255, 0.9));
}

html[data-theme="dark"] .architecture-panel {
  background: linear-gradient(135deg, rgba(121, 169, 255, 0.1), rgba(15, 24, 39, 0.9));
}

.doc-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.doc-card a {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: auto;
  color: var(--primary);
  font-weight: 700;
}

.doc-card a:hover,
.doc-card a:focus-visible {
  color: var(--primary-strong);
}

.faq-list {
  display: grid;
  gap: 14px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.faq-item summary {
  position: relative;
  display: block;
  padding: 22px 58px 22px 22px;
  margin: 0;
  list-style: none;
  font-weight: 700;
  line-height: 1.45;
  cursor: pointer;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::marker {
  content: "";
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 22px;
  top: 50%;
  color: var(--primary);
  font-size: 1.4rem;
  font-weight: 400;
  transform: translateY(-50%);
}

.faq-item[open] summary::after {
  content: "-";
}

.faq-item p {
  margin: 0;
  padding: 0 22px 22px;
}

.site-footer {
  padding: 34px 0 28px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.36);
}

html[data-theme="dark"] .site-footer {
  background: rgba(8, 13, 23, 0.42);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto;
  gap: 24px;
  align-items: start;
}

.footer-brand {
  margin-bottom: 14px;
}

.footer-copy {
  max-width: 58ch;
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: flex-end;
}

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

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--text);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 24px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.65;
}

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

.subpage-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 72px 0;
}

.error-card {
  width: min(calc(100% - 40px), 760px);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-lg);
}

.error-code {
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.error-card h1 {
  max-width: none;
  margin-top: 16px;
  font-size: clamp(2.4rem, 6vw, 3.8rem);
}

.error-card p {
  max-width: 52ch;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

@media (max-width: 1120px) {
  .hero-grid,
  .overview-grid,
  .infra-grid {
    grid-template-columns: 1fr;
  }

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

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

  h1,
  h2 {
    max-width: none;
  }
}

@media (max-width: 860px) {
  .menu-toggle {
    display: inline-block;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 12px);
    right: 20px;
    left: 20px;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-lg);
  }

  html[data-theme="dark"] .site-nav {
    background: rgba(12, 19, 32, 0.98);
  }

  .site-nav.is-open {
    display: flex;
  }

  .hero {
    padding-top: 48px;
  }

  .diagram-shell {
    grid-template-columns: 1fr;
  }

  .footer-grid,
  .footer-bottom {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(calc(100% - 28px), var(--container));
  }

  .header-inner {
    min-height: 74px;
  }

  .hero-actions,
  .error-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .feature-grid,
  .use-case-grid,
  .doc-grid {
    grid-template-columns: 1fr;
  }

  .diagram-card,
  .info-panel,
  .feature-card,
  .use-card,
  .doc-card,
  .error-card {
    padding: 20px;
  }

  .faq-item summary {
    padding-right: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
