/* themex.ca */
/* the platform for people who build sites for other people and are tired of starting over */

/* this took longer than i'd like to admit */
/* safari strikes again — this fix is load-bearing */
/* resist the urge to add more breakpoints */
/* z-index: 9 because 10 felt arrogant */
/* don't let anyone talk you into a CSS framework here */
/* the spacing scale took three rounds. this is the one */

/* component playground: iframe approach was tried. abandoned. too fragile on mobile */
/* system-builder state lives in localStorage — keep it simple, no redux temptation */
/* the token table on design-systems page is the hardest thing here to keep aligned */
/* brand-generator: three color modes felt like enough. four felt like a settings panel */
/* the tool cards are not cards. they are decision surfaces. naming matters */
/* audit tool scoring: 0–100 felt fake. switched to zone labels. better */

/* reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
input, button, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }
button { cursor: pointer; border: none; background: none; }

/* tokens */
:root {
  --c-bg:          #0b0e14;
  --c-surface:     #131720;
  --c-surface-2:   #1c2130;
  --c-border:      #252d3d;
  --c-border-soft: #1a2133;
  --c-text:        #e8ecf4;
  --c-subtle:      #7a8499;
  --c-muted:       #3d4659;
  --c-violet:      #8b5cf6;
  --c-violet-dim:  #5b3db0;
  --c-electric:    #3b82f6;
  --c-teal:        #14b8a6;
  --c-teal-dim:    #0d8a7c;
  --c-success:     #22c55e;
  --c-warning:     #f59e0b;
  --c-error:       #ef4444;
  --font-ui:      'Switzer', system-ui, sans-serif;
  --font-display: 'Lora', Georgia, serif;
  --fs-xs:   0.75rem;
  --fs-sm:   0.875rem;
  --fs-base: 1rem;
  --fs-md:   1.125rem;
  --fs-lg:   1.25rem;
  --fs-xl:   1.5rem;
  --fs-2xl:  2rem;
  --fs-3xl:  2.75rem;
  --fs-4xl:  3.5rem;
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;
  --radius-sm:  4px;
  --radius:     8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow:     0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.6);
  --shadow-glow-violet: 0 0 24px rgba(139,92,246,0.25);
  --shadow-glow-teal:   0 0 24px rgba(20,184,166,0.2);
  --transition: 200ms ease;
  --transition-slow: 400ms ease;
  --z-header:  9;
  --z-modal:   8;
  --z-overlay: 7;
  --z-toast:   6;
  --z-cookie:  5;
  --z-btt:     4;
  --header-h: 64px;
  --container: 1200px;
  --logo-w: 140px;
  --logo-h: 36px;
}

/* base */
body { font-family: var(--font-ui); font-size: var(--fs-base); color: var(--c-text); background: var(--c-bg); }
h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.25; color: var(--c-text); }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p { color: var(--c-subtle); line-height: 1.75; }
code { font-family: 'Fira Code','Cascadia Code',monospace; font-size: 0.875em; background: var(--c-surface-2); padding: 2px 6px; border-radius: var(--radius-sm); color: var(--c-teal); }
pre { background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--radius); padding: var(--sp-6); overflow-x: auto; font-size: var(--fs-sm); line-height: 1.7; }
pre code { background: none; padding: 0; border-radius: 0; }
a.text-link { color: var(--c-violet); text-decoration: underline; text-underline-offset: 3px; }
a.text-link:hover { color: var(--c-text); }

