/* Skeuo Next interpretation for a long-form method document.
   Porcelain glass canvas, glossy graphite plastic, aqua glass accent,
   22px squircle cards, layered depth, depth-lift hover. Inter. Mobile first. */
:root {
  --canvas: #e9eef3; --canvas-2: #f5f8fa;
  --glass: rgba(255,255,255,.74); --glass-strong: rgba(255,255,255,.92);
  --line: rgba(30,45,60,.09); --line-strong: rgba(30,45,60,.16);
  --ink: #1b222b; --ink-2: #48535f; --ink-3: #66727e;
  --graphite: #262b33; --graphite-2: #3a414c;
  --aqua: #0f8fa3; --aqua-ink: #0a6877; --aqua-glass: rgba(39,190,212,.13); --aqua-line: rgba(15,143,163,.3);
  --ok: #1d7a4e; --ok-bg: rgba(29,122,78,.1);
  --warn: #8a5a00; --warn-bg: rgba(196,140,20,.15);
  --bad: #a3322b; --bad-bg: rgba(163,50,43,.09);
  --r-xl: 22px; --r-lg: 16px; --r-md: 12px; --r-pill: 999px;
  --sh-1: 0 1px 0 rgba(255,255,255,.9) inset, 0 1px 2px rgba(20,30,45,.06), 0 4px 12px rgba(20,30,45,.05);
  --sh-2: 0 1px 0 rgba(255,255,255,.95) inset, 0 2px 4px rgba(20,30,45,.06), 0 12px 28px rgba(20,30,45,.08);
  --ease: cubic-bezier(.2,.8,.2,1);
  --text-xs: .75rem; --text-sm: .875rem; --text-base: 1rem; --text-lg: 1.125rem; --text-xl: 1.375rem; --text-2xl: clamp(1.6rem, 1.2rem + 2vw, 2.3rem);
  font-family: "Inter", system-ui, sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 118px; }
body { margin: 0; min-height: 100dvh; font-size: var(--text-base); line-height: 1.6;
  background: radial-gradient(1100px 560px at 0% -10%, #fff 0%, rgba(255,255,255,0) 60%), linear-gradient(180deg, var(--canvas-2), var(--canvas)); background-attachment: fixed; }
a { color: var(--aqua-ink); text-underline-offset: 2px; }
p { margin: 0 0 .7em; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: var(--text-2xl); font-weight: 700; }
h2 { font-size: var(--text-xl); font-weight: 700; }
h3 { font-size: var(--text-lg); font-weight: 650; }
h4 { font-size: var(--text-xs); font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin: 0 0 8px; }
ul, ol { margin: 0 0 .6em; padding-left: 1.25em; }
li { margin-bottom: .4em; }
li::marker { color: var(--ink-3); }
code, .mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .84em; }
code { background: rgba(30,45,60,.06); padding: 1px 5px; border-radius: 6px; overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--aqua); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--ink-2); } .small { font-size: var(--text-sm); } .xs { font-size: var(--text-xs); }

/* Top bar and step rail */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(245,248,250,.8); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1080px; margin: 0 auto; padding: 10px 14px 0; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mark { width: 28px; height: 28px; flex: none; border-radius: 9px; background: var(--graphite); position: relative;
  box-shadow: 0 1px 0 rgba(255,255,255,.22) inset, 0 -6px 10px rgba(0,0,0,.25) inset, 0 4px 10px rgba(20,30,45,.2); }
