/* =========================================================
   HandsBook.it — Shared stylesheet
   Palette: brown earth #8b5a2b on warm light grey #f4f4f4
   ========================================================= */

:root {
  /* Colors */
  --brown: #8b5a2b;
  --brown-dark: #5c3a1a;
  --brown-light: #b98862;
  --gold: #c6a052;
  --cream: #f4ede0;
  --bg: #f4f4f4;
  --ink: #211c16;
  --muted: #6e645a;
  --line: #d9d2c7;
  --card: #ffffff;

  /* Type */
  --serif: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Layout */
  --max: 1240px;
  --radius: 6px;
  --shadow: 0 4px 18px rgba(33, 28, 22, 0.08);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Accessibility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  z-index: 999;
  background: var(--brown-dark);
  color: var(--cream);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  letter-spacing: 0.04em;
  border: none;
}
.skip-link:focus {
  left: 12px;
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
a:focus-visible,
button:focus-visible,
area:focus-visible,
summary:focus-visible,
textarea:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}
[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: var(--brown);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}
a:hover {
  color: var(--brown-dark);
  border-bottom-color: var(--brown-dark);
}

/* ---------- Header ---------- */
.site-header {
  background: var(--brown-dark);
  color: var(--cream);
  border-bottom: 3px solid var(--gold);
}
.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 28px 18px;
  position: relative;
  display: grid;
  align-items: center;
  justify-items: center;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--cream);
  border: none;
}
.brand__logo {
  width: 44px;
  height: 44px;
  color: var(--gold);
  flex-shrink: 0;
}
.brand__name {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.brand__name em {
  color: var(--gold);
  font-style: italic;
  font-weight: 500;
}
.site-nav {
  display: flex;
  gap: 14px 26px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.site-nav a {
  color: var(--cream);
  border: none;
  opacity: 0.85;
}
.site-nav a:hover {
  color: var(--gold);
  opacity: 1;
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 64px 28px 32px;
  text-align: center;
}
.hero__eyebrow {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brown);
  margin-bottom: 14px;
}
.hero__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(36px, 5.2vw, 64px);
  line-height: 1.05;
  margin: 0 0 18px;
  color: var(--ink);
}
.hero__title em {
  color: var(--brown);
  font-style: italic;
}
.hero__lede {
  max-width: 640px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 17px;
}

/* ---------- Ranking block (image map) ---------- */
.ranking {
  max-width: var(--max);
  margin: 24px auto 48px;
  padding: 0 28px;
}
.ranking__frame {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.ranking__frame img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}
.ranking__hint {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.04em;
}
.ranking__hint strong {
  color: var(--brown-dark);
}
.ranking__title {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 500;
  color: var(--ink);
  text-align: center;
}

/* ---------- Ranking dynamic table ---------- */
.ranking__table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 18px 18px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--brown-dark);
  overflow-x: auto;
}
.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Cormorant Garamond", "Georgia", serif;
  color: var(--brown-dark);
}
.ranking-table__caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ranking-table thead th {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brown);
  padding: 16px 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.ranking-table__th--rank {
  width: 52px;
}
.ranking-table__th--age {
  width: 64px;
}
.ranking-table__th--nat {
  min-width: 140px;
  white-space: nowrap;
}
.ranking-table__th--joined {
  min-width: 110px;
  white-space: nowrap;
}
.ranking-table__th--score {
  width: 90px;
  text-align: right;
}
.ranking-table tbody tr {
  transition: background-color 0.18s ease;
  cursor: pointer;
}
.ranking-table tbody tr:nth-child(even) {
  background: rgba(198, 160, 82, 0.08); /* gold tint */
}
.ranking-table tbody tr:hover {
  background: rgba(198, 160, 82, 0.18);
}
.ranking-table tbody td {
  padding: 18px 14px;
  font-size: 20px;
  line-height: 1.3;
  border: none;
}
.ranking-table tbody td:first-child {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ranking-table tbody tr:first-child {
  background: rgba(198, 160, 82, 0.22); /* leader row */
}
.ranking-table tbody tr:first-child td {
  font-weight: 600;
}
.ranking-row__name a {
  color: var(--brown-dark);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s ease;
}
.ranking-row__name a:hover,
.ranking-table tbody tr:hover .ranking-row__name a {
  border-bottom-color: var(--brown-dark);
}
.ranking-row__score {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.ranking-row__age {
  font-variant-numeric: tabular-nums;
}
.ranking-row__nat,
.ranking-row__joined {
  font-size: 16px;
  color: var(--brown);
  white-space: nowrap;
}
/* Badge Editorial demo */
.ranking-row__demo-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brown);
  background: transparent;
  border: 1px solid var(--brown);
  border-radius: 3px;
  vertical-align: middle;
  white-space: nowrap;
}
.ranking-table__loading td,
.ranking-table__empty td,
.ranking-table__error td {
  padding: 40px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  font-family: "Inter", system-ui, sans-serif;
  letter-spacing: 0.02em;
}
.ranking-table__error td {
  color: #a23a2a;
}

/* Mobile tweaks for ranking table */
@media (max-width: 640px) {
  .ranking__table-wrap {
    padding: 6px 10px 14px;
  }
  .ranking-table {
    min-width: 0;
  }
  .ranking-table thead th {
    font-size: 10px;
    padding: 12px 4px 10px;
    letter-spacing: 0.03em;
  }
  .ranking-table tbody td {
    padding: 12px 4px;
    font-size: 16px;
  }
  .ranking-table__th--rank {
    width: 34px;
  }
  .ranking-table__th--nat,
  .ranking-row__nat {
    display: none;
  }
  .ranking-table__th--joined {
    min-width: 0;
    width: 64px;
  }
  .ranking-table__th--score {
    width: 44px;
  }
  .ranking-row__demo-badge {
    font-size: 9px;
    padding: 1px 5px;
    margin-left: 5px;
    letter-spacing: 0.04em;
  }
  /* Hide profession on very small screens to preserve score column */
  .ranking-table__th--age,
  .ranking-row__age {
    display: none;
  }
}