/* layout */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--sp-6); }
main { padding-top: var(--header-h); }
.section { padding: var(--sp-20) 0; }
.section-header { margin-bottom: var(--sp-12); }
.section-header h2 { margin-bottom: var(--sp-3); }
.section-header p { font-size: var(--fs-md); max-width: 600px; }
.section-label { display: inline-block; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--c-violet); margin-bottom: var(--sp-3); }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--sp-6); }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: var(--sp-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--sp-6); }
.btn { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: 600; border-radius: var(--radius); padding: var(--sp-3) var(--sp-5); transition: var(--transition); white-space: nowrap; }
.btn-primary { background: var(--c-violet); color: #fff; border: 1px solid var(--c-violet); }
.btn-primary:hover { background: var(--c-violet-dim); border-color: var(--c-violet-dim); }
.btn-secondary { background: transparent; color: var(--c-text); border: 1px solid var(--c-border); }
.btn-secondary:hover { border-color: var(--c-violet); color: var(--c-violet); }
.btn-teal { background: var(--c-teal); color: #0b0e14; border: 1px solid var(--c-teal); font-weight: 700; }
.btn-teal:hover { background: var(--c-teal-dim); border-color: var(--c-teal-dim); }
.btn-sm { font-size: var(--fs-xs); padding: var(--sp-2) var(--sp-4); }
.btn-lg { font-size: var(--fs-base); padding: var(--sp-4) var(--sp-8); }
.divider { border: none; border-top: 1px solid var(--c-border); margin: var(--sp-12) 0; }
.page-hero { padding: var(--sp-16) 0 var(--sp-12); border-bottom: 1px solid var(--c-border); margin-bottom: var(--sp-12); }
.page-hero h1 { margin-bottom: var(--sp-4); }
.page-hero p { font-size: var(--fs-md); max-width: 640px; }
.breadcrumb { padding: var(--sp-4) 0; border-bottom: 1px solid var(--c-border-soft); margin-bottom: var(--sp-8); }
.breadcrumb ol { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.breadcrumb li { display: flex; align-items: center; gap: var(--sp-2); }
.breadcrumb li + li::before { content: "›"; color: var(--c-subtle); }
.breadcrumb a { font-size: var(--fs-sm); color: var(--c-subtle); }
.breadcrumb a:hover { color: var(--c-text); }
.breadcrumb [aria-current="page"] { font-size: var(--fs-sm); color: var(--c-text); }
#reading-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0%; background: linear-gradient(90deg, var(--c-violet), var(--c-teal)); z-index: calc(var(--z-header) + 1); transition: width 100ms linear; }
#back-to-top { position: fixed; bottom: var(--sp-8); right: var(--sp-8); width: 44px; height: 44px; background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--radius); color: var(--c-subtle); display: flex; align-items: center; justify-content: center; z-index: var(--z-btt); opacity: 0; transform: translateY(12px); transition: var(--transition); pointer-events: none; }
#back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
#back-to-top:hover { color: var(--c-text); border-color: var(--c-violet); }

/* header */
#site-header { position: fixed; top: 0; left: 0; right: 0; height: var(--header-h); background: rgba(11,14,20,0.95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--c-border-soft); z-index: var(--z-header); overflow: hidden; }
.nav-inner { display: flex; align-items: center; gap: var(--sp-8); height: var(--header-h); overflow: hidden; }
.nav-logo { display: flex; align-items: center; flex-shrink: 0; }
.nav-logo img { max-width: var(--logo-w); max-height: var(--logo-h); width: auto; height: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: var(--sp-6); flex: 1; }
.nav-links a { font-size: var(--fs-sm); color: var(--c-subtle); font-weight: 500; transition: var(--transition); white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { color: var(--c-text); }
.nav-actions { display: flex; align-items: center; flex-shrink: 0; }
.hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 40px; padding: var(--sp-2); color: var(--c-text); flex-shrink: 0; }
.hamburger span { display: block; height: 2px; background: currentColor; border-radius: 2px; transition: var(--transition); }

/* system launchpad */
.launchpad { padding: var(--sp-16) 0 var(--sp-12); border-bottom: 1px solid var(--c-border); }
.launchpad-inner { display: grid; grid-template-columns: 3fr 2fr; gap: 0; align-items: start; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg); overflow: hidden; }
.launchpad-preview { padding: var(--sp-8); border-right: 1px solid var(--c-border); }
.lp-system-tabs { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-6); }
.lp-system-tabs button { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-sm); color: var(--c-subtle); border: 1px solid var(--c-border); background: transparent; transition: var(--transition); }
.lp-system-tabs button:hover { color: var(--c-text); }
.lp-system-tabs button[aria-selected="true"] { background: var(--c-violet); color: #fff; border-color: var(--c-violet); }
.lp-token-display { min-height: 320px; }
.lp-section { margin-bottom: var(--sp-6); }
.lp-section-label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--c-muted); margin-bottom: var(--sp-3); }
.lp-swatches { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.lp-swatch { width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.08); opacity: 0; transform: translateY(8px); animation: swatchIn 400ms ease forwards; }
.lp-type-samples { display: flex; flex-direction: column; gap: var(--sp-2); }
.lp-type-sample { color: var(--c-text); line-height: 1.2; opacity: 0; transform: translateY(8px); animation: swatchIn 400ms ease forwards; }
.lp-spacing-bars { display: flex; flex-direction: column; gap: var(--sp-2); }
.lp-spacing-bar-row { display: flex; align-items: center; gap: var(--sp-3); }
.lp-spacing-bar-label { font-size: var(--fs-xs); color: var(--c-muted); width: 36px; flex-shrink: 0; }
.lp-spacing-bar { height: 8px; border-radius: var(--radius-sm); background: var(--c-violet); opacity: 0.6; width: 0; animation: barGrow 600ms ease forwards; }
.launchpad-actions { padding: var(--sp-8); }
.launchpad-actions nav { display: flex; flex-direction: column; }
.lp-action { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-5) var(--sp-3); border-bottom: 1px solid var(--c-border-soft); color: var(--c-text); transition: var(--transition); border-left: 3px solid transparent; }
.lp-action:last-child { border-bottom: none; }
.lp-action:hover { background: var(--c-surface-2); border-left-color: var(--c-violet); padding-left: var(--sp-4); }
.lp-action-icon { color: var(--c-violet); flex-shrink: 0; width: 20px; height: 20px; }
.lp-action-label { flex: 1; font-size: var(--fs-sm); font-weight: 600; }
.lp-action-arrow { color: var(--c-muted); flex-shrink: 0; }
.launchpad-caption { text-align: center; color: var(--c-subtle); font-size: var(--fs-md); margin-top: var(--sp-8); padding: 0 var(--sp-4); }