.mark::after { content: ""; position: absolute; inset: 8px; border-radius: 4px; background: var(--aqua); box-shadow: 0 0 0 3px rgba(39,190,212,.25); }
.brand b { font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand span { font-size: var(--text-xs); color: var(--ink-3); white-space: nowrap; }
.rail { position: relative; display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 10px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail { padding-right: 40px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.rail.at-end { -webkit-mask-image: none; mask-image: none; }
.rail a { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px 0 5px; border-radius: var(--r-pill);
  background: var(--glass-strong); border: 1px solid var(--line-strong); box-shadow: var(--sh-1); text-decoration: none; color: var(--ink); font-size: var(--text-xs); font-weight: 600;
  transition: transform .15s var(--ease), background .15s; }
.rail a:active { transform: scale(.96); }
.rail a .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1px solid var(--line-strong); font-variant-numeric: tabular-nums; }
.rail a.deep .n { background: var(--aqua); color: #fff; border-color: transparent; }
.rail a.on { background: var(--graphite); color: #fff; border-color: #11151a; }
.rail a.on .n { border-color: transparent; color: var(--ink); }
.rail a.on.deep .n { color: #fff; }

main { max-width: 1080px; margin: 0 auto; padding: 18px 14px 60px; }
.card { background: var(--glass); border: 1px solid rgba(255,255,255,.7); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-radius: var(--r-xl); box-shadow: var(--sh-1), 0 0 0 1px var(--line); padding: 18px; margin-bottom: 14px; min-width: 0; }
.card.inset { background: rgba(255,255,255,.55); box-shadow: 0 0 0 1px var(--line); backdrop-filter: none; }
.lift { transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.lift:hover { transform: translateY(-2px); box-shadow: var(--sh-2), 0 0 0 1px var(--line); }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: var(--r-pill); font-size: 11px; font-weight: 650; letter-spacing: .02em; white-space: nowrap; vertical-align: 1px; }
.b-verified { background: var(--ok-bg); color: var(--ok); }
.b-sourced { background: var(--aqua-glass); color: var(--aqua-ink); }
.b-assumed { background: var(--warn-bg); color: var(--warn); }
.b-unknown { background: rgba(80,90,100,.1); color: var(--ink-2); }
.b-published { background: var(--graphite); color: #fff; }
.b-adapted { background: var(--aqua-glass); color: var(--aqua-ink); border: 1px solid var(--aqua-line); }
.b-reconstructed { background: rgba(80,90,100,.08); color: var(--ink-2); border: 1px solid var(--line-strong); }
.b-deep { background: var(--aqua); color: #fff; }
.b-draft { background: var(--warn-bg); color: var(--warn); }

/* Hero */
.hero { padding: 24px 20px; }
.hero .kicker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.hero h1 { max-width: 20ch; }
.hero .sub { font-size: var(--text-lg); color: var(--ink-2); margin: 10px 0 14px; max-width: 60ch; }
.legend { display: grid; gap: 8px; margin-top: 14px; }
.legend div { display: flex; gap: 10px; align-items: flex-start; font-size: var(--text-sm); }
.ideas { display: grid; gap: 12px; }
.idea .num { font-weight: 700; color: var(--aqua-ink); font-size: var(--text-sm); }
.idea h3 { margin: 4px 0 6px; font-size: var(--text-base); }

/* Step index */
.index { display: grid; gap: 8px; }
.index a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; min-height: 56px; border-radius: var(--r-lg); background: rgba(255,255,255,.62); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: transform .18s var(--ease), box-shadow .18s; }
.index a:hover { transform: translateY(-1px); box-shadow: var(--sh-1); }
.index .n { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 10px; background: #fff; border: 1px solid var(--line-strong); font-weight: 650; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.index a.deep .n { background: var(--aqua); color: #fff; border-color: transparent; }
.index .t { flex: 1; min-width: 0; }
.index .t b { display: block; font-size: var(--text-sm); }
.index .t span { font-size: var(--text-xs); color: var(--ink-3); }

.sec-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 30px 4px 12px; flex-wrap: wrap; }

/* Step sections */
.step { margin-top: 34px; }
.step-head { padding: 20px 18px; }
.step-head .kick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--text-xs); font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--aqua-ink); margin-bottom: 6px; }
.step-head .ask { margin: 12px 0 0; padding: 4px 0 4px 12px; border-left: 3px solid var(--aqua); font-weight: 600; }
.grid2 { display: grid; gap: 14px; }
.how { counter-reset: how; list-style: none; padding: 0; margin: 0; }
.how > li { counter-increment: how; position: relative; padding-left: 38px; margin-bottom: 12px; }
.how > li::before { content: counter(how); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; font-size: 12px; font-weight: 650; background: #fff; border: 1px solid var(--line-strong); font-variant-numeric: tabular-nums; box-shadow: 0 1px 2px rgba(20,30,45,.06); }
.how > li b:first-child { display: block; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; }
.sources a { display: inline-block; padding: 5px 11px; border-radius: var(--r-pill); background: rgba(255,255,255,.75); border: 1px solid var(--line); font-size: var(--text-xs); text-decoration: none; }
.sources a:hover { border-color: var(--aqua-line); }

/* Deep step */
.deep-banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-lg); background: var(--aqua-glass); border: 1px solid var(--aqua-line); margin-top: 14px; font-size: var(--text-sm); }
.toc { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 14px; }
.toc a { display: flex; gap: 8px; align-items: center; padding: 8px 10px; min-height: 44px; border-radius: var(--r-md); background: rgba(255,255,255,.7); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: var(--text-xs); font-weight: 600; }
.toc a span { color: var(--aqua-ink); font-variant-numeric: tabular-nums; }
.part { margin-top: 22px; }
.part-title { display: flex; align-items: center; gap: 10px; margin: 0 4px 10px; }
.part-title .pn { width: 30px; height: 30px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--graphite); color: #fff; font-size: var(--text-sm); font-weight: 650;
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 -6px 10px rgba(0,0,0,.25) inset, 0 3px 8px rgba(20,30,45,.2); }
.output { display: block; margin-top: 6px; padding: 7px 10px; border-radius: var(--r-md); background: rgba(30,45,60,.045); font-size: var(--text-sm); }
.output::before { content: "Output: "; font-weight: 650; color: var(--ink); }
.callout { padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--line-strong); background: rgba(255,255,255,.7); font-size: var(--text-sm); margin: 10px 0; }
.callout.warn { background: var(--warn-bg); border-color: rgba(196,140,20,.35); }
.callout.bad { background: var(--bad-bg); border-color: rgba(163,50,43,.25); }
.callout h4 { color: var(--ink); }
.find { display: grid; gap: 10px; }
.find > div { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r-lg); background: rgba(255,255,255,.72); border: 1px solid var(--line); }
.find .fn { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--bad-bg); color: var(--bad); font-weight: 700; font-size: 13px; }
.find p { margin: 0; font-size: var(--text-sm); }
.find b { display: block; margin-bottom: 2px; font-size: var(--text-sm); }