/* ---------- Detail page ---------- */
.detail {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px 28px 24px;
}
.detail__breadcrumb {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.detail__title {
  font-family: var(--serif);
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 500;
  margin: 0 0 8px;
}
.detail__meta {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 32px;
}
.detail__infographic {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 48px;
}

/* Clean editorial hand photo used on the 12 profile pages */
.detail__photo {
  margin: 0 0 48px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.detail__photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: calc(var(--radius) - 6px);
}
.detail__photo figcaption {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  font-style: italic;
  text-align: center;
  padding: 0 8px;
}

/* Symbolic disclaimer at the bottom of each profile */
.detail__disclaimer {
  margin-top: 8px;
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brown);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  font-style: italic;
}

.bio {
  max-width: 720px;
  margin: 0 auto 56px;
  padding: 32px 40px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
}
.bio__title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--brown-dark);
  margin: 0 0 14px;
  letter-spacing: 0.01em;
}
.bio__text {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0;
}
@media (max-width: 640px) {
  .bio {
    padding: 24px 22px;
  }
  .bio__text {
    font-size: 17px;
  }
}

.analysis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 56px;
}
.analysis__card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--brown);
  border-radius: var(--radius);
  padding: 24px 22px;
}
.analysis__card[data-line="heart"] {
  border-top-color: #b4424e;
}
.analysis__card[data-line="head"] {
  border-top-color: #3c5aa0;
}
.analysis__card[data-line="life"] {
  border-top-color: var(--brown);
}
.analysis__label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.analysis__title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--ink);
}
.analysis__text {
  color: #3a322a;
  font-size: 15px;
  line-height: 1.65;
  margin: 0;
}

/* Dual reading columns (self + reading) */
.analysis__dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 4px;
}
.analysis__col {
  padding: 14px 16px;
  border-radius: calc(var(--radius) - 4px);
  background: var(--parchment, #f8f4ee);
}
.analysis__col--self {
  background: rgba(200,188,170,0.18);
  border-left: 2px solid rgba(120,100,80,0.25);
}
.analysis__col--reading {
  background: rgba(60,90,160,0.06);
  border-left: 2px solid rgba(60,90,160,0.25);
}
.analysis__card[data-line="heart"] .analysis__col--reading {
  background: rgba(180,66,78,0.06);
  border-left-color: rgba(180,66,78,0.25);
}
.analysis__card[data-line="life"] .analysis__col--reading {
  background: rgba(142,107,58,0.06);
  border-left-color: rgba(142,107,58,0.25);
}
.analysis__col--full {
  grid-column: 1 / -1;
}
.analysis__col-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
  font-family: var(--sans);
}
.analysis__col-text {
  font-size: 15px;
  line-height: 1.65;
  color: #3a322a;
}
.analysis__col-text p {
  margin: 0 0 0.7em;
}
.analysis__col-text p:last-child {
  margin-bottom: 0;
}
@media (max-width: 600px) {
  .analysis__dual {
    grid-template-columns: 1fr;
  }
  .analysis__col--full {
    grid-column: auto;
  }
}

/* ---------- Back link ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brown-dark);
  border: none;
  margin-bottom: 32px;
}
.back-link:hover {
  color: var(--brown);
  border: none;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--brown-dark);
  color: var(--cream);
  padding: 40px 28px 28px;
  margin-top: 40px;
}
.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
}
.site-footer h4 {
  font-family: var(--serif);
  color: var(--gold);
  font-size: 16px;
  margin: 0 0 12px;
  letter-spacing: 0.02em;
}
.site-footer p,
.site-footer a {
  color: rgba(244, 237, 224, 0.78);
  font-size: 14px;
  border: none;
}
.site-footer a:hover {
  color: var(--gold);
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.site-footer__legal {
  max-width: var(--max);
  margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(244, 237, 224, 0.18);
  font-size: 12px;
  color: rgba(244, 237, 224, 0.6);
  display: flex;
  justify-content: space-between;
  letter-spacing: 0.04em;
}

/* ---------- About / Method / FAQ sections ---------- */
.content-section {
  max-width: var(--max);
  margin: 56px auto 0;
  padding: 0 28px;
}
.content-section__inner {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 44px;
  box-shadow: var(--shadow);
}
.content-section__eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brown);
  margin: 0 0 10px;
}
.content-section__title {
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 500;
  margin: 0 0 18px;
  color: var(--ink);
  line-height: 1.15;
}
.content-section__title em {
  color: var(--brown);
  font-style: italic;
}
.content-section__lede {
  font-size: 17px;
  color: #3a322a;
  max-width: 72ch;
  margin: 0 0 20px;
}
.content-section p {
  color: #3a322a;
  margin: 0 0 14px;
  max-width: 72ch;
}
.content-section p:last-child {
  margin-bottom: 0;
}

/* Method — three lines grid */
.method-lines {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}
.method-line {
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brown);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.method-line[data-line="head"]  { border-left-color: #3c5aa0; }
.method-line[data-line="heart"] { border-left-color: #b4424e; }
.method-line[data-line="life"]  { border-left-color: var(--brown); }
.method-line h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--ink);
}
.method-line p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  max-width: none;
}
.method-disclaimer {
  margin-top: 24px;
  padding: 14px 18px;
  background: var(--cream);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  font-size: 14px;
  color: var(--brown-dark);
  font-style: italic;
}

