/* Stepwell Technologies: editorial consulting style.
   Idea: a stepwell. Content descends in clear tiers; each section is a "landing". */
:root {
  --ink: #121a2b;
  --ink-2: #2b3547;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --muted: #5b6577;
  --rule: #e2ded3;
  --rule-strong: #c9c3b4;
  --accent: #1f3a93;        /* Jaipur blue-pottery indigo */
  --accent-2: #2c4fc4;
  --accent-ink: #ffffff;
  --sand: #a86b1f;          /* sandstone ochre */
  --sand-soft: #f3eadb;
  --step: #f1eee6;
  --band: #0e1a3a;          /* deep indigo band */
  --band-ink: #eef1f8;
  --band-muted: #aeb8d0;
  --band-rule: #26345e;
  --font-serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --font-body: "IBM Plex Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --max: 1180px;
  --narrow: 720px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e9ecf3; --ink-2: #cdd3df; --paper: #0d121b; --surface: #141b27; --muted: #9ea8b9;
    --rule: #242e3e; --rule-strong: #34405a; --accent: #8fa8ff; --accent-2: #b3c3ff; --accent-ink: #0b1020;
    --sand: #e2a955; --sand-soft: #2a2216; --step: #161e2b;
    --band: #0a1330; --band-ink: #eef1f8; --band-muted: #a3aec8; --band-rule: #22305a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #e9ecf3; --ink-2: #cdd3df; --paper: #0d121b; --surface: #141b27; --muted: #9ea8b9;
  --rule: #242e3e; --rule-strong: #34405a; --accent: #8fa8ff; --accent-2: #b3c3ff; --accent-ink: #0b1020;
  --sand: #e2a955; --sand-soft: #2a2216; --step: #161e2b;
  --band: #0a1330; --band-ink: #eef1f8; --band-muted: #a3aec8; --band-rule: #22305a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 1.65; }
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--sand); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.15; text-wrap: balance; margin: 0; font-weight: 600; color: var(--ink); }
h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); letter-spacing: -0.015em; }
h3 { font-size: 1.3rem; }
h4 { font-family: var(--font-body); font-size: 0.95rem; font-weight: 600; }
p { margin: 0; max-width: 68ch; }
.mono { font-family: var(--font-mono); font-size: 0.85em; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 6px; z-index: 50; }
.skip:focus { left: 16px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: var(--narrow); }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

.eyebrow { font-family: var(--font-mono); font-size: 0.76rem; color: var(--sand); text-transform: uppercase; letter-spacing: 0.12em; display: block; margin-bottom: 14px; }

/* Notice bar */
.notice { background: var(--sand-soft); color: var(--ink-2); font-size: 0.8rem; text-align: center; padding: 7px 16px; }

/* Header */
.site-header { background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand svg { width: 32px; height: 32px; flex: none; }
.brand b { font-family: var(--font-serif); font-weight: 600; font-size: 1.32rem; letter-spacing: -0.01em; line-height: 1; }
.brand small { display: block; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.nav { display: flex; gap: 2px; align-items: center; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 8px 12px; font-size: 0.93rem; border-radius: 6px; }
.nav a:hover { color: var(--accent); background: var(--step); }
.nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--sand); border-radius: 0; }
.nav a.cta { background: var(--accent); color: var(--accent-ink); font-weight: 600; margin-left: 8px; border-radius: 6px; box-shadow: none; }
.nav a.cta:hover { background: var(--accent-2); }
.menu-btn { display: none; background: none; border: 1px solid var(--rule-strong); color: var(--ink); border-radius: 6px; padding: 8px 14px; font: inherit; cursor: pointer; }
@media (max-width: 960px) {
  .menu-btn { display: inline-block; }
  .nav { display: none; position: absolute; top: 72px; left: 0; right: 0; background: var(--paper); border-bottom: 1px solid var(--rule); flex-direction: column; align-items: stretch; padding: 8px 16px 18px; }
  .nav.open { display: flex; }
  .nav a.cta { margin: 8px 0 0; text-align: center; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 6px; text-decoration: none; font: inherit; font-weight: 600; font-size: 0.97rem; border: 1.5px solid var(--accent); cursor: pointer; transition: background .15s, color .15s; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); }
