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

   "The voice, held."

   WHAT THIS WAS GOING TO BE, AND WHY IT ISN'T
   brief/02-project-pages.md specifies a live 60/30/10 ratio meter: a bar that
   tracks the real ivory / green / accent proportion of the campaign imagery as
   you scroll, and holds at the brand's stated ratio. We built the sampler
   (tools/sample-ratios.py) and ran it before writing a line of this file. It
   fails on both candidate corpora, and the numbers are committed next to it in
   site/assets/work/_ratios-possah-*.json so anyone can check:

     campaign frames   coverage 34.5%   drift +-30pp   proximity 28.7pp
     identity boards   coverage 83.2%   drift +-8.5pp  proximity 26.4pp

   60/30/10 is a LAYOUT rule. The board that states it illustrates it on a web
   hero, an Instagram post and a packaging panel — three compositions the
   studio controls pixel by pixel, under the line "Restraint is the brand."
   The campaign frames are photographs of garments on a person in a room.
   Nobody specified the proportion of her hair. Tuning the classifier until the
   number agreed would have been fabrication with extra steps.

   brief/02 names the fallback: the tone-of-voice matrix. This is it, built as
   a live element rather than a picture of one, so it carries the weight the
   Zingara slider carries on the other page.

   HOW IT WORKS
   The matrix is the control, not an illustration. Possah sits at Bold +
   Composed, where its own guidelines put it. Drag the point away and the six
   lines the brand writes dissolve into the six it refuses to write. The
   argument is that a brand's position on that matrix is a CHOICE, and you can
   feel what the other choices cost.

   Every line on both sides is quoted verbatim from the tone-of-voice page
   of the guidelines.
   The off-quadrant lines are the client's own "we don't write" list — they are
   not alternative Possah voices, and the page says so in a note rather than
   letting the interaction imply it.

   THE PROPERTIES
   The script writes exactly two: --x (soft 0 -> bold 1) and --y (playful 0 ->
   composed 1). Everything else is CSS reading them, as on the Zingara page.
   --drift is derived in CSS with max(), so the distance from Possah's plotted
   position never has to make the round trip through JavaScript:

     --drift: max(0, (.75 - x)/.75, (.75 - y)/.75)

   0 at Possah's position, 1 at the soft/playful corner, and 0 again anywhere
   bolder or more composed than Possah — which is the honest reading of a
   matrix whose two far sides are the brand's own direction of travel.

   The one thing that cannot interpolate is which quadrant you are standing in,
   because that is a text swap rather than a value. It rides on data-q, exactly
   as Zingara's typeface swap rides on data-settled.
   ========================================================================== */

/* ============ THE PAGE'S ACCENT ============
   The documented palette, with hex and RGB, is on the colour board:
   Dusty Rose Pink #C99A99, Deep Forest Green #1F3A2D, Warm Ivory #F4ECDF,
   Burnt Orange #B35A2B, Muted Mustard Gold #C8973A.

   Which one goes where is a contrast decision, measured, not a taste one.
   Against the forest-green opening frame:

     burnt orange on green   2.59:1  -> unusable as text. Rules and blocks only
     mustard gold on green   4.67:1  -> passes, but thin
     dusty rose on green     5.03:1  -> the clear winner, and a documented
                                        PRIMARY rather than an accent stretched
                                        into a job it was not given

   So rose takes --accent-l, the ink for small text on the dark frame.

   --accent-ink is #A05026: burnt orange darkened until it clears 4.5:1 as
   small text on ivory (4.88:1) and on the chassis cream (5.37:1). Same
   derivation, and the same reason, as core.css's --copper-ink.

   ONE DELIBERATE RESTRAINT. Possah's burnt orange #B35A2B and NUANSE's copper
   #B56528 are nearly the same colour, and the nav stays NUANSE copper on every
   page. So green carries this page's signal and orange is held to the accent
   rule and the signature — which is what the brand's own 10% ceiling asks for
   anyway. Two near-identical oranges competing for the same meaning would read
   as a mistake even to someone who could not name why. */
