@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Noto+Sans:wght@400;500;600;700&display=swap");

:root {
  --font-body: Noto, "Noto Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --font-arab: s-arab;
  --font-jpan: s-jpan;

  --gray: oklch(0.6 0 0);
  --color-red: oklch(0.461 0.157 29);
  --rir-arin: #4d85c5;

  --reg-col: 44%;
  --baseline: 20px;
  --nav-drop: 75px;

  --color-ink: #333;
  --color-ink-2: #666;
  --color-ink-3: #999;
  --color-muted: var(--gray);
  --color-border: #ccc;
  --color-border-soft: #ddd;
  --color-canvas: #f3f4f5;
  --color-surface: #fafafc;
  --color-surface-2: #f0f0f0;

  --color-primary: #003b71;
  --color-primary-hover: #00294f;
  --color-on-primary: #fff;
  --color-nav: rgb(46 83 105);
  --color-link: #003b71;
  --color-link-hover: rgb(46 83 105);
  --color-focus: #003b71;

  --color-live: #ff674f;
  --color-pulse-mid: rgb(111 42 33);
  --color-highlight: rgb(255 235 59);
  --color-highlight-soft: rgb(255 249 196);
  --color-notice-bg: #fff1bb;
  --color-notice-border: #f2de32;
  --color-error-bg: #fae5e3;
  --color-error-border: #c87872;
  --color-error-text: #b9554d;
  --color-info-bg: #fafafc;
  --color-info-border: #b4c8dd;

  --space-2xs: 5px;
  --space-xs: 10px;
  --space-sm: 15px;
  --space-md: 25px;
  --space-lg: 50px;
  --space-xl: 75px;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.875rem;
  --text-3xl: 2.25rem;

  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.08);
  --shadow-md: 0 2px 4px oklch(0 0 0 / 0.16);
  --shadow-lg: 0 8px 24px oklch(0 0 0 / 0.18);

  --duration-fast: 150ms;
  --duration: 250ms;
  --duration-slow: 450ms;
  --ease: cubic-bezier(0.2, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --measure: 70ch;
  --container: 1200px;
  --container-narrow: 720px;
  --header-height: var(--nav-drop);
  --focus-ring: 0 0 0 3px oklch(0.58 0.14 251 / 0.35);
}

[data-theme="dark"] {
  --color-ink: #e9ecef;
  --color-ink-2: #b6bcc4;
  --color-ink-3: #8a919a;
  --color-muted: #8a919a;
  --color-border: #3a4149;
  --color-border-soft: #2c3238;
  --color-canvas: #14181c;
  --color-surface: #1b2126;
  --color-surface-2: #222a30;
  --color-primary: #7fb2e8;
  --color-primary-hover: #a3c9f2;
  --color-on-primary: #10222f;
  --color-nav: #9ec4ea;
  --color-link: #8db9e8;
  --color-link-hover: #b7d6f5;
  --color-focus: #8db9e8;
  --color-live: #ff8a75;
  --color-pulse-mid: #c96a58;
  --color-highlight: rgb(255 235 59 / 0.35);
  --color-highlight-soft: rgb(255 249 196 / 0.16);
  --color-notice-bg: #3a3413;
  --color-notice-border: #6b5f17;
  --color-error-bg: #3a1f1c;
  --color-error-border: #8c4a43;
  --color-error-text: #e8a49c;
  --color-info-bg: #1b2126;
  --color-info-border: #33506b;
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.5);
  --shadow-md: 0 2px 4px oklch(0 0 0 / 0.55);
  --shadow-lg: 0 8px 24px oklch(0 0 0 / 0.6);
  --focus-ring: 0 0 0 3px oklch(0.7 0.12 251 / 0.45);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-ink);
  background: var(--color-canvas);
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-sm);
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  color: var(--color-primary);
  letter-spacing: -0.01em;
}

h1,
.h1 {
  font-size: var(--text-2xl);
}

h2,
.h2 {
  font-size: var(--text-xl);
}

h3,
.h3 {
  font-size: var(--text-lg);
}

h4,
.h4 {
  font-size: var(--text-md);
}

p {
  margin: 0 0 var(--space-sm);
}

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--color-link-hover);
}

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

ul,
ol {
  margin: 0 0 var(--space-sm);
  padding-left: 1.35em;
}

li + li {
  margin-top: var(--space-2xs);
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: 0.925em;
}