.btn-ghost { color: var(--accent); background: transparent; }
.btn-ghost:hover { background: var(--step); }
.band .btn-primary { background: var(--band-ink); color: var(--band); border-color: var(--band-ink); }
.band .btn-primary:hover { background: #fff; color: var(--band); }
.band .btn-ghost { color: var(--band-ink); border-color: var(--band-muted); }
.band .btn-ghost:hover { background: rgba(255,255,255,.08); }
.link-arrow { font-weight: 600; text-decoration: none; }
.link-arrow::after { content: " →"; }

/* Dark band (hero and CTA) */
.band { background: var(--band); color: var(--band-ink); }
.band h1, .band h2, .band h3 { color: var(--band-ink); }
.band p { color: var(--band-muted); }
.band .eyebrow { color: #e2a955; }

.hero { padding: 88px 0 80px; position: relative; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.35fr 1fr; gap: 64px; align-items: center; position: relative; }
.hero .lead { font-size: 1.22rem; margin-top: 24px; color: var(--band-muted); }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 34px; }
.hero-art { width: 100%; max-width: 440px; justify-self: end; }
.hero-art .tier { fill: none; stroke: #6f86d6; stroke-width: 1.5; }
.hero-art .tier.hl { stroke: #e2a955; stroke-width: 2; }
@media (max-width: 900px) { .hero { padding: 56px 0 56px; } .hero .wrap { grid-template-columns: 1fr; gap: 36px; } .hero-art { justify-self: start; max-width: 300px; order: -1; } }

/* Commitment strip under hero */
.strip { border-bottom: 1px solid var(--rule); background: var(--surface); }
.strip ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.strip li { padding: 22px 20px; border-left: 1px solid var(--rule); font-size: 0.93rem; color: var(--ink-2); }
.strip li:first-child { border-left: none; padding-left: 0; }
.strip b { display: block; font-family: var(--font-serif); font-size: 1.08rem; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
@media (max-width: 860px) { .strip ul { grid-template-columns: 1fr 1fr; } .strip li:nth-child(3) { border-left: none; padding-left: 0; } .strip li { border-top: 1px solid var(--rule); } .strip li:nth-child(-n+2) { border-top: none; } }
@media (max-width: 520px) { .strip ul { grid-template-columns: 1fr; } .strip li { border-left: none; padding-left: 0; } .strip li:nth-child(2) { border-top: 1px solid var(--rule); } }

/* Page head (inner pages) */
.page-head { padding: 72px 0 56px; border-bottom: 1px solid var(--rule); background: linear-gradient(180deg, var(--step), var(--paper)); }
.page-head h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); max-width: 22ch; }
.page-head p.lead { color: var(--muted); font-size: 1.2rem; margin-top: 18px; }
.crumbs { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); margin-bottom: 22px; letter-spacing: 0.04em; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

/* Sections: numbered landing layout */
section.tier { padding: 84px 0; border-bottom: 1px solid var(--rule); }
section.tier.alt { background: var(--surface); }
.tier-head { display: grid; grid-template-columns: 260px 1fr; gap: 40px; margin-bottom: 44px; align-items: start; }
.tier-head .num { font-family: var(--font-mono); font-size: 0.78rem; color: var(--sand); letter-spacing: 0.1em; text-transform: uppercase; padding-top: 10px; border-top: 2px solid var(--sand); }
.tier-head p.sub { color: var(--muted); margin-top: 12px; font-size: 1.08rem; }
@media (max-width: 860px) { section.tier { padding: 60px 0; } .tier-head { grid-template-columns: 1fr; gap: 14px; margin-bottom: 30px; } .tier-head .num { justify-self: start; } }

.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .grid-4 { grid-template-columns: 1fr; } }

/* Practice cards */
.practice { background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--accent); padding: 28px 26px 26px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.practice:hover { border-top-color: var(--sand); transform: translateY(-2px); color: inherit; }
.practice .idx { font-family: var(--font-mono); font-size: 0.74rem; color: var(--sand); letter-spacing: 0.08em; }
.practice p { color: var(--muted); font-size: 0.97rem; }
.practice .more { margin-top: auto; padding-top: 8px; font-weight: 600; color: var(--accent); font-size: 0.93rem; }
.practice .more::after { content: " →"; }

.card { background: var(--surface); border: 1px solid var(--rule); padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.card p { color: var(--muted); }
.card ul, .clean-list { margin: 4px 0 0; padding-left: 0; list-style: none; color: var(--ink-2); display: grid; gap: 8px; }
.card ul li, .clean-list li { padding-left: 22px; position: relative; }
.card ul li::before, .clean-list li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 10px; height: 2px; background: var(--sand); }
.tag { font-family: var(--font-mono); font-size: 0.72rem; color: var(--sand); text-transform: uppercase; letter-spacing: 0.08em; }

/* Evidence / research stats */
.evidence { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--rule-strong); }
.evidence .stat { padding: 30px 28px 26px 0; border-right: 1px solid var(--rule); display: flex; flex-direction: column; gap: 12px; }
.evidence .stat + .stat { padding-left: 28px; }
.evidence .stat:last-child { border-right: none; }
.evidence .fig { font-family: var(--font-serif); font-size: clamp(2.6rem, 5vw, 3.6rem); line-height: 1; color: var(--accent); font-weight: 600; letter-spacing: -0.02em; }
.evidence .claim { color: var(--ink-2); }
.evidence .src { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.02em; margin-top: auto; }
.evidence .src a { color: var(--muted); }
.evidence .so { font-size: 0.93rem; color: var(--ink); border-left: 2px solid var(--sand); padding-left: 12px; }
@media (max-width: 860px) { .evidence { grid-template-columns: 1fr; } .evidence .stat, .evidence .stat + .stat { padding: 26px 0; border-right: none; border-bottom: 1px solid var(--rule); } }