.pj-possah{
  --accent:#B35A2B;
  --accent-l:#C99A99;
  --accent-ink:#A05026;
  --pj-ground:#1F3A2D;
  --pj-sig-bg:#F4ECDF;
}
/* the next-project panel wears the NEXT brand's colour: Zingara true red */
.pj-next-zingara{--next-accent:#C8332A}

/* 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. */
.sw-p-rose{--sw:#C99A99}
.sw-p-green{--sw:#1F3A2D}
.sw-p-ivory{--sw:#F4ECDF}
.sw-p-orange{--sw:#B35A2B}
.sw-p-gold{--sw:#C8973A}

/* the opening frame is the brand's own ground, not the chassis night */
.pj-possah .pj-open{background:var(--pj-ground)}

/* ============================================================================
   THE VOICE MATRIX
   ========================================================================== */
.pv{
  --x:.75; --y:.75;
  /* Possah's plotted position, read off the tone-of-voice page: inside the
     Bold + Composed quadrant, not at its corner. A brand at the corner of its
     own matrix would be a caricature of itself, and the board does not draw
     one there.

     Drift is the Chebyshev distance from that point, one-sided: moving SOFTER
     or more PLAYFUL than Possah is drift, moving bolder or more composed is
     not. max() rather than a real hypotenuse because CSS has no sqrt - and
     because this reaches 1 along either axis alone, which is the honest
     reading: drifting on one axis is already drifting. */
  --drift:max(0, calc((.75 - var(--x)) / .75), calc((.75 - var(--y)) / .75));
  /* THE SLIDE. Same grammar as every other chapter and as Zingara's menu:
     the label on its own row, the writing and the CONTROL on the left, what
     the control does on the right. .pv stays the grid itself because the
     script sets --x and --y here and the whole matrix interpolates off
     them. The heading used to sit in a .pj-sig-head above the element, so
     the chapter was a block of prose and then, separately, a toy. */
  display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);
  gap:clamp(26px,3.2vw,48px) clamp(34px,5vw,88px);align-items:start;margin:0}
.pv>.eyebrow{grid-column:1/-1;margin:0;align-self:start;color:var(--accent-ink)}
.pv-txt{min-width:0}
.pv-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}
.pv-txt>p{margin:0 0 var(--s4);font-size:clamp(16px,1.2vw,19px);line-height:1.55;
  max-width:34ch;color:var(--mute)}
.pv-note{margin:14px 0 0;font-size:10px;letter-spacing:.14em;text-transform:uppercase;
  color:var(--mute)}

/* --- the pad --- */
/* capped. At the full width of the writing column the square ran to 575px
   and the chapter became a pad with a sentence beside it; the matrix is the
   control, not the chapter. */
.pv-pad{position:relative;aspect-ratio:1;max-width:400px;
  border:1px solid rgba(31,58,45,.28);
  background:var(--pj-sig-bg);touch-action:none;cursor:grab}
.pv-pad:active{cursor:grabbing}
.pv-pad::before,.pv-pad::after{content:"";position:absolute;background:rgba(31,58,45,.22)}
.pv-pad::before{left:50%;top:0;bottom:0;width:1px}
.pv-pad::after{top:50%;left:0;right:0;height:1px}

/* axis labels. Set in the chassis mono, on the brand's ivory. */
.pv-ax{position:absolute;font-family:var(--mono);font-size:10px;letter-spacing:.14em;
  text-transform:uppercase;color:#4A6356;margin:0}
.pv-ax.n{top:10px;left:50%;transform:translateX(-50%)}
.pv-ax.s{bottom:10px;left:50%;transform:translateX(-50%)}
.pv-ax.w{left:10px;top:50%;transform:translateY(-50%)}
.pv-ax.e{right:10px;top:50%;transform:translateY(-50%)}

/* where the brand sits, marked permanently so the drift has a reference */
.pv-home{position:absolute;right:calc(25% - 19px);top:calc(25% - 19px);
  width:38px;height:38px;border-radius:50%;border:1px dashed var(--accent);
  opacity:.75}
/* clear of its own marker: at two lines the label's second line used to
   run across the dashed circle it is pointing at */
.pv-home-label{position:absolute;right:12%;top:calc(25% - 54px);margin:0;
  font-family:var(--mono);font-size:9.5px;letter-spacing:.12em;
  text-transform:uppercase;color:var(--accent-ink);text-align:right;
  line-height:1.4;max-width:44%}

/* the point itself. left/top off --x and --y; nothing else moves it. */
.pv-dot{position:absolute;width:24px;height:24px;margin:-12px 0 0 -12px;
  border-radius:50%;background:var(--accent);
  left:calc(var(--x) * 100%);top:calc((1 - var(--y)) * 100%);
  box-shadow:0 0 0 6px rgba(179,90,43,.14);pointer-events:none}
.pv-pad:focus-within .pv-dot{box-shadow:0 0 0 6px rgba(179,90,43,.3)}

/* the two range inputs are the keyboard and screen-reader path. Visually
   hidden rather than display:none, because display:none is not focusable. */
.pv-ctrl{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);
  white-space:nowrap}

/* --- the lines --- */
.pv-read{min-height:0}
/* --- the head: where you are, and how far that is from the brand ---
   The column opened with a dead mono label reading "At this position",
   which was true of every position. The quadrant is named instead, and the
   meter beside it fills as the drift grows — both read the same --x/--y
   the dot does, so nothing here can disagree with the pad. */
.pv-head{display:flex;align-items:center;gap:14px;margin:0 0 var(--s3);
  padding-bottom:14px;border-bottom:1px solid rgba(31,58,45,.2)}
.pv-q{margin:0;flex:0 0 auto;font-family:var(--mono);font-size:10px;letter-spacing:.14em;
  text-transform:uppercase;color:var(--accent-ink)}
/* the quadrant names itself and nothing more. It used to carry a
   "· theirs / · not theirs" suffix off the quadrant, which is the wrong
   measure: the quadrant is still Bold + Composed a third of the way out,
   by which point the label has already lost two of its six lines. The
   count beside the meter is the honest reading, and it is the same number
   the announcement uses. */
[data-q=bc] .pv-q::after{content:"Bold + Composed"}
[data-q=bp] .pv-q::after{content:"Bold + Playful"}
[data-q=sc] .pv-q::after{content:"Soft + Composed"}
[data-q=sp] .pv-q::after{content:"Soft + Playful"}
.pv-meter{flex:1 1 auto;min-width:40px;height:1px;background:rgba(31,58,45,.26);
  position:relative}
.pv-meter i{position:absolute;inset:0;background:var(--accent);transform-origin:left;
  transform:scaleX(var(--drift))}
.pv-count{flex:0 0 auto;font-family:var(--mono);font-size:10px;letter-spacing:.14em;
  font-variant-numeric:tabular-nums;color:var(--accent-ink)}

/* --- the lines, one at a time ---
   The six lines used to be two stacked blocks cross-fading as one, which
   made drifting a single swap: the brand was either on or off. It is not
   how a voice is actually lost. Each line now holds both states and flips
   at its OWN point on the drift, so you watch the label give up "she wants
   what she wants" before it gives up the rest — and, dragging back, get
   them again in reverse.

   The thresholds are evenly spread rather than tuned: no one line is a more
   important part of the voice than another, and an uneven spread would be
   claiming that it is. Each flips over about a tenth of the range, which is
   sharp enough to read as a line being lost rather than as a fade. */
.l1{--t:.10} .l2{--t:.24} .l3{--t:.38}
.l4{--t:.52} .l5{--t:.66} .l6{--t:.80}

.pv-lines{list-style:none;margin:0;padding:0}
/* more air between them than the old stacked list had. Six lines at 10px
   apart was a block of text; a line of a brand's voice is not a paragraph,
   and the column has the room now that it is no longer two lists deep. */
.pv-lines li{position:relative;display:grid;margin:0 0 clamp(13px,1.6vw,22px)}
.pv-lines li:last-child{margin-bottom:0}
.pv-lines .is,.pv-lines .isnt{grid-column:1;grid-row:1;
  font-family:var(--serif);font-weight:400;
  font-size:clamp(19px,2.1vw,29px);line-height:1.22;letter-spacing:-.02em}
.pv-lines .is{opacity:calc((var(--t) - var(--drift)) * 9 + .5)}
/* the refused line is set in the italic it would be written in, and in the
   colour of something nobody chose */
.pv-lines .isnt{font-style:italic;color:#6E6257;
  opacity:calc((var(--drift) - var(--t)) * 9 + .5)}

/* --- the way back ---
   Inherits .btn's shape from core? No: this is one word in the chapter's
   own idiom, and a full button next to six serif lines would be the loudest
   thing on a slide about restraint. It appears only once there is something
   to put back. */
.pv-home-btn{margin:var(--s3) 0 0;padding:0 0 3px;background:none;border:0;
  border-bottom:1px solid var(--accent);color:var(--accent-ink);
  font-family:var(--mono);font-size:10px;letter-spacing:.14em;text-transform:uppercase;
  cursor:pointer;
  /* nothing to put back at the brand's own point, and not reachable then
     either — visibility, not opacity, so it leaves the tab order with it */
  opacity:clamp(0, calc(var(--drift) * 8), 1);
  visibility:hidden}
[data-drift=on] .pv-home-btn{visibility:visible}
.pv-home-btn:focus-visible{outline:1px dashed var(--accent-ink);outline-offset:5px}
@media (hover:hover){.pv-home-btn:hover{border-bottom-width:2px}}

.pv-words{margin:clamp(22px,2.6vw,34px) 0 0;padding-top:16px;
  border-top:1px solid rgba(31,58,45,.2);font-family:var(--mono);font-size:10px;
  letter-spacing:.12em;text-transform:uppercase;color:#5B5146;line-height:1.7}
.pv-words b{color:var(--accent-ink);font-weight:400}

/* The announcement for assistive technology. The visual cross-fade says
   nothing to a screen reader, so the state is also stated in words. */
.pv-say{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}

/* --- reduced motion ---
   The dot is placed explicitly at Possah's position at init by the script;
   here we simply remove the easing so nothing slides. There is no reveal to
   forget the end state of, because the end state IS the default. */
.rm .pv-dot{transition:none}

@media (max-width:900px){
  .pv{grid-template-columns:1fr}
  .pv-pad{max-width:420px}
}
