/* Belfed Learn — shared styles.
   Reuses the homepage brand tokens and base components so /learn/ pages
   are visually identical to belfed.com without duplicating the full
   homepage stylesheet. Keep tokens in sync with index.html :root. */

:root {
  --font-mono: 'Courier Prime', 'Courier New', ui-monospace, monospace;
  --font-sans: 'Courier Prime', 'Courier New', ui-monospace, monospace;
  --font-inter: 'Inter', ui-sans-serif, system-ui, sans-serif;

  --white: #f5f5f0;
  --paper: #efefe7;
  --paper-2: #e7e7dd;
  --rule: #1a1a1a14;
  --rule-strong: #1a1a1a26;
  --black: #0a0a0a;
  --ink: #161614;
  --ink-2: #2a2a26;
  --gray: #66665f;
  --gray-soft: #57574f;
  --gray-faint: #b3b3a8;

  --green: #1a6b3a;
  --green-soft: #1a6b3a14;
  --green-strong: #14542d;
  --red: #8b1a1a;
  --gold: #b8860b;
  --gold-ink: #7e6300;

  --shadow-soft: 0 1px 0 #1a1a1a0d, 0 8px 24px #1a1a1a0a;
  --shadow-frame: 0 1px 0 #1a1a1a14, 0 12px 40px #1a1a1a12;

  --radius: 4px;
  --radius-lg: 8px;
  --maxw: 1240px;
  --maxw-narrow: 820px;
  --t: 200ms cubic-bezier(.2,.7,.2,1);
}