/* mobile menu */
.mobile-menu { display: none; position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; background: var(--c-bg); border-top: 1px solid var(--c-border); flex-direction: column; padding: var(--sp-8); gap: var(--sp-4); z-index: calc(var(--z-header) - 1); overflow-y: auto; }
.mobile-menu.open { display: flex; }
.mobile-menu a { font-size: var(--fs-xl); font-weight: 600; color: var(--c-text); padding: var(--sp-3) 0; border-bottom: 1px solid var(--c-border-soft); transition: var(--transition); }
.mobile-menu a:hover { color: var(--c-violet); }
.mobile-menu .btn { margin-top: var(--sp-4); align-self: flex-start; }

/* instrument card */
.instrument-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: var(--sp-6); cursor: pointer; transition: var(--transition); border-left: 3px solid transparent; display: flex; flex-direction: column; gap: var(--sp-3); }
.instrument-card:hover { border-color: var(--c-teal); border-left-color: var(--c-teal); box-shadow: var(--shadow-glow-teal); transform: translateY(-2px); }
.ic-header { display: flex; align-items: center; justify-content: space-between; }
.ic-icon { color: var(--c-teal); width: 24px; height: 24px; }
.ic-label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--c-muted); }
.ic-title { font-size: var(--fs-lg); font-weight: 700; color: var(--c-text); }
.ic-purpose { font-size: var(--fs-sm); color: var(--c-subtle); line-height: 1.6; }
.ic-outcome { font-size: var(--fs-sm); color: var(--c-teal); line-height: 1.6; }
.ic-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: var(--sp-4); border-top: 1px solid var(--c-border-soft); }
.ic-for { font-size: var(--fs-xs); color: var(--c-muted); }
.ic-launch { color: var(--c-subtle); }
.instruments-strip { display: grid; grid-template-columns: repeat(5,1fr); gap: var(--sp-4); }

/* zone label */
.zone-label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; padding: 3px 10px; border-radius: var(--radius-sm); display: inline-block; }
.zone--strong    { background: rgba(34,197,94,0.12);  color: var(--c-success); }
.zone--attention { background: rgba(245,158,11,0.12); color: var(--c-warning); }
.zone--critical  { background: rgba(239,68,68,0.12);  color: var(--c-error); }

