/* Alfabetul de tranziție — print shop: lead-type grey, ink black, proof red. */
:root{
  --bg:#f5efe1;
  --surface:#ece1c9;
  --text:#221c11;
  --text-2:#3d3423;
  --muted:#4c4332;
  --accent:#8a1e15;
  --accent-ink:#fdf6e7;
  --line:#c4b28c;
  --lead:#6b6252;
  --paper-edge:#e0d3b4;
  color-scheme:light;
}
:root[data-theme="dark"]{
  --bg:#15120d;
  --surface:#231c12;
  --text:#f2e9d4;
  --text-2:#e2d5b8;
  --muted:#d3c5a5;
  --accent:#f0a295;
  --accent-ink:#250c07;
  --line:#4d4130;
  --lead:#a89a7d;
  --paper-edge:#332a1b;
  color-scheme:dark;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:Georgia,"Iowan Old Style","Times New Roman",serif;
  font-size:1.075rem;
  line-height:1.65;
}
.wrap{max-width:44rem;margin:0 auto;padding:0 1.25rem}
/* 404 pages: padding lives here, not in a style attribute (the CSP blocks inline styles). */
main.err404{padding:4rem 1.25rem}
.wide{max-width:62rem;margin:0 auto;padding:0 1.25rem;overflow-x:hidden}
.num{font-variant-numeric:tabular-nums}
.skip{
  position:absolute;left:-9999px;top:0;background:var(--text);color:var(--bg);
  padding:.6rem 1rem;z-index:50;border-radius:0 0 .5rem 0;
}
.skip:focus{left:0}
/* top bar: one line, jumps left, language + theme right */
.topbar{
  position:sticky;top:0;z-index:20;
  display:flex;align-items:center;gap:.9rem;
  min-height:3rem;padding:.35rem 1rem;
  background:var(--bg);border-bottom:2px solid var(--text);
}
.topbar .home{
  font-weight:bold;color:var(--text);text-decoration:none;white-space:nowrap;
}
.topnav{display:flex;gap:.15rem;overflow-x:auto;scrollbar-width:none;flex:1 1 auto;min-width:0}
.topnav::-webkit-scrollbar{display:none}
/* One line at every width: links never shrink, the nav scrolls sideways. */
.topnav a{flex:none}
@media (max-width:40rem){
  .topbar{flex-wrap:nowrap;gap:.4rem;padding:.35rem .6rem}
  .topbar .home{flex:none;max-width:30vw;overflow:hidden;text-overflow:ellipsis;font-size:.92rem}
  .topnav{order:0;flex:1 1 auto}
  .topnav a{padding:.45rem .5rem}
  .topbar .spacer{display:none}
  .topbar .chip{flex:none;padding:.4rem .6rem}
}
/* Anchor jumps land clear of the sticky bar. */
section[id]{scroll-margin-top:4.75rem}
.topnav a{
  color:var(--text);text-decoration:none;white-space:nowrap;
  padding:.45rem .6rem;border-radius:.45rem;
}
.topnav a:hover{background:var(--surface)}
.topnav a[aria-current="true"]{background:var(--surface);font-weight:bold}
.spacer{flex:1}
.chip{
  border:1.5px solid var(--text);border-radius:999px;color:var(--text);
  text-decoration:none;padding:.4rem .9rem;min-height:44px;
  display:inline-flex;align-items:center;white-space:nowrap;
}
.icon-btn{
  background:none;border:1.5px solid var(--text);border-radius:999px;
  color:var(--text);min-width:44px;min-height:44px;cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;
}
/* side rail */
.rail{
  position:fixed;right:.6rem;top:30%;z-index:10;
  display:flex;flex-direction:column;gap:.55rem;
}
.rail-dot{position:relative;display:flex;align-items:center;justify-content:flex-end;text-decoration:none}
.rail-label{
  /* Out of flow: in flow, an invisible label still takes width and every
     dot lands at a different x, which reads as a scatter, not a column. */
  position:absolute;right:100%;top:50%;margin-top:-.85rem;margin-right:.5rem;
  font-size:.8rem;color:var(--muted);opacity:0;transition:opacity .15s;
  background:var(--surface);padding:.1rem .5rem;border-radius:.4rem;
  white-space:nowrap;pointer-events:none;
}
.rail-dot:hover .rail-label,.rail-dot:focus-visible .rail-label{opacity:1}
.dot{width:.7rem;height:.7rem;border-radius:50%;background:var(--lead);flex:none}
.rail-dot.active .dot{background:var(--accent)}
@media (max-width:56rem){.rail{display:none}}
/* hero: masthead frame, proof-red correction mark */
.hero{padding:3.2rem 0 2.2rem;border-bottom:1px solid var(--line)}
.masthead{
  border:3px double var(--text);padding:1.4rem 1.5rem 1.2rem;
  background:var(--surface);position:relative;
}
.masthead::after{
  content:"";position:absolute;right:.9rem;top:-1.1rem;width:2.2rem;height:2.2rem;
  border:3px solid var(--accent);border-radius:50%;
}
.kicker{
  text-transform:uppercase;letter-spacing:.14em;font-size:.82rem;
  color:var(--muted);margin:0 0 .5rem;
}
h1{font-size:clamp(1.9rem,4.6vw,2.9rem);line-height:1.16;margin:.2rem 0 .9rem}
.deck{font-size:clamp(1.08rem,2.2vw,1.3rem);line-height:1.55;margin:0 0 1.2rem}
.cta{
  display:inline-flex;align-items:center;gap:.5rem;
  background:var(--accent);color:var(--accent-ink);font-weight:bold;
  text-decoration:none;padding:.7rem 1.3rem;border-radius:.4rem;min-height:44px;
}
.byline{font-size:.92rem;color:var(--muted);margin:1rem 0 0}
.byline a{color:inherit}
/* Subtle share line (interaction.md exception for bespoke pages): one muted
   byline-scale line; hidden until JS runs, so no-JS is pixel-identical. */
