@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800&family=Source+Serif+4:opsz,wght@8..60,600;8..60,700&display=swap");

:root {
  color-scheme: light;
  --ink: oklch(0.22 0.018 262);
  --ink-strong: oklch(0.16 0.018 262);
  --muted: oklch(0.48 0.02 262);
  --subtle: oklch(0.62 0.018 262);
  --paper: oklch(0.985 0.006 262);
  --canvas: oklch(0.955 0.01 262);
  --surface: oklch(0.998 0.004 262);
  --surface-alt: oklch(0.972 0.008 262);
  --line: oklch(0.875 0.012 262);
  --line-strong: oklch(0.78 0.018 262);
  --brand: oklch(0.42 0.13 270);
  --brand-soft: oklch(0.94 0.03 270);
  --gold: oklch(0.78 0.15 83);
  --green: oklch(0.55 0.12 164);
  --red: oklch(0.58 0.16 29);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --shadow-subtle: 0 1px 2px color-mix(in oklch, var(--ink) 9%, transparent);
  --font-body: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Source Serif 4", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(180deg, var(--paper), transparent 380px),
    var(--canvas);
  color: var(--ink);
  line-height: 1.62;
}

a {
  color: var(--brand);
  text-decoration-color: color-mix(in oklch, var(--brand) 38%, transparent);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: currentColor;
}

.site-shell {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: var(--space-xl);
  border-right: 1px solid var(--line);
  background: color-mix(in oklch, var(--surface) 90%, transparent);
}

.brand {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: var(--space-sm);
  color: var(--ink-strong);
  text-decoration: none;
}

.mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid color-mix(in oklch, var(--brand) 30%, var(--line));
  border-radius: var(--radius-md);
  background: var(--brand);
  color: var(--surface);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-name {
  display: block;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.brand-subtitle {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.nav {
  display: grid;
  gap: var(--space-2xs);
  margin-top: var(--space-2xl);
}

.nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 var(--space-sm);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.nav a::after {
  content: ">";
  color: var(--subtle);
}

.nav a[aria-current="page"],
.nav a:hover {
  border-color: var(--line);
  background: var(--surface);
}

.side-note {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.content {
  width: min(100%, 1000px);
  padding: var(--space-2xl) clamp(var(--space-md), 5vw, var(--space-3xl));
}

.document {
  display: grid;
  gap: var(--space-xl);
}

.document-header {
  display: grid;
  gap: var(--space-lg);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--line);
}

.kicker {
  margin: 0;
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  color: var(--ink-strong);
  letter-spacing: -0.035em;
}

h1 {
  max-width: 12ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 5.7rem);
  line-height: 0.92;
}

h2 {
  margin: 0 0 var(--space-md);
  font-size: clamp(1.34rem, 2vw, 1.72rem);
  line-height: 1.12;
}

h3 {
  margin: 0 0 var(--space-xs);
  font-size: 1.02rem;
  line-height: 1.25;
}

p,
li,
dd {
  color: var(--muted);
}

.lead {
  max-width: 66ch;
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.04rem, 1.5vw, 1.2rem);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-sm);
}

.meta-item,
.panel,
.notice,
.form-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-subtle);
}

.meta-item {
  padding: var(--space-md);
}

.meta-label {
  display: block;
  color: var(--subtle);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.meta-value {
  display: block;
  margin-top: var(--space-2xs);
  color: var(--ink-strong);
  font-weight: 700;
}

.notice {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--brand-soft);
}

.notice.danger {
  background: oklch(0.96 0.03 29);
}

.notice.success {
  background: oklch(0.95 0.035 164);
}

.notice-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand);
  font-weight: 900;
}

.danger .notice-icon {
  color: var(--red);
}

.success .notice-icon {
  color: var(--green);
}

.notice-title {
  margin: 0;
  color: var(--ink-strong);
  font-weight: 800;
}

.notice-copy {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.section {
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--line);
}

.section:last-child {
  border-bottom: 0;
}

.summary-list {
  display: grid;
  grid-template-columns: minmax(160px, 240px) 1fr;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.summary-list dt,
.summary-list dd {
  margin: 0;
  padding: var(--space-md);
  border-bottom: 1px solid var(--line);
}

.summary-list dt {
  color: var(--ink-strong);
  font-weight: 800;
}

.summary-list dd:nth-last-child(1),
.summary-list dt:nth-last-child(2) {
  border-bottom: 0;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-md);
}

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

a.panel {
  color: inherit;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

a.panel:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px color-mix(in oklch, var(--ink) 8%, transparent);
}

.panel p:last-child,
.section p:last-child {
  margin-bottom: 0;
}

.rule-list {
  display: grid;
  gap: var(--space-sm);
  padding: 0;
  list-style: none;
}

.rule-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: var(--space-sm);
  align-items: start;
}

.rule-list li::before {
  content: "OK";
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid color-mix(in oklch, var(--green) 35%, var(--line));
  border-radius: 999px;
  color: var(--green);
  font-weight: 900;
  line-height: 1;
}

.form-panel {
  padding: var(--space-lg);
}

form {
  display: grid;
  gap: var(--space-md);
}

label {
  display: grid;
  gap: var(--space-xs);
  color: var(--ink-strong);
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

input:focus {
  border-color: var(--brand);
  outline: 3px solid color-mix(in oklch, var(--brand) 18%, transparent);
}

.checkbox {
  grid-template-columns: 22px 1fr;
  align-items: start;
  color: var(--ink);
  font-weight: 600;
}

.checkbox input {
  width: 18px;
  min-height: 18px;
  margin-top: 4px;
  accent-color: var(--brand);
}

button {
  min-height: 48px;
  border: 1px solid color-mix(in oklch, var(--brand) 65%, black);
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--surface);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: color-mix(in oklch, var(--brand) 88%, black);
}

button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.fine-print {
  color: var(--subtle);
  font-size: 0.84rem;
}

.footer {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: 0.82rem;
}

code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--ink-strong);
}

@media (max-width: 860px) {
  .site-shell {
    display: block;
  }

  .sidebar {
    position: static;
    min-height: auto;
    padding: var(--space-md);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: var(--space-lg);
  }

  .side-note {
    display: none;
  }

  .content {
    padding: var(--space-xl) var(--space-md);
  }

  h1 {
    max-width: 100%;
  }

  .summary-list {
    grid-template-columns: 1fr;
  }

  .summary-list dt {
    padding-bottom: var(--space-2xs);
    border-bottom: 0;
  }

  .summary-list dd {
    padding-top: 0;
  }

  .summary-list dd:nth-last-child(1),
  .summary-list dt:nth-last-child(2) {
    border-bottom: 0;
  }
}

@media (max-width: 520px) {
  .nav {
    grid-template-columns: 1fr;
  }

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