/* Font: loaded by motion.js only while this look is picked (see LOOKS there). */

/* KRS Payals: the "Order Book" look (look id "imp-new").
   The page is a page of a wholesaler's order book, the paperwork every shop owner knows:
   a printed bill head with a thick-and-thin rule, ruled rows, a perforated counterfoil edge,
   tear-off slips for the designs, and violet rubber-stamp ink.
   Two inks, as on real paperwork: deep indigo "printing ink" for the form, and
   violet "stamp-pad ink" for what matters (the headline, the main button, the stamps).
   Light = the duplicate copy: pale lavender-blue paper.
   Dark  = the carbon sheet: deep indigo-violet, with pale impressions.
   Every rule is scoped to :root[data-look="imp-new"], so the look's colours never leak
   into anything else that carries a data-look attribute (such as a Settings button). */

/* ---------- Colours ---------- */

:root[data-look="imp-new"] {
  --paper: #E6E7F2;
  --card: #F7F7FB;
  --oxide: #231E57;              /* printing ink: main text */
  --oxide-soft: #4E4A7C;
  --kumkum: #A3123C;
  --brass: #4A2FB0;              /* stamp-pad violet: small headings */
  --silver-pale: #F6F5FC;
  --silver-mid: #C8C6E2;
  --rule: 1px solid rgba(35, 30, 87, .16);

  --ink: #4A2FB0;                /* violet ink: headline, main button, picked buttons */
  --ink-deep: #3A2192;
  --on-ink: #F6F5FC;
  --headline: #4A2FB0;
  --ruling: rgba(35, 30, 87, .17);   /* printed ruled lines */
  --edge: rgba(35, 30, 87, .34);     /* outlines of buttons */
  --perf: rgba(35, 30, 87, .26);     /* perforation holes */
  --chain: #6A5CB8;
  --select: rgba(74, 47, 176, .22);
  --photo-tint: #EFEEFA;         /* cool light behind the pale catalogue pictures */
  scrollbar-color: #A9A6CC var(--paper);
  caret-color: var(--ink);
}

:root[data-look="imp-new"][data-theme="dark"] {
  --paper: #14122B;
  --card: #1E1B3B;
  --oxide: #E9E7F7;
  --oxide-soft: #A9A5CF;
  --kumkum: #FF9EB5;
  --brass: #B6A8FF;
  --silver-pale: #14122B;
  --silver-mid: #3A3566;
  --rule: 1px solid rgba(233, 231, 247, .14);

  --ink: #6247E0;
  --ink-deep: #5239C8;
  --on-ink: #FFFFFF;
  --headline: #C4B8FF;
  --ruling: rgba(233, 231, 247, .15);
  --edge: rgba(233, 231, 247, .3);
  --perf: rgba(233, 231, 247, .2);
  --chain: #9A90D8;
  --select: rgba(182, 168, 255, .3);
  --photo-tint: #E2E0F2;         /* a little dimmer, so the pictures don't glare on the dark sheet */
  scrollbar-color: #4A4480 var(--paper);
}

:root[data-look="imp-new"] ::selection { background: var(--select); color: var(--oxide); }
:root[data-look="imp-new"] :focus-visible { outline-color: var(--brass); }

/* ---------- The page: paper with a perforated counterfoil edge on the left ---------- */

:root[data-look="imp-new"] body {
  background-color: var(--paper);
  background-image: radial-gradient(circle, var(--perf) 0 1.3px, transparent 1.8px);
  background-size: 6px 9px;
  background-repeat: repeat-y;
  background-position: max(6px, calc(50% - 298px)) 0;
}

/* ---------- Type: Anek, an Indian-designed family, for everything printed big ---------- */

:root[data-look="imp-new"] h1,
:root[data-look="imp-new"] h2,
:root[data-look="imp-new"] .mark,
:root[data-look="imp-new"] .cat-card .name {
  font-family: 'Anek Latin', 'Archivo', system-ui, sans-serif;
}

/* The bill head: firm name in wide capitals over a thick-and-thin printer's rule */
:root[data-look="imp-new"] .mark {
  font-size: 1.32rem;
  font-weight: 760;
  font-stretch: 125%;
  letter-spacing: .07em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--oxide);
  margin-bottom: 1.6rem;
}
:root[data-look="imp-new"] .mark small {
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: .72rem;
  font-weight: 400;
  letter-spacing: .03em;
  text-transform: none;
  color: var(--oxide-soft);
  margin-top: .3rem;
}
:root[data-look="imp-new"] .mark::after {
  content: "";
  display: block;
  height: 7px;
  margin-top: 1rem;
  border-top: 2.5px solid currentColor;
  border-bottom: 1px solid currentColor;
}