.tbl { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255,255,255,.7); margin: 8px 0 4px; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: var(--text-xs); color: var(--ink-3); font-weight: 650; background: rgba(255,255,255,.8); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.min { white-space: nowrap; }
.tbl.wide table { min-width: 680px; }

/* Template blocks */
.tpl { border-radius: var(--r-lg); background: #fbfcfd; border: 1px solid var(--line-strong); box-shadow: 0 1px 2px rgba(20,30,45,.05) inset; overflow: hidden; margin-top: 10px; }
.tpl-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 14px; background: rgba(30,45,60,.04); border-bottom: 1px solid var(--line); }
.tpl-head b { font-size: var(--text-sm); }
.tpl-body { padding: 12px 14px; font-size: var(--text-sm); }
.tpl-body .field { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 8px 0; border-bottom: 1px dashed var(--line-strong); }
.tpl-body .field:last-child { border-bottom: 0; }
.tpl-body .field > span:first-child { font-weight: 650; }
.tpl-body .field > span:last-child { color: var(--ink-2); }

/* Example filled */
.filled { border-left: 3px solid var(--aqua); }
.slo-card { padding: 14px; border-radius: var(--r-lg); background: rgba(255,255,255,.75); border: 1px solid var(--line); margin-bottom: 10px; }
.slo-card .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 8px; }
.slo-card .target { font-size: var(--text-lg); font-weight: 700; font-variant-numeric: tabular-nums; }
.slo-card dl { margin: 0; display: grid; gap: 6px; font-size: var(--text-sm); }
.slo-card dt { font-weight: 650; font-size: var(--text-xs); color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.slo-card dd { margin: 0 0 4px; }

.checks { list-style: none; padding: 0; margin: 0; }
.checks li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); margin: 0; font-size: var(--text-sm); }
.checks li:first-child { border-top: 0; }
.checks .box { flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 6px; border: 1.5px solid var(--line-strong); background: #fff; box-shadow: 0 1px 2px rgba(20,30,45,.08) inset; }
.checks .x { flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 6px; background: var(--bad-bg); color: var(--bad); display: grid; place-items: center; font-weight: 700; font-size: 12px; }

details.more { margin-top: 10px; }
details.more summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; font-size: var(--text-sm); color: var(--aqua-ink); list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+"; width: 22px; height: 22px; margin-right: 8px; display: grid; place-items: center; border-radius: 7px; background: var(--aqua-glass); font-weight: 700; }
details.more[open] summary::before { content: "−"; }

footer { max-width: 1080px; margin: 0 auto; padding: 0 14px 48px; font-size: var(--text-xs); color: var(--ink-3); }
.totop { position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 25; width: 48px; height: 48px; border-radius: 16px; border: 1px solid #11151a; background: var(--graphite); color: #fff; display: grid; place-items: center; text-decoration: none; font-size: 18px;
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 -8px 14px rgba(0,0,0,.28) inset, 0 6px 14px rgba(20,30,45,.25); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .15s var(--ease); }
.totop.show { opacity: 1; pointer-events: auto; }
.totop:active { transform: scale(.94); }

@media (min-width: 760px) {
  .topbar-in, main { padding-left: 24px; padding-right: 24px; }
  .hero { padding: 34px 34px; }
  .card { padding: 22px; }
  .ideas { grid-template-columns: repeat(3, 1fr); }
  .index { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr 1fr; align-items: start; }
  .toc { grid-template-columns: repeat(4, 1fr); }
  .legend { grid-template-columns: 1fr 1fr; }
  .tpl-body .field { grid-template-columns: 200px 1fr; gap: 14px; }
  .step-head { padding: 26px 26px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }
@media print { .topbar, .totop { display: none; } body { background: #fff; } .card { box-shadow: none; border: 1px solid #ddd; backdrop-filter: none; } }
