/* Inviolo review tool.
 *
 * WHY THIS PALETTE IS NOT THE SITE'S PALETTE, measured rather than argued.
 *
 * The tool used the product's own tokens and looked plain, and the reason is a
 * number. Converted to OKLCH, every token sat between hue 292 and 298 at a mean
 * neutral chroma of 0.0499, which made the accent only 5.5 times more colourful
 * than its own surroundings. Linear is 24.6x, Cursor 25.6x, Stripe 10.0x,
 * Superhuman 13.0x with a violet brand of its own. An accent is a relationship
 * and not a colour: violet sitting on violet, separated by violet hairlines,
 * above violet ink, cannot read as an accent at all.
 *
 * There was also no white. The lightest value was #f8f6ff at L 97.7, so nothing
 * in the view could read as lifted, which is why it kept needing shadows it was
 * not allowed to have.
 *
 * So the chroma is drained out of the neutrals and kept in the accent. Same
 * violet, same hues, 0.0126 mean neutral chroma instead of 0.0499, ratio 21.6x.
 * The product still reads as violet because the neutrals still carry the hue,
 * at a tenth of the saturation. Superhuman is the precedent: a violet brand
 * with warm neutral chrome at 0.0104 against pure white.
 *
 * This is the TOOL's palette. The site keeps its own.
 */
.tool{
  /* surfaces, a real ladder with white at the top */
  --raised:#ffffff;            /* L 100.0  C 0.0000  the frame, the deck      */
  --shell:#f4f3f7;             /* L  96.6  C 0.0054  the rail                 */
  --canvas:#eceaf1;            /* L  94.1  C 0.0096  the well behind the page */
  --hair:#e6e4ec;              /* L  92.3  C 0.0109  dividers                 */
  --hair-strong:#d2cfdb;       /* L  86.0  C 0.0167  edges that carry weight  */

  /* ink. The old #0e0524 carried 0.0626 chroma, the second most saturated ink
     in the whole reference set, and violet text at 13px reads as faded. */
  --ink:#17151d;               /* 18.08:1 on white */
  --ink-2:#55525f;             /*  7.61:1 */
  --ink-3:#817e8c;             /*  3.96:1, labels and non-text only */

  /* the accent, spent once per view and nowhere else */
  --accent:#4a0be8; --accent-deep:#3c08bd; --accent-wash:#f0eafe;

  /* Status is its own low chroma scale, scoped to the rail. Ten status words in
     the accent is the accent spent ten times, which is the same as not having
     one. */
  --ok:#3f7d58;  --ok-bg:#eaf2ec;
  --no:#a33b3b;  --no-bg:#f6ebeb;

  --disp:"Barlow Condensed","Arial Narrow",sans-serif;
  --body:"IBM Plex Sans",system-ui,sans-serif;
  --mono:"IBM Plex Mono",ui-monospace,monospace;
  --disp-w:600;

  --t1:11px; --t2:13px; --t3:14px; --t4:16px; --t5:20px; --t6:26px;
  --track-micro:.08em;

  --s0:4px; --s1:6px; --s2:8px; --s3:12px; --s4:16px; --s5:24px; --s6:32px;

  /* Six of eight reference tools converge on exactly this set. */
  --r-xs:4px; --r-sm:6px; --round-sm:6px; --r-md:8px; --round:12px; --r-pill:9999px;

  /* Depth is a ring, not a shadow. Four of the eight ship no drop shadows at
     all, and the one that does makes every level a 1px ring with a 1 to 2px
     blur. The only real shadow in this tool is on the one overlay. */
  --ring:0 0 0 1px rgb(0 0 0 / .08);
  --lift:0 0 0 1px rgb(0 0 0 / .08), 0 1px 2px rgb(0 0 0 / .04);
  --sunken:inset 0 1px 0 rgb(0 0 0 / .04);
  --overlay:0 0 0 1px rgb(0 0 0 / .10), 0 8px 16px -4px rgb(0 0 0 / .08),
            0 24px 32px -8px rgb(0 0 0 / .06);

  --ctl:44px;
  --quick:100ms; --move:150ms; --slow:200ms;
  --ease:cubic-bezier(.2,0,0,1);

  color-scheme:light;
  background:var(--canvas); color:var(--ink);
  font-family:var(--body);
  -webkit-font-smoothing:antialiased;
}

