/* Self-hosted fonts (SIL Open Font License, see fonts/OFL.txt).
   Subsets: latin and cyrillic, plus the ruble sign and arrows used on the site. */
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/golos-text-400.woff2") format("woff2");
}

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/golos-text-500.woff2") format("woff2");
}

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/golos-text-600.woff2") format("woff2");
}

@font-face {
  font-family: "Prata";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/prata-400.woff2") format("woff2");
}

:root {
    --ink: #211d19;
    --muted: #74675c;
    --pale: #f1ebe3;
    --accent: #80601f;
    --accent2: #8a5e43;
    --accent3: #56755f;
    --accent4: #c49b3c;
    --red: #9a5650;
    --card: #fffdfa;
    --border: #d9cfc3;
  }

  html,
  body {
    scroll-behavior: auto;
    overflow-x: clip;
  }

  body {
    font-family: "Golos Text", Arial, sans-serif;
    background-color: #f5f0e8;
    background-image:
      radial-gradient(ellipse at 8% 8%, rgba(196, 155, 60, 0.12), transparent 36rem),
      radial-gradient(ellipse at 92% 42%, rgba(138, 94, 67, 0.08), transparent 34rem);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.68;
  }

  .page {
    max-width: 1040px;
    padding: clamp(24px, 5vw, 56px) clamp(18px, 4vw, 36px) clamp(56px, 8vw, 96px);
  }

  h1,
  h2,
  .section-title {
    font-family: "Prata", Georgia, serif;
    font-weight: 400;
  }

  [style*="font-family:sans-serif"] {
    font-family: "Golos Text", Arial, sans-serif !important;
  }

  [style*="font-family:'Georgia'"] {
    font-family: "Prata", Georgia, serif !important;
    font-weight: 400 !important;
  }

  .header {
    position: relative;
    overflow: hidden;
    background: #17130f;
    border-left-color: var(--accent4);
    border-radius: 0 14px 14px 0;
    box-shadow: 0 22px 52px rgba(75, 52, 35, 0.12);
    padding: clamp(26px, 5vw, 46px);
    margin-bottom: clamp(44px, 6vw, 68px);
  }

  .header::after {
    content: "";
    position: absolute;
    width: 16rem;
    height: 16rem;
    right: -7rem;
    top: -8rem;
    border: 1px solid rgba(196, 155, 60, 0.22);
    border-radius: 50%;
    box-shadow: 0 0 0 3rem rgba(196, 155, 60, 0.035);
    pointer-events: none;
  }

  .header h1 {
    max-width: 760px;
    color: #f7f2e9;
    font-size: clamp(27px, 4.2vw, 45px);
    line-height: 1.18;
    letter-spacing: -0.025em;
    margin-bottom: 16px;
  }

  .header p {
    position: relative;
    z-index: 1;
    max-width: 760px;
    color: #c9bfb3;
    font-size: 14px;
    line-height: 1.72;
  }

  .header .tag {
    position: relative;
    z-index: 1;
    background: transparent;
    color: #d7b65f;
    border: 1px solid rgba(215, 182, 95, 0.48);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    padding: 5px 11px;
    margin-bottom: 18px;
  }

  .section {
    margin-bottom: clamp(52px, 8vw, 78px);
  }

  .section-title {
    color: #241e19;
    font-size: clamp(20px, 2.7vw, 29px);
    line-height: 1.32;
    gap: 13px;
    padding-bottom: 15px;
    margin-bottom: 24px;
    border-bottom-color: #d8cbbd;
  }

  .section-title .num {
    width: 30px;
    height: 30px;
    background: #211a15;
    color: #e4c36b;
    font-size: 12px;
    box-shadow: 0 0 0 4px rgba(184, 139, 46, 0.1);
  }

  .flow-label {
    color: #7c6c5e;
    font-weight: 600;
    letter-spacing: 0.09em;
  }

  .flow-arrow {
    color: #b29269;
  }

  .flow-box {
    background: rgba(255, 253, 250, 0.94);
    border-color: #d7cdc1;
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(76, 54, 37, 0.055);
  }

  .flow-box.wound {
    color: #874640;
    background: #fbefec;
    border-color: #b66b64;
  }

  .flow-box.schema {
    color: #765714;
    background: #fbf5e7;
    border-color: #c39a3c;
  }

  .flow-box.justify {
    color: #785f24;
    background: #f8f0dc;
    border-color: #c8a959;
  }

  .flow-box.behavior {
    color: #774832;
    background: #f7eee8;
    border-color: #9b6c50;
  }

  .flow-box.relief {
    color: #3f654d;
    background: #edf5ef;
    border-color: #6d9077;
  }

  .flow-box.cost {
    color: #874640;
    background: #faeeeb;
    border-color: #b66b64;
  }

  .mech-card,
  .pattern-card,
  .rec-card {
    background: rgba(255, 253, 250, 0.95);
    border-color: #d9cfc3;
    box-shadow: 0 10px 28px rgba(76, 54, 37, 0.06);
  }

  .mech-card {
    border-radius: 12px;
    padding: 20px;
  }

  .mech-card h3,
  .rec-card h4 {
    color: #2c241e;
  }

  .mech-card .example-phrase,
  .pattern-meta,
  .rec-card ul li {
    border-color: #e9e0d7;
  }

  .mech-card .example-phrase {
    background: #f4eee6;
    color: #774c34;
  }

  .pattern-card {
    border-left-color: var(--accent2);
  }

  .sub-table,
  .ex-table {
    background: rgba(255, 253, 250, 0.88);
    border: 1px solid #ddd2c6;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(76, 54, 37, 0.05);
  }

  .sub-table th,
  .ex-table th {
    background: #272019;
    color: #f3e8d8;
    border-color: #3d332a;
  }

  .sub-table th {
    color: #e0bf68;
  }

  .sub-table td,
  .ex-table td {
    border-color: #e5dcd2;
  }

  .sub-table tr:nth-child(even) td,
  .ex-table tr:nth-child(even) td {
    background: rgba(244, 238, 230, 0.5);
  }

  .sub-table tr:hover td,
  .ex-table tr:hover td {
    background: #f6f0e8;
  }

  .phrase {
    color: #774b34;
  }

  .real,
  .cost-tag {
    color: #8f4e48;
  }

  .mech-tag {
    background: #f1ebe3;
    color: #6f6257;
    border-color: #ddd2c7;
  }

  .q {
    color: #8a6821;
  }

  .footnote {
    background: #eee6dc;
    border-color: #d5c7b9;
    color: #6b5e54;
    padding: 20px 24px;
  }

  .page > div[style*="background:#18150F"] {
    background:
      radial-gradient(circle at 92% 8%, rgba(196, 155, 60, 0.13), transparent 18rem),
      #17130f !important;
    border-color: rgba(196, 155, 60, 0.5) !important;
    box-shadow: 0 24px 60px rgba(63, 43, 30, 0.17) !important;
  }

  .page > div[style*="background:#18150F"] a {
    background: #c49b3c !important;
    color: #17130f !important;
    border-radius: 6px !important;
    box-shadow: 0 8px 22px rgba(196, 155, 60, 0.18);
  }

  @media (max-width: 760px) {
    body {
      font-size: 14px;
    }

    .page {
      width: 100%;
      padding-inline: 16px;
    }

    .header {
      padding: 26px 22px;
      border-left-width: 4px;
      border-radius: 0 10px 10px 0;
    }

    .section-title {
      align-items: flex-start;
    }

    .section-title .num {
      margin-top: 1px;
    }

    [style*="display:grid;grid-template-columns:1fr 1fr"] {
      grid-template-columns: 1fr !important;
    }

    .sub-table,
    .ex-table {
      display: block;
      width: 100%;
      max-width: 100%;
      overflow-x: auto;
      overscroll-behavior-inline: contain;
      -webkit-overflow-scrolling: touch;
      border-radius: 9px;
    }

    .sub-table thead,
    .sub-table tbody,
    .ex-table thead,
    .ex-table tbody {
      display: table;
      width: 100%;
      table-layout: fixed;
    }

    .sub-table thead,
    .sub-table tbody {
      min-width: 650px;
    }

    .ex-table thead,
    .ex-table tbody {
      min-width: 860px;
    }

    .page > div[style*="background:#18150F"] {
      padding: 28px 21px !important;
      border-radius: 11px !important;
    }

    .page > div[style*="background:#18150F"] a {
      display: block !important;
      width: 100%;
      padding-inline: 18px !important;
      text-align: center;
    }
  }

  @media (max-width: 480px) {
    .header h1 {
      font-size: 28px;
    }

    .flow-box {
      min-width: min(100%, 138px);
    }

    .flow-row {
      gap: 7px;
    }

    .section {
      margin-bottom: 52px;
    }
  }

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      scroll-behavior: auto !important;
      transition-duration: 0.01ms !important;
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
    }
}