/* Stepped engagement list */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: s; }
.steps li { background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--accent); padding: 22px 24px; display: grid; grid-template-columns: 130px 1fr; gap: 20px; }
.steps li:nth-child(2) { margin-left: 32px; } .steps li:nth-child(3) { margin-left: 64px; } .steps li:nth-child(4) { margin-left: 96px; }
.steps .when { font-family: var(--font-mono); font-size: 0.82rem; color: var(--sand); padding-top: 3px; }
.steps p { color: var(--muted); margin-top: 4px; }
@media (max-width: 760px) { .steps li { grid-template-columns: 1fr; gap: 6px; margin-left: 0 !important; } }

/* Service detail */
.svc { display: grid; grid-template-columns: 260px 1fr; gap: 40px; padding: 64px 0; border-bottom: 1px solid var(--rule); }
.svc:last-child { border-bottom: none; }
.svc .meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); display: grid; gap: 6px; padding-top: 12px; border-top: 2px solid var(--accent); align-self: start; }
.svc .meta b { color: var(--sand); font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; }
.svc h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.svc .problem { color: var(--muted); font-size: 1.08rem; margin: 14px 0 26px; }
@media (max-width: 860px) { .svc { grid-template-columns: 1fr; gap: 18px; padding: 48px 0; } }

/* Table */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 0.96rem; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 500; background: var(--step); }
tbody th { font-weight: 600; width: 32%; }
tr:last-child td, tr:last-child th { border-bottom: none; }

.callout { background: var(--step); border-left: 3px solid var(--sand); padding: 26px 28px; display: grid; gap: 10px; }
.callout p { color: var(--ink-2); }
.quote { font-family: var(--font-serif); font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.35; color: var(--ink); max-width: 30ch; }

