/* RuleCrest public site. Self-hosted only: no web fonts, no third-party resources (the CSP is default-src 'self').
   Tokens first; light is the base, dark redefines the tokens only (system preference, then an explicit choice). */
:root {
  --bg: #F3F2EE;
  --bg-soft: #E8E7E1;
  --card: #FFFFFF;
  --ink: #17181C;
  --slate: #5A5E68;
  --hairline: #DAD8D1;
  --tape: #E0A500;
  --tape-ink: #17181C;
  --tape-text: #6B4A00;
  --verify: #1F7A4D;
  --verify-soft: #E4F3EA;
  --signal: #B3261E;
  --link: #1F7A4D;
  --hero-from: #FFFFFF;
  --hero-to: #ECEAE4;
  --grid-line: rgba(23, 24, 28, .06);
  --radius: 12px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --edge: clamp(1.1rem, 4vw, 2.5rem);
  --measure: 66ch;
  --shadow: 0 1px 2px rgba(23, 24, 28, .06), 0 18px 40px -22px rgba(23, 24, 28, .35);
  --shadow-sm: 0 1px 2px rgba(23, 24, 28, .06), 0 6px 18px -12px rgba(23, 24, 28, .3);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15161A;
    --bg-soft: #1B1D22;
    --card: #1E2025;
    --ink: #F1F0EC;
    --slate: #A3A7B0;
    --hairline: #33363D;
    --tape: #F0B429;
    --tape-ink: #15161A;
    --tape-text: #F0B429;
    --verify: #5CC98F;
    --verify-soft: #1C3A2B;
    --signal: #FF8A80;
    --link: #5CC98F;
    --hero-from: #1A1C21;
    --hero-to: #15161A;
    --grid-line: rgba(237, 240, 238, .06);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 18px 40px -22px rgba(0, 0, 0, .8);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px -12px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  --bg: #15161A;
  --bg-soft: #1B1D22;
  --card: #1E2025;
  --ink: #F1F0EC;
  --slate: #A3A7B0;
  --hairline: #33363D;
  --tape: #F0B429;
  --tape-ink: #15161A;
  --tape-text: #F0B429;
  --verify: #5CC98F;
  --verify-soft: #1C3A2B;
  --signal: #FF8A80;
  --link: #5CC98F;
  --hero-from: #1A1C21;
  --hero-to: #15161A;
  --grid-line: rgba(237, 240, 238, .06);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 18px 40px -22px rgba(0, 0, 0, .8);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px -12px rgba(0, 0, 0, .7);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1.0625rem/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--tape); outline-offset: 3px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--tape); color: var(--tape-ink); padding: .6rem 1rem; z-index: 20; }
.skip:focus { left: 0; }
.wrap { width: min(74rem, 100% - 2 * var(--edge)); margin-inline: auto; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---- header ---- */
.top { border-bottom: 1px solid var(--hairline); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); position: sticky; top: 0; z-index: 10; }
.top__in { display: flex; align-items: center; gap: 1.25rem; min-height: 4.1rem; flex-wrap: wrap; padding-block: .5rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font: 700 1.2rem/1 var(--serif); letter-spacing: .005em; }
.brand img { width: 2rem; height: 2rem; border-radius: 6px; }
.nav { display: flex; gap: .25rem 1.4rem; flex-wrap: wrap; margin-left: auto; align-items: center; }
.nav a:not(.btn) { color: var(--ink); text-decoration: none; padding: .4rem 0; border-bottom: 2px solid transparent; font-size: .97rem; font-weight: 500; }
.nav a:not(.btn):hover, .nav a[aria-current="page"] { border-bottom-color: var(--tape); }
.btn { display: inline-flex; align-items: center; gap: .5rem; font: 600 .97rem/1 var(--sans); text-decoration: none; cursor: pointer; padding: .8rem 1.2rem; border-radius: 8px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn--tape { background: var(--tape); color: var(--tape-ink); border-color: var(--tape); }
.btn--quiet:hover { background: var(--ink); color: var(--bg); }
.btn--lg { padding: 1rem 1.5rem; font-size: 1.02rem; }
.theme { background: transparent; border: 1px solid var(--hairline); color: var(--slate); border-radius: 8px; padding: .4rem .65rem; font: .82rem var(--mono); cursor: pointer; }
.logo--for-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo--for-light { display: none; }
  :root:not([data-theme="light"]) .logo--for-dark { display: inline; }
}
:root[data-theme="dark"] .logo--for-light { display: none; }
:root[data-theme="dark"] .logo--for-dark { display: inline; }