/* token table */
.token-table { width: 100%; border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; font-size: var(--fs-sm); }
.token-table thead tr { background: var(--c-surface-2); }
.token-table th { text-align: left; padding: var(--sp-3) var(--sp-4); font-weight: 700; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-muted); border-bottom: 1px solid var(--c-border); }
.token-table td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--c-border-soft); color: var(--c-subtle); vertical-align: middle; }
.token-table tr:last-child td { border-bottom: none; }
.token-table tbody tr:hover { background: var(--c-surface-2); }
.token-table td:first-child { color: var(--c-text); font-weight: 500; }
.token-swatch { display: inline-block; width: 24px; height: 24px; border-radius: 4px; border: 1px solid var(--c-border); vertical-align: middle; }

/* generic card — used across sections */
.card-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--sp-6); }
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: var(--sp-6);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.card:hover { border-color: var(--c-violet); box-shadow: var(--shadow-glow-violet); transform: translateY(-2px); }
.card h3 { font-size: var(--fs-lg); font-weight: 600; color: var(--c-text); margin: 0; }
.card p { font-size: var(--fs-sm); color: var(--c-subtle); line-height: 1.65; margin: 0; }
.card-meta { font-size: var(--fs-xs); color: var(--c-muted); font-weight: 500; }
.card-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-violet);
  margin-top: auto;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border-soft);
}
.card:hover .card-link { color: var(--c-text); }
@media (max-width: 1024px) { .card-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px)  { .card-grid { grid-template-columns: 1fr; } }

/* page-specific: systems */
.system-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: var(--sp-8); transition: var(--transition); cursor: pointer; }
.system-card:hover { border-color: var(--c-violet); box-shadow: var(--shadow-glow-violet); transform: translateY(-2px); }
.system-card-label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--c-violet); margin-bottom: var(--sp-3); }
.system-card h3 { margin-bottom: var(--sp-3); }
.system-card p { font-size: var(--fs-sm); margin-bottom: var(--sp-4); }
.system-card-tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.tag { font-size: var(--fs-xs); padding: 2px 8px; border-radius: var(--radius-sm); background: var(--c-surface-2); color: var(--c-muted); border: 1px solid var(--c-border); }
.system-overview-grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--sp-12); align-items: start; }
.system-meta-block { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: var(--sp-6); }
.system-meta-block h4 { margin-bottom: var(--sp-4); font-size: var(--fs-base); }
.system-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin-bottom: var(--sp-6); }
.stat-item { display: flex; flex-direction: column; gap: var(--sp-1); }
.stat-value { font-size: var(--fs-2xl); font-weight: 700; color: var(--c-violet); }
.stat-label { font-size: var(--fs-xs); color: var(--c-muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* page-specific: instruments */
.tool-layout { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-8); align-items: start; }
.tool-panel { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); overflow: hidden; }
.tool-panel-header { padding: var(--sp-4) var(--sp-6); border-bottom: 1px solid var(--c-border); background: var(--c-surface-2); font-size: var(--fs-sm); font-weight: 700; color: var(--c-text); }
.tool-panel-body { padding: var(--sp-6); }
.field-group { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.field-label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-muted); }
.field-input { padding: var(--sp-3) var(--sp-4); background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--radius); color: var(--c-text); font-size: var(--fs-sm); width: 100%; transition: var(--transition); }
.field-input:focus { outline: none; border-color: var(--c-violet); box-shadow: 0 0 0 3px rgba(139,92,246,0.15); }
.field-input::placeholder { color: var(--c-muted); }
select.field-input { cursor: pointer; }
.radio-group, .checkbox-group { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.radio-option, .checkbox-option { display: flex; align-items: center; gap: var(--sp-2); cursor: pointer; font-size: var(--fs-sm); color: var(--c-subtle); }
.radio-option input, .checkbox-option input { accent-color: var(--c-violet); }
.output-block { background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--radius); padding: var(--sp-5); font-size: var(--fs-xs); line-height: 1.8; color: var(--c-teal); white-space: pre-wrap; margin-bottom: var(--sp-4); max-height: 400px; overflow-y: auto; font-family: 'Fira Code','Cascadia Code',monospace; }
.color-preview { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-6); }
.color-chip { width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.08); }
.tool-layout-3 { display: grid; grid-template-columns: 220px 1fr 1fr; gap: var(--sp-6); align-items: start; }
.component-selector { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); overflow: hidden; }
.component-selector-item { padding: var(--sp-3) var(--sp-5); font-size: var(--fs-sm); color: var(--c-subtle); cursor: pointer; border-left: 3px solid transparent; transition: var(--transition); }
.component-selector-item:hover { color: var(--c-text); background: var(--c-surface-2); }
.component-selector-item.active { color: var(--c-text); background: var(--c-surface-2); border-left-color: var(--c-teal); }
.audit-category { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: var(--sp-6); margin-bottom: var(--sp-5); }
.audit-category-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-5); }
.audit-category h3 { font-size: var(--fs-base); }
.audit-questions { display: flex; flex-direction: column; gap: var(--sp-4); }
.audit-question { display: flex; flex-direction: column; gap: var(--sp-2); }
.audit-question-text { font-size: var(--fs-sm); color: var(--c-text); font-weight: 500; }
.audit-answers { display: flex; gap: var(--sp-3); }
.audit-answer { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); cursor: pointer; color: var(--c-subtle); }
.audit-answer input { accent-color: var(--c-violet); }
.audit-results { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: var(--sp-8); }
.audit-results h3 { margin-bottom: var(--sp-6); }
.audit-result-category { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-3) 0; border-bottom: 1px solid var(--c-border-soft); }
.audit-result-category:last-of-type { border-bottom: none; }
.audit-result-name { font-size: var(--fs-sm); color: var(--c-subtle); }
.audit-actions { margin-top: var(--sp-6); }
.audit-actions h4 { font-size: var(--fs-base); margin-bottom: var(--sp-4); }
.audit-action-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.audit-action-item { display: flex; gap: var(--sp-3); font-size: var(--fs-sm); color: var(--c-subtle); align-items: flex-start; }
.audit-action-num { color: var(--c-violet); font-weight: 700; flex-shrink: 0; }