.shareline{font-size:.92rem;color:var(--muted);margin:.15rem 0 0}
.shareline button{background:none;border:0;padding:.75rem 0;color:inherit;font:inherit;cursor:pointer;text-decoration:underline;text-underline-offset:.18em;min-height:44px}
.shareline button:hover{color:var(--text)}
.shareline [data-share-status]:empty{display:none}
/* chapters */
.chapter{padding:2.4rem 0;border-bottom:1px solid var(--line)}
.chapter-head h2{font-size:clamp(1.45rem,3.2vw,2rem);line-height:1.25;margin:.2rem 0 1rem}
.seclink{font-size:.8em;color:var(--muted);text-decoration:none;display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:.55rem;margin:-.55rem -.55rem -.55rem 0;border-radius:.45rem;vertical-align:middle}
.seclink:hover{color:var(--text)}
.lede{font-size:1.14rem;margin:0 0 1.4rem}
.reveal{opacity:1}
/* the clipping: a set proof, not a facsimile */
.proof{
  background:var(--surface);border:1px solid var(--line);
  border-top:6px solid var(--text);padding:1.4rem 1.3rem;margin:0 0 1.2rem;
}
.proof-head{
  display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap;
  border-bottom:1px solid var(--line);padding-bottom:.6rem;margin-bottom:1rem;
  font-size:.9rem;color:var(--muted);
}
.clipping{
  font-size:clamp(1.35rem,3.4vw,1.9rem);line-height:2;
  background:var(--bg);border:1px dashed var(--lead);
  padding:1rem 1.1rem;margin:0 0 1rem;
}
.clipping .g{border-radius:.2rem;padding:0 .04em;transition:background-color .12s,color .12s}
.clipping .g.done{background:var(--accent);color:var(--accent-ink)}
.clipping .g.next{outline:2px solid var(--accent);outline-offset:1px}
.loupe-row{display:flex;flex-direction:column;gap:.4rem;margin:0 0 .8rem}
.loupe-row label{font-weight:bold}
input[type="range"]{min-height:44px;width:100%;accent-color:var(--accent)}
.loupe-btns{display:flex;gap:.6rem;flex-wrap:wrap}
.btn{
  border:1.5px solid var(--text);background:none;color:var(--text);
  border-radius:.45rem;padding:.55rem 1.1rem;min-height:44px;font:inherit;cursor:pointer;
}
.btn.primary{background:var(--text);color:var(--bg);font-weight:bold}
.loupe-count{font-size:.95rem;color:var(--muted);margin:.4rem 0 0}
.calc-status{
  border-left:4px solid var(--accent);background:var(--bg);
  padding:.7rem 1rem;margin:.8rem 0;
}
.calc-status p{margin:0}
/* Unavailable state without scripting: controls sit dimmed, the note names
   what is missing (the static transcription below stays the alternative). */