/* FAQ */
.faq-list {
  margin-top: 20px;
  display: grid;
  gap: 10px;
}
.faq-list details {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  transition: border-color 0.2s ease;
}
.faq-list details[open] {
  border-color: var(--brown-light);
}
.faq-list summary {
  cursor: pointer;
  padding: 16px 20px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  list-style: none;
  position: relative;
  padding-right: 48px;
}
.faq-list summary::-webkit-details-marker {
  display: none;
}
.faq-list summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brown);
  font-size: 22px;
  font-family: var(--sans);
  font-weight: 300;
  transition: transform 0.2s ease;
}
.faq-list details[open] summary::after {
  content: "–";
}
.faq-list details > p,
.faq-list details > div {
  padding: 0 20px 18px;
  color: #3a322a;
  font-size: 15px;
  line-height: 1.65;
  margin: 0;
  max-width: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .site-header__inner {
    gap: 12px;
    padding: 16px 20px 18px;
    text-align: center;
  }
  .site-nav {
    gap: 12px 16px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
    font-size: 12px;
    letter-spacing: 0.06em;
  }
  .analysis {
    grid-template-columns: 1fr;
  }
  .method-lines {
    grid-template-columns: 1fr;
  }
  .content-section__inner {
    padding: 28px 22px;
  }
  .site-footer__inner {
    grid-template-columns: 1fr;
  }
  .site-footer__legal {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

@media (max-width: 520px) {
  .hero {
    padding: 40px 20px 20px;
  }
  .ranking,
  .detail {
    padding-left: 16px;
    padding-right: 16px;
  }
  .detail__infographic,
  .ranking__frame {
    padding: 10px;
  }
}

/* ---------- Site nav CTA (Join us) ---------- */
.site-nav__cta {
  color: var(--brown-dark) !important;
  background: var(--gold);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.08em;
  opacity: 1 !important;
}
.site-nav__cta:hover {
  background: #d9b368;
  color: var(--brown-dark) !important;
}

/* ---------- Language switcher ---------- */
.lang-switcher {
  position: absolute;
  right: 28px;
  bottom: 18px;
  display: flex;
  gap: 4px;
  align-items: center;
  font-size: 12px;
  letter-spacing: 0.06em;
  flex-wrap: wrap;
  justify-content: center;
}
.lang-switcher a {
  color: var(--cream);
  opacity: 0.55;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 3px;
  text-decoration: none;
  font-family: var(--sans);
  font-weight: 500;
  transition: opacity 0.2s, border-color 0.2s;
}
.lang-switcher a:hover {
  opacity: 1;
  border-color: var(--gold);
  color: var(--gold);
}
.lang-switcher a.is-active {
  opacity: 1;
  color: var(--gold);
  border-color: var(--gold);
}
@media (max-width: 1100px) {
  .lang-switcher {
    position: static;
  }
}

/* ---------- Hero promise + CTA ---------- */
.hero__promise {
  max-width: 640px;
  margin: 22px auto 20px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--brown-dark);
  letter-spacing: 0.01em;
}
.hero__cta {
  display: inline-block;
  margin-top: 6px;
  padding: 14px 30px;
  background: var(--brown-dark);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 2px solid var(--brown-dark);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.hero__cta:hover {
  background: var(--gold);
  color: var(--brown-dark);
  border-color: var(--gold);
  transform: translateY(-1px);
}

/* ---------- CTA box (after ranking) ---------- */
.cta-box {
  max-width: 720px;
  margin: 48px auto 0;
  padding: 36px 40px;
  background: linear-gradient(180deg, #fbf4e4 0%, #f4ede0 100%);
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow);
}
.cta-box__eyebrow {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brown);
  margin: 0 0 10px;
  font-weight: 600;
}
.cta-box__title {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  margin: 0 0 16px;
  color: var(--ink);
  line-height: 1.15;
}
.cta-box__title em {
  color: var(--brown);
  font-style: italic;
}
.cta-box__text {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 24px;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}
.cta-box__text strong {
  color: var(--brown-dark);
  font-weight: 600;
}
.cta-box__button {
  display: inline-block;
  padding: 14px 32px;
  background: var(--brown-dark);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 2px solid var(--brown-dark);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.cta-box__button:hover {
  background: var(--gold);
  color: var(--brown-dark);
  border-color: var(--gold);
  transform: translateY(-1px);
}
@media (max-width: 640px) {
  .cta-box { padding: 28px 22px; }
  .cta-box__title { font-size: 24px; }
  .cta-box__text { font-size: 16px; }
}

/* ---------- Participate page ---------- */
.participate {
  max-width: 780px;
  margin: 0 auto;
  padding: 56px 28px 64px;
}
.participate__eyebrow {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brown);
  margin-bottom: 14px;
  text-align: center;
}
.participate__title {
  font-family: var(--serif);
  font-size: clamp(34px, 4.8vw, 54px);
  font-weight: 500;
  text-align: center;
  color: var(--ink);
  line-height: 1.1;
  margin: 0 0 18px;
}
.participate__title em {
  color: var(--brown);
  font-style: italic;
}
.participate__lede {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.65;
  color: var(--muted);
  text-align: center;
  max-width: 620px;
  margin: 0 auto 40px;
}
.participate__promise {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 0 0 48px;
}
.participate__promise-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
}
.participate__promise-card h3 {
  font-family: var(--serif);
  font-size: 19px;
  margin: 0 0 8px;
  color: var(--brown-dark);
}
.participate__promise-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}
.participate__steps {
  counter-reset: step;
  margin: 0 0 48px;
  padding: 0;
  list-style: none;
}
.participate__steps li {
  counter-increment: step;
  position: relative;
  padding: 20px 24px 20px 72px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.participate__steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 22px;
  top: 20px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  color: var(--gold);
}
.participate__steps h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  margin: 0 0 4px;
  color: var(--ink);
}
.participate__steps p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}
.participate__cta {
  text-align: center;
  padding: 36px 24px;
  background: linear-gradient(180deg, #fbf4e4 0%, #f4ede0 100%);
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius);
  margin-bottom: 40px;
}
.participate__cta h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  margin: 0 0 12px;
  color: var(--ink);
}
.participate__cta h2 em {
  color: var(--brown);
  font-style: italic;
}
.participate__cta p {
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 22px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
.participate__cta a {
  display: inline-block;
  padding: 14px 32px;
  background: var(--brown-dark);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 2px solid var(--brown-dark);
  transition: background 0.2s, color 0.2s;
}
.participate__cta a:hover {
  background: var(--gold);
  color: var(--brown-dark);
  border-color: var(--gold);
}
.participate__note {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  font-style: italic;
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.6;
}
@media (max-width: 640px) {
  .participate__promise { grid-template-columns: 1fr; }
  .participate__steps li { padding-left: 62px; }
}


/* =========================================================
   FORM DI PARTECIPAZIONE — integrato nel sito live
   ========================================================= */
.form-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.form-wrap h1 {
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 500;
  line-height: 1.1;
  margin: 0 0 12px;
  color: var(--ink);
}
.form-wrap h1 em { color: var(--brown); font-style: italic; }
.form-wrap > p.form-lede {
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 620px;
  margin: 0 0 40px;
}
.form-section {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 30px;
  margin-bottom: 26px;
  position: relative;
}
.form-section__number {
  position: absolute;
  top: -14px;
  left: 24px;
  background: var(--brown-dark);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  padding: 4px 14px;
  border-radius: 999px;
  text-transform: uppercase;
}
.form-section h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  margin: 6px 0 6px;
  color: var(--ink);
}
.form-section > p.section-hint {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.6;
  font-style: italic;
}
.field { margin-bottom: 22px; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 22px;
}
.field label {
  display: block;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--brown-dark);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.field label .req { color: #b85a3a; margin-left: 3px; }
.field label .opt {
  font-weight: 400;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  margin-left: 6px;
  font-style: italic;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(198,160,82,0.2);
}
.field textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.55;
}
.field .counter {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  margin-top: 4px;
  font-family: var(--sans);
}
.field .helper {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}
.photo-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  background: #fdfaf1;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.photo-upload:hover {
  border-color: var(--gold);
  background: #fbf5e4;
}
.photo-upload svg {
  width: 56px;
  height: 56px;
  color: var(--brown);
  margin-bottom: 14px;
}
.photo-upload__title {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink);
  margin: 0 0 6px;
}
.photo-upload__hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}
.photo-upload input { display: none; }

