/* ============================================================================
   NUANSE — work/zingara.css · ONE signature element

   "The menu, re-set." The home page carries a reduced before/after that links
   here; this is the full argument.

   The mechanism is a single menu, not two stacked copies, driven entirely by
   one custom property --p (0 = before, 1 = after) set on .zm by the script.
   Everything else is CSS interpolating off it:

     - the prices physically slide into one aligned column
     - "Rs." and "/-" fade out
     - the dish names cross-fade from four competing faces to one
     - the colour chaos resolves to a single accent
     - the TODAY SPECIAL burst lets go

   Doing it as one property means the reduced-motion path is simply --p:1, and
   the script never touches a style attribute, which the CSP forbids.

   The prices moving IS the argument. A clip-path reveal would show two
   outcomes; this shows the correction happening.

   TYPEFACES. The "before" uses system faces only — that is the chaos, and
   nothing is loaded for it. The "after" is set in Gloock, NUANSE's own
   display face, standing in for the Cormorant Garamond that shipped. Per
   brief/02 we do not load a client's typeface; it appears inside the boards
   in section 4, where it belongs.
   ========================================================================== */

/* ============ THE PAGE'S ACCENT ============
   Zingara's own, documented on its palette board: true red #C8332A primary,
   charcoal #1C1A18 secondary, cream #F5EDD8, burnished gold #C9933A accent.

   Which one goes where is a contrast decision, not a taste one:
     true red on cream     4.97:1  -> fine as text on light, so --accent-ink
     true red on charcoal  3.27:1  -> large type and rules only
     gold on charcoal      6.38:1  -> the small text on the dark opening frame
     gold on cream         2.55:1  -> never as text on light

   The home page's case art uses oxblood #8A2B1D. That was our invention, not
   Zingara's colour, and it is not used here. */