pre {
  margin: 0 0 var(--space-md);
  padding: var(--space-sm) var(--space-md);
  overflow-x: auto;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-md);
  line-height: var(--leading-normal);
}

code {
  padding: 0.1em 0.35em;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-sm);
}

pre code {
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-sm);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.container--wide {
  max-width: 1360px;
}

.section {
  padding-block: var(--space-lg);
}

.section--alt {
  background: var(--color-surface-2);
}

.section--tight {
  padding-block: var(--space-md);
}

.grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
  margin: 0;
  padding: 0;
  list-style: none;
}

.grid--auto {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
}

.stack > * + * {
  margin-top: var(--baseline);
}

.split {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--space-xs);
  left: var(--space-xs);
  z-index: 100;
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-radius: var(--radius-md);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--duration-fast) var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 42px;
  padding: var(--space-xs) var(--space-md);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease),
    border-color var(--duration-fast) var(--ease),
    color var(--duration-fast) var(--ease),
    box-shadow var(--duration-fast) var(--ease),
    transform var(--duration-fast) var(--ease);
}

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

.btn:active {
  transform: translateY(0);
}

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

.btn-primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  color: var(--color-on-primary);
}

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

.btn-secondary:hover {
  background: var(--color-surface-2);
  border-color: var(--color-ink-3);
  color: var(--color-ink);
}

.btn-sm {
  min-height: 34px;
  padding: var(--space-2xs) var(--space-sm);
  font-size: var(--text-xs);
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.card-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  color: var(--color-primary);
}

.card-title a {
  text-decoration: none;
}

.card-body {
  margin: 0;
  color: var(--color-ink-2);
}

.card-footer {
  margin-top: auto;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border-soft);
}

.site-header {
  position: relative;
  z-index: 20;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-soft);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  min-height: var(--header-height);
  padding-block: var(--space-xs);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 0;
  text-decoration: none;
  color: var(--color-primary);
}

.brand:hover {
  color: var(--color-primary-hover);
  text-decoration: none;
}

.brand-mark {
  font-family: var(--font-body);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--color-primary);
}

.brand-sub {
  display: none;
  font-size: var(--text-xs);
  line-height: 1.3;
  color: var(--color-ink-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-nav);
  cursor: pointer;
  user-select: none;
}

.nav-toggle:hover {
  border-color: var(--color-ink-3);
}

.nav-toggle-input:focus-visible + .nav-toggle {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

.nav-toggle-label {
  letter-spacing: 0.02em;
}

.site-nav {
  display: none;
  flex-basis: 100%;
  width: 100%;
  padding-top: var(--space-xs);
  border-top: 1px solid var(--color-border-soft);
}

.nav-toggle-input:checked ~ .site-nav {
  display: block;
}

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

.site-nav-item {
  margin: 0;
}

.site-nav-link {
  display: block;
  padding: var(--space-xs) 0;
  border-bottom: 2px solid transparent;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--color-nav);
  text-decoration: none;
  transition:
    color var(--duration-fast) var(--ease),
    border-color var(--duration-fast) var(--ease);
}

.site-nav-link:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary-soft);
}

.site-nav-link.is-active,
.site-nav-link[aria-current="page"] {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.site-footer {
  margin-top: var(--space-lg);
  padding-block: var(--space-lg) var(--space-md);
  background: var(--color-surface-2);
  border-top: 1px solid var(--color-border-soft);
  color: var(--color-ink-2);
  font-size: var(--text-sm);
}

.footer-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
  margin: 0 0 var(--space-md);
}

.footer-col {
  min-width: 0;
}

.footer-brand-name {
  margin: 0 0 var(--space-2xs);
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  color: var(--color-primary);
}

.footer-tagline {
  margin: 0 0 var(--space-xs);
  max-width: 32ch;
  color: var(--color-ink-2);
}

.footer-heading {
  margin: 0 0 var(--space-xs);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-ink-2);
}

.footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links li + li {
  margin-top: var(--space-2xs);
}

.footer-link {
  color: var(--color-nav);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.footer-note {
  margin: 0 0 var(--space-2xs);
  color: var(--color-muted);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border);
}