/* page-specific: frameworks */
.framework-stage { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: var(--sp-8); margin-bottom: var(--sp-6); position: relative; }
.framework-stage::before { content: attr(data-step); position: absolute; top: var(--sp-6); right: var(--sp-6); font-size: var(--fs-3xl); font-weight: 700; color: var(--c-border); line-height: 1; }
.framework-stage-label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--c-violet); margin-bottom: var(--sp-2); }
.framework-stage h3 { margin-bottom: var(--sp-4); }
.framework-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--sp-5); margin-top: var(--sp-5); }
.framework-grid-item h4 { font-size: var(--fs-sm); font-weight: 700; color: var(--c-text); margin-bottom: var(--sp-2); }
.framework-grid-item li { font-size: var(--fs-sm); color: var(--c-subtle); padding-left: var(--sp-4); position: relative; margin-bottom: var(--sp-1); }
.framework-grid-item li::before { content: "—"; position: absolute; left: 0; color: var(--c-muted); }
.framework-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: var(--sp-8); cursor: pointer; transition: var(--transition); }
.framework-card:hover { border-color: var(--c-teal); box-shadow: var(--shadow-glow-teal); }
.framework-card-icon { color: var(--c-teal); margin-bottom: var(--sp-4); }
.framework-card h3 { margin-bottom: var(--sp-3); }
.tier-block { border-left: 3px solid var(--c-violet); padding: var(--sp-6) var(--sp-8); margin-bottom: var(--sp-4); background: var(--c-surface); border-radius: 0 var(--radius) var(--radius) 0; }
.tier-level { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--c-violet); margin-bottom: var(--sp-2); }
.tier-block h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-4); }

/* page-specific: blueprints */
.blueprint-section { margin-bottom: var(--sp-16); }
.blueprint-section > h3 { font-size: var(--fs-xl); margin-bottom: var(--sp-3); padding-bottom: var(--sp-4); border-bottom: 1px solid var(--c-border); }
.component-preview { background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: var(--sp-8); margin: var(--sp-5) 0; }
.bp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-6); }
.bp-meta { display: flex; flex-direction: column; gap: var(--sp-5); }
.bp-meta-item h4 { font-size: var(--fs-sm); font-weight: 700; margin-bottom: var(--sp-2); }
.bp-meta-item p, .bp-meta-item li { font-size: var(--fs-sm); color: var(--c-subtle); line-height: 1.7; }
.bp-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: var(--sp-6); cursor: pointer; transition: var(--transition); }
.bp-card:hover { border-color: var(--c-violet); }