/* Preview after file selection */
.photo-preview {
  display: none;
  margin-top: 24px;
  padding: 18px;
  background: var(--cream);
  border: 1px solid var(--gold);
  border-radius: 4px;
  align-items: center;
  gap: 18px;
}
.photo-preview.is-active { display: flex; }
.photo-preview__thumb {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  border-radius: 4px;
  object-fit: cover;
  background: #fff;
  border: 1px solid rgba(139, 90, 43, 0.25);
}
.photo-preview__info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.photo-preview__ok {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brown);
}
.photo-preview__name {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--brown-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-preview__meta {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}
.photo-preview__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
}
.photo-preview__btn {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border: 1px solid var(--brown);
  background: #fff;
  color: var(--brown);
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.photo-preview__btn:hover {
  background: var(--brown);
  color: #fff;
}
.photo-preview__btn--remove {
  border-color: rgba(139, 90, 43, 0.4);
  color: var(--muted);
}
.photo-preview__btn--remove:hover {
  background: #7a2a1a;
  border-color: #7a2a1a;
  color: #fff;
}
.photo-upload.is-hidden { display: none; }
.photo-error {
  display: none;
  margin-top: 12px;
  padding: 10px 14px;
  background: #fcebe6;
  border-left: 3px solid #a04020;
  color: #7a2a1a;
  font-family: var(--sans);
  font-size: 13px;
  border-radius: 2px;
}
.photo-error.is-active { display: block; }

@media (max-width: 640px) {
  .photo-preview { flex-direction: column; text-align: center; }
  .photo-preview__actions { flex-direction: row; justify-content: center; }
}

/* ---------- Submit status + success ---------- */
.submit-status {
  display: none;
  margin-top: 14px;
  padding: 14px 18px;
  font-family: var(--sans);
  font-size: 14px;
  border-radius: 2px;
  border-left: 3px solid var(--gold);
  background: #fbf6ec;
  color: var(--brown-dark);
}
.submit-status.is-active { display: block; }
.submit-status.is-loading { background: #fbf6ec; border-left-color: var(--gold); }
.submit-status.is-warning {
  background: #fff3d3;
  border-left-color: #c58b22;
  color: #5a3907;
}
.submit-status.is-error {
  background: #fcebe6;
  border-left-color: #a04020;
  color: #5a1a0a;
}

.submit-success {
  display: none;
  max-width: 720px;
  margin: 80px auto 120px;
  padding: 60px 48px;
  background: var(--cream);
  border: 1px solid var(--gold);
  text-align: center;
  border-radius: 2px;
}
.submit-success.is-active { display: block; }
.submit-success__title {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--brown-dark);
  margin: 0 0 20px;
}
.submit-success__body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--brown);
  margin: 0;
}
@media (max-width: 640px) {
  .submit-success { padding: 40px 24px; margin: 40px auto 80px; }
  .submit-success__title { font-size: 24px; }
}

