/* base */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; scroll-padding-top: 28px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
.pol-page { font-size: 16px; line-height: 1.75; overflow-x: hidden; }
.pol-page a { overflow-wrap: anywhere; }
.pol-shell { max-width: 1180px; margin: 0 auto; padding: 0 32px; }

/* skip */
.pol-skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: var(--sh-radius-sm);
  background: #f0edf4;
  color: #17121d;
  font: 500 14px/1 var(--sh-font);
  text-decoration: none;
  transform: translateY(-200%);
}
.pol-skip:focus { transform: none; }

/* progress */
.pol-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 10; height: 2px; pointer-events: none; }
.pol-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--sh-accent), var(--sh-accent-strong));
  box-shadow: 0 0 10px var(--sh-accent-glow);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* header */
.pol-header { flex-wrap: wrap; row-gap: 10px; }
.pol-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 4px;
  color: var(--sh-text-2);
  text-decoration: none;
  transition: color 180ms ease;
}
.pol-back svg { width: 18px; height: 18px; transition: translate 260ms var(--sh-ease); }
.pol-back:hover { color: var(--sh-text); }
.pol-back:hover svg { translate: -3px 0; }
.pol-scopes { margin-right: -12px; }
.pol-scopes a { display: inline-flex; align-items: center; min-height: 36px; }

/* layout */
.pol-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 56px; align-items: start; padding-top: 28px; }
.pol-hub .pol-layout { display: block; padding-top: 40px; }
.pol-main { min-width: 0; max-width: 760px; }
.pol-hub .pol-main { max-width: none; }

/* hero */
.pol-hero { --i: 0; margin-bottom: 36px; }
.pol-hero .sh-eyebrow { margin: 0 0 14px; font-size: 14px; }
.pol-hero h1 {
  margin: 0 0 18px;
  max-width: 760px;
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.pol-intro { max-width: 640px; margin: 0; font-size: 17px; line-height: 1.7; color: var(--sh-text-2); text-wrap: pretty; }
.pol-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; }

/* hub cards */
.pol-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.pol-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 24px 22px;
  color: var(--sh-text);
  text-decoration: none;
}
.pol-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.pol-card .sh-icon-tile { transition: color 220ms ease, border-color 220ms ease; }
.pol-card:hover .sh-icon-tile { color: var(--sh-accent-strong); border-color: rgba(201, 180, 227, 0.32); }
.pol-card-arrow { width: 18px; height: 18px; color: var(--sh-dim); transition: color 200ms ease, translate 260ms var(--sh-ease); }
.pol-card:hover .pol-card-arrow, .pol-card:focus-visible .pol-card-arrow { color: var(--sh-accent); translate: 2px -2px; }
.pol-card h2 { margin: 0; font-size: 21px; font-weight: 600; line-height: 1.25; }
.pol-card p { flex: 1; margin: 0; font-size: 15px; line-height: 1.7; color: var(--sh-muted); }
.pol-card-docs { display: flex; gap: 6px; margin-top: 8px; }
.pol-cards .sh-reveal { animation-duration: 760ms; }
.pol-cards > :nth-child(1) { --i: 2; }
.pol-cards > :nth-child(2) { --i: 3; }
.pol-cards > :nth-child(3) { --i: 4; }
.pol-hub-note { --i: 6; max-width: 720px; margin: 36px 0 0; font-size: 15px; line-height: 1.8; color: var(--sh-muted); }