:root[data-look="imp-new"] .hero h1 {
  font-size: clamp(2.6rem, 12.4vw, 3.6rem);
  font-weight: 720;
  font-stretch: 78%;
  letter-spacing: -.01em;
  line-height: .98;
  color: var(--headline);
  text-wrap: balance;
  margin-bottom: .9rem;
}
:root[data-look="imp-new"] .hero .sub { color: var(--oxide-soft); font-size: 1.04rem; }
:root[data-look="imp-new"] .hint { color: var(--oxide-soft); letter-spacing: .02em; }

:root[data-look="imp-new"] .band h2 {
  font-size: 1.65rem;
  font-weight: 700;
  font-stretch: 84%;
  letter-spacing: -.005em;
  line-height: 1.1;
  color: var(--oxide);
  margin-bottom: .6rem;
}
:root[data-look="imp-new"] h3 {
  font-size: .95rem;
  font-weight: 600;
  color: var(--brass);
  margin-bottom: .3rem;
}

/* ---------- Buttons: violet ink for the main action, printed outlines for the rest ---------- */

:root[data-look="imp-new"] .btn {
  border-radius: 3px;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 500;
  letter-spacing: .01em;
}
:root[data-look="imp-new"] .btn.ghost {
  background: none;
  color: var(--oxide);
  border: 1px solid var(--edge);
}
@media (hover: hover) and (pointer: fine) {
  :root[data-look="imp-new"] .btn:hover { background: var(--ink-deep); }
  :root[data-look="imp-new"] .btn.ghost:hover { background: var(--select); }
}

/* The round corner buttons become small printed squares */
:root[data-look="imp-new"] .theme-btn,
:root[data-look="imp-new"] .settings-btn {
  border-radius: 4px;
  border-color: var(--edge);
  color: var(--oxide);
}
:root[data-look="imp-new"] .sound {
  border-radius: 3px;
  border-color: var(--edge);
  color: var(--oxide-soft);
}
:root[data-look="imp-new"] .sound[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}

/* ---------- Sections: the chain divider in ink, rows ruled like a bill book ---------- */

:root[data-look="imp-new"] .chain-defs { color: var(--chain) !important; }

/* Each group of the range is a column: a printed head rule, then ruled rows */
:root[data-look="imp-new"] .group h3 {
  padding-bottom: .4rem;
  margin-bottom: 0;
  border-bottom: 1px solid var(--edge);
}
:root[data-look="imp-new"] .group li {
  border-bottom: 1px solid var(--ruling);
}
:root[data-look="imp-new"] .group li:last-child { border-bottom: 0; }

/* "How we work" and the design facts read as a two-column ledger */
:root[data-look="imp-new"] .terms,
:root[data-look="imp-new"] .cat-sheet .facts {
  border-top: 1px solid var(--ruling);
  border-bottom: 1px solid var(--ruling);
}
:root[data-look="imp-new"] .terms li,
:root[data-look="imp-new"] .cat-sheet .facts li {
  border-bottom: 1px solid var(--ruling);
  align-items: stretch;
  gap: .9rem;
}
:root[data-look="imp-new"] .terms li:last-child,
:root[data-look="imp-new"] .cat-sheet .facts li:last-child { border-bottom: 0; }
:root[data-look="imp-new"] .terms b,
:root[data-look="imp-new"] .cat-sheet .facts b {
  border-right: 1px solid var(--ruling);
  padding-right: .8rem;
  color: var(--oxide-soft);
}

/* The foot of the bill: thin-and-thick rule, closing what the bill head opened */
:root[data-look="imp-new"] footer {
  border-top: 0;
  color: var(--oxide-soft);
  letter-spacing: .02em;
}
:root[data-look="imp-new"] footer::before {
  content: "";
  display: block;
  max-width: calc(560px - 3rem);
  height: 7px;
  margin: 0 auto 1.3rem;
  border-top: 1px solid var(--oxide);
  border-bottom: 2.5px solid var(--oxide);
}

/* ---------- Catalogue ---------- */

:root[data-look="imp-new"] .cat-note { color: var(--oxide-soft); }
:root[data-look="imp-new"] .cat-sample-note {
  color: var(--kumkum);
  background: none;
  border: 1px dashed var(--kumkum);
  border-radius: 3px;
  padding: .55rem .75rem;
}

/* Range buttons: printed tabs; the picked one is inked */
:root[data-look="imp-new"] .cat-chip {
  border-radius: 3px;
  border-color: var(--edge);
  color: var(--oxide);
}
:root[data-look="imp-new"] .cat-chip span { color: var(--oxide-soft); font-variant-numeric: tabular-nums; }
:root[data-look="imp-new"] .cat-chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}
:root[data-look="imp-new"] .cat-chip[aria-pressed="true"] span { color: inherit; opacity: .88; }

