/* Socket Geek
   Palette comes from the hardware itself: solder mask green, gold contact pads, silkscreen white.
   The pin 1 triangle (gold corner) marks the few panels that matter. Everything else stays plain. */
:root {
  --bg: #f2f5f1; --surface: #ffffff; --surface-2: #e8eee8; --ink: #15261f; --muted: #52645b; --line: #d3dcd3;
  --mask: #0f4a38; --gold: #c8a43a; --gold-soft: #e2c15a;
  --link: #0b6a4f; --focus: #8a5f00;
  --ok-bg: #dcefe5; --ok-ink: #0b5a42; --warn-bg: #f4e8c8; --warn-ink: #6d4f00; --mute-bg: #e4e8e4; --mute-ink: #44524b;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  /* Motion: crisp reference-site feel. transform+opacity only, ease-out for enter, custom curves. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-hover: ease;
  --dur-press: 160ms;
  --dur-pop: 180ms;
  --dur-banner: 350ms;
}
:root[data-theme="dark"] {
  --bg: #0c1914; --surface: #12241d; --surface-2: #1a3128; --ink: #e3eee8; --muted: #97ada2; --line: #244237;
  --mask: #0d4332; --link: #7ad9b6; --focus: #e2b94f;
  --ok-bg: #16382c; --ok-ink: #8fe0bf; --warn-bg: #3b3015; --warn-ink: #e8c868; --mute-bg: #1f2f28; --mute-ink: #a9bdb2;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1914; --surface: #12241d; --surface-2: #1a3128; --ink: #e3eee8; --muted: #97ada2; --line: #244237;
    --mask: #0d4332; --link: #7ad9b6; --focus: #e2b94f;
    --ok-bg: #16382c; --ok-ink: #8fe0bf; --warn-bg: #3b3015; --warn-ink: #e8c868; --mute-bg: #1f2f28; --mute-ink: #a9bdb2;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1.0625rem/1.65 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: var(--gold); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -64px; z-index: 100; padding: 0.6rem 1rem; border-radius: 6px; background: var(--surface); color: var(--ink); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3); }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }

/* Header */
.site-header { position: relative; background: var(--mask); color: #fff; }
.site-header::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 40%; pointer-events: none;
  background-image: radial-gradient(circle, rgba(226, 193, 90, 0.26) 1.4px, transparent 1.9px); background-size: 16px 16px;
  -webkit-mask-image: linear-gradient(to left, #000, transparent); mask-image: linear-gradient(to left, #000, transparent); }
.home .site-header::after { display: none; }
.bar { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; white-space: nowrap; color: #fff; font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; text-decoration: none; }
.brand svg { width: 30px; height: 30px; flex: none; }
.nav { display: none; order: 5; width: 100%; flex-direction: column; gap: 2px; padding: 4px 0 10px; }
.nav.open { display: flex; opacity: 1; transform: translateY(0); transition: opacity var(--dur-pop) var(--ease-out), transform var(--dur-pop) var(--ease-out); }
@starting-style { .nav.open { opacity: 0; transform: translateY(-6px); } }
.nav a { padding: 0.65rem 0.5rem; border-radius: 4px; color: #e9f3ee; font-weight: 500; text-decoration: none; transition: background-color 150ms var(--ease-hover); }
.nav a:hover { background: rgba(255, 255, 255, 0.12); }
.nav a[aria-current="page"] { color: var(--gold-soft); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 6px; background: transparent; color: #fff; cursor: pointer; transition: transform var(--dur-press) var(--ease-out), background-color 150ms var(--ease-hover); }
.icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
.icon-btn:active { transform: scale(0.97); }
.icon-btn svg { width: 22px; height: 22px; }
.search { position: relative; order: 4; width: 100%; }
.search input { width: 100%; height: 46px; padding: 0 48px 0 14px; border: 2px solid transparent; border-radius: 6px; background: #fff; color: #15261f; font: inherit; }
.search input::placeholder { color: #5b6b63; }
.search input:focus { border-color: var(--gold-soft); outline: 0; }
.search button { position: absolute; right: 2px; top: 2px; display: flex; align-items: center; justify-content: center; width: 42px; height: calc(100% - 4px); border: 0; border-radius: 4px; background: transparent; color: #0f4a38; cursor: pointer; transition: transform var(--dur-press) var(--ease-out), background-color 150ms var(--ease-hover); }
.search button:hover { background: rgba(15, 74, 56, 0.08); }
.search button:active { transform: scale(0.97); }
.search button svg { width: 20px; height: 20px; }
/* Keyboard hint: physical keyboards only, hidden on touch. Fades (opacity only) on focus. */
.search-kbd { display: none; position: absolute; right: 52px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search-kbd kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--surface-2); color: var(--muted); font-family: var(--mono); font-size: 0.8rem; }
@media (hover: hover) and (pointer: fine) { .search-kbd { display: block; opacity: 1; transition: opacity 150ms var(--ease-hover); } .search:focus-within .search-kbd { opacity: 0; } }
.search input { padding-right: 48px; }
@media (hover: hover) and (pointer: fine) { .search input { padding-right: 82px; } .search-hero input { padding-right: 82px; } }
/* Fast spinner for perceived performance: constant motion -> linear is correct. */
.spin { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--mask); animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sug { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; max-height: 70vh; overflow: auto; margin: 0; padding: 4px; list-style: none; scroll-behavior: auto;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  transform-origin: top center; opacity: 1; transform: translateY(0) scale(1);
  transition: opacity var(--dur-pop) var(--ease-out), transform var(--dur-pop) var(--ease-out); }
@starting-style { .sug { opacity: 0; transform: translateY(-4px) scale(0.98); } }
/* Subsequent opens while typing stay snappy: no re-animation, content swaps instantly. */
.sug[data-instant] { transition-duration: 0ms; }
.sug a, .results a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 0.7rem 0.8rem; border-radius: 4px; color: inherit; text-decoration: none; }
.sug [aria-selected="true"] a, .sug a:hover, .results a:hover { background: var(--surface-2); }
.sug .all a { color: var(--link); font-weight: 600; }
.r-title { font-weight: 600; }
.r-meta { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.kind { font-size: 0.82rem; }
@media (max-width: 560px) { .sug a, .results a { flex-direction: column; align-items: flex-start; gap: 2px; } .r-meta { white-space: normal; } }
@media (min-width: 900px) {
  .bar { flex-wrap: nowrap; }
  .brand { margin-right: 0; }
  .nav { display: flex; order: 0; width: auto; flex-direction: row; gap: 2px; margin-right: auto; padding: 0; }
  .nav-toggle { display: none; }
  .search { order: 0; width: 340px; flex: 0 1 340px; }
}

/* Hero (home page) */
.hero { position: relative; z-index: 2; background: var(--mask); color: #fff; padding: 2rem 0 3rem; }
.hero::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 58%; pointer-events: none;
  background-image: radial-gradient(circle, rgba(226, 193, 90, 0.34) 1.8px, transparent 2.3px); background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to left, #000 10%, transparent); mask-image: linear-gradient(to left, #000 10%, transparent); }
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { max-width: 14ch; margin-top: 0.4rem; color: #fff; font-size: clamp(2.3rem, 1.4rem + 4.2vw, 4rem); line-height: 1.04; }
.hero p { max-width: 54ch; color: #d6e6dd; font-size: 1.15rem; }
.hero p a { color: var(--gold-soft); }
main .search { order: 0; width: 100%; max-width: 640px; flex: none; }
.hero .search-hero { order: 0; width: 100%; max-width: 640px; flex: none; margin-top: 1.4rem; }
.search-hero input { height: 58px; font-size: 1.15rem; }

/* Typography */
main { display: block; }
.page { padding-top: 1.25rem; padding-bottom: 2rem; }
h1, h2, h3 { text-wrap: balance; }
h1 { margin: 0.2em 0 0.4em; font-size: clamp(1.8rem, 1.2rem + 2.6vw, 2.7rem); line-height: 1.12; letter-spacing: -0.025em; }
h2 { margin: 2.4rem 0 0.8rem; font-size: 1.55rem; line-height: 1.25; letter-spacing: -0.015em; }
h3 { margin: 1.8rem 0 0.5rem; font-size: 1.2rem; line-height: 1.3; }
p { margin: 0 0 1.1em; }
.lede { max-width: 62ch; font-size: 1.2rem; line-height: 1.55; }
.prose { max-width: 72ch; }
.prose ul, .prose ol { max-width: 72ch; padding-left: 1.4rem; }
.prose li { margin: 0.35rem 0; }
code { padding: 0.1em 0.35em; border-radius: 3px; background: var(--surface-2); font-family: var(--mono); font-size: 0.9em; }
pre { overflow: auto; padding: 1rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 0.9rem; line-height: 1.5; }
pre code { padding: 0; background: none; }
blockquote { margin: 1.2rem 0; padding: 0.2rem 0 0.2rem 1rem; border-left: 4px solid var(--gold); color: var(--muted); }
.crumbs { margin: 0 0 0.9rem; color: var(--muted); font-size: 0.9rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0.2rem 0.5rem; margin: 0; padding: 0; list-style: none; }
.crumbs li + li::before { content: "/"; margin-right: 0.5rem; color: var(--line); }
.crumbs a { color: var(--muted); }

/* Panels with the pin 1 corner */
.answer, .tile { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.answer::before, .tile::before { content: ""; position: absolute; left: -1px; top: -1px; width: 22px; height: 22px; background: linear-gradient(135deg, var(--gold) 0 50%, transparent 50%); }
.answer { margin: 1.25rem 0 0; padding: 1.5rem 1.25rem 1.1rem; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem 1.2rem; margin: 0; }
.facts dt { color: var(--muted); font-size: 0.84rem; }
.facts dd { margin: 0; font-weight: 600; }
@media (min-width: 720px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Tiles (popular sockets) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; margin: 1rem 0; padding: 0; list-style: none; }
.tile { display: block; height: 100%; padding: 1.3rem 1rem 1rem; color: inherit; text-decoration: none; transition: transform var(--dur-press) var(--ease-out), border-color 150ms var(--ease-hover), box-shadow 150ms var(--ease-hover); }
.tile:hover { border-color: var(--mask); }
.tile:active { transform: scale(0.97); }
.tile::before { width: 18px; height: 18px; }
/* Lift only where hover is real. Touch taps get :active instead, no false hover. */
@media (hover: hover) and (pointer: fine) {
  .tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15, 74, 56, 0.12); }
}
.t-name { display: block; font-family: var(--mono); font-size: 1.25rem; font-weight: 700; }
.t-sub { display: block; margin-top: 0.15rem; color: var(--muted); font-size: 0.9rem; }
.t-count { display: block; margin-top: 0.6rem; font-size: 0.9rem; }

/* Tables and lists */
.table-wrap { margin: 1rem 0; overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 0.97rem; font-variant-numeric: tabular-nums; }
th, td { padding: 0.6rem 0.75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { border-bottom: 2px solid var(--mask); font-weight: 600; white-space: nowrap; }
.kv th { width: 36%; color: var(--muted); font-weight: 600; }
.cpu-table { min-width: 660px; }
/* Row scan aid: instant background only (tens of rows/day, no motion allowed). */
.cpu-table tbody tr:hover td { background: var(--surface-2); }
/* Sticky header where it can work: desktop widths where the table fits without
   horizontal scroll. overflow-x:auto creates a scroll container that traps
   position:sticky, so it is lifted only where no sideways scroll is needed. */
@media (min-width: 720px) {
  .table-wrap { overflow-x: visible; }
  .cpu-table { border-collapse: separate; border-spacing: 0; }
  .cpu-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); }
}
.sock { padding: 0.12em 0.45em; border-radius: 3px; background: var(--surface-2); color: var(--ink); font-family: var(--mono); font-size: 0.88em; white-space: nowrap; }
.badge { display: inline-block; padding: 0.12em 0.55em; border-radius: 3px; font-size: 0.82rem; font-weight: 600; white-space: nowrap; }
.b-ok { background: var(--ok-bg); color: var(--ok-ink); }
.b-warn { background: var(--warn-bg); color: var(--warn-ink); }
.b-mute { background: var(--mute-bg); color: var(--mute-ink); }
.plain { margin: 0; padding: 0; list-style: none; }
.plain li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.2rem 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 2rem; }
.filter { display: block; width: 100%; max-width: 340px; height: 42px; margin: 0.5rem 0 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 1.5rem 0; }
.pager a, .pager span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 0.8rem; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); text-decoration: none; transition: transform var(--dur-press) var(--ease-out), border-color 150ms var(--ease-hover), background-color 150ms var(--ease-hover); }
.pager a:active { transform: scale(0.97); }
.pager [aria-current="page"] { border-color: var(--mask); background: var(--mask); color: #fff; }
.results { margin: 1rem 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.results li { border-bottom: 1px solid var(--line); }

/* Article layout with table of contents */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 40px; }
.toc { order: -1; margin: 1.25rem 0 0; }
.toc summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0.5rem 0; font-weight: 600; cursor: pointer; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-right: 3px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform var(--dur-pop) var(--ease-out); }
.toc-d[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.toc ol { margin: 0.25rem 0 0; padding-left: 2rem; }
.toc li { margin: 0.3rem 0; font-size: 0.95rem; }
.toc a { color: var(--ink); text-decoration-color: var(--line); overflow-wrap: anywhere; }
.toc a[aria-current="true"] { color: var(--link); font-weight: 700; text-decoration-color: var(--gold); }
@media (min-width: 980px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr) 250px; }
  .toc { order: 0; position: sticky; top: 1rem; align-self: start; max-height: calc(100vh - 2rem); margin-top: 0.4rem; overflow: auto; }
}
.content > section:first-child > h2:first-child { margin-top: 1.6rem; }
.faq h3 { margin-top: 1.4rem; font-size: 1.1rem; }
.sources ol { padding-left: 1.3rem; }
.sources li { margin: 0.3rem 0; overflow-wrap: anywhere; }
.note { padding: 0.9rem 1rem; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 4px; background: var(--surface); }

/* Compare tool */
.cmp-controls { display: flex; flex-wrap: wrap; gap: 14px; margin: 1rem 0; }
.field { display: flex; flex-direction: column; gap: 0.25rem; font-weight: 600; font-size: 0.9rem; }
select { min-width: 210px; height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; }
.cmp thead th a { color: var(--ink); }
/* Difference highlight: state indication, instant swap (no motion). Gold-tinted to match palette. */
.cmp tr.is-diff td { background: var(--warn-bg); transition: background-color 150ms var(--ease-hover); }
.cmp-status { margin-top: -0.25rem; }

/* Footer */
.site-footer { margin-top: 3rem; padding: 2rem 0 2.5rem; border-top: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 0.95rem; }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem 2rem; }
.foot-title { margin: 0 0 0.5rem; color: var(--ink); font-weight: 700; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin: 0.3rem 0; }
.site-footer a { color: var(--ink); }
.legal { margin: 1.5rem 0 0; font-size: 0.85rem; }

/* Footer link-styled button (Cookie settings) */
.link-btn { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: var(--gold); cursor: pointer; }
.link-btn:hover { text-decoration-thickness: 2px; }

/* Cookie consent banner: self-hosted, fixed at the bottom, works with and without JS.
   Rare (once per visitor) so it earns a full drawer entrance. Dismiss is instant (hidden). */
.consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); color: var(--ink); border-top: 2px solid var(--mask); box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.22);
  opacity: 1; transform: translateY(0);
  transition: opacity 250ms var(--ease-out), transform var(--dur-banner) var(--ease-drawer); }
@starting-style { .consent { opacity: 0; transform: translateY(100%); } }
.consent-inner { width: 100%; max-width: 1120px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.consent-title { margin: 0; font-weight: 700; }
.consent p { margin: 0; font-size: 0.95rem; }
.consent-desc { flex: 1 1 280px; color: var(--muted); }
.consent-desc a { color: var(--ink); }
.consent-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.consent-actions button { min-height: 44px; padding: 0 1.1rem; border-radius: 6px; font: inherit; font-weight: 600; cursor: pointer; transition: transform var(--dur-press) var(--ease-out), filter 150ms var(--ease-hover), background-color 150ms var(--ease-hover); }
.consent-actions button:active { transform: scale(0.97); }
.consent-actions [data-consent-accept] { border: 2px solid var(--mask); background: var(--mask); color: #fff; }
.consent-actions [data-consent-accept]:hover { filter: brightness(1.08); }
.consent-actions [data-consent-reject] { border: 2px solid var(--mask); background: transparent; color: var(--ink); }
.consent-actions a { padding: 0.6rem 0.4rem; font-size: 0.92rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* Fewer and gentler: keep opacity/color comprehension, remove movement. */
  .sug, .consent, .nav.open, .tile, .icon-btn, .search button, .pager a, .consent-actions button {
    transition-property: opacity, background-color, border-color, color, filter, box-shadow;
    transition-duration: 150ms;
    transform: none !important;
  }
  /* Chevron keeps its open/closed angle, just snaps. Spinner becomes a static ring; text remains. */
  .toc summary::after { transition: none; }
  .spin { animation: none; }
  @starting-style { .sug, .consent, .nav.open { opacity: 0; } }
}

@media print {
  .site-header, .site-footer, .toc, .search, .pager, .filter, .skip, .hero::after, .consent { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; }
  .answer { border-color: #888; }
}