.noscript-note{font-size:.92rem;color:var(--muted);border-left:4px solid var(--accent);background:var(--bg);padding:.7rem 1rem;margin:.8rem 0}
.no-js #loupe,.no-js .loupe-btns,.no-js #nameIn{opacity:.45;pointer-events:none}
/* name converter */
.converter{background:var(--bg);border:1px solid var(--line);padding:1.1rem 1.2rem;margin:1.2rem 0}
.converter label{font-weight:bold;display:block;margin-bottom:.4rem}
.converter input[type="text"]{
  width:100%;font:inherit;color:var(--text);background:var(--surface);
  border:1.5px solid var(--text);border-radius:.4rem;padding:.6rem .8rem;min-height:44px;
}
.converter output{display:block;font-size:1.5rem;margin-top:.7rem;min-height:2.2em}
.conv-note{font-size:.92rem;color:var(--muted);margin:.4rem 0 0}
/* summary box: the whole finding without interaction */
.summary-box{
  border:2px solid var(--text);background:var(--bg);
  padding:1.1rem 1.3rem;margin-top:1.4rem;
}
.summary-box h3{margin:.1rem 0 .6rem;font-size:1.2rem}
.summary-box p{margin:.5rem 0}
/* letter table */
.letter-table{width:100%;border-collapse:collapse;margin:1rem 0;font-size:1rem}
.letter-table caption{text-align:left;font-size:.92rem;color:var(--muted);padding-bottom:.5rem}
.letter-table th,.letter-table td{
  border:1px solid var(--line);padding:.5rem .7rem;text-align:left;vertical-align:top;
}
.letter-table thead th{background:var(--text);color:var(--bg)}
.letter-table .cyr{font-size:1.35rem}
/* parallel tracks */
.tracks{list-style:none;margin:1.2rem 0;padding:0;display:grid;gap:.9rem}
@media (min-width:56rem){.tracks{grid-template-columns:1fr 1fr}}
.track{
  border:1px solid var(--line);border-top:6px solid var(--accent);
  background:var(--surface);padding:1rem 1.2rem;margin:0;
}
.track h3{margin:.1rem 0 .4rem;font-size:1.15rem}
.track .when{font-weight:bold;color:var(--accent)}
.track p{margin:.4rem 0}
/* beats, limits, sources */
.beats{list-style:none;margin:1.2rem 0;padding:0;display:grid;gap:.9rem}
@media (min-width:56rem){.beats{grid-template-columns:repeat(3,1fr)}}
.beat{border:1px solid var(--line);background:var(--surface);padding:1rem 1.1rem;margin:0}
.beat h3{margin:.1rem 0 .4rem;font-size:1.1rem}
.beat .n{
  display:inline-flex;align-items:center;justify-content:center;
  width:1.7rem;height:1.7rem;border-radius:50%;
  background:var(--text);color:var(--bg);font-size:1rem;margin-right:.5rem;
}
.limit-list{margin:1rem 0;padding-left:1.2rem}
.limit-list li{margin:.45rem 0}
.sources{margin:1rem 0;padding-left:1.2rem}
.sources li{margin:.55rem 0}
.sources a{color:var(--text)}
.schema-note{font-size:.92rem;color:var(--muted)}
footer{padding:2rem 0 3rem;font-size:.92rem;color:var(--muted)}
footer a{color:inherit}
a:focus-visible,button:focus-visible,input:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
@media (prefers-reduced-motion:no-preference){
  html.js .reveal{opacity:0;transform:translateY(10px);transition:opacity .4s,transform .4s}
  html.js .reveal.in{opacity:1;transform:none}
}
@media (prefers-reduced-motion:reduce){
  *{transition:none !important;animation:none !important}
}
@media (max-width:56rem){
  body{font-size:1rem}
  .clipping{line-height:2.1}
}