.photo-guidelines {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
  padding-left: 0;
}
.photo-guidelines li {
  list-style: none;
  padding: 10px 12px;
  background: #faf5e8;
  border-radius: 6px;
  line-height: 1.4;
}
.photo-guidelines li strong {
  display: block;
  color: var(--brown);
  margin-bottom: 3px;
  font-family: var(--sans);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.privacy-grid { display: grid; gap: 10px; }
.privacy-check {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: #fdfaf1;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.privacy-check:hover {
  background: #faf3e0;
  border-color: var(--gold);
}
.privacy-check input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--brown);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
}
.privacy-check input[type="checkbox"]:checked {
  background: var(--brown-dark);
  border-color: var(--brown-dark);
}
.privacy-check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid var(--cream);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.privacy-check__label {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
}
.privacy-check__label strong {
  display: block;
  color: var(--brown-dark);
  font-weight: 600;
  margin-bottom: 2px;
}
.privacy-check__label span {
  color: var(--muted);
  font-size: 13px;
}
.consent-block {
  background: linear-gradient(180deg, #fbf4e4 0%, #f4ede0 100%);
  border: 1px solid var(--gold);
  border-top: 4px solid var(--brown-dark);
  border-radius: var(--radius);
  padding: 30px;
  margin-top: 30px;
}
.consent-block h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 10px;
  color: var(--brown-dark);
}
.consent-block > p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 20px;
}
.consent-block a { color: var(--brown); text-decoration: underline; }
.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(140,90,43,0.15);
}
.consent-check:first-of-type { border-top: none; }
.consent-check label {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.55;
  cursor: pointer;
}
.consent-check input[type="checkbox"] {
  appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--brown-dark);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  position: relative;
}
.consent-check input[type="checkbox"]:checked {
  background: var(--brown-dark);
  border-color: var(--brown-dark);
}
.consent-check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid var(--cream);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.signature-row {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(140,90,43,0.15);
}
.signature-row label {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--brown-dark);
  margin-bottom: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.signature-row input {
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  font-style: italic;
  padding: 12px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
  color: var(--brown-dark);
}
.signature-row .signature-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  font-family: var(--sans);
  font-style: italic;
}
.submit-row { text-align: center; padding: 32px 0; }
.btn-submit {
  display: inline-block;
  padding: 16px 42px;
  background: var(--brown-dark);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 2px solid var(--brown-dark);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-submit:hover {
  background: var(--gold);
  color: var(--brown-dark);
  border-color: var(--gold);
}
.submit-row .submit-note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 14px;
  font-style: italic;
}

/* Privacy Policy document */
.doc-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.doc-wrap h1 {
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 500;
  line-height: 1.1;
  margin: 0 0 10px;
  color: var(--ink);
}
.doc-wrap h1 em { color: var(--brown); font-style: italic; }
.doc-wrap .doc-meta {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 40px;
}
.doc-wrap h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  margin: 36px 0 10px;
  color: var(--brown-dark);
}
.doc-wrap h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  margin: 22px 0 6px;
  color: var(--ink);
}
.doc-wrap p,
.doc-wrap li {
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
}
.doc-wrap ul {
  padding-left: 20px;
  margin: 10px 0 18px;
}
.doc-wrap li { margin-bottom: 6px; }
.doc-callout {
  background: #fbf4e4;
  border-left: 4px solid var(--gold);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 4px;
  font-size: 14px;
}
.doc-callout strong { color: var(--brown-dark); }

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
  .photo-guidelines { grid-template-columns: 1fr; }
  .form-wrap h1 { font-size: 34px; }
  .form-section { padding: 28px 20px; }
}

/* =========================================================
   Dynamic profile page (profile.html?slug=...)
   ========================================================= */
.profile-state {
  max-width: 640px;
  margin: 4rem auto;
  padding: 2rem 1.25rem;
  text-align: center;
}
.profile-state__msg {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  color: var(--brown-dark, #5c3a1a);
  margin: 0 0 1.5rem;
  line-height: 1.4;
}
.profile-state--notfound .profile-state__msg {
  color: var(--brown, #8b5a2b);
}
.profile-state--error .profile-state__msg {
  color: #a23a2a;
}
.profile-state--notfound .back-link,
.profile-state--error .back-link {
  display: inline-block;
  margin-top: 0.5rem;
}

/* Editor reading (submission reali senza head/heart/life) */
.editor-reading {
  margin: 3rem 0 2rem;
  padding: 2rem 2.25rem;
  background: var(--cream, #f4ede0);
  border-left: 3px solid var(--gold, #c6a052);
  border-radius: 2px;
}
.editor-reading .analysis__label {
  margin: 0 0 1rem;
}
.editor-reading__body {
  max-width: 62ch;
  margin: 0 auto;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.15rem;
  line-height: 1.75;
  color: var(--brown-dark, #5c3a1a);
}
.editor-reading__body p {
  margin: 0 0 1.1em;
  white-space: pre-line;
}
.editor-reading__body p:last-child { margin-bottom: 0; }

/* Container for dynamic content  */
.profile-content { display: block; }
.profile-content[hidden] { display: none; }
.profile-state[hidden] { display: none; }

/* Force hidden attribute to win over layout display rules on dynamic page */
.detail [hidden] { display: none !important; }

@media (max-width: 640px) {
  .editor-reading {
    padding: 1.5rem 1.25rem;
    margin: 2rem 0 1.5rem;
  }
  .editor-reading__body {
    font-size: 1.05rem;
  }
}

/* =====================================================
   Vote box
   ===================================================== */
.vote-box {
  margin: 3rem auto 2rem;
  max-width: 740px;
  padding: 2rem 2.25rem;
  border: 1px solid rgba(92, 58, 26, 0.22);
  border-radius: 14px;
  background: #fdfaf4;
  display: flex;
  justify-content: center;
}
.vote-box__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  width: 100%;
}
.vote-box__count {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.vote-box__number {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 3rem;
  font-weight: 500;
  color: #5c3a1a;
  line-height: 1;
}
.vote-box__label {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7a5a3a;
  margin-top: 0.35rem;
}
.vote-box__button {
  background: #5c3a1a;
  color: #fdfaf4;
  border: none;
  border-radius: 999px;
  padding: 0.85rem 2rem;
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, opacity 0.2s;
}
.vote-box__button:hover:not(:disabled) {
  background: #3f2510;
  transform: translateY(-1px);
}
.vote-box__button:disabled {
  cursor: default;
  opacity: 0.85;
}
.vote-box__button.is-loading {
  opacity: 0.6;
}
.vote-box__button.is-voted {
  background: #7a5a3a;
}
.vote-box__hint {
  font-size: 0.78rem;
  color: #8a6a4a;
  font-style: normal;
  margin: 0;
}
@media (min-width: 640px) {
  .vote-box__inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }
  .vote-box__count {
    align-items: flex-start;
  }
  .vote-box__hint {
    order: 3;
    width: 100%;
    text-align: center;
    margin-top: 0.75rem;
  }
}


/* ---------- Updated HandsBook participation flow ---------- */
.method-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 30px;
  align-items: stretch;
}
.method-flow__step {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 18px 18px;
  min-height: 172px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 10px 28px rgba(92, 58, 26, 0.06);
}
.method-flow__step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--brown-dark);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  flex: 0 0 auto;
}
.method-flow__step strong {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--brown-dark);
  margin-top: 2px;
}
.method-flow__step p {
  margin: 0;
  max-width: none;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}
