:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --ink: #1e2a3a;
  --muted: #5d6b82;
  --line: #d8e0ec;
  --accent: #0e7c86;
  --accent-2: #f4b942;
  --danger: #c73f3f;
  --ink-soft: #22384e;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Avenir Next', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ink-soft);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 0.8rem;
  z-index: 2000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.container {
  width: min(1120px, 92vw);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(243, 246, 251, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  border: 1px solid var(--line);
  border-radius: 6px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 1.05rem;
}

.desktop-nav a,
.mobile-menu a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
}

.desktop-nav a[aria-current='page'],
.mobile-menu a[aria-current='page'] {
  color: var(--accent);
}

.mobile-toggle {
  display: none;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  padding: 0.42rem 0.68rem;
  font-weight: 600;
}

.mobile-menu {
  display: grid;
  gap: 0.4rem;
  padding: 0.6rem 0 1rem;
  border-top: 1px solid var(--line);
}

.mobile-menu[hidden] {
  display: none;
}

main {
  padding: 1.5rem 0 2.5rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.3rem;
  align-items: start;
}

.section-tag {
  display: inline-block;
  font-size: 0.88rem;
  color: var(--accent);
  background: #e8f5f6;
  border: 1px solid #c7e6e8;
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
}

h1,
h2,
h3 {
  line-height: 1.2;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin: 0.7rem 0;
}

h2 {
  font-size: clamp(1.35rem, 2.3vw, 2rem);
  margin-top: 0;
}

h3 {
  font-size: clamp(1.08rem, 1.6vw, 1.3rem);
}

.lead {
  max-width: 65ch;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.button,
.copy-btn {
  appearance: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 0.58rem 0.9rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  font: inherit;
}

.button-quiet,
.copy-btn.subtle {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}

.intent-rail {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  padding: 0;
  margin: 1rem 0 0;
  gap: 0.6rem;
}

.intent-rail a {
  display: inline-block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.key-ribbon {
  background: #10283a;
  color: #d9f7fb;
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 1rem;
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  position: relative;
  overflow: hidden;
}

.key-ribbon::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(244, 185, 66, 0.16) 46%, transparent 62%);
  animation: scan 3.2s linear infinite;
}

@keyframes scan {
  from { transform: translateX(-110%); }
  to { transform: translateX(110%); }
}

.key-ribbon code {
  display: block;
  margin: 0.6rem 0 0.8rem;
  font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  font-size: 0.98rem;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 0.65rem;
  word-break: break-all;
}

.key-title {
  margin: 0;
  font-weight: 700;
}

.panel {
  margin-top: 1.2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.15rem;
}

.panel-alt {
  border-left: 5px solid var(--accent);
}

.panel-ink {
  background: #eef3fb;
  border: 1px solid #cfd9ea;
}

.note-text,
.muted {
  color: var(--muted);
}

.small {
  font-size: 0.88rem;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.list-clean {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

pre {
  margin: 0.5rem 0;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
  font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.notice {
  margin-top: 0.9rem;
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
}

.notice.warning {
  border: 1px solid #f2d7a2;
  background: #fff7e8;
}

.step-list {
  margin: 0.65rem 0 0;
  padding-left: 1.1rem;
}

.step-list li {
  margin-bottom: 0.55rem;
}

.diagram {
  margin: 1rem 0 0;
  border: 1px dashed #bfd3df;
  border-radius: 12px;
  padding: 0.8rem;
  background: #f8fbff;
}

.diagram img {
  width: 100%;
  height: auto;
  display: block;
}

.diagram figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

caption {
  text-align: left;
  margin-bottom: 0.5rem;
  color: var(--muted);
}

th,
td {
  border: 1px solid var(--line);
  padding: 0.6rem;
  text-align: left;
}

th {
  background: #f5f9ff;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.link-tile {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid #c8d5e8;
  background: var(--panel);
  border-left: 6px solid var(--accent-2);
  border-radius: 12px;
  padding: 0.85rem;
}

.link-tile p {
  margin-bottom: 0.2rem;
  color: var(--muted);
}

.breadcrumbs {
  margin: 0.25rem 0 0.75rem;
  display: flex;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.page-intro {
  margin-bottom: 0.65rem;
}

.check-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.checklist {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
}

.checklist.good li::marker {
  color: var(--accent);
}

.checklist.bad li::marker {
  color: var(--danger);
}

.faq-group details {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  background: #fcfdff;
  margin-bottom: 0.6rem;
}

.faq-group summary {
  cursor: pointer;
  font-weight: 700;
}

.site-footer {
  background: #233246;
  color: #dde6f3;
  margin-top: 2.1rem;
  padding: 1.5rem 0 1rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 1rem;
}

.site-footer h2 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

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

.site-footer a {
  color: #f0f6ff;
}

.footer-brand {
  color: #f0f6ff;
}

.footnote {
  margin: 1rem auto 0;
  border-top: 1px solid rgba(221, 230, 243, 0.25);
  padding-top: 0.8rem;
  width: min(1120px, 92vw);
  color: #c6d3e5;
  font-size: 0.9rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}

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

  .mobile-toggle {
    display: inline-block;
  }

  .hero,
  .split,
  .links-grid,
  .footer-grid,
  .check-columns {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 560px;
  }
}

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

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