/* sample components in blueprints */
.demo-nav { display: flex; align-items: center; gap: var(--sp-6); padding: var(--sp-4); background: var(--c-surface); border-radius: var(--radius); border: 1px solid var(--c-border); }
.demo-nav a { font-size: var(--fs-sm); color: var(--c-subtle); }
.demo-nav a.active { color: var(--c-text); }
.demo-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: var(--sp-5); }
.demo-card-image { height: 120px; background: var(--c-surface-2); border-radius: var(--radius); margin-bottom: var(--sp-4); }
.demo-card h4 { font-size: var(--fs-base); margin-bottom: var(--sp-2); }
.demo-card p { font-size: var(--fs-sm); }
.demo-form { display: flex; flex-direction: column; gap: var(--sp-4); }
.demo-form label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-muted); }
.type-specimen { margin-bottom: var(--sp-4); }
.type-specimen-level { display: flex; align-items: baseline; gap: var(--sp-4); padding: var(--sp-3) 0; border-bottom: 1px solid var(--c-border-soft); }
.type-specimen-label { font-size: var(--fs-xs); color: var(--c-muted); width: 60px; flex-shrink: 0; }
.type-specimen-sample { color: var(--c-text); }

/* page-specific: field-notes */
.field-note-meta { display: flex; align-items: center; gap: var(--sp-4); margin-bottom: var(--sp-8); flex-wrap: wrap; }
.field-note-author { font-size: var(--fs-sm); color: var(--c-text); font-weight: 600; }
.field-note-date, .field-note-time { font-size: var(--fs-sm); color: var(--c-subtle); }
.field-note-meta-sep { color: var(--c-muted); }
.field-note-body { max-width: 720px; }
.field-note-body h2 { font-family: var(--font-display); font-size: var(--fs-2xl); margin: var(--sp-8) 0 var(--sp-4); }
.field-note-body p { color: var(--c-subtle); line-height: 1.85; margin-bottom: var(--sp-5); }
.field-note-body p.lede { font-size: var(--fs-md); color: var(--c-text); }
.field-note-body ul { margin: var(--sp-4) 0 var(--sp-5); padding-left: var(--sp-6); }
.field-note-body li { color: var(--c-subtle); margin-bottom: var(--sp-2); line-height: 1.7; list-style: disc; }
.field-note-body blockquote { border-left: 3px solid var(--c-violet); padding-left: var(--sp-6); margin: var(--sp-8) 0; color: var(--c-text); font-size: var(--fs-md); font-style: italic; font-family: var(--font-display); }
.field-note-body .closing { font-size: var(--fs-base); color: var(--c-text); font-weight: 500; }
.field-note-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: var(--sp-6); cursor: pointer; transition: var(--transition); }
.field-note-card:hover { border-color: var(--c-violet); transform: translateY(-2px); }
.fn-card-meta { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.fn-card-author { font-size: var(--fs-xs); font-weight: 600; color: var(--c-text); }
.fn-card-date, .fn-card-time { font-size: var(--fs-xs); color: var(--c-muted); }
.fn-card h3 { font-size: var(--fs-base); margin-bottom: var(--sp-2); }
.fn-card p { font-size: var(--fs-sm); color: var(--c-subtle); line-height: 1.6; }
.cta-block { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: var(--sp-8); margin: var(--sp-10) 0; }
.cta-block h3 { margin-bottom: var(--sp-3); }
.cta-block p { margin-bottom: var(--sp-5); }
.cta-email-form { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.cta-email-form .field-input { max-width: 320px; }

/* page-specific: academy */
.academy-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: var(--sp-8); cursor: pointer; transition: var(--transition); }
.academy-card:hover { border-color: var(--c-electric); box-shadow: 0 0 24px rgba(59,130,246,0.15); }
.academy-card-label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--c-electric); margin-bottom: var(--sp-3); }
.academy-card h3 { margin-bottom: var(--sp-3); }
.academy-card p { font-size: var(--fs-sm); margin-bottom: var(--sp-4); }
.module-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.module-item { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: var(--sp-5); }
.module-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }
.module-number { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--c-muted); }
.module-duration { font-size: var(--fs-xs); color: var(--c-muted); }
.module-title { font-size: var(--fs-base); font-weight: 700; margin-bottom: var(--sp-2); }
.module-concepts { font-size: var(--fs-sm); color: var(--c-subtle); margin-bottom: var(--sp-2); }
.module-outcome { font-size: var(--fs-sm); color: var(--c-teal); }

