/* KnowCrypto theme
   Ink navy + saffron gold. Literata for reading, Figtree for interface. */

:root {
  --paper: #f3f5f9;
  --surface: #ffffff;
  --ink: #18233a;
  --ink-soft: #4d586c;
  --line: #d6dce6;
  --gold: #e3a21a;
  --gold-ink: #7a5300;
  --gold-wash: #fbf0d6;
  --teal: #0f7b6c;
  --teal-wash: #e1f2ee;
  --red: #b93a26;
  --red-wash: #fbe7e2;
  --focus: #2457d6;

  --serif: var(--gh-font-heading, "Literata", Georgia, "Times New Roman", serif);
  --sans: var(--gh-font-body, "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif);

  --wrap: 1180px;
  --text: 42rem;
  --gutter: clamp(16px, 4vw, 32px);
  --radius-s: 4px;
  --radius-m: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1626;
    --surface: #152036;
    --ink: #e6eaf2;
    --ink-soft: #a5afc2;
    --line: #2a3752;
    --gold: #f0b53a;
    --gold-ink: #f6cd74;
    --gold-wash: #2b2615;
    --teal: #4cc3ae;
    --teal-wash: #12312d;
    --red: #f07a63;
    --red-wash: #3a1d18;
    --focus: #8fb0ff;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 20; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-text { max-width: calc(var(--text) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px; border-radius: var(--radius-s);
  font: 600 0.95rem/1 var(--sans); text-decoration: none; border: 0; cursor: pointer;
}
.btn-gold { background: var(--gold); color: #1b1300; }
.btn-gold:hover { filter: brightness(1.06); }
.link-quiet { font-weight: 600; text-decoration: none; }

/* Masthead */
.masthead { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.masthead-row { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { height: 34px; width: auto; }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--ink); color: var(--gold); border-radius: 50%;
  font: 700 1.1rem/1 var(--serif);
}
.brand-name { font: 500 1.25rem/1 var(--serif); letter-spacing: -0.01em; }
.brand-name strong { font-weight: 700; }
.menu { display: flex; align-items: center; gap: 24px; flex: 1; }
.primary-nav { flex: 1; }
.primary-nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.primary-nav a { text-decoration: none; font-weight: 500; color: var(--ink-soft); }
.primary-nav a:hover, .primary-nav .nav-current a { color: var(--ink); }
.menu-toggle { display: none; margin-left: auto; min-height: 44px; padding: 0 14px; background: none; border: 1px solid var(--line); border-radius: var(--radius-s); color: var(--ink); font: 600 0.95rem var(--sans); }

.regionbar { border-top: 1px solid var(--line); background: var(--paper); }
.regionbar-row { display: flex; align-items: center; gap: 14px; min-height: 44px; font-size: 0.9rem; }
.regionbar-label { color: var(--ink-soft); }
.region-switch { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.region-switch a {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  text-decoration: none; font-weight: 600; border: 1px solid var(--line); background: var(--surface);
}
.region-switch a:hover { border-color: var(--ink-soft); }
.region-switch a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.regionbar-tools { margin-left: auto; font-weight: 600; color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Hero */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(32px, 5vw, 56px); }
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
.hero h1 {
  font: 500 clamp(2.4rem, 5.6vw, 4.4rem)/1.04 var(--serif);
  letter-spacing: -0.025em; margin: 0 0 20px; max-width: 14ch;
}
.hero-text { font-size: 1.15rem; color: var(--ink-soft); max-width: 36rem; margin: 0 0 28px; }

.subscribe-form { display: flex; flex-wrap: wrap; gap: 10px; max-width: 34rem; }
.subscribe-form input {
  flex: 1 1 220px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink); font: 1rem var(--sans);
}
.form-state { display: none; flex-basis: 100%; margin: 4px 0 0; font-size: 0.9rem; }
.subscribe-form.loading .form-loading,
.subscribe-form.success .form-success,
.subscribe-form.error .form-error { display: block; }
.subscribe-form.success input, .subscribe-form.success button { display: none; }
.form-success { color: var(--teal); font-weight: 600; }
.form-error { color: var(--red); }

/* The beginner path: a real reading sequence, so it is numbered */
.path { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 24px 24px 12px; }
.path-title { font: 600 1rem/1.35 var(--sans); margin: 0 0 12px; }
.path-list { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.path-list li {
  counter-increment: step; display: grid; grid-template-columns: 32px 1fr auto; gap: 4px 12px;
  align-items: baseline; padding: 12px 0; border-top: 1px solid var(--line);
}
.path-list li::before { content: counter(step); font: 700 1.1rem var(--serif); color: var(--gold-ink); }
.path-list a { font: 500 1.02rem/1.35 var(--serif); text-decoration: none; }
.path-list a:hover { text-decoration: underline; }
.path-list span { font-size: 0.8rem; color: var(--ink-soft); white-space: nowrap; }
.path-list .path-empty { display: block; color: var(--ink-soft); font-size: 0.9rem; }
.path-list .path-empty::before { content: none; }

/* Scam alert band */
.alert-band { background: var(--red-wash); border-block: 1px solid color-mix(in srgb, var(--red) 35%, transparent); }
.alert-row { display: flex; align-items: center; gap: 16px; min-height: 52px; flex-wrap: wrap; padding-block: 8px; }
.alert-kind { margin: 0; font-weight: 700; color: var(--red); }
.alert-link { font-weight: 600; text-underline-offset: 3px; flex: 1; }
.alert-row time { color: var(--ink-soft); font-size: 0.9rem; }

/* Sections */
.section-title { font: 600 1.5rem/1.2 var(--serif); margin: 0 0 20px; letter-spacing: -0.01em; }
.topics { padding-top: clamp(40px, 6vw, 64px); }
.topic-index { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 40px; }
.topic-index li { border-top: 1px solid var(--line); }
.topic-index a { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 16px 0; text-decoration: none; }
.topic-name { font: 600 1.15rem/1.3 var(--serif); }
.topic-desc { grid-column: 1; color: var(--ink-soft); font-size: 0.95rem; }
.topic-count { grid-column: 2; grid-row: 1; font-size: 0.85rem; color: var(--ink-soft); }
.topic-index a:hover .topic-name { text-decoration: underline; text-underline-offset: 3px; }

.latest { padding-top: clamp(40px, 6vw, 64px); padding-bottom: clamp(40px, 6vw, 64px); }
.feed { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 32px; }
.entry-link { display: block; text-decoration: none; }
.entry-image { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; border-radius: var(--radius-s); margin-bottom: 14px; background: var(--line); }
.entry-topic { margin: 0 0 6px; font-size: 0.85rem; font-weight: 600; color: var(--teal); }
.entry-title { font: 600 1.25rem/1.28 var(--serif); margin: 0 0 8px; letter-spacing: -0.005em; }
.entry-link:hover .entry-title { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.entry-excerpt { margin: 0 0 10px; color: var(--ink-soft); font-size: 0.97rem; }
.entry-meta { margin: 0; font-size: 0.85rem; color: var(--ink-soft); display: flex; gap: 12px; }
/* First post on the home feed gets more room */
.home-template .feed .entry:first-child { grid-column: span 2; }
.home-template .feed .entry:first-child .entry-title { font-size: clamp(1.5rem, 2.6vw, 2rem); }

.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 40px; font-weight: 600; }
.pagination a { text-decoration: none; }

/* Subscribe block */
.subscribe { background: var(--ink); color: var(--paper); padding: clamp(40px, 6vw, 72px) var(--gutter); }
.subscribe-inner { max-width: 44rem; margin: 0 auto; }
.subscribe h2 { font: 500 clamp(1.6rem, 3.2vw, 2.3rem)/1.15 var(--serif); margin: 0 0 12px; letter-spacing: -0.015em; }
.subscribe p { color: color-mix(in srgb, var(--paper) 78%, transparent); margin: 0 0 22px; }
.subscribe .subscribe-form input { background: transparent; color: var(--paper); border-color: color-mix(in srgb, var(--paper) 40%, transparent); }
.subscribe .subscribe-form input::placeholder { color: color-mix(in srgb, var(--paper) 55%, transparent); }
.subscribe .form-success { color: var(--gold); }
@media (prefers-color-scheme: dark) {
  .subscribe { background: #070c16; color: var(--ink); }
  .subscribe p { color: var(--ink-soft); }
  .subscribe .subscribe-form input { color: var(--ink); border-color: var(--line); }
}

/* Article */
.article { padding-top: clamp(32px, 5vw, 64px); }
.article-topic { margin: 0 0 12px; font-weight: 600; }
.article-topic a { color: var(--teal); text-decoration: none; }
.article-title { font: 500 clamp(2rem, 4.6vw, 3.2rem)/1.1 var(--serif); letter-spacing: -0.02em; margin: 0 0 16px; }
.article-dek { font: 400 1.25rem/1.5 var(--serif); color: var(--ink-soft); margin: 0 0 24px; }
.byline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.byline p { margin: 0; }
.byline-when { color: var(--ink-soft); }
.byline-when span { margin-left: 10px; }
.byline a { font-weight: 600; }

/* The memorable element: the facts-checked stamp */
.checked {
  display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start;
  margin: 24px 0 0; padding: 16px 18px;
  background: var(--teal-wash); border-left: 4px solid var(--teal); border-radius: 0 var(--radius-s) var(--radius-s) 0;
}
.checked-seal {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--teal); color: var(--teal); font: 700 1.2rem var(--sans);
}
.checked p { margin: 0; font-size: 0.95rem; }
.disclosure { margin: 14px 0 0; padding: 12px 16px; background: var(--gold-wash); border-radius: var(--radius-s); font-size: 0.9rem; }

.article-image { margin: 36px auto 0; max-width: var(--wrap); padding: 0 var(--gutter); }
.article-image img { width: 100%; border-radius: var(--radius-s); }
.article-image figcaption { font-size: 0.85rem; color: var(--ink-soft); margin-top: 8px; }

.article-content { font-family: var(--serif); font-size: 1.15rem; line-height: 1.75; padding-top: 32px; }
.article-content > * { margin: 0 0 1.25em; }
.article-content h2 { font: 600 1.7rem/1.25 var(--serif); letter-spacing: -0.01em; margin: 2em 0 0.6em; }
.article-content h3 { font: 600 1.3rem/1.3 var(--sans); margin: 1.6em 0 0.5em; }
.article-content a { color: var(--ink); text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.article-content a:hover { text-decoration-color: var(--ink); }
.article-content ul, .article-content ol { padding-left: 1.3em; }
.article-content li { margin-bottom: 0.45em; }
.article-content blockquote { margin-left: 0; padding-left: 20px; border-left: 3px solid var(--gold); font-style: italic; }
.article-content table { width: 100%; border-collapse: collapse; font: 0.95rem/1.45 var(--sans); display: block; overflow-x: auto; }
.article-content th, .article-content td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.article-content th { font-weight: 700; border-bottom: 2px solid var(--ink); }
.article-content hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.article-content code { font-size: 0.9em; background: var(--surface); padding: 2px 5px; border-radius: 3px; }
.article-content .kc-key { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 22px; font-family: var(--sans); font-size: 1rem; }
.article-content .kc-key h2, .article-content .kc-key h3 { margin-top: 0; font: 700 1.05rem var(--sans); }
.article-content .kc-warn { background: var(--red-wash); border-left: 4px solid var(--red); padding: 14px 18px; font-family: var(--sans); font-size: 1rem; border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.article-content .kc-sources { font-family: var(--sans); font-size: 0.92rem; color: var(--ink-soft); }

/* Ghost editor card widths (required) */
.kg-width-wide { position: relative; width: min(75vw, 1000px); left: 50%; transform: translateX(-50%); }
.kg-width-full { position: relative; width: 100vw; left: 50%; transform: translateX(-50%); }
.kg-width-full img { border-radius: 0; }
.kg-image-card figcaption, .kg-embed-card figcaption { font: 0.85rem var(--sans); color: var(--ink-soft); margin-top: 8px; }

.article-foot { padding-bottom: 48px; }
.nfa { font: 0.95rem/1.55 var(--sans); padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); }
.article-tags { font-size: 0.9rem; color: var(--ink-soft); }

.related { padding-top: clamp(40px, 6vw, 64px); padding-bottom: clamp(40px, 6vw, 64px); }

/* Archives */
.archive-head { padding-top: clamp(40px, 6vw, 72px); }
.archive-kind { margin: 0 0 6px; color: var(--ink-soft); font-weight: 600; }
.archive-title { font: 500 clamp(2.2rem, 5vw, 3.4rem)/1.08 var(--serif); margin: 0 0 12px; letter-spacing: -0.02em; }
.archive-desc { font-size: 1.1rem; color: var(--ink-soft); max-width: 40rem; margin: 0; }
.author-photo { width: 72px; height: 72px; border-radius: 50%; margin-bottom: 16px; object-fit: cover; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding-top: 48px; font-size: 0.93rem; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 0.8fr 1.4fr; gap: 40px; }
.footer-brand { font: 500 1.3rem var(--serif); margin: 0 0 10px; }
.footer-about p, .footer-legal p { color: var(--ink-soft); margin: 0 0 12px; }
.footer-legal strong { color: var(--ink); }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-nav a { text-decoration: none; font-weight: 500; }
.footer-base { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 32px; padding-top: 16px; padding-bottom: 24px; color: var(--ink-soft); }
.footer-base p { margin: 0; }

/* Error */
.error { padding: 96px var(--gutter); max-width: 40rem; }
.error-code { font: 700 1rem var(--sans); color: var(--gold-ink); }
.error h1 { font: 500 2.4rem/1.15 var(--serif); }

@media (prefers-color-scheme: dark) {
  .brand-mark { background: var(--gold); color: #1b1300; }
}

/* Responsive */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .feed { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-legal { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .menu-toggle { display: inline-flex; align-items: center; }
  .menu { display: none; position: absolute; left: 0; right: 0; top: 68px; background: var(--surface); border-bottom: 1px solid var(--line); padding: 16px var(--gutter) 20px; flex-direction: column; align-items: stretch; }
  .menu.is-open { display: flex; }
  .primary-nav ul { flex-direction: column; gap: 4px; }
  .primary-nav a { display: block; padding: 10px 0; }
  .masthead-row { position: relative; }
  .regionbar-tools { display: none; }
  .topic-index { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .feed { grid-template-columns: 1fr; }
  .home-template .feed .entry:first-child { grid-column: auto; }
  .footer-grid { grid-template-columns: 1fr; }
  .article-content { font-size: 1.08rem; }
  .kg-width-wide { width: 100%; left: 0; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
