:root {
  --ink: #202124;
  --muted: #666a6d;
  --line: #d9dada;
  --soft: #f5f5f3;
  --paper: #ffffff;
  --footer: #252525;
  --twitter: #1da1f2;
  --youtube: #ff0000;
  --shell: 960px;
  --article: 1180px;
  --radius: 10px;
  --shadow: 0 18px 45px rgba(0,0,0,.07);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(calc(100% - 32px), var(--shell));
  margin-inline: auto;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 999;
  transform: translateY(-160%);
  padding: 9px 13px;
  background: #111;
  color: #fff;
  text-decoration: none;
}

.skip-link:focus {
  transform: none;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 5px rgba(0,0,0,.035);
  backdrop-filter: blur(10px);
}

.top-rule {
  height: 5px;
  background: #4c4c4c;
}

.header-inner {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand img {
  width: 132px;
  height: auto;
  max-height: 60px;
  object-fit: contain;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.desktop-nav > a {
  position: relative;
  color: #222;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .085em;
  text-decoration: none;
}

.desktop-nav > a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -9px;
  left: 0;
  height: 1px;
  background: #222;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .18s ease;
}

.desktop-nav > a:hover::after,
.desktop-nav > a:focus-visible::after {
  transform: scaleX(1);
}

.search-toggle,
.content-icon {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  background: transparent;
  color: #222;
  border: 0;
  text-decoration: none;
  cursor: pointer;
}

.search-toggle svg,
.content-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-actions {
  display: none;
  align-items: center;
  gap: 3px;
}

.menu-toggle {
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.menu-toggle span:not(.sr-only) {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: #222;
}

.search-panel {
  background: #fff;
  border-top: 1px solid #ececec;
}

.search-panel[hidden] {
  display: none;
}

.search-form {
  display: flex;
  gap: 8px;
  padding-block: 14px;
}

.search-form input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 8px 12px;
  border: 1px solid #c9cbcc;
  border-radius: 0;
}

.search-form button {
  min-width: 92px;
  height: 42px;
  border: 1px solid #222;
  background: #222;
  color: #fff;
  cursor: pointer;
}

.mobile-menu {
  display: none;
  padding: 5px 16px 18px;
  background: #fff;
  border-top: 1px solid #ededed;
}

.mobile-menu.open {
  display: grid;
}

.mobile-menu a {
  padding: 12px 0;
  border-bottom: 1px solid #ededed;
  color: #222;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-decoration: none;
}

/* Original-style homepage */
.home-main {
  flex: 1;
}

.home-shell {
  width: min(calc(100% - 32px), var(--shell));
  margin-inline: auto;
  padding: 52px 0 80px;
}

.home-shell > h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(25px, 3vw, 30px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -.02em;
}

.double-rule {
  width: 100%;
  height: 4px;
  margin-top: 37px;
  border-top: 1px solid #333;
  border-bottom: 1px solid #777;
}

.legacy-post-links {
  max-width: 760px;
  display: grid;
  gap: 54px;
  margin-top: 104px;
  padding-left: 8px;
}

.legacy-post-links a {
  width: fit-content;
  color: #565a5d;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.55;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.legacy-post-links a:hover,
.legacy-post-links a:focus-visible {
  color: #111;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 35px;
  margin-top: 62px;
  padding-left: 48px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  text-decoration: none;
}

.social-links svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.social-links .twitter {
  color: var(--twitter);
}

.social-links .youtube {
  color: var(--youtube);
}

.seo-intro {
  max-width: 780px;
  margin-top: 86px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

.seo-intro h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
}

.seo-intro p {
  color: var(--muted);
}

.seo-intro a,
.read-link {
  font-weight: 700;
  text-underline-offset: 4px;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--footer);
  color: #92979b;
}

.footer-inner {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-inner p {
  margin: 4px 0;
  font-size: 12px;
  letter-spacing: .045em;
}

.footer-inner a {
  color: inherit;
  text-decoration: none;
}

.footer-inner a:hover,
.footer-inner a:focus-visible {
  color: #fff;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rss-link {
  font-size: 10px;
  letter-spacing: .08em;
}

/* Archive */
.archive-main {
  flex: 1;
  padding: 58px 0 82px;
}

.archive-header {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #767a7d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.archive-header h1,
.error-main h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.08;
  letter-spacing: -.04em;
}

.archive-header > p:last-child {
  color: var(--muted);
  font-size: 18px;
}

.archive-grid {
  display: grid;
  gap: 0;
  margin-top: 54px;
  border-top: 1px solid var(--line);
}

.archive-card {
  padding: 28px 0 30px;
  border-bottom: 1px solid var(--line);
}

.archive-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: #7b7f82;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.archive-card h2 {
  margin: 9px 0 8px;
  font-size: clamp(21px, 3vw, 28px);
  line-height: 1.25;
}

.archive-card h2 a {
  text-decoration: none;
}

.archive-card h2 a:hover,
.archive-card h2 a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.archive-card p {
  max-width: 760px;
  color: var(--muted);
}

/* Article */
.article-shell {
  width: min(calc(100% - 32px), var(--article));
  padding: 54px 0 82px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 9px;
  margin-bottom: 26px;
  color: #74787b;
  font-size: 13px;
}

.breadcrumbs a {
  text-underline-offset: 3px;
}

.article-header {
  max-width: 1020px;
}

.article-header.compact {
  max-width: 860px;
}

.article-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.article-categories a {
  padding: 5px 8px;
  background: var(--soft);
  color: #55595c;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .055em;
  text-decoration: none;
  text-transform: uppercase;
}

.article-header h1 {
  max-width: 1000px;
  margin: 0;
  font-size: clamp(35px, 6.2vw, 70px);
  line-height: 1.04;
  letter-spacing: -.052em;
}

.article-deck {
  max-width: 860px;
  margin: 23px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.58;
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 22px;
  color: #73777a;
  font-size: 13px;
}

.article-hero {
  margin: 42px 0;
}

.article-hero img {
  width: 100%;
  height: auto;
  border: 1px solid #dedede;
}

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 810px) minmax(230px, 270px);
  gap: 58px;
  align-items: start;
}