/* ---- type ---- */
h1, h2, h3 { font-family: var(--serif); line-height: 1.12; text-wrap: balance; margin: 0 0 .6em; }
h1 { font-size: clamp(2.1rem, 4.3vw, 3.3rem); letter-spacing: -.015em; font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: var(--measure); }
.lede { font-size: 1.2rem; color: var(--slate); max-width: 58ch; }
.eyebrow { display: inline-flex; align-items: center; gap: .55rem; font: 700 .76rem/1 var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--tape-text); margin-bottom: 1rem; }
.eyebrow::before { content: ""; width: 1.6rem; height: 3px; background: var(--tape); border-radius: 2px; }
.small { font-size: .92rem; color: var(--slate); }
.section-head { max-width: 48rem; margin-bottom: 2.2rem; }
.section-head p { color: var(--slate); }

/* ---- sections ---- */
section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.band { background: var(--bg-soft); border-block: 1px solid var(--hairline); }
.tapeline { height: 8px; background: repeating-linear-gradient(-45deg, var(--tape) 0 14px, var(--ink) 14px 28px); opacity: .92; }

.hero { padding-block: clamp(3rem, 8vw, 6.5rem) clamp(2.5rem, 6vw, 4.5rem); background:
  linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 44px 44px,
  linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 44px 44px,
  linear-gradient(180deg, var(--hero-from), var(--hero-to)); border-bottom: 1px solid var(--hairline); }
.hero__grid { display: grid; gap: clamp(2rem, 5vw, 4rem); grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; }
.hero__cta { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.75rem; }
.stats { list-style: none; padding: 0; margin: 2.6rem 0 0; display: flex; gap: 1.5rem 2.8rem; flex-wrap: wrap; }
.stats li { display: grid; }
.stats b { font: 700 2.3rem/1 var(--serif); }
.stats span { color: var(--slate); font-size: .92rem; margin-top: .2rem; }

.page-hero { padding-block: clamp(2.6rem, 6vw, 4.2rem) clamp(2rem, 4vw, 3rem); background:
  linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 44px 44px,
  linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 44px 44px,
  linear-gradient(180deg, var(--hero-from), var(--hero-to)); border-bottom: 1px solid var(--hairline); }
.page-hero h1 { font-size: clamp(2rem, 4.2vw, 3rem); margin-bottom: .4em; }
.page-hero .lede { margin-bottom: 0; }

/* trust strip */
.trust { padding-block: 1.4rem; border-bottom: 1px solid var(--hairline); background: var(--bg); }
.trust__in { display: flex; gap: .6rem 1.3rem; flex-wrap: wrap; align-items: center; justify-content: center; color: var(--slate); font: 600 .78rem var(--mono); letter-spacing: .03em; }
.trust__in span { display: inline-flex; align-items: center; gap: .5rem; }
.trust__in .icon { width: 1.05rem; height: 1.05rem; color: var(--verify); }

/* product visual */
.visual { background: var(--card); border: 1px solid var(--hairline); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.visual__bar { display: flex; align-items: center; gap: .4rem; padding: .65rem .9rem; border-bottom: 1px solid var(--hairline); background: var(--bg-soft); }
.visual__dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--hairline); }
.visual__title { margin-left: .6rem; font: 600 .76rem var(--mono); color: var(--slate); }
.visual__body { padding: 1.2rem 1.3rem 1.3rem; display: grid; gap: 1rem; }
.mod { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center; font-size: .92rem; }
.mod__n { width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; font: 700 .76rem var(--mono); background: var(--bg-soft); color: var(--slate); }
.mod--done .mod__n { background: var(--verify); color: var(--bg); }
.mod--now .mod__n { background: var(--tape); color: var(--tape-ink); }
.mod__track { height: .5rem; border-radius: 4px; background: var(--bg-soft); overflow: hidden; }
.mod__fill { display: block; height: 100%; background: var(--verify); border-radius: 4px; }
.mod--now .mod__fill { background: var(--tape); }
.mod__score { font: 700 .8rem var(--mono); color: var(--slate); }
.seal { display: flex; gap: .9rem; align-items: center; border-top: 1px dashed var(--hairline); padding-top: 1rem; }
.seal svg { width: 3rem; height: 3rem; }
.seal b { display: block; font-size: .95rem; }
.seal span { color: var(--slate); font-size: .82rem; font-family: var(--mono); }
.visual__label { position: absolute; }

