/* Fontes servidas pelo próprio site, só com os caracteres latinos (cobrem o português). */
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/figtree.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Figtree";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/figtree-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../fonts/fraunces.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/fraunces-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/source-serif-4.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/source-serif-4-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #f3eee4;
  --bg-elevated: #faf6ee;
  --bg-soft: #e8efe9;
  --ink: #241f1a;
  --ink-muted: #5e564e;
  --line: #d9d0c0;
  --accent: #1e5a49;
  --accent-hover: #164538;
  --accent-text: #f7f3ea;
  --gold: #8a6230;
  --button-secondary: #faf6ee;
  --note: #ebebe2;
  --note-line: #ced7cd;
  --note-accent: var(--accent);
  --shadow: 0 18px 40px rgba(36, 31, 26, 0.08);
  --radius: 18px;
  --font-ui: "Figtree", "Segoe UI", sans-serif;
  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Source Serif 4", "Georgia", serif;
  --content: 42rem;
  --page: 70rem;
  --header-h: 4.5rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0, 1, 0.45);
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #161412;
  --bg-elevated: #1f1c18;
  --bg-soft: #22352e;
  --ink: #eee7db;
  --ink-muted: #b3aa9d;
  --line: #3c362e;
  --button-secondary: #1f1c18;
  --note: #1f221d;
  --note-line: #2f4038;
  --note-accent: #7fb8a2;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 480px at 10% -10%, rgba(30, 90, 73, 0.08), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1.05rem;
  line-height: 1.6;
}

img {
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-text);
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
}

.skip-link:focus {
  top: 0.8rem;
}

.wrap {
  width: min(calc(100% - 2rem), var(--page));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--header-h);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
}