/* Each design is a tear-off slip: picture above, a perforation, the details below */
/* The pictures are drawn on a faintly warm grey. A cool lavender sheet behind them,
   multiplied in, puts the silver under the same cool light as the page. */
:root[data-look="imp-new"] .cat-card {
  border: 1px solid var(--ruling);
  border-radius: 3px;
  background: var(--photo-tint);
  box-shadow: 0 10px 22px -18px rgba(20, 16, 60, .55);
}
:root[data-look="imp-new"][data-theme="dark"] .cat-card { box-shadow: 0 12px 24px -16px rgba(0, 0, 0, .75); }
:root[data-look="imp-new"] .cat-card img,
:root[data-look="imp-new"] .cat-sheet .pic img { mix-blend-mode: multiply; }
:root[data-look="imp-new"] .cat-card img,
:root[data-look="imp-new"] .cat-card .cat-noimg { border-bottom: 1px solid var(--ruling); }
:root[data-look="imp-new"] .cat-card .body {
  flex: 1;
  padding-top: .85rem;
  background-color: var(--card);
  background-image: radial-gradient(circle, var(--perf) 0 1.35px, transparent 1.8px);
  background-size: 8px 6px;
  background-repeat: repeat-x;
  background-position: 3px 2px;
}
:root[data-look="imp-new"] .cat-card .name {
  font-size: 1.08rem;
  font-weight: 650;
  font-stretch: 90%;
  line-height: 1.15;
  color: var(--oxide);
}
:root[data-look="imp-new"] .cat-card .meta { color: var(--oxide-soft); font-variant-numeric: tabular-nums; letter-spacing: .01em; }

/* "Sample": a violet rubber stamp, slightly crooked, as stamps always are.
   It sits on the pale picture in both modes, so its ink stays the light-mode violet. */
:root[data-look="imp-new"] .cat-badge {
  top: .55rem;
  left: .55rem;
  font-family: 'Anek Latin', 'Archivo', sans-serif;
  font-size: .64rem;
  font-weight: 720;
  font-stretch: 112%;
  letter-spacing: .14em;
  color: #4A2FB0;
  background: rgba(247, 247, 251, .8);
  border: 1.5px solid currentColor;
  outline: 1px solid currentColor;
  outline-offset: 1.5px;
  border-radius: 2px;
  padding: .08rem .4rem .04rem;
  transform: rotate(-6deg);
}

/* ---------- Design sheet: a slip torn from the book ---------- */

:root[data-look="imp-new"] dialog.cat-sheet,
:root[data-look="imp-new"] dialog.settings-sheet {
  border-radius: 6px 6px 0 0;
  background-color: var(--paper);
  background-image: radial-gradient(circle, var(--perf) 0 1.35px, transparent 1.8px);
  background-size: 9px 6px;
  background-repeat: repeat-x;
  background-position: 4px 3px;
}
:root[data-look="imp-new"] .cat-sheet img { border: 1px solid var(--ruling); border-radius: 3px; }
/* (the picture's margins fall outside .pic, so its box is exactly the picture) */
:root[data-look="imp-new"] .cat-sheet .pic { background: var(--photo-tint); border-radius: 3px; }
:root[data-look="imp-new"] .cat-sheet h2 { font-size: 1.75rem; font-weight: 700; font-stretch: 84%; color: var(--oxide); }
:root[data-look="imp-new"] .cat-sheet .code { font-variant-numeric: tabular-nums; }
:root[data-look="imp-new"] .cat-sheet .nav { border-radius: 4px; }
:root[data-look="imp-new"] .cat-sheet .nav button { border-radius: 3px; }
:root[data-look="imp-new"] .size-chip {
  border-radius: 3px;
  border-color: var(--edge);
  color: var(--oxide);
}
:root[data-look="imp-new"] .size-chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}

/* ---------- One small moment: the stamps land on the slips as the cards come in ---------- */

@keyframes imp-stamp {
  from { opacity: 0; transform: rotate(-15deg) scale(1.8); }
  55% { opacity: 1; }
  to { opacity: 1; transform: rotate(-6deg) scale(1); }
}
@media (prefers-reduced-motion: no-preference) {
  :root[data-look="imp-new"] .cat-grid.play .cat-card.enter .cat-badge {
    animation: imp-stamp 340ms cubic-bezier(0.23, 1, 0.32, 1) both;
    animation-delay: calc(var(--i, 0) * 50ms + 380ms);
  }
}