/* cards and grids */
.grid { display: grid; gap: 1.25rem; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr)); }
.panel { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 1.5rem 1.5rem 1.4rem; box-shadow: var(--shadow-sm); }
.panel h3 { margin-bottom: .4em; }
.panel p:last-child { margin-bottom: 0; }
.panel .icon { color: var(--verify); margin-bottom: .9rem; width: 1.9rem; height: 1.9rem; }
.panel--accent { border-top: 4px solid var(--tape); }

/* steps */
.steps { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); counter-reset: step; }
.step { position: relative; padding: 1.4rem 1.4rem 1.3rem 1.4rem; background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--tape); color: var(--tape-ink); font: 700 .95rem var(--mono); margin-bottom: .9rem; }
.step h3 { margin-bottom: .3em; }
.step p:last-child { margin: 0; color: var(--slate); }

/* specimen certificate */
.specimen { background: var(--card); border: 1px solid var(--hairline); border-radius: 12px; box-shadow: var(--shadow); padding: 1.6rem 1.6rem 1.4rem; border-top: 8px solid var(--tape); position: relative; }
.specimen__label { position: absolute; top: -.85rem; right: 1rem; background: var(--ink); color: var(--bg); font: 700 .68rem/1 var(--mono); letter-spacing: .14em; padding: .38rem .55rem; border-radius: 3px; }
.specimen h2 { font-size: 1.35rem; margin-bottom: .2em; }
.specimen dl { margin: 1rem 0 0; display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; font-size: .92rem; }
.specimen dt { color: var(--slate); font-family: var(--mono); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; padding-top: .15rem; }
.specimen dd { margin: 0; }
.specimen .sig { font-family: var(--mono); font-size: .74rem; color: var(--slate); word-break: break-all; margin: 1rem 0 0; padding-top: .8rem; border-top: 1px dashed var(--hairline); }

/* course catalog */
.group { margin-bottom: 3.2rem; }
.group h2 { font-size: 1.5rem; }
.group__blurb { color: var(--slate); }
.courses { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); }
.course { background: var(--card); border: 1px solid var(--hairline); border-left: 5px solid var(--tape); border-radius: var(--radius); padding: 1.15rem 1.25rem; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.course h3 { font-size: 1.08rem; }
.course p { font-size: .95rem; }
.course__meta { color: var(--slate); font-family: var(--mono); font-size: .82rem; margin: auto 0 0; padding-top: .5rem; }

/* facts and tallies */
.facts { padding-left: 1.2rem; max-width: var(--measure); }
.facts li { margin-bottom: .55rem; }
.tallies { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr)); }
.tally { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 1.35rem 1.5rem; box-shadow: var(--shadow-sm); }
.tally h3 { font-size: .8rem; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--slate); }
.tally__n { font: 700 2.8rem/1 var(--serif); margin: .2rem 0 .9rem; }
.tally__n span { font: 400 .95rem var(--sans); color: var(--slate); }
.tally__list { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; gap: .4rem 1.2rem; flex-wrap: wrap; font-size: .94rem; }
.bar { display: flex; height: .8rem; width: 100%; min-width: 8rem; background: var(--hairline); overflow: hidden; border-radius: 999px; }
.bar__seg { display: block; height: 100%; }
.bar__seg--met { background: var(--verify); }
.bar__seg--progress { background: var(--tape); }
.bar__seg--planned { background: var(--signal); }
.bar__seg--golive { background: repeating-linear-gradient(-45deg, var(--slate) 0 4px, transparent 4px 8px); }
.bar__seg--na { background: var(--hairline); }
.table-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--card); margin-top: .6rem; }
table.data { border-collapse: collapse; width: 100%; font-size: .94rem; }
table.data th, table.data td { padding: .6rem .75rem; border-bottom: 1px solid var(--hairline); text-align: left; vertical-align: middle; }
table.data thead th { font: 700 .72rem/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--slate); background: var(--bg-soft); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td:nth-child(4) { min-width: 9rem; }
details { margin-top: 1rem; }
details > summary { cursor: pointer; padding: .7rem 0; font-weight: 600; }
details[open] > summary { margin-bottom: .4rem; }