.content-section__inner--wide {
  max-width: 1180px;
}
.content-section--philosophy {
  background: #ede7dc;
  border-block: 1px solid rgba(92, 58, 26, 0.16);
}
.source-note {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  margin-top: 22px;
}
.founding-studies {
  padding-top: 56px;
}
.study-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}
.study-source-note {
  max-width: 68ch;
  margin: 12px 0 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.55;
  font-style: italic;
}
.study-card {
  position: relative;
  padding: 24px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(33, 28, 22, 0.05);
  overflow: hidden;
}
.study-card::before {
  content: "";
  display: block;
  width: 100%;
  height: clamp(188px, 20vw, 252px);
  margin: 8px 0 20px;
  border: 1px solid rgba(139, 90, 43, 0.18);
  border-radius: 12px;
  background-color: #f1e9df;
  background-image: url("img/palms/study-palm-01.jpg");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
  filter: saturate(0.96) contrast(1.02);
}
.study-card:nth-child(1)::before {
  background-image: url("img/palms/study-palm-01.jpg");
}
.study-card:nth-child(2)::before {
  background-image: url("img/palms/study-palm-02.jpg");
}
.study-card:nth-child(3)::before {
  background-image: url("img/palms/study-palm-03.jpg");
}
.study-card:nth-child(4)::before {
  background-image: url("img/palms/study-palm-04.jpg");
}
.study-card:nth-child(5)::before {
  background-image: url("img/palms/study-palm-05.jpg");
}

.study-card:nth-child(6)::before {
  background-image: url("img/palms/study-palm-06.jpg");
}
.study-card__rank {
  font-family: var(--serif);
  font-size: 32px;
  color: rgba(92, 58, 26, 0.22);
  position: absolute;
  right: 20px;
  top: 14px;
}
.study-card__badge {
  display: inline-block;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brown);
  border: 1px solid rgba(139, 90, 43, 0.28);
  border-radius: 999px;
  padding: 4px 9px;
  margin-bottom: 14px;
}
.study-card__badge--demo {
  color: #5f1d12;
  background: #f6dfd5;
  border-color: rgba(132, 45, 24, 0.5);
  font-weight: 700;
}
.study-card h3 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  margin: 0 0 2px;
  color: var(--ink);
}
.study-card__meta {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}
.study-card p {
  color: var(--ink);
  margin: 0 0 16px;
}
.study-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}
.study-card dl div {
  border-top: 1px solid rgba(92, 58, 26, 0.12);
  padding-top: 10px;
}
.study-card dt {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brown);
}
.study-card dd {
  margin: 3px 0 0;
  color: var(--muted);
  line-height: 1.55;
}
.ai-reading-section {
  border-top: 4px solid var(--gold);
}
.ai-reading-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #fbf4e4;
  border: 1px solid rgba(198, 160, 82, 0.55);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 20px;
}
.ai-reading-callout strong,
.ai-reading-callout span {
  display: block;
}
.ai-reading-callout strong {
  color: var(--brown-dark);
  margin-bottom: 2px;
}
.ai-reading-callout span {
  color: var(--muted);
  font-size: 14px;
}
.btn-generate-reading {
  flex: 0 0 auto;
  padding: 13px 22px;
  border-radius: 999px;
  border: 2px solid var(--brown-dark);
  background: var(--brown-dark);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn-generate-reading:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--brown-dark);
}
.btn-generate-reading:disabled {
  opacity: 0.65;
  cursor: wait;
}
.ai-reading-status {
  display: none;
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 13px;
  background: #fdfaf1;
  color: var(--brown-dark);
  border: 1px solid var(--line);
}
.ai-reading-status.is-active { display: block; }
.ai-reading-status.is-error {
  background: #fcebe6;
  color: #6f2112;
  border-color: rgba(160, 64, 32, 0.35);
}
.ai-reading-status.is-success {
  background: #eef6ea;
  color: #315d20;
  border-color: rgba(67, 122, 34, 0.35);
}
.ai-reading-status.is-demo {
  background: #fff8df;
  color: #6e4e12;
  border-color: rgba(198, 160, 82, 0.5);
}
.ai-draft-field textarea.is-ai-filled {
  background: #fffdf8;
  border-color: rgba(198, 160, 82, 0.85);
  box-shadow: inset 0 0 0 1px rgba(198, 160, 82, 0.16);
}
@media (max-width: 820px) {
  .study-grid,
  .method-flow {
    grid-template-columns: 1fr;
  }
  .study-card::before {
    height: clamp(158px, 48vw, 210px);
  }
  .method-flow__step {
    min-height: 0;
    padding: 18px;
  }
  .ai-reading-callout {
    align-items: stretch;
    flex-direction: column;
  }
  .btn-generate-reading {
    width: 100%;
  }
}