.pj-zingara{
  --accent:#C8332A;
  --accent-l:#C9933A;
  --accent-ink:#C8332A;
  --pj-ground:#1C1A18;
  /* Zingara's own documented cream. Also the accessible choice: true red
     on it is 4.54:1, where the warmer grey I had first reached only 4.27. */
  --pj-sig-bg:#F5EDD8;
}
/* the next-project panel wears the NEXT brand's colour: Possah forest green */
.pj-next-possah{--next-accent:#1F3A2D}

/* The documented palette, as chips. Classes setting --sw, never style
   attributes: style-src has no 'unsafe-inline'. The chip is hidden from the
   accessibility tree and the hex beside it is real text, so the value is the
   accessible name and nothing depends on seeing the colour. */
.sw-z-red{--sw:#C8332A}
.sw-z-charcoal{--sw:#1C1A18}
.sw-z-cream{--sw:#F5EDD8}
.sw-z-gold{--sw:#C9933A}

/* THE SLIDE. .zm is the grid, not a centred block: the writing, the control
   and the count on the left, the sheet on the right. It carries --p because
   the script writes it here and everything below reads it.

   The sheet is NARROW on purpose. A menu is a tall object and a 900px-wide
   one is a placemat; at ~420px the eye runs down it the way it runs down a
   real menu, which is also what makes the prices sliding into one column
   legible as a correction rather than as a wide row of things moving. */
.zm{--p:0;position:relative;display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,.86fr);
  gap:clamp(26px,3.2vw,48px) clamp(34px,5vw,88px);align-items:start;
  user-select:none;-webkit-user-select:none}
.zm>.eyebrow{grid-column:1/-1;margin:0;align-self:start;color:var(--accent-ink)}
.zm-txt{min-width:0}
.zm-txt h2{--f-min:40;--f-max:74;margin:0 0 .4em;font-family:var(--serif);
  font-weight:400;font-size:var(--fluid);line-height:.95;letter-spacing:.025em;
  text-wrap:balance}
.zm-txt>p{margin:0;font-size:clamp(16px,1.2vw,19px);line-height:1.55;max-width:34ch;
  color:var(--mute)}
.zm-sheet{min-width:0;justify-self:end;width:100%;max-width:440px}
/* one line, and it says the one thing a reconstruction owes the reader. The
   paragraph it replaces also re-listed the three facts standing two inches
   above it in the readout. */
.zm-note{margin:14px 0 0;font-size:10px;letter-spacing:.14em;text-transform:uppercase;
  color:var(--mute)}

/* Per-row price offsets — how far each price had wandered from the column.
   Classes rather than style attributes, because style-src has no
   'unsafe-inline'. The values are deliberately uneven; a regular stagger
   would read as a pattern rather than as a mess. */
/* Mostly leftward, and no rightward drift past ~12px. The sheet is 440px
   wide now, not 900: a price is flush with the right margin, so a +41
   wander pushed it under the stage's overflow:hidden and took the mark
   drawn round it with it. The spread is still deliberately uneven — a
   regular stagger reads as a pattern rather than as a mess. */
.w1{--wander:-38}
.w2{--wander:11}
.w3{--wander:-14}
.w4{--wander:-41}
.w5{--wander:-29}
.w6{--wander:9}
.w7{--wander:-47}

/* container-type:inline-size is what lets the sheet keep its own typographic
   scale at 440px that it had at 900: every size inside is in cqi. */
.zm-stage{position:relative;background:#FFFDF6;border:1px solid rgba(28,26,24,.22);
  padding:clamp(24px,6cqi,40px) clamp(20px,5cqi,34px);overflow:hidden;
  container-type:inline-size;cursor:ew-resize;touch-action:pan-y;
  /* the burst's geometry, named once: .zm-burst and the mark drawn round it
     both read these, so the circle cannot drift off the thing it circles */
  --burst-r:clamp(10px,3cqi,34px);
  --burst-t:clamp(80px,17cqi,190px);
  --burst-w:clamp(62px,13cqi,116px)}

/* the sheet discolours as it is corrected: a yellowed print becoming paper */
.zm-stage::before{content:"";position:absolute;inset:0;background:#FFF6CF;
  opacity:calc(1 - var(--p));pointer-events:none;transition:opacity .12s linear}

.zm-head{position:relative;text-align:center;margin-bottom:clamp(22px,3.4cqi,38px)}
.zm-wordmark{display:block;line-height:1;
  font-family:"Arial Black",Impact,sans-serif;font-size:clamp(30px,7cqi,62px);
  letter-spacing:calc(.02em + (1 - var(--p)) * .3em);
  color:color-mix(in srgb, #D7263D calc((1 - var(--p)) * 100%), var(--accent));
  text-shadow:calc((1 - var(--p)) * 4px) calc((1 - var(--p)) * 4px) 0
              rgba(255,183,3,calc(1 - var(--p)))}
/* the real face takes over the moment the correction is more than half made */
.zm[data-settled="1"] .zm-wordmark{font-family:var(--serif);font-weight:400}
.zm-sub{display:block;margin-top:8px;font-style:italic;font-weight:700;color:#217D72;
  font-size:clamp(11px,2cqi,15px);opacity:calc(1 - var(--p) * 2)}
.zm-sub-after{position:absolute;left:0;right:0;margin-top:8px;
  opacity:calc((var(--p) - .5) * 2);
  font-family:var(--mono);font-size:clamp(9px,1.5cqi,11px);letter-spacing:.18em;
  text-transform:uppercase;color:#6B655C}

/* position:relative is load-bearing. .zm-stage::before is the yellowed
   ground, absolutely positioned; a positioned ::before paints above every
   NON-positioned sibling. .zm-head and .zm-row are already relative, so they
   sat above it and these did not — the section headers were being painted
   over by the paper. */
.zm-sec{position:relative;display:flex;justify-content:space-between;align-items:baseline;
  margin:clamp(20px,3cqi,34px) 0 clamp(8px,1.4cqi,14px);
  padding-bottom:calc(6px + var(--p) * 4px);
  border-bottom:1px solid color-mix(in srgb, #E76F51 calc((1 - var(--p)) * 100%), rgba(28,26,24,.5))}
/* The asterisks belong to the bad menu, so the label cannot simply restyle —
   it has to be replaced. Same two-layer handoff as the dish names. */
.zm-sec b{position:relative;display:inline-block;font-weight:700;
  font-size:clamp(12px,2.2cqi,17px);line-height:1.3}
/* LEGIBILITY OF THE 'BEFORE'. The old menu is meant to look bad, and it
   does — four clashing faces, a drop shadow, a starburst, prices adrift. It
   is not meant to be unreadable. Three of its colours were under 4.5:1 on
   the yellowed ground, so each is darkened just enough to clear AA while
   keeping exactly the same clashing hue. Depicting bad design is fine;
   shipping inaccessible text to depict it is not. */
.zm-sec-before{display:block;font-family:"Courier New",monospace;letter-spacing:.02em;
  color:#B1553E;opacity:calc(1 - var(--p) * 2.1)}
.zm-sec-after{position:absolute;left:0;top:0;white-space:nowrap;display:block;
  font-family:var(--mono);font-weight:400;letter-spacing:.16em;text-transform:uppercase;
  font-size:.86em;color:var(--accent-ink);opacity:calc((var(--p) - .47) * 2.1)}
.zm-sec-meta{font-family:var(--mono);font-size:clamp(9px,1.5cqi,11px);color:#746F66;
  opacity:calc((var(--p) - .5) * 2)}

.zm-list{position:relative;list-style:none;margin:0;padding:0}
.zm-row{position:relative;display:grid;grid-template-columns:1fr auto;
  gap:0 clamp(12px,3cqi,32px);align-items:baseline;
  padding:calc(5px + var(--p) * 5px) 0;
  border-bottom:1px dotted rgba(28,26,24,calc(.18 + var(--p) * .12))}

/* the two name layers cross-fade: a typeface cannot be interpolated */
.zm-name{position:relative;display:block;min-width:0}
.zm-before,.zm-after{display:block}
.zm-after{position:absolute;inset:0}
/* The handoff is deliberately STEEP, not linear. Cross-fading two typefaces
   linearly leaves both half-visible through the middle of the move, which
   reads as a rendering fault rather than as a correction. Each layer owns
   half the range: the old face is gone by 0.5, the new one starts there.
   CSS clamps opacity to 0..1, so the negative half of each calc costs
   nothing. */
/* 2.1 and .47, not 2 and .5: at exactly half a layer each the old face was
   gone at .5 and the new one had not started, so the sheet went BLANK for a
   band in the middle of the drag. Nobody saw it while this was a wide sheet
   you glanced at; it is the centre of the chapter now. The handoff is still
   steep — they are visible together for about a hundredth of the range —
   but there is no longer a hole in it. */
.zm-before{opacity:calc(1 - var(--p) * 2.1);text-transform:uppercase;font-weight:700;
  font-size:clamp(11px,2.1cqi,16px);line-height:1.3;color:#1D3557}
.zm-after{opacity:calc((var(--p) - .47) * 2.1);font-family:var(--serif);font-weight:400;
  font-size:clamp(13px,2.4cqi,19px);line-height:1.25;color:#1C1A18;white-space:nowrap}
/* the four competing faces, one per row, exactly as the audit found them */
.f1 .zm-before{font-family:"Times New Roman",serif}
.f2 .zm-before{font-family:"Comic Sans MS","Trebuchet MS",sans-serif;text-transform:none}
.f3 .zm-before{font-family:"Courier New",monospace}
.f4 .zm-before{font-family:"Trebuchet MS",Arial,sans-serif;font-style:italic}

/* THE ARGUMENT. Each price starts at its own wandered offset and arrives in
   one column. --wander is per row, set in the markup as a plain number. */
.zm-price{position:relative;font-variant-numeric:tabular-nums;white-space:nowrap;justify-self:end;
  transform:translateX(calc(var(--wander, 0) * (1 - var(--p)) * 1px));
  font-size:clamp(12px,2.2cqi,17px);
  color:color-mix(in srgb, #C1121F calc((1 - var(--p)) * 100%), var(--accent));
  font-family:"Comic Sans MS","Trebuchet MS",sans-serif;font-weight:700}
.zm[data-settled="1"] .zm-price{font-family:var(--mono);font-weight:500}
.zm-cur,.zm-suf{opacity:calc(1 - var(--p));display:inline-block;
  width:calc(var(--p) * 0px + (1 - var(--p)) * var(--w, 2.4em));overflow:hidden;
  vertical-align:bottom}
.zm-suf{--w:1.6em}

/* the description only exists in the corrected menu.
   #746F66, not the #8A857C this and the two other greys in this mockup
   started as: at 11-13px on #FFFDF6 that measured 3.6:1 and failed AA. It is a mockup of a menu listing, but it
   is real text in the DOM, so the real rule applies. #746F66 is 4.9:1 and
   still reads as the quiet line under the dish name. The failure was only
   visible under prefers-reduced-motion, where the text is shown at full
   opacity instead of fading in with the slider. */
.zm-desc{grid-column:1;display:block;font-size:clamp(10px,1.7cqi,13px);color:#746F66;
  line-height:1.4;opacity:calc((var(--p) - .6) * 2.5);
  max-height:calc(var(--p) * 3em);overflow:hidden;font-family:var(--sans)}

.zm-burst{position:absolute;right:var(--burst-r);top:var(--burst-t);
  width:var(--burst-w);aspect-ratio:1;border-radius:50%;background:#FFB703;
  color:#A40F1A;display:grid;place-items:center;text-align:center;font-weight:900;
  font-size:clamp(9px,1.7cqi,13px);line-height:1.1;border:3px dotted #D7263D;
  opacity:calc(1 - var(--p));
  transform:rotate(calc(-14deg + var(--p) * 26deg)) scale(calc(1 - var(--p) * .35));
  pointer-events:none}
/* ---- the control ---- */
/* Padded by the knob's RADIUS on every side, so the control's box is the
   46px the knob actually occupies. It used to be a 1px track with the knob
   hanging out of it: at --p:0 the knob sat left of the column over the
   writing, and its bottom half crossed the Before/Drag/After legend. */
.zm-ctrl{position:relative;margin:var(--s4) 0 0;padding:23px}
.zm-track{position:relative;height:1px;background:rgba(28,26,24,.22)}
.zm-fill{position:absolute;inset:0;background:var(--accent);transform-origin:left;
  transform:scaleX(var(--p))}
/* the knob's CENTRE travels from one end of the track to the other, which
   is 23px in from each edge of the box */
.zm-knob{position:absolute;top:50%;left:calc(23px + var(--p) * (100% - 46px));
  width:46px;height:46px;margin:-23px 0 0 -23px;border-radius:50%;
  background:#1C1A18;color:#F5EDD8;display:grid;place-items:center;font-size:15px;
  pointer-events:none}
/* the input covers exactly the track, so where you press is where it goes */
.zm-range{position:absolute;top:50%;left:23px;right:23px;width:auto;height:46px;
  margin:-23px 0 0;opacity:0;cursor:ew-resize}
.zm-range:focus-visible ~ .zm-knob{outline:2px dashed var(--accent);outline-offset:3px}
/* .zm-txt>p is (0,1,1) and zeroes the margin of every paragraph in the
   column, the legend included, so it needs the same weight to keep its
   clearance from the bottom of the knob. */
.zm-txt>.zm-legend{display:flex;justify-content:space-between;margin-top:16px;
  font-family:var(--mono);font-size:10.5px;letter-spacing:.14em;text-transform:uppercase;
  color:var(--mute)}
.zm-legend b{font-weight:400;transition:color .3s}
.zm-legend .is-on{color:var(--accent-ink)}

/* the running count of what the correction touches */
/* the count, in the .pj-facts idiom so it is the same object as the facts
   on the problem slide rather than a third way of setting three numbers */
/* ONE fact, and it is the warm one. The other two — four faces to one, one
   column — are now lines in .zm-faults that you watch happen, so printing
   them again two inches below was the page telling you twice. */
.zm-readout{display:flex;align-items:baseline;gap:18px;flex-wrap:wrap;
  margin-top:var(--s4);padding-top:var(--s3);
  border-top:1px solid rgba(28,26,24,.16)}
.zm-readout div{display:contents}
.zm-readout b{font-family:var(--serif);font-weight:400;
  font-size:clamp(34px,3.6vw,52px);line-height:1;letter-spacing:-.03em;color:var(--accent-ink)}
.zm-readout span{font-family:var(--mono);font-size:10px;letter-spacing:.12em;
  text-transform:uppercase;color:var(--mute)}

@media (max-width:900px){
  .zm{grid-template-columns:1fr}
  .zm-sheet{justify-self:start;max-width:520px}
}
@media (max-width:600px){
  .zm-after{white-space:normal}
  .zm-burst{top:auto;bottom:clamp(60px,14cqi,110px)}
  .zm-m-burst{top:auto;bottom:calc(clamp(60px,14cqi,110px) - 9px)}
}
/* Reduced motion: no scrub theatre. The corrected state is the useful one,
   so the page simply presents it, and the control still works if used. */
.rm .zm{--p:1}
.rm .zm-stage::before,.rm .zm-burst{display:none}

/* ============ THE AUDIT · the two halves of the slide, reading each other
   The chapter was a sheet on the right and a paragraph with a slider on the
   left, and nothing connecting them — so the drag was a toy rather than an
   argument, and the writing column ran out halfway down the sheet.

   Now it is one object. Three faults are circled ON the menu, where they
   actually happen, and numbered to three lines in the writing column. Drag,
   and each fault resolves at its own point: the mark lifts off the sheet,
   the line in the column is struck through and the fix takes its place.
   The eye crosses the slide three times instead of looking at two things.

   Everything still interpolates off --p in CSS. A freehand circle is four
   unequal border-radius pairs and a few degrees of rotation — no SVG, no
   script, and it inherits the reduced-motion path (--p:1, so the marks are
   simply never drawn) for free.

   The thresholds are staggered and they are not decorative: 01 is the
   prices, which move first and furthest; 02 is the typeface handoff, which
   zingara.css already puts at the halfway point; 03 is the starburst, which
   should be the last thing to let go. */
.t1{--t:.34}
.t2{--t:.56}
.t3{--t:.78}

/* --- the faults, in the writing column --- */
.zm-faults{list-style:none;margin:var(--s4) 0 0;padding:var(--s3) 0 0;
  border-top:1px solid rgba(28,26,24,.16)}
.zm-faults li{position:relative;display:grid;
  grid-template-columns:auto minmax(0,1fr);gap:0 14px;align-items:baseline;
  padding:12px 0;border-bottom:1px dotted rgba(28,26,24,.24)}
.zm-faults li:last-child{border-bottom:0;padding-bottom:0}
.zm-faults b{grid-row:1;font-family:var(--mono);font-size:10px;font-weight:500;
  letter-spacing:.14em;color:var(--accent-ink)}
/* the two states occupy the same cell, as the dish names do on the sheet:
   a fault is not replaced by a different line, it becomes one */
.zm-faults .was,.zm-faults .now{grid-column:2;grid-row:1;
  font-size:clamp(14px,1.1vw,16px);line-height:1.4}
.zm-faults .was{position:relative;color:var(--mute);
  opacity:calc((var(--t) - var(--p)) * 8 + .5)}
.zm-faults .now{color:#1C1A18;opacity:calc((var(--p) - var(--t)) * 8 + .5)}
/* struck through just BEFORE it goes, so the correction is seen being made
   rather than having happened */
.zm-faults .was::after{content:"";position:absolute;left:0;right:0;top:.6em;height:1px;
  background:var(--accent);transform-origin:left;
  transform:scaleX(clamp(0, calc((var(--p) - var(--t) + .12) * 7), 1))}

/* --- the marks, on the sheet --- */
.zm-mark{position:absolute;pointer-events:none;
  border:1.5px solid var(--accent);
  border-radius:49% 51% 56% 44% / 57% 43% 54% 46%;
  transform:rotate(var(--rot,-4deg));
  opacity:calc((var(--t) - var(--p)) * 8 + .5)}
.zm-mark::after{content:attr(data-n);position:absolute;top:-8px;right:-17px;
  font-family:var(--mono);font-size:9px;letter-spacing:.1em;color:var(--accent)}

/* 01 · inside .zm-price, so the circle RIDES the wandering price into the
   column before it lifts. That is the whole argument of the element, drawn
   on rather than described beside. */
.zm-m-price{inset:-7px -11px;--rot:-6deg}
/* 02 · the row set in the face that does not belong. Sized in cqi against
   the sheet, not the name box: the name cell is the full 1fr column and a
   circle round all of it would be circling the layout, not the fault. */
.zm-m-name{left:-9px;top:-6px;width:min(64cqi,250px);height:calc(100% + 12px);--rot:3deg}
/* 03 · the starburst. The burst's own geometry is lifted to custom
   properties on the stage so the mark cannot drift away from it. */
.zm-m-burst{right:calc(var(--burst-r) - 9px);top:calc(var(--burst-t) - 9px);
  width:calc(var(--burst-w) + 18px);aspect-ratio:1;--rot:7deg}
/* under the circle, not beside it: to its left is the wordmark and to its
   right is the edge of the sheet */
.zm-m-burst::after{top:calc(100% + 4px);right:auto;left:50%;transform:translateX(-50%)}