/* toc */
.pol-aside { position: sticky; top: 28px; }
.pol-toc { border-radius: var(--sh-radius-md); box-shadow: none; }
.pol-toc summary { display: none; list-style: none; }
.pol-toc summary::-webkit-details-marker { display: none; }
.pol-toc nav { position: relative; max-height: calc(100vh - 56px); overflow: auto; padding: 16px 10px 14px; scrollbar-width: thin; }
.pol-toc-title { margin: 0; padding: 0 12px 8px; font-size: 13px; font-weight: 500; color: var(--sh-muted); }
.pol-toc a {
  position: relative;
  z-index: 1;
  display: block;
  padding: 6px 10px 6px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--sh-muted);
  text-decoration: none;
  transition: color 220ms ease;
}
.pol-toc a:hover { color: var(--sh-text); }
.pol-toc .toc-section { margin-top: 10px; font-weight: 600; color: var(--sh-text-2); }
.pol-toc .pol-toc-title + .toc-section { margin-top: 0; }
.pol-toc a[aria-current="location"] { color: var(--sh-text); }
.pol-toc-indicator {
  position: absolute;
  top: 0;
  left: 10px;
  right: 10px;
  height: 0;
  border-radius: 8px;
  background: var(--sh-glass-strong);
  box-shadow: inset 2px 0 0 var(--sh-accent);
  opacity: 0;
  pointer-events: none;
  transition: translate 420ms var(--sh-ease), height 420ms var(--sh-ease), opacity 200ms ease;
}
.pol-toc-indicator:not(.is-ready) { transition: none; }
.pol-toc-indicator.is-ready { opacity: 1; }

/* tldr */
.pol-tldr { --i: 1; margin-bottom: 52px; padding: 22px 26px 18px; border-radius: var(--sh-radius-md); }
.pol-tldr h2 { margin: 0 0 14px; font: 600 15px/1.4 var(--sh-font); letter-spacing: 0; color: var(--sh-accent); }
.pol-tldr ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.pol-tldr li { display: flex; gap: 12px; font-size: 15.5px; line-height: 1.6; color: var(--sh-text); }
.pol-tldr li svg { flex: none; width: 17px; height: 17px; margin-top: 3px; color: var(--sh-good); }
.pol-tldr li path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: pol-draw 520ms var(--sh-ease) forwards; animation-delay: calc(420ms + var(--d, 0) * 140ms); }
.pol-tldr li:nth-child(2) { --d: 1; }
.pol-tldr li:nth-child(3) { --d: 2; }
.pol-tldr li:nth-child(4) { --d: 3; }
@keyframes pol-draw { to { stroke-dashoffset: 0; } }
.pol-tldr-note { margin: 16px 0 0; font-size: 13px; line-height: 1.6; color: var(--sh-dim); }

/* prose */
.pol-body { font-size: 16px; }
.pol-section { padding-bottom: 40px; }
.pol-section + .pol-section { padding-top: 44px; border-top: 1px solid var(--sh-line); }
.pol-section h2 { margin: 0 0 10px; font-size: 30px; font-weight: 600; line-height: 1.2; color: var(--sh-text); }
.pol-section h3 { margin: 40px 0 12px; font: 600 19px/1.4 var(--sh-font); letter-spacing: -0.01em; color: var(--sh-text); }
.pol-body p { margin: 0 0 18px; }
.pol-body ul { margin: 0 0 18px; padding-left: 20px; }
.pol-body li { margin-bottom: 6px; }
.pol-body li::marker { color: var(--sh-dim); }
.pol-body strong { font-weight: 600; }
.pol-body code { overflow-wrap: anywhere; color: var(--sh-text); }
.pol-body a { text-decoration-color: rgba(201, 180, 227, 0.4); transition: color 180ms ease, text-decoration-color 180ms ease; }
.pol-body a:hover { text-decoration-color: currentColor; }

/* tables */
.pol-body .sh-table-wrap { margin: 22px 0 26px; max-width: 100%; }
.pol-body .sh-table td { color: var(--sh-text-2); min-width: 160px; }
.pol-body .sh-table td:first-child { color: var(--sh-text); }
.pol-body .sh-table th { background: var(--sh-glass); }
.pol-body .sh-table tbody tr { transition: background-color 200ms ease; }
.pol-body .sh-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

/* preference */
.pol-preference .sh-btn { min-height: 44px; margin: 6px 0 12px; font-size: 14px; }
.pol-preference .sh-btn:disabled { opacity: 0.55; cursor: default; }
#activity-preference-state { font-size: 14px; color: var(--sh-muted); }

