/* Bilingual public site stylesheet — strictly consumes web/kit/src/tokens.css */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 60;
  padding: 10px 16px;
  background: var(--inv);
  color: var(--on-inv);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 0 0 var(--r-2) 0;
}
.skip-link:focus {
  left: 0;
}

.sr-only {
  position: fixed;
  top: 0;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

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

.site-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
}

.site-frame {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Desktop sidebar matching docs/diagrams/page-01-landing.svg & ConsoleShell */
.site-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .site-sidebar {
    display: flex;
    flex-direction: column;
    width: 244px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100dvh;
    border-right: 1px solid var(--hairline);
    background: var(--bg);
  }
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px 10px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--inv);
  color: var(--on-inv);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-primary {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px 16px;
}

.nav-group + .nav-group {
  margin-top: 20px;
}

.nav-group-title {
  margin: 0 0 6px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  min-height: 36px;
  border-radius: var(--r-3);
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 450;
  transition: background-color var(--d1) var(--e-out);
}

.nav-link:hover {
  background: var(--hover);
}

.nav-link[aria-current="page"] {
  background: var(--well);
  font-weight: 600;
}

.nav-link-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nav-icon {
  width: 15px;
  height: 15px;
  color: var(--ink-2);
  flex-shrink: 0;
}

.nav-link[aria-current="page"] .nav-icon {
  color: var(--ink);
}

.nav-count {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  color: var(--ink-3);
}

.sidebar-footer {
  border-top: 1px solid var(--hairline);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-signin {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--r-2);
  text-decoration: none;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  transition: background-color var(--d1) var(--e-out);
}

.sidebar-signin:hover {
  background: var(--hover);
}

.signin-avatar {
  display: inline-flex;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  background: var(--well);
  color: var(--ink-2);
}

.utility-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 6px;
}

.lang-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: var(--r-2);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  transition: border-color var(--d1) var(--e-out);
}

.lang-link:hover {
  border-color: var(--line-3);
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
  border-radius: var(--r-2);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color var(--d1) var(--e-out), color var(--d1) var(--e-out);
}

.theme-btn:hover {
  border-color: var(--line-3);
  color: var(--ink);
}

/* Mobile / Tablet Top Header (< 1024px) */
.site-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
}

@media (min-width: 1024px) {
  .site-topbar {
    display: none;
  }
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--r-2);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

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

/* Native <dialog> navigation drawer on mobile/tablet */
dialog.nav-drawer {
  margin: 0 auto 0 0;
  height: 100dvh;
  max-height: 100dvh;
  width: min(296px, 86vw);
  max-width: 296px;
  border: 0;
  border-right: 1px solid var(--hairline);
  border-radius: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
}

.nav-drawer-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.nav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
}

/* Main Content Column */
.site-main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1;
  width: 100%;
  max-width: 960px;
  padding: 32px 16px 56px;
  outline: none;
}

@media (min-width: 640px) {
  .site-main {
    padding: 40px 28px 64px;
  }
}

@media (min-width: 1024px) {
  .site-main {
    padding: 48px 48px 72px;
  }
}

/* Typography */
.hero-title {
  margin: 0;
  font-size: clamp(2.125rem, 5vw, 3.375rem);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
  color: var(--ink);
}

.page-title {
  margin: 0;
  font-size: clamp(1.875rem, 3.5vw, 2.5rem);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: balance;
  color: var(--ink);
}

.hero-subtitle,
.page-subtitle {
  margin: 14px 0 0;
  max-width: 62ch;
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

.section-block {
  margin-top: 44px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.section-link {
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
}

.section-link:hover {
  color: var(--ink);
  text-decoration: underline;
}

.section-lead {
  margin: 6px 0 18px;
  max-width: 64ch;
  font-size: 14.5px;
  color: var(--ink-2);
}

/* Entry Cards (page-01-landing.svg exact 2-column geometry) */
.entry-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .card-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .card-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: var(--surface);
}

.card-title {
  margin: 10px 0 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.card-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 550;
  line-height: 1.3;
  background: var(--well);
  color: var(--ink-2);
}

.badge-ink {
  background: var(--inv);
  color: var(--on-inv);
}

.badge-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge-accent {
  background: var(--accent-soft);
  color: var(--accent-text);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: var(--r-3);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
  transition: opacity var(--d1) var(--e-out), background-color var(--d1) var(--e-out), border-color var(--d1) var(--e-out);
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  opacity: 0.92;
}

.btn-secondary {
  background: var(--well);
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--hover);
  border-color: var(--hairline);
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--hairline);
}

.btn-outline:hover {
  border-color: var(--line-3);
}

/* Dark Code Panel matching page-01-landing.svg & web/kit CodePanel */
.code-panel {
  margin-top: 24px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--code-line);
  background: var(--code-bg);
  color: var(--code-text);
}

.code-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--code-line);
}

.code-panel-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--code-dim);
}

.code-copy-btn {
  min-height: 32px;
  padding: 4px 14px;
  border: 0;
  border-radius: var(--r-3);
  background: var(--accent);
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: opacity var(--d1) var(--e-out);
}

.code-copy-btn:hover {
  opacity: 0.9;
}

.code-panel pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--code-text);
}

/* 3-layer RangeTrack visualization matching web/kit RangeTrack */
.range-box {
  padding: 20px 24px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: var(--surface);
}

.range-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  gap: 3px;
}

.range-seg-direct {
  flex: 55;
  background: var(--ok);
  border-radius: 999px;
}

.range-seg-approval {
  flex: 30;
  background: var(--warn);
  border-radius: 999px;
}

.range-seg-factory {
  flex: 15;
  background: var(--line-3);
  border-radius: 999px;
}

.range-legend {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 640px) {
  .range-legend {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.legend-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

.dot-ok {
  background: var(--ok);
}

.dot-warn {
  background: var(--warn);
}

.dot-muted {
  background: var(--ink-3);
}

.legend-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.legend-desc {
  margin: 3px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
}

/* Tables with hairline dividers and tabular numerals */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.data-table th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 550;
  color: var(--ink-3);
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
  vertical-align: top;
}

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

.num-cell {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Filter bar for templates */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}

.filter-pill {
  min-height: 34px;
  padding: 5px 12px;
  border-radius: var(--r-3);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.filter-pill[aria-pressed="true"] {
  background: var(--well);
  color: var(--ink);
  border-color: var(--line-3);
  font-weight: 600;
}

.is-hidden {
  display: none !important;
}

/* Prose / Whitepaper sections */
.prose-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 28px;
}

.prose-section {
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}

.prose-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.prose-section h2 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.prose-section p {
  margin: 0;
  max-width: 68ch;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
}

.note-box {
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: var(--r-3);
  border: 1px solid var(--hairline);
  background: var(--well);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

.cta-row {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 28px 16px 40px;
  color: var(--ink-2);
  font-size: 13px;
}

@media (min-width: 1024px) {
  .site-footer {
    padding: 32px 48px 48px;
  }
}

.footer-inner {
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.footer-links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-notes {
  margin: 0;
  line-height: 1.55;
  color: var(--ink-3);
}