.header-inner {
  min-height: var(--header-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.8rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}

.brand-mark {
  width: 2.2rem;
  height: 2.2rem;
  flex: none;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

.brand-tag {
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.nav-toggle {
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink);
  border-radius: 999px;
  min-width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  font: inherit;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem;
  gap: 0.15rem;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  border-radius: 999px;
}

.theme-switch button {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  border-radius: 999px;
  min-height: 2.1rem;
  padding: 0 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.theme-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-text);
}

.reader-trigger {
  border: 0;
  padding: 0;
  background: none;
  border-radius: 999px;
  cursor: pointer;
}

.reader-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.reader-trigger:hover .reader-avatar {
  background: var(--accent-hover);
}

.reader-avatar-lg {
  width: 3.6rem;
  height: 3.6rem;
  flex: none;
  font-size: 1.2rem;
}

.reader-panel {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(22rem, 100vw);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.reader-panel[open] {
  animation: panel-in 0.45s var(--ease-out);
}

.reader-panel.is-closing {
  animation: panel-out 0.3s var(--ease-in) forwards;
}

.reader-panel::backdrop,
.auth-modal::backdrop {
  background: rgba(36, 31, 26, 0.35);
  backdrop-filter: blur(2px);
}

.reader-panel[open]::backdrop,
.auth-modal[open]::backdrop {
  animation: backdrop-in 0.45s ease;
}

.reader-panel.is-closing::backdrop,
.auth-modal.is-closing::backdrop {
  animation: backdrop-out 0.3s ease forwards;
}

@keyframes panel-in {
  from {
    transform: translateX(100%);
  }
}

@keyframes panel-out {
  to {
    transform: translateX(100%);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(1.25rem) scale(0.97);
  }
}

@keyframes modal-out {
  to {
    opacity: 0;
    transform: translateY(0.75rem) scale(0.98);
  }
}

@keyframes backdrop-in {
  from {
    background: rgba(36, 31, 26, 0);
    backdrop-filter: blur(0);
  }
}

@keyframes backdrop-out {
  to {
    background: rgba(36, 31, 26, 0);
    backdrop-filter: blur(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(0.4rem);
  }
}

.reader-panel-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 100%;
  padding: 1.1rem 1.4rem 1.6rem;
}

.reader-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reader-panel-kicker,
.reader-panel-label {
  margin: 0;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reader-panel-close {
  width: 2.3rem;
  height: 2.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.reader-panel-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.reader-panel-profile {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}

.reader-panel-profile p {
  margin: 0;
}

.reader-panel-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.2;
}

.reader-panel-email,
.reader-panel-since {
  color: var(--ink-muted);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.reader-panel-nav ul {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.reader-panel-nav a {
  display: block;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.reader-panel-nav a span {
  display: block;
  color: var(--ink-muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.reader-panel-nav a:hover {
  background: var(--bg-soft);
  color: var(--accent);
}

.reader-panel-section {
  display: grid;
  gap: 0.6rem;
  justify-items: start;
}

.reader-panel-logout {
  margin-top: auto;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.reader-panel-logout .button {
  width: 100%;
}

body:has(.reader-panel[open]) {
  overflow: hidden;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.site-nav {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}

.site-nav ul {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.site-nav a[aria-current="page"],
.site-nav a:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 50;
}

.hero {
  padding: 4.5rem 0 2.5rem;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.hero h1,
.page-title,
.article-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0.7rem 0 1rem;
}

.hero h1 {
  max-width: 16ch;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
}

.lede {
  max-width: 38rem;
  font-family: var(--font-body);
  font-size: 1.25rem;
  color: var(--ink-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.8rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.9rem;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.button-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.button-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-text);
}

.button-ghost {
  background: var(--button-secondary);
  color: var(--ink);
  border-color: var(--line);
}

.button-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.section {
  padding: 2.5rem 0 4.5rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.5rem;
}

.section-head h1,
.section-head h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0;
}

.trail {
  display: grid;
  gap: 1rem;
}

.trail-card {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  gap: 1rem;
  align-items: start;
  padding: 1.3rem 1.4rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}

.trail-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.trail-num {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--gold);
  line-height: 1;
}

.trail-card h2,
.trail-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.trail-card p {
  margin: 0;
  color: var(--ink-muted);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.trail-cta {
  align-self: center;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.note {
  margin-top: 2.5rem;
  padding: 1.15rem 1.4rem 1.25rem;
  background: var(--note);
  border: 1px solid var(--note-line);
  border-left: 4px solid var(--note-accent);
  border-radius: 12px;
}

.note-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--note-accent);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.note h2 {
  margin: 0.35rem 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
}

.note p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.parachute,
.series-nav,
.author-box,
.toc,
.disclaimer,
.text-box {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18rem;
  gap: 2.5rem;
  align-items: start;
  padding: 2rem 0 4rem;
}

.article-layout--full {
  grid-template-columns: minmax(0, 1fr);
}

.lede + .trail {
  margin-top: 1.8rem;
}

.ad-box {
  min-height: 250px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.92rem;
  color: var(--ink-muted);
  margin: 1.5rem 0 1rem;
}

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

.breadcrumb a:hover {
  color: var(--accent);
}

.article-title {
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  max-width: 18ch;
}

.prose {
  font-family: var(--font-body);
  font-size: 1.2rem;
  line-height: 1.8;
  font-optical-sizing: auto;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote {
  margin: 0 0 1.25rem;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1.25;
  margin: 2.4rem 0 0.8rem;
  scroll-margin-top: calc(var(--header-h) + 0.8rem);
}

.prose h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 1.8rem 0 0.6rem;
}

.prose blockquote {
  margin-left: 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 3px solid var(--accent);
  color: var(--ink-muted);
  font-style: italic;
}

.prose li + li {
  margin-top: 0.4rem;
}

.aside {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  display: grid;
  gap: 1rem;
}

.aside-title {
  margin: 0 0 0.7rem;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.series-nav .aside-title {
  margin-bottom: 0.2rem;
}

.series-where {
  margin: 0 0 0.75rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.series-list,
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.series-list a,
.toc a {
  color: inherit;
  text-decoration: none;
}

.series-list a:hover,
.toc a:hover,
.series-list a[aria-current="page"] {
  color: var(--accent);
}

.series-list li {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.4rem;
}

.step {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: inline-grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.step.is-current {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.step.is-done {
  background: var(--bg-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-top: 2.2rem;
}

.pager a {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  background: var(--bg-elevated);
}

.pager a:hover {
  border-color: var(--accent);
}

.pager span {
  display: block;
  color: var(--ink-muted);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.pager .next {
  text-align: right;
}

.pager .disabled {
  opacity: 0.45;
  pointer-events: none;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18rem;
  gap: 2.5rem;
  align-items: start;
  padding: 2rem 0 4rem;
}

.page-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.5rem;
  color: var(--ink-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.error {
  padding: 5rem 0;
  text-align: center;
}

.error h1 {
  font-family: var(--font-display);
  font-size: 3rem;
}

.comments-section {
  padding: 2rem 0 4.5rem;
  border-top: 1px solid var(--line);
}

.comments-inner {
  min-width: 0;
}

.comments-title {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 2rem 0 0.3rem;
}

.comments-count,
.comments-empty {
  color: var(--ink-muted);
  margin: 0 0 1.4rem;
}

.comment-list {
  display: grid;
  gap: 1.2rem;
}

.comment {
  display: grid;
  grid-template-columns: 2.7rem 1fr;
  gap: 0.75rem;
}

.comment[hidden],
.comment-replies[hidden] {
  display: none;
}

.comment.is-new > .comment-body {
  animation: comment-new 2.4s ease;
  border-radius: 10px;
}

@keyframes comment-new {
  from {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    box-shadow: 0 0 0 0.5rem color-mix(in srgb, var(--accent) 12%, transparent);
  }
}

.comment-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 50%;
  color: #f7f3ea;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.comment-body {
  min-width: 0;
}

.comment-text {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.comment-form-hint {
  align-self: center;
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.comment-form-reply {
  margin-top: 0.8rem;
}

.comment-form textarea[aria-invalid="true"] {
  border-color: var(--gold);
}

.comment-form[aria-busy="true"] [type="submit"] {
  opacity: 0.7;
  cursor: progress;
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: baseline;
  margin: 0.15rem 0 0.35rem;
  font-size: 0.92rem;
}

.comment-meta span {
  color: var(--ink-muted);
}

.comment-text {
  margin: 0 0 0.45rem;
  font-family: var(--font-body);
  line-height: 1.65;
}

.comment-reply-btn,
.comment-toggle {
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0;
  cursor: pointer;
}

.comment-replies {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
  border-left: 2px solid var(--line);
  padding-left: 0.9rem;
}

.comment-toggle {
  justify-self: start;
}

.comment-form {
  margin-top: 1.6rem;
  padding: 1.15rem 1.2rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 0.7rem;
}

.auth-page {
  min-height: calc(100dvh - var(--header-h));
  display: grid;
  align-items: center;
  padding: 2.5rem 0;
}

.auth-form {
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  padding: 1.6rem 1.6rem 1.7rem;
  box-shadow: var(--shadow);
}

.auth-title {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
}

.auth-modal {
  width: min(26rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}

.auth-modal[open] {
  animation: modal-in 0.4s var(--ease-out);
}

.auth-modal.is-closing {
  animation: modal-out 0.25s var(--ease-in) forwards;
}

.auth-modal [data-auth-view]:not([hidden]) {
  animation: fade-in 0.3s var(--ease-out);
}

.auth-modal:focus,
.auth-modal:focus-visible,
.reader-panel:focus,
.reader-panel:focus-visible {
  outline: none;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--accent);
  background: var(--bg-soft);
}

.password-toggle[hidden] {
  display: none;
}

.password-toggle .password-icon-hide,
.password-toggle[aria-pressed="true"] .password-icon-show {
  display: none;
}

.password-toggle[aria-pressed="true"] .password-icon-hide {
  display: block;
}

.auth-form input[aria-invalid="true"] {
  border-color: var(--gold);
}

.auth-form[aria-busy="true"] [type="submit"] {
  opacity: 0.7;
  cursor: progress;
}

.auth-modal .auth-form {
  margin: 0;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
}

.auth-modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 1;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.auth-modal-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

body:has(.auth-modal[open]) {
  overflow: hidden;
}

.auth-form .comment-form-actions {
  margin-top: 0.4rem;
}

.auth-form .comment-form-actions .button {
  flex: 1;
}

.field-error {
  margin: 0;
  color: var(--gold);
  font-weight: 650;
}

.comment-form-title {
  margin: 0;
  font-weight: 700;
}

.comment-form label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.comment-form input,
.comment-form textarea {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  width: 100%;
}

.comment-form textarea {
  resize: vertical;
  min-height: 5.5rem;
}

.comment-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.auth-lead {
  margin: 0 0 0.3rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
  text-align: center;
}

.auth-forgot {
  justify-self: end;
  margin-top: -0.2rem;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 650;
}

.auth-success {
  margin: 0;
  padding: 0.75rem 0.9rem;
  background: var(--note);
  border: 1px solid var(--note-line);
  border-left: 4px solid var(--note-accent);
  border-radius: 12px;
  font-size: 0.92rem;
}

.check-field,
.comment-form .check-field {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.check-field input,
.comment-form .check-field input {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.15rem 0 0;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.check-field small {
  display: block;
  color: var(--ink-muted);
  font-size: 0.83rem;
  font-weight: 400;
}

.reader-emails {
  gap: 0.8rem;
}

.reader-emails-status {
  min-height: 1.2em;
  margin: -0.3rem 0 0;
  color: var(--accent);
  font-size: 0.83rem;
  font-weight: 650;
}

.reader-verify {
  display: grid;
  gap: 0.5rem;
  justify-items: start;
  padding: 0.8rem 0.9rem;
  background: var(--note);
  border: 1px solid var(--note-line);
  border-left: 4px solid var(--note-accent);
  border-radius: 12px;
}

.reader-verify p {
  margin: 0;
  font-size: 0.88rem;
}

.reader-verify-resend {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.reader-verify-resend:disabled {
  opacity: 0.6;
  cursor: default;
}

.flash {
  background: var(--note);
  border-bottom: 1px solid var(--note-line);
  animation: fade-in 0.3s var(--ease-out);
}

.flash-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
}

.flash p {
  margin: 0;
  padding-left: 0.8rem;
  border-left: 4px solid var(--note-accent);
  font-weight: 600;
}

.flash-close {
  flex: none;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--note-line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.flash-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    display: none;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    padding: 0.2rem 0 0.9rem;
    border-top: 1px solid var(--line);
  }

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

  .site-nav ul {
    flex-direction: column;
    gap: 0.2rem;
  }

  .site-nav a {
    display: block;
    padding: 0.55rem 0;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .article-layout,
  .about-grid,
  .trail-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .aside {
    position: static;
  }

  .trail-cta {
    display: none;
  }

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

  .pager .next {
    text-align: left;
  }

  .comment {
    grid-template-columns: 2.2rem 1fr;
  }

  .comment-avatar {
    width: 2.2rem;
    height: 2.2rem;
  }

  .comment-replies {
    padding-left: 0.65rem;
  }
}

.trail-intro {
  max-width: 40rem;
  margin: -0.4rem 0 1.2rem;
  color: var(--ink-muted);
}

.cta-box {
  margin-top: 2.5rem;
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem 2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.cta-box-text {
  flex: 1 1 22rem;
  min-width: 0;
}

.cta-box-text p {
  margin: 0;
}

.cta-box-text .cta-box-title {
  margin-top: 0.3rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}

.cta-box-text .cta-box-summary {
  margin-top: 0.4rem;
  max-width: 40rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.cta-box-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.trail-card.is-locked {
  box-shadow: none;
  background: transparent;
  cursor: default;
}

.trail-card.is-locked:hover {
  border-color: var(--line);
}

.lock-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.lock-icon {
  width: 0.72rem;
  height: 0.52rem;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  display: inline-block;
  position: relative;
  flex: none;
}

.lock-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 0.38rem;
  height: 0.32rem;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  transform: translateX(-50%);
}

.series-list .is-locked {
  color: var(--ink-muted);
}

.calc {
  display: grid;
  gap: 0.85rem;
  margin: 0.4rem 0 1.6rem;
  padding: 1.15rem 1.2rem 1.3rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
  max-width: 100%;
}

.calc label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.95rem;
  font-weight: 700;
  min-width: 0;
}

.calc input {
  font: inherit;
  font-weight: 500;
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.45rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
}

.calc .hint,
.calc-notes {
  color: var(--ink-muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.calc-result p {
  margin: 0 0 0.55rem;
}

.calc-result {
  max-width: 100%;
  overflow-x: auto;
}

.calc-result strong {
  font-family: var(--font-display);
  font-weight: 600;
}

.calc-error {
  color: var(--gold);
  font-weight: 650;
}

.calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}

.calc-table th,
.calc-table td {
  text-align: left;
  padding: 0.55rem 0.35rem;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}

.calc-table thead th {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

.calc-table tr.is-winner th,
.calc-table tr.is-winner td {
  color: var(--accent);
  font-weight: 700;
}

.tool-links {
  display: grid;
  gap: 0.7rem;
  margin: 0 0 1.4rem;
}

.tool-links a {
  display: block;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  background: var(--bg-elevated);
}

.tool-links a:hover {
  border-color: var(--accent);
}

.tool-links span {
  display: block;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

@media (max-width: 860px) {
  .trail-card.is-locked .trail-cta {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reader-panel,
  .reader-panel::backdrop,
  .auth-modal,
  .auth-modal::backdrop,
  .auth-modal [data-auth-view],
  .comment.is-new > .comment-body {
    animation: none !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .progress,
  .theme-switch,
  .nav-toggle,
  .pager,
  .aside,
  .comment-form,
  .comment-invite,
  .comment-reply-btn,
  .comment-toggle {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .article-layout {
    display: block;
  }
}
