:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --ink: #172033;
  --muted: #5f6d7f;
  --line: #dbe3ed;
  --blue: #246bfe;
  --blue-2: #dfeaff;
  --green: #16865a;
  --green-bg: #def7eb;
  --yellow: #9a6500;
  --yellow-bg: #fff0c7;
  --red: #b42318;
  --red-bg: #ffe4df;
  --shadow: 0 20px 60px rgba(23, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.6;
}

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

button {
  font: inherit;
}

.site-frame {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(245, 247, 251, 0.92);
  border-bottom: 1px solid rgba(219, 227, 237, 0.85);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  color: var(--muted);
  font-size: 14px;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-cta,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.nav-cta,
.button.primary {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.button.secondary {
  color: var(--ink);
  background: var(--surface);
}

.section-band {
  padding: clamp(56px, 8vw, 98px) clamp(18px, 4vw, 56px);
}

.section-band.compact {
  padding-top: clamp(46px, 7vw, 80px);
  padding-bottom: clamp(46px, 7vw, 80px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: clamp(34px, 5vw, 72px);
  align-items: center;
  min-height: min(760px, calc(100vh - 70px));
}

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

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 22px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
  letter-spacing: 0;
}

.hero-lede,
.section-heading p,
.contact-band p {
  color: var(--muted);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0;
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 32px 0 0;
}

.trust-row div {
  min-height: 104px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.trust-row dt {
  font-weight: 800;
}

.trust-row dd {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.hero-visual {
  overflow: hidden;
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.visual-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.08);
}

.visual-toolbar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
}

.visual-toolbar strong {
  margin-left: 8px;
  font-size: 13px;
}

.visual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 20px;
}

.node,
.visual-event {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.node small,
.node strong {
  display: block;
}

.node small {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
}

.node strong {
  color: #fff;
  font-size: 15px;
}

.policy-node {
  background: rgba(36, 107, 254, 0.25);
}

.data-node {
  background: rgba(22, 134, 90, 0.22);
}

.sandbox-node {
  background: rgba(154, 101, 0, 0.22);
}

.visual-event {
  margin: 0 20px 20px;
  color: #fff;
}

.visual-event span {
  display: inline-flex;
  margin-bottom: 6px;
  color: #ffd9d4;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.visual-event p {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
}

.section-heading {
  max-width: 780px;
  margin: 0 auto 30px;
  text-align: center;
}

.section-heading.left {
  margin: 0;
  text-align: left;
}

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

.module-card,
.panel,
.agent-card,
details,
.metric-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.module-card {
  min-height: 210px;
  padding: 22px;
}

.module-icon {
  display: inline-grid;
  width: 38px;
  height: 32px;
  margin-bottom: 18px;
  place-items: center;
  color: var(--blue);
  background: var(--blue-2);
  border-radius: 8px;
  font-weight: 800;
}

.module-card p,
.agent-card li,
details p {
  color: var(--muted);
}

.cockpit-band {
  background: #eaf0f7;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  overflow: hidden;
  max-width: 1240px;
  margin: 0 auto;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 600px;
  padding: 20px;
  color: rgba(255, 255, 255, 0.78);
  background: #172033;
}

.sidebar-title {
  margin-bottom: 16px;
  color: #fff;
  font-weight: 800;
}

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

.sidebar a.active,
.sidebar a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.cockpit-main {
  padding: 22px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  min-height: 126px;
  padding: 18px;
}

.metric-card span,
.metric-card small,
.panel-head span,
.policy-stack span {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 34px;
  line-height: 1;
}

.metric-card.danger strong {
  color: var(--red);
}

.metric-card.warning strong {
  color: var(--yellow);
}

.cockpit-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  gap: 14px;
  margin-top: 14px;
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segmented button {
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.segmented button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 6px rgba(23, 32, 51, 0.12);
}

.event-list {
  display: grid;
  gap: 10px;
}

.event-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.event-time {
  color: var(--muted);
  font-size: 13px;
}

.event-copy strong,
.event-copy small {
  display: block;
}

.event-copy small {
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.allowed,
.status-allowed {
  color: var(--green);
  background: var(--green-bg);
}

.status-pill.review,
.status-masked {
  color: var(--yellow);
  background: var(--yellow-bg);
}

.status-pill.blocked,
.status-blocked {
  color: var(--red);
  background: var(--red-bg);
}

.policy-stack {
  display: grid;
  gap: 10px;
}

.policy-stack div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.flow-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.flow-step {
  position: relative;
  min-height: 168px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.flow-step::after {
  position: absolute;
  top: 50%;
  right: -12px;
  width: 20px;
  height: 2px;
  content: "";
  background: var(--line);
}

.flow-step:nth-child(4n)::after,
.flow-step:last-child::after {
  display: none;
}

.flow-step span {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 40px;
  align-items: center;
  background: #eaf0f7;
}

.gateway-map {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.9fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.gateway-col,
.gateway-core {
  display: grid;
  gap: 10px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.gateway-core {
  background: var(--ink);
}

.gateway-core span,
.gateway-core div {
  color: #fff;
}

.gateway-col span,
.gateway-core span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.gateway-core span {
  color: rgba(255, 255, 255, 0.68);
}

.gateway-col strong,
.gateway-core div {
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.gateway-core div {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.sandbox-grid,
.faq-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.agent-card {
  padding: 20px;
}

.agent-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agent-card ul {
  margin: 14px 0 0;
  padding-left: 20px;
}

.audit-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.audit-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.audit-table th,
.audit-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.audit-table th {
  color: var(--muted);
  font-size: 13px;
}

.audit-table tr:last-child td {
  border-bottom: 0;
}

details {
  padding: 18px;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

details p {
  margin: 12px 0 0;
}

.contact-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(40px, 6vw, 70px) clamp(18px, 4vw, 56px);
  color: #fff;
  background: var(--ink);
}

.contact-band .eyebrow,
.contact-band p {
  color: rgba(255, 255, 255, 0.72);
}

.contact-band h2 {
  margin-bottom: 8px;
}

@media (max-width: 980px) {
  .nav-links {
    display: none;
  }

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

  .hero {
    min-height: auto;
  }

  .module-grid,
  .dashboard-grid,
  .flow-board,
  .sandbox-grid,
  .faq-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell,
  .cockpit-panels,
  .gateway-map {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 42px;
    line-height: 1.12;
  }

  h2 {
    font-size: 30px;
    line-height: 1.16;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand {
    min-width: auto;
  }

  .nav-cta {
    display: none;
  }

  .trust-row,
  .module-grid,
  .dashboard-grid,
  .flow-board,
  .sandbox-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }

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

  .event-item {
    grid-template-columns: 1fr;
  }

  .flow-step::after {
    display: none;
  }

  .contact-band {
    align-items: flex-start;
    flex-direction: column;
  }
}