[data-theme="dark"] {
  --white: #0d0d0a;
  --paper: #131310;
  --paper-2: #1a1a16;
  --rule: #ffffff14;
  --rule-strong: #ffffff26;
  --black: #f1f1ea;
  --ink: #e5e5dc;
  --ink-2: #c9c9bf;
  --gray: #8a8a82;
  --gray-soft: #a3a39a;
  --gray-faint: #4a4a44;
  --green: #2fa05a;
  --green-soft: #2fa05a1f;
  --green-strong: #46c277;
  --red: #d65a5a;
  --gold: #d6a020;
  --gold-ink: #d6a020;
  --shadow-soft: 0 1px 0 #00000040, 0 8px 24px #00000040;
  --shadow-frame: 0 1px 0 #00000060, 0 12px 40px #00000060;
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-mono);
  font-size: 15px; line-height: 1.6;
  color: var(--ink); background: var(--white);
  transition: background var(--t), color var(--t);
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: var(--green); color: var(--white); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 1000; background: var(--green); color: var(--white); padding: 10px 16px; border-radius: 0 0 6px 0; font-weight: 600; text-decoration: none; }
.skip-link:focus { left: 0; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.wrap-narrow { max-width: var(--maxw-narrow); margin: 0 auto; padding: 0 28px; }

.label {
  font-family: var(--font-mono); font-size: 12px; font-weight: 400;
  color: var(--gray); text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 14px; display: inline-block;
}
.label::before { content: "// "; color: var(--gray-faint); }

h1, h2, h3, h4 { font-family: var(--font-mono); font-weight: 700; color: var(--black); letter-spacing: -0.01em; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(32px, 4.8vw, 52px); line-height: 1.08; letter-spacing: -0.02em; }
h2 { font-size: clamp(24px, 3vw, 34px); }
h3 { font-size: 19px; }
p { text-wrap: pretty; }

/* NAV — mirrors homepage */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: color-mix(in oklab, var(--white) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.logo { font-family: var(--font-mono); font-weight: 700; font-size: 17px; letter-spacing: 0.22em; color: var(--black); white-space: nowrap; }
.logo .cursor { display: inline-block; animation: blink 1.2s steps(1) infinite; color: var(--green); margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a { font-family: var(--font-mono); font-size: 13px; color: var(--gray-soft); letter-spacing: 0.04em; }
.nav-links a:hover, .nav-links a.active { color: var(--black); }
.nav-right { display: flex; align-items: center; gap: 14px; }
.theme-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--gray-soft); }
.theme-btn:hover { color: var(--black); background: var(--paper); }
.hamburger { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; color: var(--gray-soft); border-radius: 6px; }

/* Learn — subtle "beta" product-status annotation above the nav label */
.nav-learn { position: relative; }
.nav-learn .nav-learn-label { position: relative; display: inline-block; }
.nav-learn .beta-tag {
  position: absolute; left: 50%; bottom: 100%;
  transform: translateX(-50%); margin-bottom: 1px;
  font-family: var(--font-mono); font-size: 8px; line-height: 1;
  font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold-ink); white-space: nowrap; pointer-events: none;
}
/* Keep the Learn tap target at >=44px without shifting the label baseline */
.nav-learn::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%); width: 100%; min-width: 44px; height: 44px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: 99px; transition: all var(--t); border: 1px solid transparent;
}
.btn-primary { background: var(--black); color: var(--white); }
.btn-primary:hover { background: var(--green-strong); transform: translateY(-1px); box-shadow: 0 6px 24px #1a6b3a26; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn-ghost:hover { border-color: var(--black); color: var(--black); }
.btn-sm { padding: 8px 14px; font-size: 11px; }

/* Breadcrumb */
.breadcrumb { padding: 22px 0 0; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--gray-soft); text-transform: uppercase; }
.breadcrumb li { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb li + li::before { content: "/"; color: var(--gray-faint); }
.breadcrumb a { color: var(--gray-soft); }
.breadcrumb a:hover { color: var(--green-strong); }
.breadcrumb [aria-current="page"] { color: var(--ink); }

/* Page header */
.page-head { padding: 40px 0 8px; }
.page-head h1 { margin-bottom: 18px; }
.page-head .intro { font-family: var(--font-sans); font-size: 15px; color: var(--ink-2); line-height: 1.75; max-width: 68ch; letter-spacing: 0.005em; }
.page-head .intro a { color: var(--green-strong); font-weight: 700; }
.page-head .intro a:hover { text-decoration: underline; }

/* Learn hub */
.learn-section { padding: 28px 0; }
.learn-sec-title { font-size: clamp(20px, 2.4vw, 26px); margin-bottom: 22px; }
.learn-cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.learn-cat-card { padding: 28px 26px; border: 1px solid var(--rule-strong); border-radius: var(--radius-lg); background: var(--paper); display: flex; flex-direction: column; }
.learn-cat-card h3 { font-size: 17px; margin-bottom: 10px; }
.learn-cat-card p { font-family: var(--font-sans); font-size: 13px; color: var(--ink-2); line-height: 1.7; letter-spacing: 0.005em; margin-bottom: 18px; }
.learn-cat-status { margin-top: auto; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--green-strong); }
.learn-cat-card:last-child .learn-cat-status { color: var(--gray-soft); }

.learn-article-list { display: flex; flex-direction: column; gap: 18px; }
.learn-article-card { padding: 28px 30px; border: 1px solid var(--rule-strong); border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow-soft); }
.learn-article-cat { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--green-strong); display: block; margin-bottom: 12px; }
.learn-article-card h3 { font-size: 21px; margin-bottom: 10px; }
.learn-article-card h3 a { color: var(--black); }
.learn-article-card h3 a:hover { color: var(--green-strong); }
.learn-article-card p { font-family: var(--font-sans); font-size: 13.5px; color: var(--ink-2); line-height: 1.7; letter-spacing: 0.005em; margin-bottom: 12px; }
.learn-article-meta { font-family: var(--font-mono); font-size: 11px; color: var(--gray-soft); letter-spacing: 0.04em; }

.learn-cta { margin: 8px 0 40px; padding: 44px 40px; border: 1px solid var(--rule-strong); border-radius: var(--radius-lg); background: var(--paper); text-align: center; }
.learn-cta h2 { margin-bottom: 12px; }
.learn-cta p { font-family: var(--font-sans); font-size: 14px; color: var(--ink-2); line-height: 1.7; max-width: 62ch; margin: 0 auto 24px; letter-spacing: 0.005em; }
.learn-cta .btn { margin: 6px; }