/* ---------- HandsBook World hero mark ---------- */
.hero--world {
  position: relative;
  overflow: hidden;
  max-width: none;
  padding: 88px 28px 64px;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(46, 28, 16, 0.64) 0%, rgba(46, 28, 16, 0.36) 48%, rgba(246, 240, 230, 0.62) 84%, rgba(246, 240, 230, 0.96) 100%),
    url("img/brand/handsbook-world-earth-bg.jpg") center top / cover no-repeat;
}
.hero--world::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 18%, rgba(210, 163, 84, 0.24) 0 14%, transparent 42%),
    radial-gradient(ellipse at 50% 54%, rgba(36, 22, 12, 0.34) 0 31%, transparent 58%),
    linear-gradient(180deg, rgba(46, 28, 16, 0.12) 0%, rgba(246, 240, 230, 0.42) 78%);
  pointer-events: none;
}
.hero--world > * {
  position: relative;
  z-index: 1;
}
.hero__qr {
  width: clamp(78px, 8vw, 112px);
  margin: 0 auto 22px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(255, 250, 239, 0.9);
  border: 1px solid rgba(226, 183, 102, 0.7);
  box-shadow: 0 18px 42px rgba(34, 21, 12, 0.28);
}
.hero__qr img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 8px;
}
.hero__qr figcaption {
  margin: 6px 0 0;
  color: var(--brown-dark);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero__world-mark {
  margin: 0 auto 24px;
  width: clamp(132px, 17vw, 228px);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 7px;
  background: rgba(58, 35, 19, 0.48);
  border: 1px solid rgba(218, 178, 101, 0.62);
  box-shadow: 0 22px 60px rgba(34, 21, 12, 0.32);
}
.hero__world-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.hero__claim {
  max-width: 980px;
  margin: 0 auto 24px;
  font-family: var(--serif);
  font-size: clamp(30px, 4.7vw, 62px);
  font-weight: 500;
  line-height: 1.02;
  color: var(--cream);
  text-wrap: balance;
  text-shadow: 0 3px 30px rgba(0, 0, 0, 0.5);
}
.hero--world .hero__eyebrow {
  color: #e3c17b;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.36);
}
.hero--world .hero__title {
  color: var(--cream);
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.38);
}
.hero--world .hero__title em {
  color: #e2b766;
}
.hero--world .hero__lede {
  color: rgba(255, 250, 239, 0.96);
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.28);
}
.hero--world .hero__promise {
  color: #ffe1a2;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.48);
}
.hero--world .hero__cta {
  background: #e0b760;
  color: var(--brown-dark);
  border-color: #e0b760;
  box-shadow: 0 16px 36px rgba(34, 21, 12, 0.22);
}
.hero--world .hero__cta:hover {
  background: var(--cream);
  border-color: var(--cream);
}

@media (max-width: 760px) {
  .hero--world {
    padding: 58px 20px 50px;
    background-position: center top;
  }
  .hero__world-mark {
    width: clamp(118px, 38vw, 168px);
    margin-bottom: 18px;
  }
  .hero__qr {
    width: 82px;
    margin-bottom: 18px;
    padding: 7px;
    border-radius: 14px;
  }
  .hero__qr figcaption {
    font-size: 8px;
    letter-spacing: 0.06em;
  }
  .hero--world .hero__title {
    font-size: clamp(34px, 10vw, 48px);
  }
  .hero__claim {
    font-size: clamp(31px, 9.2vw, 45px);
    margin-bottom: 20px;
  }
}

/* ---------- Header image logo ---------- */
.brand__image {
  display: block;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(218, 178, 101, 0.72);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}
.brand__name--sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 860px) {
  .brand__image {
    width: 76px;
    height: 76px;
  }
}


/* =====================================================
   v18 — Ranking cards grid (replaces table)
   Visual style mirrors the legacy founding studies cards
   to keep continuity with the existing brand palette.
   ===================================================== */
.ranking__cards-wrap {
  margin-top: 1.5rem;
}

.ranking-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .ranking-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
}
@media (min-width: 1080px) {
  .ranking-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.ranking-status {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
  color: #7a5a3a;
  font-style: italic;
}
.ranking-status--error { color: #b04646; }

.ranking-noscript {
  text-align: center;
  padding: 1rem;
  color: #7a5a3a;
}

.ranking-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #f7efe2;
  border: 1px solid #e2d2b9;
  border-radius: 14px;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  outline: none;
}
.ranking-card.is-clickable { cursor: pointer; }
.ranking-card.is-clickable:hover,
.ranking-card.is-clickable:focus-visible {
  transform: translateY(-2px);
  border-color: #c9a982;
  box-shadow: 0 8px 24px rgba(92, 58, 26, 0.12);
}
.ranking-card.is-clickable:focus-visible {
  outline: 2px solid #5c3a1a;
  outline-offset: 3px;
}

.ranking-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #efe2cd;
  display: flex; align-items: center; justify-content: center;
}
.ranking-card__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ranking-card__photo--placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #efe2cd 0%, #e2d2b9 100%);
}
.ranking-card__photo--placeholder svg {
  width: 38%;
  fill: none;
  stroke: #5c3a1a;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .55;
}

.ranking-card__rank {
  position: absolute;
  top: .5rem;
  right: .85rem;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.4rem;
  color: rgba(92, 58, 26, .55);
  letter-spacing: .04em;
  pointer-events: none;
}

.ranking-card__body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  flex: 1 1 auto;
}

.ranking-card__badge {
  align-self: flex-start;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .35em .75em;
  border-radius: 999px;
  border: 1px solid #d6b58c;
  color: #8a5a2c;
  background: #fdf6ea;
}
.ranking-card__badge--demo {
  background: #fbe6e0;
  border-color: #e9bdaf;
  color: #b04646;
}

.ranking-card__name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 500;
  margin: .1rem 0 0;
  color: #2a1c0d;
  line-height: 1.15;
}
.ranking-card__name a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease;
}
.ranking-card.is-clickable:hover .ranking-card__name a,
.ranking-card.is-clickable:focus-visible .ranking-card__name a {
  border-bottom-color: #5c3a1a;
}

.ranking-card__meta {
  font-size: .92rem;
  color: #6b4f2e;
  margin: 0;
  line-height: 1.4;
}

.ranking-card__excerpt {
  font-size: .92rem;
  color: #4a3722;
  margin: .15rem 0 0;
  line-height: 1.5;
}

