
/* === reset + base === */
*,*::before,*::after { box-sizing: border-box; }
html, body { width: 100%; overflow-x: hidden; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: #2a1f17;
  background: #f4ead8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #7a1f2b; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: #5a161f; }

h1, h2, h3, h4 {
  font-family: 'Cinzel', 'Times New Roman', serif;
  font-weight: 700;
  line-height: 1.2;
  color: #1a1208;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); letter-spacing: 0.01em; }
h2 { font-size: clamp(1.35rem, 3.5vw, 1.85rem); margin-top: 1.8em; padding-bottom: 0.3em; border-bottom: 2px solid #d9c79a; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.3rem); margin-top: 1.4em; color: #7a1f2b; }
p { margin: 0 0 1em; }

/* === header === */
.masthead {
  background: #1a1208;
  color: #f4ead8;
  border-bottom: 4px solid #b8902a;
  position: sticky;
  top: 0;
  z-index: 100;
}
.masthead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 18px;
  gap: 12px;
  position: relative;
}
.wordmark {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: #f4ead8;
  text-decoration: none;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.wordmark::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f5c945 0%, #b8902a 60%, #7a5a14 100%);
  box-shadow: 0 0 12px rgba(245, 201, 69, 0.5);
  flex-shrink: 0;
}
.menu-toggle {
  margin-left: auto;
  background: transparent;
  color: #f4ead8;
  border: 1.5px solid #d9c79a;
  padding: 7px 13px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  font-family: inherit;
  border-radius: 3px;
  text-transform: uppercase;
}
.menu-toggle:hover { background: #2c2010; }
/* Mobile: menu is a drop-panel below the row when open */
.menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  padding: 6px 0 14px;
  gap: 2px;
  background: #1a1208;
  border-top: 1px solid #3a2a14;
  z-index: 95;
}
.menu.is-open { display: flex; }
.menu a {
  color: #f4ead8;
  text-decoration: none;
  padding: 11px 18px;
  font-size: 0.97rem;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.menu a:hover, .menu a[aria-current="page"] {
  background: #2c2010;
  border-left-color: #b8902a;
  color: #f5c945;
}
.menu .menu-cta {
  margin-top: 8px;
  background: #7a1f2b;
  color: #f4ead8;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-left: 0;
  padding: 13px;
}
.menu .menu-cta:hover { background: #9a2a3a; color: #fff; }

/* === breadcrumb === */
.crumbs {
  background: #ede0c0;
  border-bottom: 1px solid #d9c79a;
  font-size: 0.85rem;
}
.crumbs-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 9px 18px;
  color: #5a4a2a;
}
.crumbs a { color: #5a4a2a; }
.crumbs span[aria-current] { color: #1a1208; font-weight: 600; }
.crumbs .sep { margin: 0 6px; color: #b8902a; }

/* === main grid === */
.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 18px 60px;
}
.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
}
.article-main { min-width: 0; }
.lede {
  background: #fffbf0;
  border-left: 5px solid #b8902a;
  padding: 18px 20px;
  margin: 18px 0 26px;
  font-size: 1.05rem;
  line-height: 1.6;
  font-family: 'Cinzel', serif;
  color: #2a1f17;
  font-weight: 500;
}
.update-stamp {
  display: inline-block;
  font-size: 0.82rem;
  color: #5a4a2a;
  background: #ede0c0;
  padding: 4px 11px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-weight: 500;
}

/* === sidebar TOC === */
.rail {
  background: #fffbf0;
  border: 1px solid #d9c79a;
  border-radius: 4px;
  padding: 16px 18px;
  font-size: 0.92rem;
  margin: 20px 0;
}
.rail h2.rail-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #7a1f2b;
  margin: 0 0 10px;
  border: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
}
.rail ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: tocnum;
}
.rail li {
  counter-increment: tocnum;
  padding: 4px 0;
  border-bottom: 1px dotted #d9c79a;
}
.rail li:last-child { border-bottom: 0; }
.rail li::before {
  content: counter(tocnum, decimal-leading-zero) ".";
  color: #b8902a;
  font-weight: 700;
  margin-right: 7px;
  font-family: 'Cinzel', serif;
}
.rail a { color: #2a1f17; text-decoration: none; }
.rail a:hover { color: #7a1f2b; text-decoration: underline; }

/* === quick-facts box === */
.facts {
  background: #2a1f17;
  color: #f4ead8;
  border-radius: 4px;
  padding: 18px 20px;
  margin: 20px 0 24px;
}
.facts h2 {
  margin: 0 0 12px;
  color: #f5c945;
  font-size: 1.05rem;
  border: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.facts dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 18px;
  row-gap: 9px;
  margin: 0;
  align-items: baseline;
}
.facts dt {
  font-size: 0.78rem;
  color: #d9c79a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  white-space: nowrap;
}
.facts dd {
  margin: 0;
  font-size: 0.97rem;
  font-weight: 600;
  color: #f4ead8;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* === CTA block === */
.cta-block {
  background: linear-gradient(135deg, #7a1f2b 0%, #5a161f 100%);
  color: #f4ead8;
  border-radius: 5px;
  padding: 24px 22px;
  margin: 28px 0;
  text-align: center;
  border: 1px solid #b8902a;
}
.cta-block h2 {
  color: #f5c945;
  margin: 0 0 8px;
  border: 0;
  padding: 0;
  font-size: 1.4rem;
}
.cta-block p {
  margin: 0 0 18px;
  font-size: 1rem;
  line-height: 1.55;
  color: #f4ead8;
}
.cta-btn {
  display: inline-block;
  background: #f5c945;
  color: #1a1208;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 36px;
  border-radius: 4px;
  text-decoration: none;
  border: 0;
  box-shadow: 0 3px 12px rgba(0,0,0,0.25);
}
.cta-btn:hover { background: #fff; color: #1a1208; }

/* === demo section (separate from CTA block) === */
.demo-strip {
  background: #ede0c0;
  border: 1px dashed #b8902a;
  border-radius: 4px;
  padding: 16px 18px;
  margin: 18px 0 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.demo-strip h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #7a1f2b;
  font-family: 'Inter', sans-serif;
}
.demo-strip p { margin: 0; font-size: 0.95rem; color: #2a1f17; }
.demo-link {
  display: inline-block;
  align-self: flex-start;
  background: #2a1f17;
  color: #f5c945;
  padding: 9px 18px;
  border-radius: 3px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid #b8902a;
}
.demo-link:hover { background: #1a1208; color: #fff; }

/* === pros/cons === */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 22px 0;
}
.pc-box {
  padding: 16px 18px;
  border-radius: 4px;
  border: 1px solid #d9c79a;
  background: #fffbf0;
}
.pc-box.pros { border-top: 4px solid #4a7a2a; }
.pc-box.cons { border-top: 4px solid #7a1f2b; }
.pc-box h3 {
  margin: 0 0 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pc-box.pros h3 { color: #4a7a2a; }
.pc-box.cons h3 { color: #7a1f2b; }
.pc-box ul { margin: 0; padding-left: 20px; }
.pc-box li { margin-bottom: 6px; font-size: 0.95rem; }

/* === FAQ accordion === */
.qa {
  border-top: 2px solid #d9c79a;
  margin: 28px 0 20px;
}
.qa h2 { border-bottom: 0; padding-bottom: 0; }
.qa-item {
  border-bottom: 1px solid #d9c79a;
}
.qa-item summary {
  cursor: pointer;
  padding: 14px 36px 14px 4px;
  font-weight: 600;
  font-size: 1.02rem;
  color: #1a1208;
  position: relative;
  list-style: none;
  line-height: 1.4;
}
.qa-item summary::-webkit-details-marker { display: none; }
.qa-item summary::after {
  content: "+";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: #b8902a;
  font-weight: 400;
  transition: transform 0.2s;
}
.qa-item[open] summary::after { content: "−"; }
.qa-item .qa-body {
  padding: 0 4px 16px;
  font-size: 0.97rem;
  line-height: 1.6;
  color: #2a1f17;
}
.qa-item .qa-body p:last-child { margin-bottom: 0; }

/* === images + figures === */
figure { margin: 18px 0; }
figure img {
  border-radius: 4px;
  border: 1px solid #d9c79a;
}
figcaption {
  font-size: 0.85rem;
  color: #5a4a2a;
  text-align: center;
  padding-top: 6px;
  font-style: italic;
}

/* === tables (mandatory scroll wrapper) === */
.table-scroll {
  overflow-x: auto;
  margin: 18px 0;
  border: 1px solid #d9c79a;
  border-radius: 4px;
  -webkit-overflow-scrolling: touch;
}
.table-scroll table {
  border-collapse: collapse;
  width: 100%;
  min-width: 480px;
  font-size: 0.93rem;
}
.table-scroll th, .table-scroll td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid #ede0c0;
}
.table-scroll th {
  background: #2a1f17;
  color: #f5c945;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}
.table-scroll tr:nth-child(even) td { background: #fffbf0; }

/* === footer === */
.foot {
  background: #1a1208;
  color: #d9c79a;
  padding: 30px 18px 22px;
  margin-top: 50px;
  font-size: 0.9rem;
  line-height: 1.55;
}
.foot-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}
.foot h3 {
  color: #f5c945;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 9px;
  font-family: 'Inter', sans-serif;
  border: 0;
  padding: 0;
}
.foot a { color: #ede0c0; text-decoration: none; }
.foot a:hover { color: #f5c945; text-decoration: underline; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 5px; }
.foot .legal {
  border-top: 1px solid #3a2a14;
  padding-top: 16px;
  font-size: 0.82rem;
  color: #a0876a;
  text-align: center;
}
.foot .rg-badges {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  font-weight: 700;
  color: #f5c945;
}
.foot .rg-badges span {
  border: 1.5px solid #b8902a;
  padding: 3px 9px;
  border-radius: 3px;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

/* === inline elements === */
.tag {
  display: inline-block;
  background: #ede0c0;
  color: #5a4a2a;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 4px 4px 0;
}
.tag.gold { background: #b8902a; color: #1a1208; }
.note {
  background: #fff7e0;
  border-left: 3px solid #b8902a;
  padding: 10px 14px;
  margin: 14px 0;
  font-size: 0.93rem;
  color: #3a2a14;
}

/* === intro grid for homepage === */
.version-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 22px 0;
}
.version-card {
  background: #fffbf0;
  border: 1px solid #d9c79a;
  padding: 16px 18px;
  border-radius: 4px;
  text-decoration: none;
  color: #2a1f17;
  display: block;
  transition: border-color 0.15s;
}
.version-card:hover { border-color: #7a1f2b; }
.version-card h3 {
  margin: 0 0 6px;
  color: #7a1f2b;
  font-size: 1.05rem;
  font-family: 'Inter', sans-serif;
}
.version-card p { margin: 0; font-size: 0.92rem; color: #5a4a2a; }

/* === desktop (≥ 768px) === */
@media (min-width: 768px) {
  .menu-toggle { display: none; }
  /* Logo left + menu right, single row */
  .menu {
    display: flex;
    flex-direction: row;
    position: static;
    width: auto;
    padding: 0;
    background: transparent;
    border-top: 0;
    margin-left: auto;
    gap: 4px;
    flex-wrap: nowrap;
    align-items: center;
    white-space: nowrap;
  }
  .menu a {
    padding: 8px 12px;
    border-left: 0;
    border-bottom: 2px solid transparent;
    font-size: 0.92rem;
  }
  .menu a:hover, .menu a[aria-current="page"] {
    background: transparent;
    border-left: 0;
    border-bottom-color: #b8902a;
    color: #f5c945;
  }
  .menu .menu-cta {
    margin-top: 0;
    margin-left: 10px;
    padding: 8px 18px;
    font-size: 0.85rem;
    border-radius: 3px;
  }
  .pros-cons { grid-template-columns: 1fr 1fr; }
  .version-grid { grid-template-columns: repeat(2, 1fr); }
  .foot-inner { grid-template-columns: 1fr 1.2fr 1.6fr; }
}

@media (min-width: 1024px) {
  .article-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
  }
  .rail {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
  }
  .version-grid { grid-template-columns: repeat(3, 1fr); }
}

/* === motion / focus === */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
:focus-visible { outline: 2px solid #f5c945; outline-offset: 2px; }
