:root {
  --blue: #1976d2;
  --blue-wash: #e3eefa;
  --ink: #1d2a38;
  --muted: #6b7785;
  --line: #e4ebf2;
  --paper: #ffffff;
  --max: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
/* Cross-document navigation: crossfade between pages instead of a white flash */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.85 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: var(--blue); text-decoration: none; }
a:focus-visible, .button:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.nav a, .brand, .button { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }

/* Header */
.site-header { background: var(--paper); }
.nav { min-height: 64px; padding: 0 40px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; height: 34px; min-width: 34px; }
.brand-mark { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--blue); transition: transform .2s ease; }
.brand:focus-visible .brand-mark { transform: scale(1.1); }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--muted); font-size: 14px; font-weight: 400; }
.nav-links a[aria-current="page"] { color: var(--blue); text-decoration: none; }

/* Layout */
.page { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 78px 24px 104px; }
h1, h2, h3 { color: var(--blue); line-height: 1.35; font-weight: 650; }
h3 { font-size: 17px; margin: 36px 0 8px; }

/* Home hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 48px; padding-top: 40px; padding-bottom: 64px; }
.hero h1 { margin: 0; font-size: clamp(64px, 11vw, 128px); font-weight: 800; letter-spacing: -.055em; line-height: .95; }
.tagline { margin: 22px 0 40px; color: var(--muted); font-size: 18px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; }
.button { display: inline-flex; align-items: baseline; gap: 8px; height: 44px; padding: 0 22px; line-height: 44px; font-size: 15px; font-weight: 600; border-radius: 22px; }
.button.primary { background: var(--blue); color: #fff; transition: background .18s ease; }
.button.secondary { background: #fff; color: var(--blue); border: 1px solid var(--blue); line-height: 42px; transition: background .18s ease; }
.button:active { opacity: .85; }
.button.disabled { background: var(--blue-wash); color: var(--muted); cursor: not-allowed; }
.button small { font-size: 12px; font-weight: 500; opacity: .8; }
.hero-art { width: 100%; max-width: 460px; justify-self: end; overflow: visible; }
.art-wash { fill: var(--blue-wash); }
.art-fill { fill: var(--blue); }
.art-eye { fill: var(--blue); transform-box: fill-box; transform-origin: center; animation: blink 18s infinite; }
/* 18s cycle (1% = 0.18s): single blinks at 6s and 12s, a quick double blink at the end */
@keyframes blink {
  0%, 31.33%, 33.33%, 64.67%, 66.67% { transform: scaleY(1); }
  32.33%, 65.67% { transform: scaleY(.1); }
  /* double blink: open → closed → open, twice */
  96.94%, 98.06%, 98.89%, 100% { transform: scaleY(1); }
  97.5%, 99.44% { transform: scaleY(.1); }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .art-eye { animation: none; }
  .brand-mark { transition: none; }
}

/* Documents */
.doc-layout { display: grid; grid-template-columns: 190px minmax(0, 700px); gap: 64px; align-items: start; justify-content: center; }
.toc { position: sticky; top: 28px; border-left: 2px solid var(--line); padding-left: 14px; }
.toc a { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; padding: 5px 0; }
.toc a.active { color: var(--blue); text-decoration: none; }
.article { padding: 0 0 20px; }
.article header { margin-bottom: 30px; }
.article h1 { font-size: 32px; letter-spacing: -.02em; margin: 0 0 10px; }
.updated { color: var(--muted); font-size: 13px; }
.article p { margin: 12px 0; }
.article strong { color: var(--blue); font-weight: 600; }

/* Footer */
.site-footer { padding: 28px 24px 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.7; text-align: center; }
.footer-row { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; }
.footer-row + .footer-row { margin-top: 4px; }
.footer-row > * + *::before { content: "|"; margin: 0 10px; color: var(--line); }
.site-footer a { color: var(--muted); }
.site-footer span a { color: var(--blue); }

@media (max-width: 720px) {
  .nav { min-height: 58px; padding: 0 20px; }
  .page { padding: 48px 22px 72px; }
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 24px; }
  .hero-art { order: -1; max-width: 260px; justify-self: start; }
  .tagline { font-size: 16px; margin-bottom: 32px; }
  .actions { flex-direction: column; align-items: flex-start; }
  .doc-layout { grid-template-columns: 1fr; gap: 28px; }
  .toc { position: static; border-left: 0; padding-left: 0; }
  .toc a { display: inline-block; margin-right: 16px; }
  .article h1 { font-size: 28px; }
  .footer-row { gap: 0 16px; }
  .footer-row > * + *::before { content: none; }
}

/* Hover effects only on devices with a real pointer, avoiding sticky hover on touch */
@media (hover: hover) and (pointer: fine) {
  a:hover { text-decoration: underline; }
  .brand:hover { text-decoration: none; }
  .brand:hover .brand-mark { transform: scale(1.1); }
  .nav-links a:hover { color: var(--blue); text-decoration: none; }
  .button.primary:hover { background: #1565c0; text-decoration: none; }
  .button.secondary:hover { background: var(--blue-wash); text-decoration: none; }
  .toc a:hover { color: var(--blue); text-decoration: none; }
  .site-footer a:hover { color: var(--blue); text-decoration: none; }
}
