/* ==========================================================================
   ROZBOR VAŠEHO PROJEKTU  —  technický dossier (aityy)
   Literary-technical dossier: bookish cool paper, ledger grid, oxblood
   numbering, schematic architecture, marked-up-manuscript margin notes.
   Deliberately distinct from the fotokurz monograph (no Playfair, no cream).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400;1,6..72,500&family=Instrument+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ------------------------------------------------------------------ tokens */
:root {
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans:  'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* bookish cool paper ramp */
  --paper:    #F3F0E8;
  --paper-2:  #ECE8DD;
  --panel:    #FBF9F3;
  --sunken:   #E5E0D2;

  /* ink */
  --ink:    #1C1B16;
  --ink-2:  #4F4B40;
  --ink-3:  #7E7868;
  --ink-4:  #A39C8A;

  /* accents */
  --ox:       #7E2B2B;   /* oxblood — numbering, critical path, emphasis */
  --ox-soft:  #EFE0DA;
  --ok:       #4C5D38;   /* olive — CONFIRMED */
  --ok-soft:  #E4E6D3;
  --warn:     #8A5A16;   /* amber — UNVERIFIED / watch */
  --warn-soft:#F0E4CC;
  --blue:     #2C3C5C;   /* schematic ink-blue */

  --rule:   #D6D0C1;
  --rule-2: #CAC3B1;

  --fs-mega:  clamp(2.7rem, 1.4rem + 5.4vw, 5rem);
  --fs-h2:    clamp(1.55rem, 1.1rem + 1.9vw, 2.35rem);
  --fs-h3:    clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
  --fs-lead:  clamp(1.08rem, 1rem + 0.45vw, 1.3rem);
  --fs-body:  1.0625rem;
  --fs-sm:    0.86rem;
  --fs-xs:    0.74rem;

  --measure: 66ch;
  --maxw:    1180px;

  --ease: cubic-bezier(.2,.6,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){ html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--paper);
  /* ledger grid + faint grain, layered */
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214,208,193,.5) 1px, transparent 1px),
    radial-gradient(circle at 18% -10%, rgba(126,43,43,.05), transparent 55%);
  background-size: 100% 2.1rem, 2.1rem 2.1rem, 100% 100%;
  background-attachment: fixed, fixed, fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--ox); color: #fff; }

/* ---------------------------------------------------------- reading progress */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--ox); z-index: 60;
  transition: width .08s linear;
}

/* ----------------------------------------------------------------- structure */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 3rem); }
.measure { max-width: var(--measure); }

main { position: relative; }

/* a document "sheet" — the body column sits on a paper panel with rules */
section { position: relative; padding: clamp(2.6rem, 5vw, 4.6rem) 0; }
section + section { border-top: 1px solid var(--rule); }

/* --------------------------------------------------------------- top masthead */
.masthead {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 1.1rem 0 1.05rem;
  border-bottom: 1.5px solid var(--ink);
  font-family: var(--mono); font-size: var(--fs-xs);
  letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2);
}
.masthead .brand { font-weight: 600; color: var(--ink); letter-spacing: .02em; }
.masthead .brand b { font-weight: 600; }
.masthead .meta { display: flex; gap: 1.4rem; flex-wrap: wrap; }

/* ------------------------------------------------------------------ hero/cover */
.cover { padding-top: clamp(2.4rem, 5vw, 4.2rem); }
.kicker {
  font-family: var(--mono); font-size: var(--fs-xs); font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--ox);
  display: inline-flex; align-items: center; gap: .6rem; margin: 0 0 1.3rem;
}
.kicker::before { content: ""; width: 1.9rem; height: 1.5px; background: var(--ox); }

.cover h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: var(--fs-mega); line-height: .98; letter-spacing: -.018em;
  margin: 0; color: var(--ink);
}
.cover h1 em { font-style: italic; color: var(--ox); font-weight: 400; }

.cover .verdict {
  font-family: var(--serif); font-size: var(--fs-lead); font-weight: 400;
  line-height: 1.5; color: var(--ink-2); max-width: 60ch;
  margin: 1.6rem 0 0;
}
.cover .verdict b { color: var(--ink); font-weight: 600; }

.coverline {
  display: flex; gap: 2.2rem; flex-wrap: wrap; margin-top: 2.2rem;
  font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: .03em;
  text-transform: uppercase; color: var(--ink-3);
}
.coverline span b { color: var(--ink); font-weight: 600; }

/* ----------------------------------------------------------------- section head */
.shead { display: flex; gap: 1.1rem; align-items: baseline; margin: 0 0 1.7rem; }
.shead .num {
  font-family: var(--mono); font-weight: 600; font-size: var(--fs-sm);
  color: var(--ox); border: 1.5px solid var(--ox); border-radius: 2px;
  padding: .12rem .5rem; line-height: 1; align-self: center; flex: none;
}
.shead h2 {
  font-family: var(--serif); font-weight: 500; font-size: var(--fs-h2);
  line-height: 1.05; letter-spacing: -.015em; margin: 0; color: var(--ink);
}
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--ink-2); margin: 0 0 1.5rem; }
p { margin: 0 0 1.05rem; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 600; color: var(--ink); }
a { color: var(--ox); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }

/* --------------------------------------------------------------- margin notes */
/* marked-up-manuscript device: floats into the right margin on wide screens */
.marginnote {
  font-family: var(--mono); font-size: var(--fs-xs); line-height: 1.5;
  color: var(--ink-3); letter-spacing: .01em;
  border-left: 2px solid var(--rule-2); padding-left: .7rem;
  margin: 1.2rem 0;
}
.marginnote b { color: var(--ink-2); font-weight: 600; }
@media (min-width: 1080px) {
  .has-margin { position: relative; }
  .marginnote {
    float: right; clear: right; width: 220px;
    margin-right: -268px; margin-top: .2rem; border-left: 0;
    border-top: 2px solid var(--ox); padding: .55rem 0 0;
  }
}
/* layer cards are grid containers, so the float above is ignored — render the
   in-card note as a quiet annotation footnote pinned to the bottom instead */
.layer .marginnote {
  float: none; width: auto; order: 99;
  margin: .4rem 0 0; padding: .15rem 0 .15rem .7rem;
  border-top: 0; border-left: 2px solid var(--ox-soft);
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- verdict band */
.verdictband {
  background: var(--panel); border: 1px solid var(--rule);
  border-left: 3px solid var(--ox);
  padding: clamp(1.3rem,3vw,2rem); border-radius: 3px; margin: 1.8rem 0;
}
.verdictband h3 {
  font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: .14em;
  text-transform: uppercase; color: var(--ox); margin: 0 0 .9rem; font-weight: 600;
}
.verdictband p { font-family: var(--serif); font-size: 1.18rem; line-height: 1.55; color: var(--ink); margin: 0; }

/* --------------------------------------------------------------------- chips */
.tag {
  font-family: var(--mono); font-size: .68rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  padding: .16rem .42rem; border-radius: 2px; white-space: nowrap;
  display: inline-block; vertical-align: middle;
}
.tag.ok   { color: var(--ok);   background: var(--ok-soft); }
.tag.corr { color: var(--ox);   background: var(--ox-soft); }
.tag.unv  { color: var(--warn); background: var(--warn-soft); }

/* ----------------------------------------------------------------- layer cards */
.layers { display: grid; gap: 1.1rem; margin-top: .5rem; }
.layer {
  background: var(--panel); border: 1px solid var(--rule);
  border-radius: 4px; padding: clamp(1.2rem,2.6vw,1.7rem);
  display: grid; gap: .6rem;
}
.layer .top { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; }
.layer .idx { font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-4); font-weight: 600; }
.layer h3 {
  font-family: var(--serif); font-weight: 500; font-size: var(--fs-h3);
  margin: 0; color: var(--ink); line-height: 1.15; letter-spacing: -.01em;
}
.layer .pick {
  font-family: var(--mono); font-size: var(--fs-sm); font-weight: 600;
  color: var(--ox); letter-spacing: .01em;
}
.layer .arrow { color: var(--ink-4); }
.layer p { font-size: var(--fs-sm); line-height: 1.6; color: var(--ink-2); margin: 0; }
.layer .why b, .layer .gotcha b { color: var(--ink); }
.layer .gotcha {
  font-size: var(--fs-sm); color: var(--ink-2);
  border-top: 1px dashed var(--rule-2); padding-top: .7rem; margin-top: .2rem;
}
.layer .gotcha .lbl {
  font-family: var(--mono); font-size: .68rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--warn);
  margin-right: .5rem;
}

/* ------------------------------------------------------------------- schematic */
.schematic {
  background: var(--panel); border: 1px solid var(--rule); border-radius: 5px;
  padding: clamp(1.3rem, 3.5vw, 2.6rem) clamp(1rem,3vw,2.2rem);
  margin-top: .4rem; overflow: hidden;
}
.sch-grid { display: grid; gap: .9rem; justify-items: center; }
.node {
  width: 100%; max-width: 460px; text-align: center;
  border: 1.5px solid var(--ink); background: var(--paper);
  border-radius: 3px; padding: .7rem .9rem; position: relative;
}
.node.edge   { border-color: var(--ink-3); }
.node.hub    { border-color: var(--ox); border-width: 2px; background: var(--ox-soft); max-width: 520px; }
.node .name { font-family: var(--mono); font-weight: 600; font-size: var(--fs-sm); letter-spacing: .01em; color: var(--ink); }
.node .desc { font-size: var(--fs-xs); color: var(--ink-2); margin-top: .25rem; line-height: 1.4; }
.node.hub .name { color: var(--ox); }
.spine { width: 1.5px; height: 1.4rem; background: var(--rule-2); }