/* Shared site shell: matches index.html without changing the map layout. */
.wrap {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(196, 155, 60, 0.24);
  background: rgba(14, 12, 8, 0.96);
  color: #f4efe7;
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
}

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

.site-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: #f4efe7;
  font-family: "Prata", Georgia, serif;
  font-size: 1.22rem;
  font-weight: 400;
  letter-spacing: -0.018em;
  text-decoration: none;
  white-space: nowrap;
}

.site-header .brand::before {
  width: 34px;
  height: 24px;
  flex: 0 0 34px;
  background:
    linear-gradient(#f4efe7, #f4efe7) 0 0 / 34px 4px no-repeat,
    linear-gradient(#c49b3c, #c49b3c) 7px 10px / 27px 4px no-repeat,
    linear-gradient(#f4efe7, #f4efe7) 14px 20px / 20px 4px no-repeat;
  content: "";
}

.site-header .brand:hover,
.site-nav a:hover {
  color: #d4ae55;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
}

.site-nav a {
  color: #c7baab;
  font-size: 0.77rem;
  font-weight: 600;
  text-decoration: none;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid #c49b3c;
  border-radius: 2px;
  padding: 12px 22px;
  background: #c49b3c;
  color: #0e0c08;
  font-weight: 700;
  text-decoration: none;
}

.button-small {
  min-height: 40px;
  padding: 9px 18px;
  font-size: 0.75rem;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(196, 155, 60, 0.24);
  border-radius: 2px;
  background: transparent;
  color: #f4efe7;
  cursor: pointer;
}

.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  display: block;
  width: 20px;
  height: 1.5px;
  background: currentColor;
  content: "";
}

.menu-toggle span {
  position: relative;
}

.menu-toggle span::before {
  position: absolute;
  top: -6px;
}

.menu-toggle span::after {
  position: absolute;
  top: 6px;
}

.site-footer {
  border-top: 1px solid rgba(196, 155, 60, 0.28);
  background:
    radial-gradient(circle at 12% 0%, rgba(196, 155, 60, 0.08), transparent 25rem),
    #0e0c08;
  color: #f4efe7;
}

.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr 0.7fr;
  gap: 50px;
  border-bottom: 1px solid rgba(196, 155, 60, 0.16);
  padding: 58px 0 44px;
}

.site-footer .footer-title {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  color: #f4efe7;
  font-family: "Prata", Georgia, serif;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.015em;
}

.site-footer .footer-title::before {
  width: 34px;
  height: 24px;
  flex: 0 0 34px;
  background:
    linear-gradient(#f4efe7, #f4efe7) 0 0 / 34px 4px no-repeat,
    linear-gradient(#c49b3c, #c49b3c) 7px 10px / 27px 4px no-repeat,
    linear-gradient(#f4efe7, #f4efe7) 14px 20px / 20px 4px no-repeat;
  content: "";
}

.site-footer .footer-note {
  max-width: 430px;
  margin: 0;
  color: #c7baab;
  font-size: 0.82rem;
  line-height: 1.65;
}

.site-footer .footer-links {
  display: grid;
  align-content: start;
  gap: 9px;
}

.site-footer .footer-links strong {
  margin-bottom: 5px;
  color: #d4ae55;
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.site-footer .footer-links a {
  color: #e6ddd2;
  font-size: 0.8rem;
  text-decoration: none;
}

.site-footer .footer-links a:hover {
  color: #d4ae55;
}

.site-footer .footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-top: 0;
  padding: 20px 0 24px;
  color: #aa9a88;
  font-size: 0.7rem;
}

.site-footer .footer-bottom p {
  margin: 0;
}

@media (max-width: 1040px) {
  .site-nav {
    position: fixed;
    top: 66px;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 18px 24px 28px;
    border-bottom: 1px solid rgba(196, 155, 60, 0.24);
    background: rgba(14, 12, 8, 0.99);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    border-bottom: 1px solid rgba(196, 155, 60, 0.24);
    padding: 12px 0;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .header-cta {
    margin-left: auto;
  }
}

@media (max-width: 740px) {
  .wrap {
    width: calc(100% - 36px);
  }

  .site-header .brand {
    gap: 11px;
    font-size: 1.05rem;
  }

  .site-header .brand::before {
    width: 30px;
    height: 21px;
    flex-basis: 30px;
    background:
      linear-gradient(#f4efe7, #f4efe7) 0 0 / 30px 3px no-repeat,
      linear-gradient(#c49b3c, #c49b3c) 6px 9px / 24px 3px no-repeat,
      linear-gradient(#f4efe7, #f4efe7) 12px 18px / 18px 3px no-repeat;
  }

  .header-cta {
    display: none;
  }

  .site-footer .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 46px 0 34px;
  }
}

/* 2026-09-25: aligned with the main site */
.site-header .button,
.site-header .header-cta {
  border-color: #f4efe7;
  background: #f4efe7;
  color: #211d19;
  font-family: "Golos Text", system-ui, sans-serif;
  letter-spacing: 0.02em;
}

.site-header .button:hover {
  border-color: #ffffff;
  background: #ffffff;
}

.site-nav a,
.site-header .button,
.site-footer {
  font-family: "Golos Text", system-ui, sans-serif;
}

.tm-cta-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  border-radius: 2px;
  padding: 14px 28px;
  background: #f4efe7;
  color: #211d19;
  font: 700 0.9rem/1.2 "Golos Text", system-ui, sans-serif;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.tm-cta-button:hover {
  background: #ffffff;
}

.tm-cta-button:focus-visible {
  outline: 2px solid #c49b3c;
  outline-offset: 3px;
}

.flow-box.wound {
  flex-direction: column;
  gap: 4px;
}

.flow-box.wound small {
  display: block;
}

@media (min-width: 900px) {
  .sub-table {
    table-layout: fixed;
  }

  .sub-table th:nth-child(1) { width: 15%; }
  .sub-table th:nth-child(2) { width: 4%; }
  .sub-table th:nth-child(3) { width: 24%; }
  .sub-table th:nth-child(4) { width: 19%; }
  .sub-table th:nth-child(5) { width: 19%; }
  .sub-table th:nth-child(6) { width: 19%; }
}

/* Substitution map as readable cards instead of a six-column table */
.sub-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.sub-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px 22px 18px;
  background: var(--card);
}

.sub-card-phrase {
  margin: 0;
  color: var(--ink);
  font-family: "Prata", Georgia, serif;
  font-size: 1.12rem;
  line-height: 1.3;
}

.sub-card-real {
  margin: 0;
  border-left: 2px solid var(--accent);
  padding-left: 12px;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.55;
}

.sub-card-real span {
  display: block;
  margin-bottom: 2px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.sub-card-facts {
  display: grid;
  gap: 8px;
  margin: 4px 0 0;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.sub-card-facts div {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 12px;
}

.sub-card-facts dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.5;
}

.sub-card-facts dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.5;
}

.sub-card-cost dd {
  color: var(--red);
}

@media (max-width: 740px) {
  .sub-cards {
    grid-template-columns: 1fr;
  }

  .sub-card {
    padding: 18px 16px 16px;
  }

  .sub-card-facts div {
    grid-template-columns: 1fr;
    gap: 0;
  }
}





@media (min-width: 741px) {
  .sub-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

.footer-bottom.footer-bottom-stack {
  flex-direction: column;
  gap: 4px;
}

.footer-bottom .footer-credit {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.footer-bottom .footer-credit:hover {
  color: #d4ae55;
}

/* Footer bottom: one quiet line, legal note on the left, credit on the right */
.site-footer .footer-bottom.footer-bottom-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 32px;
}

.footer-bottom-row p {
  margin: 0;
  color: #8f8272;
  font-size: 0.78rem;
  line-height: 1.5;
}

.footer-bottom-row .footer-sep {
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 12px;
  border-radius: 50%;
  background: #c49b3c;
  vertical-align: middle;
}

.footer-bottom-row .footer-made {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}

.footer-bottom-row .footer-credit {
  color: #d4ae55;
  text-decoration: none;
  border-bottom: 1px solid rgba(212, 174, 85, 0.4);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-bottom-row .footer-credit:hover {
  color: #f4efe7;
  border-bottom-color: #f4efe7;
}

@media (max-width: 780px) {
  .site-footer .footer-bottom.footer-bottom-row {
    flex-direction: column;
    gap: 10px;
  }

  .footer-bottom-row .footer-sep {
    margin: 0 8px;
  }

  .footer-bottom-row .footer-made {
    display: block;
  }

  .footer-bottom-row .footer-made .footer-credit {
    margin-left: 6px;
  }
}

.footer-bottom-row .footer-credit {
  white-space: nowrap;
}


/* Menu call to action: only inside the phone menu */
.site-nav .nav-cta {
  display: none;
}

/* Phone menu, 2026-09-29: full-screen, calm and readable */
@media (max-width: 780px) {
  html.menu-open,
  html.menu-open body {
    overflow: hidden;
  }

  .site-header .site-nav {
    position: fixed !important;
    top: 66px !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: none !important;
    overflow-y: auto;
    padding: 18px 22px calc(28px + env(safe-area-inset-bottom, 0px)) !important;
    background: #0e0c08 !important;
    -webkit-backdrop-filter: none !important;
            backdrop-filter: none !important;
  }

  .site-header .site-nav.is-open {
    display: flex !important;
  }

  .site-header .site-nav a:not(.nav-cta) {
    display: block;
    border-bottom: 1px solid rgba(196, 155, 60, 0.16) !important;
    padding: 16px 0 !important;
    color: #f4efe7 !important;
    font-family: "Prata", Georgia, serif !important;
    font-size: 1.5rem !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    line-height: 1.2;
    text-transform: none !important;
  }

  .site-header .site-nav .nav-cta {
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    margin-top: 28px;
    border-radius: 2px;
    padding: 14px 20px;
    background: #f4efe7;
    color: #211d19 !important;
    font: 700 0.9rem/1.2 "Golos Text", system-ui, sans-serif;
    letter-spacing: 0.02em;
    text-decoration: none;
  }

  .menu-toggle[aria-expanded="true"] span {
    background: transparent !important;
  }

  .menu-toggle[aria-expanded="true"] span::before {
    transform: translateY(6px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span::after {
    transform: translateY(-6px) rotate(-45deg);
  }

  .menu-toggle span::before,
  .menu-toggle span::after {
    transition: transform 0.2s ease;
  }
}

@media (max-width: 780px) {
  /* The header uses a backdrop blur, which makes it the containing block
     for the fixed menu, so the menu height is set explicitly. */
  .site-header .site-nav {
    top: 100% !important;
    bottom: auto !important;
    height: calc(100vh - 66px);
    height: calc(100svh - 66px);
  }
}