/* note */
.pol-note { max-width: 760px; margin: 56px auto 0; padding: 14px 18px; border: 1px solid var(--sh-line); border-left: 2px solid var(--sh-warn); border-radius: var(--sh-radius-sm); background: var(--sh-glass); }
.pol-hub .pol-note { margin-left: 0; }
.pol-doc .pol-note { margin-left: calc(236px + 56px); }
.pol-note p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--sh-muted); }
.pol-note strong { color: var(--sh-text); font-weight: 600; }

/* footer */
.pol-footer { margin-top: 40px; border-top: 1px solid var(--sh-line); }

/* scroll reveal */
.pol-motion .pol-inview {
  opacity: 0;
  translate: 0 18px;
  transition: opacity 640ms ease, translate 760ms var(--sh-ease);
}
.pol-motion .pol-inview.is-in { opacity: 1; translate: none; }

@media (max-width: 1000px) {
  .pol-cards { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
  .pol-layout { grid-template-columns: 200px minmax(0, 1fr); gap: 36px; }
  .pol-doc .pol-note { margin-left: calc(200px + 36px); }
}

@media (max-width: 860px) {
  .pol-shell { padding: 0 16px; }
  .pol-header { padding: 16px 0; }
  .pol-header .pol-scopes { flex: 1 0 100%; flex-wrap: nowrap; justify-content: space-between; gap: 0; margin: 0 -6px; }
  .pol-header .pol-scopes a { padding: 6px; white-space: nowrap; }
  .pol-layout, .pol-hub .pol-layout { display: block; padding-top: 12px; }
  .pol-aside { position: static; margin-bottom: 30px; }
  .pol-toc summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 16px; font-size: 14px; font-weight: 500; color: var(--sh-text-2); cursor: pointer; }
  .pol-toc summary::after { content: ''; width: 8px; height: 8px; border-right: 1.5px solid var(--sh-accent); border-bottom: 1.5px solid var(--sh-accent); rotate: 45deg; translate: 0 -2px; transition: rotate 260ms var(--sh-ease); }
  .pol-toc[open] summary::after { rotate: 225deg; translate: 0 2px; }
  .pol-toc nav { max-height: none; padding-top: 0; }
  .pol-toc-title { display: none; }
  .pol-hero { margin-bottom: 28px; }
  .pol-intro { font-size: 16px; }
  .pol-tldr { margin-bottom: 40px; padding: 18px 18px 16px; }
  .pol-section h2 { font-size: 26px; }
  .pol-section h3 { font-size: 18px; margin-top: 34px; }
  .pol-body .sh-table th, .pol-body .sh-table td { padding: 12px; min-width: 140px; }
  .pol-note, .pol-doc .pol-note { margin: 40px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pol-motion .pol-inview { opacity: 1; translate: none; transition: none; }
  .pol-tldr li path { animation: none; stroke-dashoffset: 0; }
  .pol-toc-indicator, .pol-back svg, .pol-card-arrow, .pol-toc a, .pol-toc summary::after { transition: none; }
  .pol-back:hover svg, .pol-card:hover .pol-card-arrow { translate: none; }
}

@media print {
  .pol-page { background: #fff; color: #000; }
  .sh-stars, .pol-progress, .pol-skip, .pol-scopes, .pol-back, .pol-aside, .pol-note, .pol-footer, .pol-preference button, #activity-preference-state { display: none !important; }
  .pol-shell { max-width: none; padding: 0; }
  .pol-layout { display: block; padding: 0; }
  .pol-main { max-width: none; }
  .sh-reveal { animation: none; }
  .pol-inview { opacity: 1 !important; translate: none !important; }
  .pol-tldr li path { animation: none; stroke-dashoffset: 0; }
  .sh-glass, .sh-table-wrap { background: none; border: 1px solid #ccc; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .sh-glass::before, .sh-sheen { display: none; }
  .pol-page *, .sh-prose a { color: #000 !important; }
  .sh-table-wrap { overflow: visible; }
  .pol-section { break-inside: auto; }
  .pol-section h2, .pol-section h3 { break-after: avoid; }
}
