/* cea-mai-veche-mana: warm limestone and red ochre. The hero wall stays dark in both themes. */
:root {
  --bg: #f6efe3; --surface: #ece2d1; --text: #261b13; --muted: #54453a; --line: #cdbfa9;
  --accent: #802d0e; --link: #7a2a0c; --on-accent: #fff8ee;
  --c-male: #4d5f82; --c-fem: #a8401f; --c-unk: #6f6354;
  --hero-bg: #120d0a; --hero-text: #f6ebdb; --hero-muted: #dccdb4; --hero-accent: #f2a07a; --hero-line: #8b7763;
  --ochre: #b63e22;
  --topbar-h: 3rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15110e; --surface: #201a15; --text: #f2e8d8; --muted: #cdbea8; --line: #41362c;
    --accent: #f0956b; --link: #f4a883; --on-accent: #1a110b;
    --c-male: #94a9cf; --c-fem: #ec9168; --c-unk: #a69887;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15110e; --surface: #201a15; --text: #f2e8d8; --muted: #cdbea8; --line: #41362c;
  --accent: #f0956b; --link: #f4a883; --on-accent: #1a110b;
  --c-male: #94a9cf; --c-fem: #ec9168; --c-unk: #a69887;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1.125rem/1.65 "Atkinson Hyperlegible Next", system-ui, sans-serif;
  overflow-x: hidden;
}
h1, h2, h3, .age-n, .kicker { font-family: Fraunces, Georgia, serif; font-variation-settings: "SOFT" 60; }
h1, h2, h3 { line-height: 1.12; margin: 0; font-weight: 600; text-wrap: balance; }
a { color: var(--link); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .12em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.skip { position: absolute; left: .5rem; top: -4rem; background: var(--accent); color: var(--on-accent); padding: .6rem 1rem; z-index: 50; border-radius: .4rem; }
.skip:focus { top: .5rem; }
section[id], li[id] { scroll-margin-top: calc(var(--topbar-h) + .75rem); }

/* topbar */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: .75rem;
  padding: 0 .9rem; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); font-size: .95rem;
}
.home { display: inline-flex; align-items: center; gap: .45rem; text-decoration: none; color: var(--text); font-weight: 600; white-space: nowrap; }
.home span { display: none; }
@media (min-width: 34rem) { .home span { display: inline; } }
.homehand { color: var(--accent); }
.topnav { display: flex; gap: .2rem; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { padding: .35rem .6rem; text-decoration: none; color: var(--muted); white-space: nowrap; border-radius: .4rem; }
.topnav a:hover, .topnav a[aria-current="true"] { color: var(--text); background: var(--surface); }
.spacer { flex: 1 0 .25rem; }
.chip { padding: .3rem .65rem; border: 1px solid var(--line); border-radius: 2rem; text-decoration: none; color: var(--text); white-space: nowrap; font-size: .9rem; }
.chip:hover { border-color: var(--accent); }
.icon-btn { width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--text); display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { display: block; }
.icon-btn svg[hidden] { display: none; }
.progress { position: sticky; top: var(--topbar-h); z-index: 29; height: 0; }
.progress .phand { position: absolute; left: 0; top: -1px; color: var(--accent); transform: translateX(0); will-change: transform; opacity: 0; transition: opacity .2s; }
.progress.on .phand { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .progress .phand { transition: none; } }
@media (max-width: 30rem) { .topnav a:nth-child(1), .topnav a:nth-child(n+4) { display: none; } }

/* hero: always dark */
.hero { background: var(--hero-bg); color: var(--hero-text); }
.hero-in { max-width: 80rem; margin: 0 auto; padding: 1.4rem 1rem 2.2rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem; grid-template-areas: "head" "wall" "sub"; }
.hero-head { grid-area: head; min-width: 0; align-self: end; }
.hero-sub { grid-area: sub; min-width: 0; align-self: start; }
.wall { grid-area: wall; }
.kicker { margin: 0 0 .7rem; color: var(--hero-accent); font-size: 1.05rem; letter-spacing: .02em; font-weight: 600; }
.hero h1 { font-size: 1.95rem; font-weight: 650; }
.hero .lede { margin: .7rem 0 0; font-size: 1.15rem; color: var(--hero-muted); max-width: 36rem; }
.hero .deck { margin: .2rem 0 0; font-size: 1.1rem; color: var(--hero-muted); max-width: 36rem; }
.hero-go { margin: 1.4rem 0 0; display: flex; flex-wrap: wrap; gap: .6rem; }
@media (min-width: 40rem) { .hero h1 { font-size: 2.4rem; } .hero .deck { font-size: 1.2rem; } }
@media (min-width: 62rem) {
  .hero-in { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 0 3rem; padding: 2.4rem 1.5rem 2.6rem; grid-template-areas: "head wall" "sub wall"; align-content: center; }
  .hero-head { padding-bottom: 1rem; }
  .hero h1 { font-size: 2.85rem; }
}
@media (min-width: 90rem) { .hero h1 { font-size: 3.2rem; } }

.btn {
  font: inherit; font-size: 1rem; font-weight: 600; min-height: 2.75rem; padding: .5rem 1.05rem; border-radius: 2rem; cursor: pointer;
  border: 1.5px solid var(--accent); background: transparent; color: var(--accent); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
}
.btn:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.btn.solid { background: var(--hero-accent); border-color: var(--hero-accent); color: #1b100a; }
.btn.solid:hover { background: #f7b394; }
.btn.ghost { border-color: var(--line); color: var(--text); font-weight: 500; }
.btn.ghost.light { border-color: var(--hero-line); color: var(--hero-text); }
.btn.sq { min-width: 2.75rem; padding: .3rem; font-size: 1.4rem; }
.btn[data-on="1"] { background: var(--accent); color: var(--on-accent); }
.hero .btn { color: var(--hero-accent); border-color: var(--hero-accent); }
.hero .btn.solid { color: #1b100a; }
.hero .btn.ghost { color: var(--hero-text); border-color: var(--hero-line); }
.hero .btn:hover { background: color-mix(in srgb, var(--hero-accent) 18%, transparent); }
.hero .btn.solid:hover { background: #f7b394; }

/* the wall */
.wall { margin: 0; min-width: 0; justify-self: center; width: 100%; max-width: 31rem; }
.wall-stage { position: relative; aspect-ratio: 4 / 5; border-radius: .9rem; overflow: hidden; background: #1b1511; box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .06); }
.wall-still, .wall-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.wall-canvas { touch-action: manipulation; cursor: crosshair; }
.wall.blowing .wall-canvas { touch-action: none; }
.wall-ctl { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.wall-ctl .btn { font-size: .95rem; padding: .4rem .9rem; }
.wall-status { min-height: 1.4em; margin: .4rem 0 0; font-size: .95rem; color: var(--hero-muted); }
.wall figcaption { font-size: .93rem; line-height: 1.5; color: var(--hero-muted); margin-top: .3rem; }
.wall-canvas, .wall-still { -webkit-tap-highlight-color: transparent; }
@media (min-width: 62rem) { .wall { max-width: min(31rem, calc((100svh - 11rem) * .8)); } }
.js-wall .wall-still { opacity: 1; }

/* sections */
.sec { padding: 3.2rem 0; border-top: 1px solid var(--line); }
.sec.alt { background: var(--surface); }
.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1rem; }
.wrap.wide { max-width: 64rem; }
.sec h2 { font-size: 1.75rem; margin-bottom: 1.2rem; }
@media (min-width: 40rem) { .sec h2 { font-size: 2.1rem; } }
.sec p { margin: 0 0 1.05rem; }
.sec .lead { font-size: 1.2rem; color: var(--muted); }
.sec h3 { font-size: 1.3rem; }

/* glass: set the screen, lay the palm */
.glass { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; margin: 1.5rem 0 1.8rem; padding: 1.1rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--bg); }
.sec.alt .glass { background: var(--bg); }
.g-card, .g-patch { min-width: 0; }
.g-h { margin: 0 0 .6rem !important; font-weight: 700; }
.g-cardwrap { overflow-x: auto; padding-bottom: .3rem; }
.g-cardbox { position: relative; border: 2px dashed var(--accent); border-radius: .5rem; background: color-mix(in srgb, var(--accent) 9%, transparent); display: grid; place-items: center; text-align: center; min-width: 4rem; }
.g-cardbox { -webkit-mask-image: linear-gradient(#000 72%, transparent); mask-image: linear-gradient(#000 72%, transparent); border-bottom-style: none; }
.g-cardlab { font-size: .85rem; line-height: 1.3; padding: .4rem; color: var(--muted); }
.g-btns, .g-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; }
.g-tabs { margin: 0 0 .8rem; }
.g-stage { position: relative; overflow: auto; border: 1px solid var(--line); border-radius: .6rem; background: #1a1410; min-height: 6rem; max-height: 90svh; padding: 1.8rem 1.8rem 2.2rem 2.2rem; }
.g-stage svg.patch-real { display: block; overflow: visible; }
.g-status { margin: .6rem 0 0 !important; font-size: .95rem; color: var(--muted); min-height: 1.3em; }
.ruler line { stroke: #d9c9b0; stroke-width: 1; }
.ruler text { fill: #e8dcc6; font: 600 11px "Atkinson Hyperlegible Next", sans-serif; }
.refpalm { fill: none; stroke: #f6ebdb; stroke-width: 1.5; stroke-dasharray: 6 5; }
.reflab { fill: #f6ebdb; font: 600 12px "Atkinson Hyperlegible Next", sans-serif; }
.pig { fill: #bf4426; }
.patchsvg { display: block; width: 100%; height: auto; }
.patchfig { max-width: 22rem; }
.patchdraw { background: #1a1410; border-radius: .6rem; padding: 1.2rem; display: grid; place-items: center; }
.patchdraw .patchsvg { max-height: 14rem; width: auto; }

/* age figure */
.agefig { margin: 1.6rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); }
.sec:not(.alt) .agefig { background: var(--surface); }
.agesvg { width: 100%; height: auto; display: block; }
.agesvg .ax { stroke: var(--muted); stroke-width: 1.2; }
.agesvg .tk { fill: var(--muted); font: 500 12px "Atkinson Hyperlegible Next", sans-serif; }
.agesvg .lb { fill: var(--text); font: 500 14px "Atkinson Hyperlegible Next", sans-serif; }
.agesvg .lb.strong { font-weight: 800; fill: var(--accent); font-size: 15px; }
.agesvg .band { fill: color-mix(in srgb, var(--accent) 30%, transparent); }
.agesvg .dot { fill: var(--accent); }
.agesvg .minline { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 4; }
.agesvg .arrow { stroke: var(--text); stroke-width: 2; fill: none; }
.agesvg .arrowhead { fill: var(--text); }
figcaption { font-size: .95rem; color: var(--muted); line-height: 1.5; }
.agefig figcaption, .studies figcaption, .gargas-bar figcaption { margin-top: .7rem; }

/* time wall */
.wall-list { list-style: none; margin: 2rem 0 0; padding: 0; position: relative; }
.wall-list::before { content: ""; position: absolute; left: .45rem; top: .6rem; bottom: .6rem; width: 2px; background: linear-gradient(var(--accent), var(--line)); }
.wall-item { position: relative; padding: 0 0 2.6rem 2rem; display: grid; gap: .4rem; }
.wall-item::before { content: ""; position: absolute; left: 0; top: .55rem; width: 1rem; height: 1rem; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); }
.tone-c::before { border-style: dashed; }
.tone-d::before { border-color: var(--c-unk); }
.tone-t::before { background: var(--accent); }
.age { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .6rem; }
.age-n { font-size: 1.75rem; font-weight: 700; line-height: 1.1; color: var(--text); }
.age-u { font-size: 1.1rem; color: var(--muted); }
.wall-body h3 { font-size: 1.2rem; font-family: "Atkinson Hyperlegible Next", sans-serif; font-weight: 700; }
.status { display: inline-block; margin: .15rem 0 .5rem !important; font-size: .9rem; font-weight: 600; padding: .1rem .6rem; border: 1px solid var(--line); border-radius: 2rem; color: var(--muted); }
.tone-c .status { border-color: var(--accent); color: var(--accent); }
.shot { margin: 1rem 0 0; }
.shot img { display: block; width: 100%; height: auto; border-radius: .6rem; background: #1a1410; }
.shot figcaption { margin-top: .5rem; }
.nophoto { font-size: .93rem !important; color: var(--muted); }
@media (min-width: 52rem) {
  .wall-item { grid-template-columns: 13rem minmax(0, 1fr); gap: 0 2rem; padding-left: 2.2rem; }
  .age { align-self: start; display: block; position: sticky; top: calc(var(--topbar-h) + 1rem); }
  .age-n { display: block; font-size: 1.9rem; }
  .wall-list::before { left: .5rem; }
  .shot { max-width: 30rem; }
  .shot img { max-height: 28rem; object-fit: cover; }
}

/* bars */
.bar { display: flex; height: 1.15rem; border-radius: .35rem; overflow: hidden; background: var(--line); }
.bar.big { height: 1.6rem; }
.bar i { display: block; height: 100%; }
.bar i.m { background: var(--c-male); } .bar i.w { background: var(--c-fem); } .bar i.u { background: var(--c-unk); }
.studies ol { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; gap: 1.1rem; }
.s-head { margin-bottom: .3rem; }
.s-head span { color: var(--muted); font-size: .95rem; }
.s-nums { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .95rem; margin-top: .3rem; }
.s-nums .m::before, .s-nums .w::before, .s-nums .u::before { content: ""; display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin-right: .35rem; vertical-align: -.05rem; }
.s-nums .m::before { background: var(--c-male); } .s-nums .w::before { background: var(--c-fem); } .s-nums .u::before { background: var(--c-unk); }
.s-nums .n { color: var(--muted); margin-left: auto; }
.gargas-bar { margin: 1.4rem 0; }

.mi { padding-left: 1.2rem; }
.mi li { margin-bottom: .8rem; }
.src { padding-left: 1.3rem; font-size: .98rem; line-height: 1.5; }
.src li { margin-bottom: .55rem; }
.share-wrap { margin-top: 2rem; --sr-acc: var(--accent); --sr-ink: var(--text); --sr-line: var(--line); --sr-ok: var(--muted); }
.foot { padding: 1.6rem 0 3rem; border-top: 1px solid var(--line); font-size: .95rem; color: var(--muted); }
.foot p { margin: 0 0 .5rem; }
.nf { padding: 4rem 1rem; }
@media print { .topbar, .progress, .wall-ctl, .glass { display: none; } }
.g-grip { position: absolute; right: -14px; top: 0; bottom: 0; width: 28px; cursor: ew-resize; touch-action: none; }
.g-grip::after { content: ""; position: absolute; left: 11px; top: 25%; bottom: 25%; width: 6px; border-radius: 3px; background: var(--accent); }

@media (min-width: 56rem) {
  .glass { grid-template-columns: auto minmax(0, 1fr); gap: 2rem; align-items: start; }
  .g-cardwrap { overflow: visible; }
}
@media (max-width: 24rem) { .topnav a:nth-child(3) { display: none; } }
.wall-chip { position: absolute; left: .6rem; top: .6rem; z-index: 2; pointer-events: none; font-size: .85rem; font-weight: 600; padding: .2rem .65rem; border-radius: 2rem; background: rgba(18, 13, 10, .78); color: #f6ebdb; border: 1px solid #8b7763; }


/* share row (standards/v2/tools/share_row.py) */
.share-row{display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}
.share-row .lab{font-size:.95rem;opacity:.8;margin-right:.3rem}
.share-row a,.share-row button{display:inline-grid;place-items:center;flex:none;width:2.5rem;height:2.5rem;padding:0;border-radius:50%;border:1px solid var(--sr-line,color-mix(in srgb,currentColor 28%,transparent));background:transparent;color:var(--sr-ink,inherit);text-decoration:none;cursor:pointer;font:inherit;transition:color .15s,border-color .15s}
.share-row a:hover,.share-row button:hover,.share-row a:focus-visible,.share-row button:focus-visible{color:var(--sr-acc,inherit);border-color:var(--sr-acc,currentColor)}
.share-row [hidden]{display:none}
@media (pointer:coarse){.share-row a,.share-row button{width:2.75rem;height:2.75rem}}
@media (max-width:30rem){.share-row .lab{flex-basis:100%;margin:0 0 .15rem}}
.share-status{font-size:.92rem;color:var(--sr-ok,inherit);min-height:1.2em;margin:.4rem 0 0}
.share-field{display:block;width:100%;max-width:36rem;margin-top:.4rem;font:inherit;font-size:.9rem}