.footer-copy {
  margin: 0;
  color: var(--color-muted);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb {
  margin: 0 0 var(--space-md);
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb-list li + li::before {
  content: "›";
  margin-right: var(--space-2xs);
  color: var(--color-ink-3);
}

.breadcrumb-link {
  color: var(--color-nav);
  text-decoration: none;
}

.breadcrumb-link:hover {
  text-decoration: underline;
}

.notice {
  margin: 0 0 var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-notice-bg);
  border: 1px solid var(--color-notice-border);
  border-radius: var(--radius-md);
  color: var(--color-ink);
}

.notice-title {
  margin: 0 0 var(--space-2xs);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

.notice p:last-child {
  margin-bottom: 0;
}

.notice--info {
  background: var(--color-info-bg);
  border-color: var(--color-info-border);
}

.notice--error {
  background: var(--color-error-bg);
  border-color: var(--color-error-border);
  color: var(--color-error-text);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 0.15em 0.55em;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-ink);
}

.chip--rir {
  border-left: 3px solid var(--rir-arin);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75em;
  padding: 0.1em 0.45em;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-ink-2);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.table {
  margin: 0;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: var(--space-xs) var(--space-sm);
  text-align: left;
  border-bottom: 1px solid var(--color-border-soft);
}

.table thead th {
  background: var(--color-surface-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-ink-2);
  white-space: nowrap;
}

.table tbody tr:nth-child(even) {
  background: var(--color-canvas);
}

.table tbody tr:hover {
  background: var(--color-highlight-soft);
}

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

.prose {
  max-width: var(--measure);
  line-height: var(--leading-relaxed);
}

.prose h2 {
  margin-top: calc(var(--baseline) * 2);
}

.prose h3 {
  margin-top: calc(var(--baseline) * 1.5);
}

.prose > *:last-child {
  margin-bottom: 0;
}

.lead {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--color-ink-2);
}

.hero {
  padding-block: var(--space-lg);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-soft);
}

.hero-title {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-2xl);
  color: var(--color-primary);
}

.hero-lede {
  max-width: var(--measure);
  margin: 0 0 var(--space-md);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--color-ink-2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.eyebrow {
  margin: 0 0 var(--space-xs);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-nav);
}

.mono {
  font-family: var(--font-mono);
}

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

.text-sm {
  font-size: var(--text-sm);
}

.text-center {
  text-align: center;
}

.mono-nowrap {
  font-family: var(--font-mono);
  white-space: nowrap;
}

@keyframes pulse {
  0% {
    color: var(--color-live);
  }
  50% {
    color: var(--color-pulse-mid);
  }
  100% {
    color: var(--color-live);
  }
}

@keyframes search-highlight-fade {
  0%,
  20% {
    background-color: var(--color-highlight);
  }
  100% {
    background-color: var(--color-highlight-soft);
  }
}

@keyframes copy-check-flash {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  20% {
    opacity: 1;
    transform: scale(1.15);
  }
  35% {
    opacity: 1;
    transform: scale(1);
  }
  75% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.pulse {
  animation: pulse 2.4s ease-in-out infinite;
}

.search-highlight {
  animation: search-highlight-fade 1.6s var(--ease-out) both;
}

.copy-check {
  animation: copy-check-flash 0.9s var(--ease-out) both;
}

.fade-up {
  animation: fade-up var(--duration-slow) var(--ease-out) both;
}

.fade-in {
  animation: fade-in var(--duration-slow) var(--ease) both;
}

.reveal {
  animation: reveal 0.6s var(--ease-out) both;
}

.marquee {
  overflow: hidden;
  width: 100%;
}

.marquee-track {
  display: flex;
  width: max-content;
  gap: var(--space-lg);
  animation: marquee 32s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.delay-1 {
  animation-delay: 80ms;
}

.delay-2 {
  animation-delay: 160ms;
}

.delay-3 {
  animation-delay: 240ms;
}

@media (min-width: 48rem) {
  .container {
    padding-inline: var(--space-md);
  }

  h1,
  .h1,
  .hero-title {
    font-size: var(--text-3xl);
  }

  h2,
  .h2 {
    font-size: var(--text-2xl);
  }

  .brand-sub {
    display: block;
  }

  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: block;
    flex-basis: auto;
    width: auto;
    margin-left: auto;
    padding-top: 0;
    border-top: 0;
  }

  .site-nav-list {
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
  }

  .site-nav-link {
    padding: var(--space-2xs) 0;
  }

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

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }

  .split {
    grid-template-columns: var(--reg-col) 1fr;
  }
}

@media (min-width: 64rem) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }

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

  .hero {
    padding-block: var(--space-xl);
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
