/* hvck labs v13, rhythm round (2026-11-18): the four #rhythm proposals (js/rhythm.js builds the one chosen by
   <html data-rhythm>, set from ?rhythm=a|b|c|d|old before paint). Enterprise only (#rhythm is [data-show="teams"]).
   Paper skin rules: hairlines, ink type, orange on one thing at most. Archivo for words, Fragment Mono for machine data
   (times, windows), never tracked caps. Square corners. Nothing moves. */

html:not([data-rhythm="old"]) #year { display: none; }
.rh { margin-top: clamp(72px, 7vw, 112px); }

/* ============================================================================ a: a month in the calendar */
.rh-a { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 24px; align-items: start; }
.cal { grid-column: 1 / span 9; background: var(--raise); border: 1px solid var(--tile-line); }
.cal-bar { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 24px; flex-wrap: wrap; padding: 20px 20px 18px; }
.cal-t { font-size: 22px; font-weight: 600; font-stretch: 112%; letter-spacing: -0.015em; line-height: 1.2; }
.cal-t span { color: var(--faint); font-weight: 500; }
.cal-s { font-size: 14px; line-height: 1.4; color: var(--faint); }
.cal-wd { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-wd span { padding: 9px 12px; font-size: 13px; line-height: 1.4; color: var(--faint); }
.cal-g { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cd { display: flex; flex-direction: column; gap: 6px; min-height: 124px; padding: 9px 8px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cd:nth-child(5n) { border-right: 0; }
.cd:nth-last-child(-n+5) { border-bottom: 0; }
.cd-n { padding: 0 4px; font-size: 13px; line-height: 1.4; font-variant-numeric: tabular-nums; color: var(--dim); }
.cd-w { display: none; }
.cd.out .cd-n { color: var(--grey); }
.cd.out { background: rgb(var(--rgb) / 2.5%); }
#rhythm .ev { display: flex; flex-direction: column; gap: 2px; padding: 7px 9px 8px; font-size: 13px; line-height: 1.3; }
#rhythm .ev .mono { font-size: 13px; line-height: 1.3; color: var(--faint); }
#rhythm .ev b { font-size: 13.5px; font-weight: 600; }
#rhythm .ev-s { font-size: 13px; color: var(--dim); }
/* the weekly lab window: a quiet booking, the hairline with an ink edge */
#rhythm .ev-lab { background: var(--paper); border: 1px solid var(--line); border-left: 2px solid var(--ink); }
/* the live day: the one orange thing, filling the day */
#rhythm .ev-live { flex: 1; background: var(--o); color: var(--c-ink); padding: 9px 10px 10px; }
#rhythm .ev-live .mono, #rhythm .ev-live .ev-s { color: var(--c-ink); }
#rhythm .ev-live b { font-size: 15px; }
/* the quarter review: ink */
#rhythm .ev-rev { background: var(--ink); color: var(--paper); }
#rhythm .ev-rev .mono, #rhythm .ev-rev .ev-s { color: var(--k-dim); }
.cal-key { grid-column: 10 / -1; padding-top: 20px; }
.cal-key ul { display: grid; gap: 28px; }
.cal-key li { align-content: start; display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 4px 14px; }
.cal-key .sw { grid-row: 1 / 3; width: 12px; height: 12px; margin-top: 6px; }
.sw-live { background: var(--o); }
.sw-lab { background: var(--paper); border: 1px solid var(--line-2); border-left: 3px solid var(--ink); }
.sw-rev { background: var(--ink); }
.cal-key b { font-size: 17px; font-weight: 600; line-height: 1.4; }
.cal-key span { font-size: 15px; line-height: 1.5; color: var(--dim); }
.cal-note { text-wrap: balance; margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.5; color: var(--faint); max-width: 30ch; }

@media (max-width: 1100px) {
  .cal { grid-column: 1 / -1; }
  .cal-key { grid-column: 1 / -1; padding-top: 40px; }
  .cal-key ul { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .cal-note { max-width: none; }
}
@media (max-width: 900px) {
  .cd { min-height: 112px; }
  .ev-s, .ev-live .ev-x { display: none; }
  .ev-live .ev-s:not(.ev-x) { display: block; }
}
/* phones: the calendar's own agenda view, the same days as a list (only the booked ones) */
@media (max-width: 600px) {
  .rh-a { display: block; }
  .cal-bar { padding: 16px 16px 14px; }
  .cal-t { font-size: 20px; }
  .cal-wd { display: none; }
  .cal-g { display: block; border-top: 1px solid var(--line); }
  .cd { display: none; }
  .cd.has { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 6px 10px; min-height: 0; padding: 12px 12px 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .cd.has:last-child { border-bottom: 0; }
  .cd-n { grid-row: 1 / span 2; padding: 6px 0 0; font-size: 14px; color: var(--ink); }
  .cd-w { display: block; font-size: 12px; color: var(--faint); }
  .ev { grid-column: 2; }
  .ev-s, .ev-live .ev-x { display: block; }
  .ev-live { padding: 10px 12px 11px; }
  .cal-key { padding-top: 40px; }
  .cal-key ul { grid-template-columns: 1fr; gap: 24px; }
}

/* ============================================================================ b: typographic cadence */
.cad { border-top: 1px solid var(--line-2); }
.cad li { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 24px; align-items: baseline; padding: clamp(40px, 4.4vw, 64px) 0 clamp(36px, 4vw, 56px); border-bottom: 1px solid var(--line); }
.cad-k { grid-column: 1 / span 3; font-size: 17px; font-weight: 600; line-height: 1.4; }
.cad-n { grid-column: 4 / span 5; font-size: clamp(96px, 10.4vw, 160px); font-weight: 560; font-stretch: 112%; letter-spacing: -0.055em; line-height: .78; margin-left: -.04em; white-space: nowrap; }
.cad-d { grid-column: 9 / -1; font-size: 16px; line-height: 1.6; color: var(--dim); max-width: 30ch; }
.cad-u { display: block; margin-bottom: 6px; font-size: 17px; line-height: 1.4; font-weight: 600; color: var(--ink); }
@media (max-width: 900px) {
  .cad li { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; }
  .cad-k { grid-column: 1 / -1; margin-bottom: 24px; }
  .cad-n { grid-column: 1; }
  .cad-d { grid-column: 2; }
}
@media (max-width: 600px) {
  .cad li { display: block; padding: 32px 0 30px; }
  .cad-k { margin-bottom: 22px; font-size: 16px; }
  .cad-n { font-size: clamp(76px, 24vw, 104px); }
  .cad-d { margin-top: 22px; font-size: 15px; }
}

/* ============================================================================ c: the V year */
.vy { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 24px; align-items: center; }
.vy-key { grid-column: 1 / span 4; }
.vy-lead { font-size: 20px; font-weight: 560; font-stretch: 112%; letter-spacing: -0.015em; line-height: 1.3; max-width: 24ch; margin-bottom: 40px; }
.vy-key ul { display: grid; gap: 26px; border-top: 1px solid var(--line); padding-top: 28px; }
.vy-key li { align-content: start; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 4px 14px; }
.vk { grid-row: 1 / 3; justify-self: center; margin-top: 5px; }
.vk.m { width: 21px; height: 22px; fill: var(--ink); }
.vk.w { width: 9px; height: 9.5px; margin-top: 8px; fill: rgb(var(--rgb) / 50%); }
.vk.q { width: 9px; height: 9.5px; margin-top: 8px; fill: var(--o); }
.vy-key b { font-size: 17px; font-weight: 600; line-height: 1.4; }
.vy-key span { font-size: 15px; line-height: 1.5; color: var(--dim); }
.vy-fig { grid-column: 6 / -1; justify-self: center; width: min(100%, 572px); }
.vy-box { position: relative; }
.vy-svg { display: block; width: 100%; height: auto; overflow: visible; }
.vy-o { fill: rgb(var(--rgb) / 4%); }   /* the master mark as a ghost: a tint, not a line, so no label ever sits across a rule */
.vy-svg .m { fill: var(--ink); }
.vy-svg .w { fill: rgb(var(--rgb) / 50%); }
.vy-svg .q { fill: var(--o); }
.vy-l { position: absolute; font-family: var(--mono); font-size: 11px; line-height: 1; color: var(--faint); white-space: nowrap; transform: translate(0, -50%); }
.vy-l.is-l { transform: translate(-100%, -50%); }
.vy-q { color: var(--ink); }
@media (max-width: 1100px) {
  .vy-key { grid-column: 1 / span 5; }
  .vy-fig { grid-column: 6 / -1; }
}
@media (max-width: 900px) {
  .vy { display: flex; flex-direction: column-reverse; align-items: stretch; gap: 48px; }
  .vy-fig { align-self: center; width: min(100%, 460px); }
  .vy-key ul { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .vy-lead { margin-bottom: 28px; }
}
@media (max-width: 600px) {
  .vy-key ul { grid-template-columns: 1fr; }
  .vy-l { font-size: 10px; }
  .vy-qw { display: none; }   /* the gap between the arms is narrow here: Q1–Q4, the key says what orange is */
}

/* ============================================================================ d: the patch window */
.pw { border-top: 1px solid var(--ink); }
.pw-bar { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 24px; flex-wrap: wrap; padding: 16px 0 15px; }
.pw-t { font-size: 17px; font-weight: 600; line-height: 1.4; }
.pw-s { font-size: 14px; line-height: 1.4; color: var(--faint); }
.pw-tb { width: 100%; border-collapse: separate; border-spacing: 0; }
.pw-tb thead th { padding: 10px 24px 10px 0; text-align: left; font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--faint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pw-tb thead th:last-child { text-align: right; padding-right: 0; }
.pw-tb tbody td, .pw-tb tbody th { padding: 28px 24px 30px 0; text-align: left; vertical-align: baseline; border-bottom: 1px solid var(--line); }
.pw-when { width: 25%; }
.pw-when .mono { display: block; font-size: 15px; line-height: 1.45; color: var(--ink); }
.pw-when .mono + .mono { color: var(--dim); }
.pw-rep { width: 13%; }
.pw-rep .mono { display: block; font-size: 13px; line-height: 1.7; color: var(--faint); }
.pw-tb tbody th { font-weight: 400; }
.pw-tb tbody th b { display: block; font-size: 22px; font-weight: 580; font-stretch: 112%; letter-spacing: -0.015em; line-height: 1.1; }
.pw-tb tbody th span { display: block; margin-top: 8px; font-size: 15px; line-height: 1.5; color: var(--dim); max-width: 46ch; }
.pw-st { width: 12%; padding-right: 0 !important; text-align: right !important; font-size: 14px; line-height: 1.6; white-space: nowrap; }
.pw-st::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 10px; vertical-align: 1px; border: 1px solid var(--ink); background: var(--ink); }
.pw-f { margin-top: 18px; font-size: 14px; line-height: 1.5; color: var(--faint); }
@media (max-width: 900px) {
  .pw-when { width: 30%; }
  .pw-rep { width: 15%; }
  .pw-tb tbody th b { font-size: 20px; }
}
@media (max-width: 600px) {
  .pw-tb thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pw-tb, .pw-tb tbody { display: block; }
  .pw-tb tbody { border-top: 1px solid var(--line); }
  .pw-tb tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 22px 0 24px; border-bottom: 1px solid var(--line); }
  .pw-tb tbody td, .pw-tb tbody th { padding: 0; border: 0; width: auto; }
  .pw-when { grid-column: 1; grid-row: 1; display: flex; flex-wrap: wrap; gap: 0 12px; }
  .pw-when .mono { font-size: 14px; }
  .pw-rep { grid-column: 2; grid-row: 1; text-align: right; }
  .pw-rep .mono { line-height: 1.6; }
  .pw-tb tbody th { grid-column: 1 / -1; grid-row: 2; margin-top: 12px; }
  .pw-tb tbody th b { font-size: 20px; }
  .pw-st { grid-column: 1 / -1; grid-row: 3; text-align: left !important; margin-top: 12px; }
}

/* ============================================================================ round 2: the year strip, branded
   (?rhythm=wire|vs|dots). The v13 strip's composition (one horizontal year, a Jan–Dec axis, the three-part key), drawn
   per quarter by js/rhythm.js so it wraps: 4 quarters in a row, 2 × 2 under 1200px, stacked on phones. */
.yb { margin-top: clamp(80px, 8vw, 120px); }
.yb-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.yb-svg { display: block; width: 100%; height: auto; overflow: visible; }
.yb-ax { position: relative; height: 34px; margin-top: 12px; border-top: 1px solid var(--line); color: var(--faint); }
.yb-ax span { position: absolute; top: 10px; line-height: 1; }
.yb-key { margin-top: 44px; }
.yb-key .yb-ic { width: 28px; height: 28px; margin-top: 0; background: none; }
.yb-key li { grid-template-columns: 28px minmax(0, 1fr); gap: 4px 16px; }
.yb-ic svg { width: 28px; height: 28px; overflow: visible; }
/* the marks: ink for live days, a quieter ink for the weeks, orange only for the reviews (and the wire) */
.yb .m { fill: var(--ink); }
.yb .w { fill: rgb(var(--rgb) / 42%); }
.yb .q { fill: var(--o); }
.yb pattern circle { fill: rgb(var(--rgb) / 15%); }
.yb-wire pattern circle { fill: rgb(var(--rgb) / 34%); }
.yb .wr { fill: none; stroke: var(--o); stroke-width: 1.75; stroke-linecap: square; vector-effect: non-scaling-stroke; }
.yb .tk { fill: none; stroke: rgb(var(--rgb) / 45%); stroke-width: 1; vector-effect: non-scaling-stroke; }
.yb .tl { fill: var(--raise); stroke: rgb(var(--rgb) / 55%); stroke-width: 1; vector-effect: non-scaling-stroke; }
.yb .td { stroke: none; }
.yb .lb { font-family: var(--mono); font-size: 11px; fill: var(--faint); }
.yb .cap { fill: var(--ink); display: none; }
.yb-q:first-child .cap-l, .yb-q:nth-child(4) .cap-r { display: inline; }
@media (max-width: 1200px) {
  .yb-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
  .yb-q .cap { display: none; }
  .yb-q:nth-child(odd) .cap-l, .yb-q:nth-child(even) .cap-r { display: inline; }
}
@media (max-width: 600px) {
  .yb-strip { grid-template-columns: minmax(0, 1fr); row-gap: 28px; }
  .yb-q .cap-l, .yb-q .cap-r { display: inline; }
  .yb-key { margin-top: 36px; }
}
/* wire: the run on past December into the page wire (placed by js/rhythm.js; desktop only) */
.yb-strip { position: relative; }
.yb-join { position: absolute; left: 100%; height: 1.75px; margin-top: -.875px; background: var(--o); pointer-events: none; }
.yb-join::after { content: ''; position: absolute; right: -3.5px; top: -2.6px; width: 7px; height: 7px; background: var(--ink); }
@media (min-width: 1201px) { .yb-wire .yb-q:nth-child(4) .cap-r { display: none; } }
@media (max-width: 1200px) { .yb-join { display: none; } }

/* Kacper (2026-11-18): "go to the old calendar and just change the orange square to our V as the brand moment".
   The quarter-review marks in the original strip (and in its key) become the orange V mark, 16px tall (LOGO.md minimum),
   sitting on top of its week. Everything else in the strip stays as it was. */
[data-rhythm="old"] .yr .q, [data-rhythm="old"] .yr-key .k-q {
  width: auto; height: 16px; aspect-ratio: .866; background: var(--o);   /* mark.svg is 866.03 × 1000 */
  -webkit-mask: url(../img/logo/mark.svg) center / contain no-repeat; mask: url(../img/logo/mark.svg) center / contain no-repeat;
}
[data-rhythm="old"] .yr span { overflow: visible; }
[data-rhythm="old"] .yr-key .k-q { margin-top: 4px; flex: none; }
/* phones: the weeks are ~7px wide, so a 16px V would touch the next month's bar: lift the Vs above the bar tops, and keep
   December's inside the strip (it was clipped at the right edge) */
@media (max-width: 760px) {
  [data-rhythm="old"] .yr { height: 72px; }
  [data-rhythm="old"] .yr .q { margin-bottom: 30px; }
  [data-rhythm="old"] .yr span:last-child { align-items: flex-end; }
}