.article-content {
  min-width: 0;
}

.article-content p,
.article-content li,
.simple-content p {
  font-size: 17px;
}

.article-intro {
  font-size: 20px !important;
}

.article-content h2,
.simple-content h2 {
  margin: 48px 0 14px;
  font-size: clamp(25px, 4vw, 34px);
  line-height: 1.22;
  letter-spacing: -.025em;
}

.article-content h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.article-content ul,
.article-content ol {
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 9px;
}

.key-takeaways,
.example-box,
.content-notice {
  margin: 32px 0;
  padding: 24px;
  background: var(--soft);
  border-left: 4px solid #292929;
}

.key-takeaways h2,
.content-notice h2 {
  margin: 0 0 8px;
  font-size: 23px;
}

.key-takeaways p,
.example-box p,
.content-notice p {
  margin-bottom: 0;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
  margin: 28px 0;
}

.rules-grid section,
.player-example,
.pros-cons section,
.sidebar-card {
  padding: 22px;
  border: 1px solid var(--line);
  background: #fff;
}

.rules-grid p,
.player-example p {
  margin-bottom: 0;
}

.player-example {
  margin: 15px 0;
}

.player-label {
  color: #818588;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
}

.pros-cons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 15px;
  margin: 24px 0;
}

.pros-cons ul {
  margin-bottom: 0;
}

.faq-section details {
  border-top: 1px solid var(--line);
}

.faq-section details:last-child {
  border-bottom: 1px solid var(--line);
}

.faq-section summary {
  padding: 17px 0;
  font-weight: 700;
  cursor: pointer;
}

.faq-section details p {
  margin-top: 0;
  color: var(--muted);
}

.article-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.article-sidebar {
  position: sticky;
  top: 116px;
  display: grid;
  gap: 18px;
}

.toc {
  padding: 21px;
  background: #fafafa;
  border: 1px solid var(--line);
}

.toc h2,
.sidebar-card h2 {
  margin: 0 0 13px;
  font-size: 17px;
}

.toc a {
  display: block;
  padding: 6px 0;
  color: #5f6366;
  font-size: 13px;
  text-decoration: none;
}

.toc a:hover,
.toc a:focus-visible {
  text-decoration: underline;
}

.sidebar-card span {
  color: #85898c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.sidebar-card p {
  color: var(--muted);
  font-size: 14px;
}

.sidebar-card > a {
  font-size: 14px;
  font-weight: 700;
  text-underline-offset: 3px;
}

.simple-content {
  max-width: 820px;
  margin-top: 42px;
}

.contact-box {
  max-width: 480px;
  display: grid;
  gap: 4px;
  margin: 24px 0;
  padding: 20px;
  border: 1px solid var(--line);
}

.contact-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.contact-box a {
  font-size: 20px;
}

/* Error */
.error-main {
  flex: 1;
  padding: 90px 0;
}

.error-main p {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding: 10px 17px;
  background: #222;
  color: #fff;
  text-decoration: none;
}

code {
  padding: 2px 5px;
  background: #ececeb;
  font-size: .9em;
}

@media (max-width: 960px) {
  .desktop-nav {
    display: none;
  }

  .mobile-actions {
    display: flex;
  }

  .header-inner {
    min-height: 58px;
  }

  .brand img {
    width: 112px;
    max-height: 43px;
  }

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

  .article-sidebar {
    position: static;
  }

  .toc {
    columns: 2;
  }

  .toc h2 {
    column-span: all;
  }
}

@media (max-width: 720px) {
  .home-shell {
    padding-top: 58px;
  }

  .home-shell > h1 {
    font-size: 29px;
  }

  .double-rule {
    margin-top: 46px;
  }

  .legacy-post-links {
    gap: 58px;
    margin-top: 125px;
  }

  .legacy-post-links a {
    font-size: 20px;
  }

  .social-links {
    margin-top: 67px;
    padding-left: 40px;
  }

  .seo-intro {
    margin-top: 70px;
  }

  .footer-inner {
    min-height: 174px;
    justify-content: center;
    text-align: center;
  }

  .footer-meta {
    justify-content: center;
  }

  .rss-link {
    display: none;
  }

  .article-shell {
    padding-top: 38px;
  }

  .article-header h1 {
    font-size: clamp(36px, 11vw, 56px);
  }

  .article-hero {
    margin: 32px 0;
  }

  .rules-grid,
  .pros-cons {
    grid-template-columns: 1fr;
  }

  .toc {
    columns: 1;
  }
}

@media (max-width: 430px) {
  .shell,
  .home-shell,
  .article-shell {
    width: calc(100% - 28px);
  }

  .legacy-post-links {
    padding-left: 7px;
  }

  .social-links {
    padding-left: 38px;
  }

  .article-content p,
  .article-content li,
  .simple-content p {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