.ranking-card__footer {
  margin-top: auto;
  padding-top: .65rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.ranking-card__votes {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .9rem;
  color: #8a5a2c;
  background: #fdf6ea;
  border: 1px solid #e2d2b9;
  border-radius: 999px;
  padding: .25rem .7rem;
  font-variant-numeric: tabular-nums;
}
.ranking-card__votes [aria-hidden="true"] { color: #c8902a; }

@media (prefers-reduced-motion: reduce) {
  .ranking-card,
  .ranking-card.is-clickable:hover,
  .ranking-card.is-clickable:focus-visible {
    transform: none;
    transition: none;
  }
}

/* Hide the old founding-studies styles if any leftover refers to them */
.founding-studies { display: none !important; }


/* =====================================================
   v18.2 — Compact list view (table) with mini thumbnails
   ===================================================== */
.ranking-list-toggle {
  margin-top: 1.5rem;
  border-top: 1px solid #e2d2b9;
  padding-top: 1rem;
}
.ranking-list-toggle > summary {
  cursor: pointer;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.1rem;
  color: #5c3a1a;
  margin-bottom: .75rem;
  list-style: none;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.ranking-list-toggle > summary::-webkit-details-marker { display: none; }
.ranking-list-toggle > summary::before {
  content: "▸";
  display: inline-block;
  transition: transform .15s ease;
  color: #8a5a2c;
}
.ranking-list-toggle[open] > summary::before { transform: rotate(90deg); }

.ranking__table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e2d2b9;
  border-radius: 12px;
  background: #fdf6ea;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
  color: #2a1c0d;
  min-width: 640px;
}
.ranking-table thead th {
  text-align: left;
  font-weight: 600;
  letter-spacing: .12em;
  font-size: .72rem;
  text-transform: uppercase;
  color: #8a5a2c;
  padding: .9rem .85rem;
  border-bottom: 1px solid #e2d2b9;
  background: #fbe9c9;
  background: linear-gradient(180deg, #fbe9c9 0%, #f7e2bc 100%);
}
.ranking-table tbody td {
  padding: .65rem .85rem;
  border-bottom: 1px solid #efe2cd;
  vertical-align: middle;
}
.ranking-table tbody tr:last-child td { border-bottom: none; }
.ranking-table tbody tr.is-clickable { cursor: pointer; transition: background .15s ease; }
.ranking-table tbody tr.is-clickable:hover { background: #fdf0d8; }

.ranking-table__photo-th {
  width: 56px;
  padding-left: .85rem !important;
  padding-right: 0 !important;
}
.ranking-row__photo { width: 56px; padding-right: 0; }

.ranking-table__thumb {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e2d2b9;
  background: #efe2cd;
}
.ranking-table__thumb--placeholder {
  background: linear-gradient(135deg, #efe2cd 0%, #e2d2b9 100%);
  position: relative;
}
.ranking-table__thumb--placeholder::after {
  content: "";
  position: absolute;
  inset: 25%;
  background: #5c3a1a;
  opacity: .35;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M14 27c1.4 8.5 6 13 12 13 6.8 0 10-5.7 10-12.8V12.8a2.8 2.8 0 0 0-5.6 0v10.4'/><path d='M30.4 23V9.8a2.8 2.8 0 0 0-5.6 0V23'/><path d='M24.8 23V11.2a2.8 2.8 0 0 0-5.6 0v13'/><path d='M19.2 25.2v-8.4a2.8 2.8 0 0 0-5.6 0V28'/><path d='M14.2 28.2 10 24a3 3 0 0 0-4.2 4.2l7.4 7.4'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M14 27c1.4 8.5 6 13 12 13 6.8 0 10-5.7 10-12.8V12.8a2.8 2.8 0 0 0-5.6 0v10.4'/><path d='M30.4 23V9.8a2.8 2.8 0 0 0-5.6 0V23'/><path d='M24.8 23V11.2a2.8 2.8 0 0 0-5.6 0v13'/><path d='M19.2 25.2v-8.4a2.8 2.8 0 0 0-5.6 0V28'/><path d='M14.2 28.2 10 24a3 3 0 0 0-4.2 4.2l7.4 7.4'/></svg>") center / contain no-repeat;
}

.ranking-row__rank {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: #8a5a2c;
  width: 48px;
  font-variant-numeric: tabular-nums;
}
.ranking-row__name a { color: #2a1c0d; text-decoration: none; border-bottom: 1px solid transparent; }
.ranking-row__name a:hover, .ranking-row__name a:focus-visible { border-bottom-color: #5c3a1a; }
.ranking-row__age, .ranking-row__votes { font-variant-numeric: tabular-nums; }
.ranking-row__votes { font-weight: 600; color: #8a5a2c; }
.ranking-row__profession, .ranking-row__place, .ranking-row__joined { color: #4a3722; }

.ranking-table__loading,
.ranking-table__empty,
.ranking-table__error {
  text-align: center;
  font-style: italic;
  color: #8a5a2c;
  padding: 1.5rem 1rem !important;
}
.ranking-table__error { color: #b04646; }

@media (max-width: 720px) {
  .ranking-table { font-size: .88rem; }
  .ranking-table thead th, .ranking-table tbody td { padding: .55rem .65rem; }
  .ranking-table__thumb { width: 32px; height: 32px; }
  .ranking-table__photo-th, .ranking-row__photo { width: 44px; }
}

/* =====================================================
   v18.3 — AI draft fallback banner on profile page
   ===================================================== */
.ai-draft-banner {
  /* Span all columns: parent .analysis is a 3-col CSS grid. */
  grid-column: 1 / -1;
  margin: 0 0 1.25rem;
  padding: .75rem 1rem;
  background: #fbe9c9;
  border: 1px solid #d6b58c;
  border-radius: 10px;
  color: #6b4f2e;
  font-size: .92rem;
  line-height: 1.45;
  text-align: center;
  font-style: italic;
}
.ai-draft-banner::before {
  content: "✦ ";
  color: #c8902a;
  font-style: normal;
  margin-right: .25rem;
}
/* Variant for the language-mismatch banner: cooler tone to differentiate */
.ai-draft-banner.lang-mismatch-banner {
  background: #eef2f7;
  border-color: #c0c8d4;
  color: #4a5263;
}
.ai-draft-banner.lang-mismatch-banner::before {
  content: "🌐 ";
  color: #5a6477;
}