/* footer */
#site-footer { background: var(--c-surface); border-top: 1px solid var(--c-border); padding: var(--sp-16) 0 var(--sp-8); margin-top: var(--sp-20); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--sp-12); margin-bottom: var(--sp-12); }
.footer-brand { display: flex; flex-direction: column; gap: var(--sp-4); }
.footer-brand .nav-logo { margin-bottom: var(--sp-2); }
.footer-mission { font-size: var(--fs-sm); color: var(--c-subtle); max-width: 280px; line-height: 1.7; }
.footer-copyright { font-size: var(--fs-xs); color: var(--c-muted); }
.footer-col h4 { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--c-muted); margin-bottom: var(--sp-4); }
.footer-links { display: flex; flex-direction: column; gap: var(--sp-3); }
.footer-links a { font-size: var(--fs-sm); color: var(--c-subtle); transition: var(--transition); }
.footer-links a:hover { color: var(--c-text); }
.footer-legal { border-top: 1px solid var(--c-border-soft); padding-top: var(--sp-6); display: flex; gap: var(--sp-6); flex-wrap: wrap; }
.footer-legal a { font-size: var(--fs-xs); color: var(--c-muted); }
.footer-legal a:hover { color: var(--c-subtle); }
.trust-band { background: var(--c-bg); border-top: 1px solid var(--c-border-soft); padding: var(--sp-4) 0; }
.trust-band-inner { display: flex; align-items: center; gap: var(--sp-6); flex-wrap: wrap; }
.trust-item { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--c-muted); }
.trust-item svg { color: var(--c-teal); }
.newsletter-section { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: var(--sp-16); text-align: center; margin: var(--sp-20) 0 0; }
.newsletter-section h2 { margin-bottom: var(--sp-4); }
.newsletter-section p { margin-bottom: var(--sp-8); max-width: 480px; margin-left: auto; margin-right: auto; }
.newsletter-form { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }
.newsletter-form .field-input { max-width: 320px; }
.newsletter-note { font-size: var(--fs-xs); color: var(--c-muted); margin-top: var(--sp-4); }

/* cookie */
#cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: var(--c-surface); border-top: 1px solid var(--c-border); z-index: var(--z-cookie); transform: translateY(100%); transition: transform 400ms ease; }
#cookie-banner.visible { transform: translateY(0); }
.cookie-inner { max-width: var(--container); margin: 0 auto; padding: var(--sp-4) var(--sp-6); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-6); flex-wrap: wrap; }
.cookie-text { font-size: var(--fs-sm); color: var(--c-subtle); }
.cookie-text a { color: var(--c-violet); text-decoration: underline; }
.cookie-actions { display: flex; gap: var(--sp-3); flex-shrink: 0; }
#cookie-decline { font-size: var(--fs-sm); color: var(--c-subtle); padding: var(--sp-2) var(--sp-4); border: 1px solid var(--c-border); border-radius: var(--radius); transition: var(--transition); }
#cookie-decline:hover { color: var(--c-text); }
#cookie-accept { font-size: var(--fs-sm); color: #fff; background: var(--c-violet); padding: var(--sp-2) var(--sp-4); border-radius: var(--radius); border: 1px solid var(--c-violet); transition: var(--transition); }
#cookie-accept:hover { background: var(--c-violet-dim); }

/* back to top */
/* (defined in layout section) */

/* reading progress */
/* (defined in layout section) */