.notice { border: 1px solid var(--hairline); border-left: 5px solid var(--tape); border-radius: var(--radius); background: var(--card); padding: 1.2rem 1.4rem; max-width: 74ch; box-shadow: var(--shadow-sm); }
.notice h3 { margin-bottom: .3em; }
.notice p:last-child { margin-bottom: 0; }

/* call to action */
.cta { padding-block: clamp(2.6rem, 6vw, 4rem); background: var(--ink); color: var(--bg); }
.cta__in { display: flex; gap: 1.5rem 2.5rem; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.cta h2 { margin: 0; color: var(--bg); font-size: clamp(1.5rem, 3vw, 2.1rem); }
.cta p { color: color-mix(in srgb, var(--bg) 78%, var(--ink)); margin: .4rem 0 0; }
.cta .btn--quiet { border-color: var(--bg); color: var(--bg); }
.cta .btn--quiet:hover { background: var(--bg); color: var(--ink); }

/* ---- footer ---- */
.foot { border-top: 1px solid var(--hairline); padding-block: 2.6rem 3rem; color: var(--slate); font-size: .94rem; background: var(--bg); }
.foot__cols { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); }
.foot h3 { font: 700 .76rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); margin-bottom: .8rem; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.foot a { color: var(--slate); text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }
.foot__brand { font: 700 1.2rem var(--serif); color: var(--ink); margin: 0 0 .5rem; }
.foot__note { border-top: 1px solid var(--hairline); margin-top: 2rem; padding-top: 1.2rem; font-size: .86rem; }

@media (max-width: 52rem) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  /* the menu is one row that scrolls sideways instead of wrapping into three; each link is a 44 px target */
  .top { position: sticky; top: 0; z-index: 30; }
  .top__in { gap: .5rem 1rem; }
  .nav { margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; gap: .25rem 1.1rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: .15rem; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a:not(.btn) { padding: .7rem 0; white-space: nowrap; }
  .nav .btn, .nav .theme { flex: none; }
  .foot__cols { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .btn:hover { transform: none; }
}
@media print {
  .top, .tapeline, .theme, .cta { display: none; }
  body { background: #fff; color: #000; }
  .hero, .page-hero { background: #fff; }
}

/* ---- course families (catalog page and home) ---- */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; }
.chip { display: inline-flex; align-items: center; font: 700 .72rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: .38rem .6rem; border-radius: 999px; background: var(--verify-soft); color: var(--verify); border: 1px solid transparent; }
.chip--link { background: var(--card); color: var(--ink); border-color: var(--hairline); text-decoration: none; padding: .55rem .85rem; font-size: .76rem; }
.chip--link:hover { border-color: var(--tape); box-shadow: var(--shadow-sm); }
.group { scroll-margin-top: 5.5rem; padding-block: 0; }
.group__head { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-bottom: .7rem; }
.group__head h2 { margin: 0; font-size: clamp(1.35rem, 2.4vw, 1.75rem); }
.group__tag { font: 700 .8rem/1 var(--mono); letter-spacing: .12em; background: var(--tape); color: var(--tape-ink); padding: .45rem .65rem; border-radius: 6px; }
.group__count { margin-left: auto; color: var(--slate); font: 600 .78rem var(--mono); }
.course__top { min-height: 1.4rem; margin-bottom: .5rem; }
.course--soon { border-left-style: dashed; border-left-color: var(--hairline); background: transparent; box-shadow: none; }
.family { display: flex; flex-direction: column; gap: .35rem; background: var(--card); border: 1px solid var(--hairline); border-top: 4px solid var(--tape); border-radius: var(--radius); padding: 1.3rem 1.35rem 1.15rem; box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none; transition: transform .12s ease, box-shadow .12s ease; }
.family:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.family h3 { margin: 0; }
.family p { color: var(--slate); font-size: .95rem; margin: 0; }
.family__tag { font: 700 .74rem/1 var(--mono); letter-spacing: .12em; color: var(--tape-text); }
.family__meta { margin-top: auto; padding-top: .7rem; font: 600 .78rem var(--mono); color: var(--slate); }
@media (prefers-reduced-motion: reduce) { .family { transition: none; } .family:hover { transform: none; } }