@media (prefers-reduced-motion: reduce){
  .tool *,.tool *::before,.tool *::after{
    animation-duration:.001ms !important; transition-duration:.001ms !important;
  }
}

.tool button,.tool a[role=button]{min-height:var(--ctl)}
/* 2px perimeter at 3:1 minimum. The accent is 8.39:1 on white. */
.tool :where(a,button,input,select,textarea,summary):focus-visible{
  outline:2px solid var(--accent); outline-offset:2px;
}
.tool :where(th,td,.count,.num,.railState,.railCount){font-variant-numeric:tabular-nums}
@media (hover:hover) and (pointer:fine){ .tool .barbtn:hover{border-color:var(--ink-3)} }
*{-webkit-tap-highlight-color:rgb(0 0 0 / 0)}
html{-webkit-text-size-adjust:100%}

/* Optical alignment, one property instead of the usual padding fudge. Chrome
   133 and Safari 18.2, degrades silently everywhere else. */
@supports (text-box: trim-both cap alphabetic){
  .tool .railState,.tool .dland,.tool .dwhere,.tool .count{text-box:trim-both cap alphabetic}
}
/* Thin scrollbars, Baseline since Safari 18.2. */
.tool .railList,.tool #log{scrollbar-width:thin;scrollbar-color:var(--hair-strong) transparent}

/* ---- dark -----------------------------------------------------------------
 *
 * The argument for it is the lightbox. The main area holds his own website, and
 * his website is light. Dark chrome around a light frame makes the thing under
 * review the brightest object on screen, which is the right hierarchy for a
 * tool whose entire job is looking at it. It is why Figma, Rive and every video
 * editor are dark around a light canvas. Light chrome around a light page means
 * the thing reviewing competes with the thing being reviewed.
 *
 * Built on the same discipline as the light theme. Violet hue 296 kept
 * throughout, neutral chroma held at 0.0127, five surface steps that are small
 * and even (luminance 0.4, 0.7, 1.1, 2.3, 4.7) rather than one jump to black.
 * Never #000: a neutral black next to a warm page reads as a hole.
 *
 * The accent has to change. #4a0be8 is 1.9:1 on this ground and unreadable, so
 * dark uses the lifted amethyst the product already defines for its own dark
 * band. Measured on the deepest surface: ink 17.10:1, secondary 9.77:1, labels
 * 5.33:1, accent 8.88:1, pass 9.52:1, fail 8.05:1.
 */
.tool[data-theme="dark"]{
  --raised:#1c1b21; --shell:#141319; --canvas:#0d0b12;
  --hair:#2a2930; --hair-strong:#3e3c43;
  --ink:#f0eff4; --ink-2:#b8b6c0; --ink-3:#87848f;

  --accent:#b9a0ff; --accent-deep:#cdbbff; --accent-wash:#241f38;
  --ok:#7cc58c; --ok-bg:#16241a;
  --no:#f2897c; --no-bg:#2a1714;

  /* On a dark ground a shadow is invisible and an inset dark edge does nothing.
     The light comes from above instead, one pixel of it. */
  --ring:0 0 0 1px rgb(255 255 255 / .07);
  --lift:0 0 0 1px rgb(255 255 255 / .07), inset 0 1px 0 rgb(255 255 255 / .05);
  --sunken:inset 0 1px 0 rgb(0 0 0 / .4);
  --overlay:0 0 0 1px rgb(255 255 255 / .10), 0 16px 48px -12px rgb(0 0 0 / .7);

  color-scheme:dark;
}
/* A filled button on dark takes the accent as its GROUND, so the label has to
   be dark. White on the lifted amethyst is 1.9:1 and unreadable, which is the
   mistake you make once per dark theme by carrying the light rule across. */
.tool[data-theme="dark"] .dbtn.go,
.tool[data-theme="dark"] .railGo{ color:#140f22; }
.tool[data-theme="dark"] .dbtn.go:hover,
.tool[data-theme="dark"] .railGo:hover{ background:var(--accent-deep); color:#140f22; }

/* His page is the one thing that must not be dimmed or tinted. */
.tool[data-theme="dark"] iframe{background:#fff}