/* animations */
@keyframes swatchIn { to { opacity: 1; transform: translateY(0); } }
@keyframes barGrow { from { width: 0; opacity: 0; } to { opacity: 0.6; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 500ms ease, transform 500ms ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }


/* section-alt */
.section-alt { background: var(--c-surface); }

/* prose — long-form article body */
.prose { max-width: 720px; }
.prose h2 { font-size: var(--fs-2xl); margin: var(--sp-10) 0 var(--sp-4); }
.prose h3 { font-size: var(--fs-xl); margin: var(--sp-8) 0 var(--sp-3); }
.prose p  { color: var(--c-subtle); line-height: 1.85; margin-bottom: var(--sp-5); }
.prose ul, .prose ol { margin: var(--sp-4) 0 var(--sp-5); padding-left: var(--sp-6); }
.prose li { color: var(--c-subtle); margin-bottom: var(--sp-2); line-height: 1.7; list-style: disc; }
.prose strong { color: var(--c-text); font-weight: 600; }
.prose a { color: var(--c-violet); text-decoration: underline; text-underline-offset: 3px; }

/* btn-ghost */
.btn-ghost { background: transparent; color: var(--c-subtle); border: 1px solid var(--c-border); }
.btn-ghost:hover { color: var(--c-text); border-color: var(--c-violet); }

/* token-table rows (flat div version, not <table>) */
.token-table-header { display: grid; grid-template-columns: 2fr 1fr 1fr; padding: var(--sp-3) var(--sp-4); background: var(--c-surface-2); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-muted); border-bottom: 1px solid var(--c-border); }
.token-row { display: grid; grid-template-columns: 2fr 1fr 1fr; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--c-border-soft); font-size: var(--fs-sm); color: var(--c-subtle); }
.token-row:last-child { border-bottom: none; }
.token-row span:first-child { color: var(--c-text); font-weight: 500; font-family: 'Fira Code', 'Cascadia Code', monospace; font-size: var(--fs-xs); }
.token-row:hover { background: var(--c-surface-2); }

/* faq */
.faq-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.faq-item { border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
.faq-question { width: 100%; text-align: left; padding: var(--sp-5) var(--sp-6); font-size: var(--fs-base); font-weight: 600; color: var(--c-text); background: var(--c-surface); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4); transition: var(--transition); }
.faq-question::after { content: '+'; font-size: var(--fs-xl); font-weight: 300; color: var(--c-muted); flex-shrink: 0; transition: var(--transition); }
.faq-question[aria-expanded="true"] { background: var(--c-surface-2); }
.faq-question[aria-expanded="true"]::after { content: '−'; color: var(--c-violet); }
.faq-answer { display: none; padding: 0 var(--sp-6) var(--sp-5); background: var(--c-surface-2); }
.faq-answer p { color: var(--c-subtle); font-size: var(--fs-sm); line-height: 1.75; margin: 0; padding-top: var(--sp-4); }
.faq-item.open .faq-answer { display: block; }

/* responsive */
@media (max-width: 1100px) and (min-width: 1025px) { .nav-actions { display: none; } }
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .nav-actions { display: none; }
  .hamburger { display: flex; }
  .launchpad-inner { grid-template-columns: 1fr; }
  .launchpad-preview { border-right: none; border-bottom: 1px solid var(--c-border); }
  .grid-3 { grid-template-columns: repeat(2,1fr); }
  .instruments-strip { grid-template-columns: repeat(3,1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .tool-layout { grid-template-columns: 1fr; }
  .tool-layout-3 { grid-template-columns: 1fr; }
  .system-overview-grid { grid-template-columns: 1fr; }
  .framework-grid { grid-template-columns: 1fr 1fr; }
}
/* contact page */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-12); align-items: start; }
@media (max-width: 768px) { .contact-grid { grid-template-columns: 1fr; } }

@media (max-width: 768px) {
  :root { --header-h: 56px; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .instruments-strip { grid-template-columns: repeat(2,1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .newsletter-section { padding: var(--sp-10); }
  .bp-grid { grid-template-columns: 1fr; }
  .framework-grid { grid-template-columns: 1fr; }
  h1 { font-size: var(--fs-2xl); }
  h2 { font-size: var(--fs-xl); }
  .section { padding: var(--sp-12) 0; }
  .page-hero { padding: var(--sp-10) 0 var(--sp-8); }
  .framework-stage::before { display: none; }
}
@media (max-width: 480px) {
  .instruments-strip { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .trust-band-inner { gap: var(--sp-3); }
  .cta-email-form { flex-direction: column; }
  .newsletter-form { flex-direction: column; align-items: center; }
}