.learn-disclaimer { font-family: var(--font-mono); font-size: 11px; color: var(--gray-soft); line-height: 1.7; max-width: 82ch; margin: 0 auto 8px; padding: 0 4px; }
.learn-disclaimer a { color: var(--green-strong); font-weight: 700; }
.learn-disclaimer a:hover { text-decoration: underline; }

/* Article */
.article { padding: 8px 0 24px; }
.article-meta-row { font-family: var(--font-mono); font-size: 11px; color: var(--gray-soft); letter-spacing: 0.04em; margin: 6px 0 26px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.article-meta-row .byline { color: var(--ink-2); }
.article-disclaimer-top {
  font-family: var(--font-sans); font-size: 12.5px; font-style: italic;
  color: var(--ink-2); line-height: 1.7; letter-spacing: 0.005em;
  border-left: 3px solid var(--gold); background: var(--paper);
  padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 34px;
}
.article-body { font-family: var(--font-sans); font-size: 15.5px; line-height: 1.8; color: var(--ink); letter-spacing: 0.004em; }
.article-body > h2 { margin: 40px 0 14px; }
.article-body > h3 { margin: 28px 0 10px; }
.article-body p { margin-bottom: 18px; }
.article-body a { color: var(--green-strong); font-weight: 700; }
.article-body a:hover { text-decoration: underline; }
.article-body ul, .article-body ol { margin: 0 0 18px 1.3em; }
.article-body li { margin-bottom: 10px; }
.article-body strong { color: var(--black); }
.article-body .formula {
  font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: var(--black);
  background: var(--paper); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  padding: 16px 20px; margin: 0 0 20px; text-align: center; overflow-x: auto;
}
.table-scroll { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--rule-strong); border-radius: var(--radius-lg); }
.article-body table { border-collapse: collapse; width: 100%; min-width: 560px; font-family: var(--font-mono); font-size: 12.5px; }
.article-body th, .article-body td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; line-height: 1.5; }
.article-body th { background: var(--paper); color: var(--black); font-weight: 700; letter-spacing: 0.02em; }
.article-body tr:last-child td { border-bottom: none; }

.faq { margin-top: 40px; padding-top: 8px; }
.faq h2 { margin-bottom: 8px; }
.faq-item { border-top: 1px solid var(--rule); padding: 20px 0; }
.faq-item h3 { font-size: 16px; margin-bottom: 8px; }
.faq-item p { font-family: var(--font-sans); font-size: 14px; color: var(--ink-2); line-height: 1.75; letter-spacing: 0.005em; }
.faq-item a { color: var(--green-strong); font-weight: 700; }
.faq-item a:hover { text-decoration: underline; }

.article-disclaimer-bottom {
  font-family: var(--font-sans); font-size: 12.5px; font-style: italic;
  color: var(--gray-soft); line-height: 1.7; letter-spacing: 0.005em;
  border-top: 1px solid var(--rule); margin-top: 36px; padding-top: 24px;
}

.article-next {
  margin: 36px 0 8px; padding: 26px 28px; border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg); background: var(--paper);
}
.article-next .label { margin-bottom: 8px; }
.article-next a { color: var(--green-strong); font-weight: 700; font-size: 16px; }
.article-next a:hover { text-decoration: underline; }

/* Footer — mirrors homepage */
footer { padding: 48px 0 32px; background: var(--paper); border-top: 1px solid var(--rule); margin-top: 40px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 36px; }
.foot-brand p { font-family: var(--font-sans); font-size: 12px; color: var(--gray-soft); margin-top: 12px; max-width: 32ch; line-height: 1.7; letter-spacing: 0.005em; }
.foot-col h3 { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gray-soft); margin-bottom: 14px; }
.foot-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.foot-col a { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); }
.foot-col a:hover { color: var(--green-strong); }
.foot-bottom { padding-top: 24px; border-top: 1px solid var(--rule); font-family: var(--font-mono); font-size: 11px; color: var(--gray-soft); display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.foot-disclaim { max-width: 56ch; line-height: 1.6; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .hamburger { display: inline-flex; }
  .learn-cat-grid { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 600px) {
  .wrap, .wrap-narrow { padding: 0 20px; }
  .foot-grid { grid-template-columns: 1fr; }
  .learn-cta { padding: 32px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .logo .cursor { animation: none; }
}