.branches {
  display: grid; gap: .9rem; width: 100%;
  grid-template-columns: 1fr; margin-top: .2rem;
}
@media (min-width: 760px){ .branches { grid-template-columns: repeat(3, 1fr); } }
.branches .node { max-width: none; }
.branches .label {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-4); margin-bottom: .45rem; text-align: center;
}

/* the critical-path stepper */
.flow {
  margin-top: 1.4rem; border-top: 2px solid var(--ox); padding-top: 1.1rem;
}
.flow .label {
  font-family: var(--mono); font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ox); margin-bottom: .8rem;
}
.steps { display: flex; flex-wrap: wrap; gap: .55rem; align-items: stretch; }
.step {
  flex: 1 1 160px; background: var(--paper); border: 1px solid var(--rule-2);
  border-radius: 3px; padding: .7rem .8rem; position: relative;
}
.step .n { font-family: var(--mono); font-size: .68rem; font-weight: 600; color: var(--ox); }
.step .t { font-size: var(--fs-sm); color: var(--ink); margin-top: .2rem; line-height: 1.35; }
.step:not(:last-child)::after {
  content: "›"; position: absolute; right: -.5rem; top: 50%; transform: translateY(-50%);
  color: var(--ox); font-weight: 700; z-index: 2;
}
@media (max-width: 620px){ .step::after { display: none; } }

/* ----------------------------------------------------------------------- tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 4px; margin-top: .4rem; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); background: var(--panel); min-width: 520px; }
th, td { text-align: left; padding: .72rem .9rem; vertical-align: top; border-bottom: 1px solid var(--rule); }
thead th {
  font-family: var(--mono); font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
  background: var(--paper-2); position: sticky; top: 0;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--paper-2); }
td .num { font-family: var(--mono); color: var(--ink); font-weight: 600; }
td.price { font-family: var(--mono); white-space: nowrap; color: var(--ink); font-weight: 600; }
.t-note { font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-3); margin-top: .7rem; }

/* ---------------------------------------------------------------- honesty list */
.honest { display: grid; gap: 1rem; margin-top: .5rem; }
.honest .item {
  background: var(--warn-soft); border: 1px solid #E0CFA8; border-radius: 4px;
  padding: 1.1rem 1.2rem; display: grid; gap: .4rem;
}
.honest .item h3 {
  font-family: var(--mono); font-size: var(--fs-sm); font-weight: 600;
  color: var(--warn); margin: 0; letter-spacing: .01em;
  display: flex; align-items: center; gap: .6rem;
}
.honest .item p { font-size: var(--fs-sm); color: var(--ink-2); margin: 0; line-height: 1.55; }

/* ----------------------------------------------------------------- references */
.refs { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-top: .5rem; }
@media (min-width: 680px){ .refs { grid-template-columns: 1fr 1fr; } }
.ref {
  border: 1px solid var(--rule); border-radius: 4px; padding: 1.2rem 1.3rem;
  background: var(--panel); display: grid; gap: .35rem;
}
.ref .role { font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-4); }
.ref a.url { font-family: var(--serif); font-size: var(--fs-h3); font-weight: 500; text-decoration: none; }
.ref p { font-size: var(--fs-sm); color: var(--ink-2); margin: 0; }

/* ----------------------------------------------------------------------- close */
.close { background: var(--ink); color: var(--paper); border-top: 0; }
.close .shead h2 { color: var(--panel); }
.close .shead .num { color: #E0B7A0; border-color: #774038; }
.close p { color: #CDC8BB; }
.close .verdict-line { font-family: var(--serif); font-size: var(--fs-lead); color: var(--panel); line-height: 1.5; }
.close a { color: #E7B7A6; }
.close a:hover { color: #fff; }
.cta-row { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.7rem; align-items: center; }
.btn {
  font-family: var(--mono); font-weight: 600; font-size: var(--fs-sm);
  letter-spacing: .02em; text-decoration: none; border-radius: 3px;
  padding: .8rem 1.3rem; display: inline-block;
}
.btn.primary { background: var(--paper); color: var(--ink); }
.btn.primary:hover { background: #fff; }
.btn.ghost { border: 1.5px solid #5b554a; color: var(--paper); }
.btn.ghost:hover { border-color: var(--paper); }

/* ------------------------------------------------------------------ colophon */
.colophon {
  padding: 2rem 0 3rem; font-family: var(--mono); font-size: var(--fs-xs);
  color: var(--ink-3); letter-spacing: .02em; line-height: 1.7;
}
.colophon .brand { color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------- load animation */
@media (prefers-reduced-motion: no-preference){
  .reveal { opacity: 0; transform: translateY(14px); animation: rise .7s var(--ease) forwards; }
  .reveal.d1 { animation-delay: .06s; }
  .reveal.d2 { animation-delay: .14s; }
  .reveal.d3 { animation-delay: .24s; }
  .reveal.d4 { animation-delay: .34s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}