/* Insights */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media (max-width: 960px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .post-grid { grid-template-columns: 1fr; } }
.post-card { display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: inherit; border-top: 1px solid var(--rule-strong); padding-top: 20px; }
.post-card:hover h3 { color: var(--accent); }
.post-card .cover { aspect-ratio: 16 / 9; background: var(--band); position: relative; overflow: hidden; margin-bottom: 6px; }
.post-card .cover svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.post-card h3 { font-size: 1.32rem; transition: color .15s; }
.post-card p { color: var(--muted); font-size: 0.96rem; }
.post-meta { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.04em; display: flex; gap: 10px; flex-wrap: wrap; text-transform: uppercase; }
.post-meta .cat { color: var(--sand); }
.post-card.feature { grid-column: 1 / -1; display: grid; grid-template-columns: 1.2fr 1fr; gap: 36px; align-items: center; border-top: none; padding-top: 0; }
.post-card.feature h3 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.post-card.feature .cover { margin: 0; }
@media (max-width: 860px) { .post-card.feature { grid-template-columns: 1fr; gap: 18px; } }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 36px; }
.filters button { font: inherit; font-size: 0.88rem; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--rule-strong); background: transparent; color: var(--ink-2); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Article */
.article-head { padding: 64px 0 40px; border-bottom: 1px solid var(--rule); }
.article-head h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); max-width: 24ch; }
.article-head .standfirst { font-family: var(--font-serif); font-size: 1.3rem; line-height: 1.5; color: var(--ink-2); margin-top: 20px; max-width: 60ch; }
.article-head .post-meta { margin-top: 26px; }
.article-layout { display: grid; grid-template-columns: 1fr 260px; gap: 64px; padding: 56px 0 80px; }
@media (max-width: 960px) { .article-layout { grid-template-columns: 1fr; gap: 32px; } }
.prose { max-width: 70ch; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: 1.75rem; margin-top: 2em; }
.prose h3 { font-size: 1.3rem; margin-top: 1.7em; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose sup a { text-decoration: none; font-family: var(--font-mono); font-size: 0.75em; padding: 0 1px; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--sand); font-family: var(--font-serif); font-size: 1.28rem; line-height: 1.45; color: var(--ink); }
.prose .table-wrap { margin: 1.6em 0; }
.keybox { background: var(--step); border-top: 3px solid var(--accent); padding: 22px 24px; }
.keybox h2, .keybox h3 { font-size: 1.1rem; margin: 0 0 10px; font-family: var(--font-body); font-weight: 600; }
.refs { font-size: 0.88rem; border-top: 1px solid var(--rule); padding-top: 22px; margin-top: 3em !important; }
.refs h2 { font-size: 1.1rem; font-family: var(--font-body); font-weight: 600; margin: 0 0 12px; }
.refs ol { padding-left: 1.4em; display: grid; gap: 8px; }
.refs li { color: var(--muted); word-break: break-word; }
.aside-box { position: sticky; top: 100px; display: grid; gap: 22px; align-self: start; }
.aside-box .card { padding: 22px; }
.aside-box h4 { margin-bottom: 4px; }
.aside-box p { font-size: 0.93rem; }
.disclaimer { font-size: 0.84rem; color: var(--muted); font-style: italic; }

/* Library */
.lib { display: grid; gap: 0; border-top: 1px solid var(--rule-strong); }
.lib-item { display: grid; grid-template-columns: 200px 1fr 220px; gap: 28px; padding: 22px 0; border-bottom: 1px solid var(--rule); align-items: start; }
.lib-item h3 { font-size: 1.12rem; }
.lib-item p { color: var(--muted); font-size: 0.95rem; margin-top: 4px; }
.lib-item .who { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.lib-item .use { font-size: 0.88rem; color: var(--ink-2); border-left: 2px solid var(--sand); padding-left: 12px; }
@media (max-width: 860px) { .lib-item { grid-template-columns: 1fr; gap: 8px; } }

/* CTA band */
.cta-band { padding: 80px 0; }
.cta-band .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; }
.cta-band .actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 860px) { .cta-band { padding: 56px 0; } .cta-band .wrap { grid-template-columns: 1fr; } .cta-band .actions { justify-content: flex-start; } }

/* Forms */
form.contact { display: grid; gap: 18px; max-width: 640px; }
form.contact label { font-weight: 600; font-size: 0.93rem; display: grid; gap: 6px; }
form.contact input, form.contact select, form.contact textarea { font: inherit; font-weight: 400; padding: 12px 13px; border: 1px solid var(--rule-strong); border-radius: 4px; background: var(--surface); color: var(--ink); }
form.contact textarea { min-height: 150px; resize: vertical; }
.form-result { display: none; background: var(--surface); border: 1px solid var(--rule); padding: 20px; }
.form-result.show { display: grid; gap: 12px; }
.form-result pre { white-space: pre-wrap; font-family: var(--font-mono); font-size: 0.85rem; background: var(--step); padding: 14px; margin: 0; }

/* Footer */
.site-footer { background: var(--band); color: var(--band-muted); padding: 64px 0 36px; font-size: 0.92rem; }
.site-footer .wrap > .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.site-footer .brand { color: var(--band-ink); }
.site-footer .brand small { color: var(--band-muted); }
.site-footer p { color: var(--band-muted); }
.site-footer a { color: var(--band-muted); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer h3 { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; color: #e2a955; }
.site-footer ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.site-footer .base { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--band-rule); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.72rem; }
@media (max-width: 860px) { .site-footer .wrap > .cols { grid-template-columns: 1fr 1fr; } .site-footer .wrap > .cols > :first-child { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
@media print { .site-header, .notice, .site-footer, .cta-band, .aside-box { display: none; } body { background: #fff; } }
