/* Effects and corners of the look engine (@npaw/web-kit look/), linked by LookStudio.astro on every
   build of a site that adopts the engine. Each effect is one word on html[data-fx] (several at
   once), set by /look.js before the first paint, and reads the look's tokens: --arc, --arc-2 and --arc-3 (fills),
   --accent, --accent-2 and --accent-3 (text on the page), --arc-on-ink, --arc-on-ink-2 and
   --arc-on-ink-3 (text on ink).
   The effect kept when a look is chosen moves into the site's own styles.

   Effects find the kit's pieces by their classes (page hero, primary button, card, code block,
   eyebrow, alternate section) and a site's own pieces by a hook attribute, data-look, which may
   carry several words:
     hero    the top of a page        title   its main title     panel  an ink panel
     card    a card                   number  a list number      band   a section that can go dark
     cta     the closing call-to-action panel (ink, glowing from two corners)
     line    a drawn line (an SVG path or a rule) that can glow   point  a marker that can halo

   halo       colour light behind the top of every page
   rejilla    a fine technical grid behind the top of every page, fading out
   titulo     the main title in a gradient (both ends are text-safe colours)
   boton      the primary buttons in a gradient, with a coloured shadow
   panel      the ink panels with a lit edge and a glow
   tarjetas   the cards with a gradient edge and a coloured shadow; a linked card lifts on hover
   detalles   the small marks in gradient: eyebrow squares, numbers, arrows, band edges
   trazos     the drawn lines glow and the markers carry a wider halo
   oscura     the bands marked "band" on ink, a dark section in the middle of a light page
   portada    the top of every page on ink, as those bands (a page that is one form stays on paper)
   contraste  on the ink blocks (a dark band, a dark top, the closing panel) the fills take the
              colour that reads on ink and their label the ink: the primary button, the marks
   grano      a fine film grain over the whole page, as printed paper
   movimiento the halo and the title drift slowly, the markers breathe (never under
              prefers-reduced-motion)

   Levels (NPAW Styles D57): halo, rejilla, boton, panel, tarjetas, trazos and grano can be drawn
   weaker or stronger than they always were. /look.js writes such an effect as a word of
   html[data-fx-level] («panel:150») and its fraction as --fx-<effect> on <html> (--fx-panel:
   1.5); at 100 % neither exists and only the effect's own rules draw. The rules at the end of
   the effects say each one's declarations again with its amounts multiplied.

   Corners (html[data-esquinas]): rectas, precisas, suaves, redondas; no attribute keeps the
   site's own radii. */

/* ---- The top of every page carries the backdrops ---- */
html[data-fx~="halo"] :is(.page-hero, .hero, [data-look~="hero"]),
html[data-fx~="rejilla"] :is(.page-hero, .hero, [data-look~="hero"]) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

/* ---- halo ---- */
html[data-fx~="halo"] :is(.page-hero, .hero, [data-look~="hero"])::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -20% -10% 0;
  pointer-events: none;
  background:
    radial-gradient(
      42% 55% at 82% 18%,
      color-mix(in srgb, var(--arc) 34%, transparent),
      transparent 72%
    ),
    radial-gradient(
      38% 50% at 18% 6%,
      color-mix(in srgb, var(--arc-2) 26%, transparent),
      transparent 72%
    ),
    radial-gradient(
      30% 40% at 55% 70%,
      color-mix(in srgb, var(--arc) 12%, transparent),
      transparent 70%
    );
}
/* The muted eyebrow at the top of a page reads on the halo: it takes the secondary text colour,
   as the muted one drops there under 4.5:1 with a light accent over dark (3.9:1 in lima or oro;
   6.2:1 or more with the secondary colour). */
html[data-fx~="halo"]
  :is(.page-hero, .hero, [data-look~="hero"])
  .eyebrow--muted {
  color: var(--text-2);
}

/* ---- rejilla ---- */
html[data-fx~="rejilla"] :is(.page-hero, .hero, [data-look~="hero"])::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--hairline) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center top;
  mask-image: radial-gradient(
    ellipse 75% 70% at 50% 0%,
    black 20%,
    transparent 78%
  );
}

/* ---- titulo ---- */
html[data-fx~="titulo"]
  :is(.page-hero__title, .hero__title, [data-look~="title"]) {
  background: linear-gradient(
    100deg,
    var(--text) 10%,
    var(--accent) 55%,
    var(--accent-2) 95%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* ---- boton ---- */
html[data-fx~="boton"] .btn.btn--primary.btn--primary.btn--primary {
  border-color: transparent;
  background: linear-gradient(120deg, var(--arc) 0%, var(--arc-2) 100%);
  background-size: 180% 100%;
  background-position: 0% 50%;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 10px 26px -12px color-mix(in srgb, var(--arc) 70%, transparent);
  transition:
    background-position 420ms var(--ease),
    box-shadow var(--dur-mid) var(--ease),
    transform var(--dur-fast) var(--ease);
}
html[data-fx~="boton"] .btn.btn--primary.btn--primary.btn--primary:hover {
  background: linear-gradient(120deg, var(--arc) 0%, var(--arc-2) 100%);
  background-size: 180% 100%;
  background-position: 100% 50%;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 14px 32px -12px color-mix(in srgb, var(--arc-2) 75%, transparent);
}

/* ---- panel ---- */
/* A code block with a caption: the frame and the glow go round the code, and the caption reads
   on the page under them. */
html[data-fx~="panel"]
  :is(.code-panel, .codeblock, [data-look~="panel"], [data-look~="cta"]) {
  position: relative;
}
html[data-fx~="panel"]
  :is(
    .code-panel,
    .codeblock:not(:has(> .codeblock__caption)),
    .codeblock:has(> .codeblock__caption) > .astro-code,
    [data-look~="panel"],
    [data-look~="cta"]
  ) {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--arc-on-ink) 26%, transparent),
    0 40px 90px -40px color-mix(in srgb, var(--arc) 60%, transparent),
    0 18px 40px -24px color-mix(in srgb, var(--arc-2) 45%, transparent);
}
html[data-fx~="panel"]
  :is(.code-panel, .codeblock, [data-look~="panel"])::after {
  content: "";
  position: absolute;
  inset: 0 8% auto;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    var(--arc-on-ink) 30%,
    var(--arc-on-ink-2) 70%,
    transparent
  );
}

/* The caption that reads on the page right under a glowing piece takes the page's text colour:
   the glow falls on it, and the muted caption colour drops there under 4.5:1 (npaw.dev in
   Marino medio, 27-nov: 3.5 to 3.6:1 on the home and the product pages, the secondary text
   colour still 4.2 to 4.5:1; down to 2.3:1 in lima or oro over dark). Captions inside an ink
   panel keep theirs. */
html[data-fx~="panel"]
  :is(
    .codeblock:has(> .codeblock__caption) > .codeblock__caption,
    .showcase__visual:has(:is(.code-panel, .codeblock, [data-look~="panel"]))
      > .showcase__caption,
    .home-hero__visual:has(:is(.code-panel, .codeblock, [data-look~="panel"]))
      > .home-hero__caption
  ):not(.kit-ink *, .code-panel *) {
  color: var(--text);
}

/* An ink panel of the site's own takes a glow from its top corner; the closing call to action
   (cta) a glow from two corners, without the lit edge. */
html[data-fx~="panel"] [data-look~="panel"] {
  background:
    radial-gradient(
      55% 70% at 0% 0%,
      color-mix(in srgb, var(--arc-on-ink) 9%, transparent),
      transparent 70%
    ),
    var(--code-bg);
}
html[data-fx~="panel"] [data-look~="cta"] {
  background:
    radial-gradient(
      60% 110% at 100% 0%,
      color-mix(in srgb, var(--arc) 26%, transparent),
      transparent 65%
    ),
    radial-gradient(
      45% 90% at 0% 100%,
      color-mix(in srgb, var(--arc-2) 16%, transparent),
      transparent 65%
    ),
    var(--code-bg);
}

/* ---- tarjetas: a gradient edge (two backgrounds: the card's fill inside, the gradient under
   its transparent border) and a coloured shadow ---- */
html[data-fx~="tarjetas"] :is(.card, [data-look~="card"]) {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--surface-1), var(--surface-1)) padding-box,
    linear-gradient(
        140deg,
        color-mix(in srgb, var(--arc) 85%, transparent),
        var(--hairline) 45%,
        color-mix(in srgb, var(--arc-2) 70%, transparent)
      )
      border-box;
  box-shadow: 0 18px 40px -30px color-mix(in srgb, var(--arc) 80%, transparent);
  transition:
    transform var(--dur-mid) var(--ease),
    box-shadow var(--dur-mid) var(--ease);
}
html[data-fx~="tarjetas"] :is(.card, [data-look~="card"]):hover {
  box-shadow: 0 26px 50px -28px
    color-mix(in srgb, var(--arc-2) 80%, transparent);
}
html[data-fx~="tarjetas"] :is(a.card, .card--hover):hover {
  transform: translateY(-2px);
}

/* ---- detalles ---- */
html[data-fx~="detalles"] .eyebrow:not(.eyebrow--muted)::before {
  background: linear-gradient(135deg, var(--arc), var(--arc-2));
  box-shadow: 0 0 10px -1px color-mix(in srgb, var(--arc) 70%, transparent);
  border-radius: var(--r-sm);
}
html[data-fx~="detalles"] [data-look~="number"] {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
html[data-fx~="detalles"] .arrow-link::after {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
html[data-fx~="detalles"] .section-alt {
  border-image: linear-gradient(
      90deg,
      transparent,
      color-mix(in srgb, var(--arc) 60%, transparent) 30%,
      color-mix(in srgb, var(--arc-2) 60%, transparent) 70%,
      transparent
    )
    1;
}

/* ---- trazos ---- */
html[data-fx~="trazos"] [data-look~="line"] {
  filter: drop-shadow(0 0 5px var(--arc)) drop-shadow(0 0 14px var(--arc-2));
}
html[data-fx~="trazos"] [data-look~="point"] {
  transform: scale(1.6);
  transform-box: fill-box;
  transform-origin: center;
  filter: drop-shadow(0 0 6px var(--arc-2));
}
/* A marker drawn in SVG also takes a coloured fill and a companion ring. */
html[data-fx~="trazos"] :is(circle, ellipse, rect, path)[data-look~="point"] {
  fill: color-mix(in srgb, var(--arc) 30%, transparent);
  stroke: color-mix(in srgb, var(--arc-2) 55%, transparent);
  stroke-width: 1;
}

/* ---- oscura and portada: a block on ink in a light page (a band; the top of every page), its
   tokens remapped so every piece inside adapts. The kit's own aliases of a colour token
   (measures.css) are computed on :root and would keep the paper's value, so they are said again
   here; a site does the same for an alias of its own that a piece inside reads. ---- */
html[data-fx~="oscura"] [data-look~="band"],
html[data-fx~="portada"]
  :is(.page-hero, .hero, [data-look~="hero"]):not(.form-page) {
  --ink: var(--code-bg);
  --surface-1: var(--code-surface);
  --surface-2: var(--code-surface);
  --text: var(--code-text);
  --title: var(--code-text);
  --text-2: var(--code-text-2);
  --text-3: var(--code-text-3);
  --hairline: var(--code-rule);
  --border: rgba(255, 255, 255, 0.16);
  --border-strong: rgba(255, 255, 255, 0.34);
  --fill-1: rgba(255, 255, 255, 0.03);
  --fill-2: rgba(255, 255, 255, 0.05);
  --fill-3: rgba(255, 255, 255, 0.08);
  --accent: var(--arc-on-ink);
  --accent-2: var(--arc-on-ink-2);
  --accent-3: var(--arc-on-ink-3);
  --btn-secondary-bg: var(--surface-1);
  --btn-ghost-hover-bg: var(--fill-2);
  --btn-link-color: var(--accent);
  --hero-rule: var(--hairline);
  --prose-rule: var(--accent);
  position: relative;
  isolation: isolate;
  /* clip, never hidden alone: hidden makes the band a scroll container, and a side layout's
     sticky title then sits a whole sticky offset below its lead instead of following the page. */
  overflow: hidden;
  overflow: clip;
  background: var(--code-bg);
  color: var(--text);
  color-scheme: dark;
}
html[data-fx~="oscura"] [data-look~="band"]::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      45% 60% at 0% 0%,
      color-mix(in srgb, var(--arc) 14%, transparent),
      transparent 70%
    ),
    radial-gradient(
      40% 55% at 100% 100%,
      color-mix(in srgb, var(--arc-2) 10%, transparent),
      transparent 70%
    );
}

/* An ink panel inside the dark top (a terminal, a drawing) stands on the ink's second surface,
   or it would be the colour of the block it sits on. */
html[data-fx~="portada"]
  :is(.page-hero, .hero, [data-look~="hero"]):not(.form-page)
  :is(.code-panel, .codeblock, .astro-code, .kit-ink, [data-look~="panel"]) {
  --code-bg: var(--code-surface);
}

/* ---- contraste: on the look's ink blocks the fills take the colour that reads on ink and their
   label the ink itself (measured pairs: --arc-on-ink, --arc-on-ink-2 and -3 on --code-bg), so a
   dark brand colour, lost on its own ink, gives way to its light companion there ---- */
html[data-fx~="contraste"][data-fx~="oscura"] [data-look~="band"],
html[data-fx~="contraste"][data-fx~="portada"]
  :is(.page-hero, .hero, [data-look~="hero"]):not(.form-page),
html[data-fx~="contraste"] [data-look~="cta"] {
  --arc: var(--arc-on-ink);
  --arc-hi: color-mix(in srgb, var(--arc-on-ink) 84%, var(--code-text));
  --arc-ink: var(--code-bg);
  --arc-2: var(--arc-on-ink-2);
  --arc-3: var(--arc-on-ink-3);
  --arc-soft: color-mix(in srgb, var(--arc-on-ink) 22%, transparent);
  --arc-halo: color-mix(in srgb, var(--arc-on-ink) 12%, transparent);
}
/* The primary button's ink edge is for a light fill on paper: on ink the fill stands by itself. */
html[data-fx~="contraste"]
  :is(
    html[data-fx~="oscura"] [data-look~="band"],
    html[data-fx~="portada"]
      :is(.page-hero, .hero, [data-look~="hero"]):not(.form-page),
    [data-look~="cta"]
  )
  .btn.btn--primary.btn--primary.btn--primary {
  border-color: transparent;
}

/* ---- grano: an SVG noise (img-src allows data:) over the page, too faint to touch contrast ---- */
html[data-fx~="grano"] body::after {
  content: "";
  position: fixed;
  z-index: 999;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1.4 -0.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
html[data-fondo="oscuro"][data-fx~="grano"] body::after {
  opacity: 0.09;
  mix-blend-mode: screen;
}

/* ---- movimiento ---- */
@media (prefers-reduced-motion: no-preference) {
  html[data-fx~="movimiento"][data-fx~="halo"]
    :is(.page-hero, .hero, [data-look~="hero"])::before {
    animation: look-drift 14s ease-in-out infinite alternate;
  }
  html[data-fx~="movimiento"][data-fx~="titulo"]
    :is(.page-hero__title, .hero__title, [data-look~="title"]) {
    background-size: 160% 100%;
    animation: look-sheen 9s ease-in-out infinite alternate;
  }
  html[data-fx~="movimiento"][data-fx~="trazos"] [data-look~="point"] {
    animation: look-breathe 2.8s ease-in-out infinite alternate;
  }
}
@keyframes look-drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-4%, 3%, 0) scale(1.08);
  }
}
@keyframes look-sheen {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 100% 50%;
  }
}
@keyframes look-breathe {
  from {
    transform: scale(1.2);
    opacity: 0.7;
  }
  to {
    transform: scale(1.9);
    opacity: 1;
  }
}

/* ---- Levels: an effect weaker or stronger than its 100 %. Each rule below is its effect's own,
   with the amounts multiplied by --fx-<effect> (0.25 to the effect's maximum, engine.mjs
   EFFECTS); a colour mix never passes 100 %, and a shadow or a glow only grows past 100 %. ---- */

/* halo: how much colour light. Below 100 % fainter; above, wider at the same strength, so no text
   under its brightest point reads worse than at 100 %. */
html[data-fx~="halo"][data-fx-level*="halo:"]
  :is(.page-hero, .hero, [data-look~="hero"])::before {
  background:
    radial-gradient(
      calc(42% * max(1, var(--fx-halo))) calc(55% * max(1, var(--fx-halo))) at
        82% 18%,
      color-mix(
        in srgb,
        var(--arc) calc(34% * min(1, var(--fx-halo))),
        transparent
      ),
      transparent 72%
    ),
    radial-gradient(
      calc(38% * max(1, var(--fx-halo))) calc(50% * max(1, var(--fx-halo))) at
        18% 6%,
      color-mix(
        in srgb,
        var(--arc-2) calc(26% * min(1, var(--fx-halo))),
        transparent
      ),
      transparent 72%
    ),
    radial-gradient(
      calc(30% * max(1, var(--fx-halo))) calc(40% * max(1, var(--fx-halo))) at
        55% 70%,
      color-mix(
        in srgb,
        var(--arc) calc(12% * min(1, var(--fx-halo))),
        transparent
      ),
      transparent 70%
    );
}

/* rejilla: how much the lines show (fainter below 100 %, darker towards the text above it) */
html[data-fx~="rejilla"][data-fx-level*="rejilla:"]
  :is(.page-hero, .hero, [data-look~="hero"])::after {
  opacity: min(1, var(--fx-rejilla));
  background-image:
    linear-gradient(
      color-mix(
          in srgb,
          var(--hairline),
          var(--text) calc(max(0, var(--fx-rejilla) - 1) * 12%)
        )
        1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      color-mix(
          in srgb,
          var(--hairline),
          var(--text) calc(max(0, var(--fx-rejilla) - 1) * 12%)
        )
        1px,
      transparent 1px
    );
}

/* boton: how much glow under the primary button */
html[data-fx~="boton"][data-fx-level*="boton:"]
  .btn.btn--primary.btn--primary.btn--primary {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 calc(10px * max(1, var(--fx-boton)))
      calc(26px * max(1, var(--fx-boton))) -12px
      color-mix(
        in srgb,
        var(--arc) min(100%, calc(70% * var(--fx-boton))),
        transparent
      );
}
html[data-fx~="boton"][data-fx-level*="boton:"]
  .btn.btn--primary.btn--primary.btn--primary:hover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 calc(14px * max(1, var(--fx-boton)))
      calc(32px * max(1, var(--fx-boton))) -12px
      color-mix(
        in srgb,
        var(--arc-2) min(100%, calc(75% * var(--fx-boton))),
        transparent
      );
}

/* panel: how much glow on the edge, around and inside the ink panels. Above 100 % the edge, its
   ring and the light inside grow; the glow outside stays at its 100 %, as it falls on the page. */
html[data-fx~="panel"][data-fx-level*="panel:"]
  :is(
    .code-panel,
    .codeblock:not(:has(> .codeblock__caption)),
    .codeblock:has(> .codeblock__caption) > .astro-code,
    [data-look~="panel"],
    [data-look~="cta"]
  ) {
  box-shadow:
    0 0 0 1px
      color-mix(
        in srgb,
        var(--arc-on-ink) min(100%, calc(26% * var(--fx-panel))),
        transparent
      ),
    0 40px 90px -40px
      color-mix(
        in srgb,
        var(--arc) calc(60% * min(1, var(--fx-panel))),
        transparent
      ),
    0 18px 40px -24px
      color-mix(
        in srgb,
        var(--arc-2) calc(45% * min(1, var(--fx-panel))),
        transparent
      );
}
html[data-fx~="panel"][data-fx-level*="panel:"]
  :is(.code-panel, .codeblock, [data-look~="panel"])::after {
  height: calc(1px * max(1, var(--fx-panel)));
  opacity: min(1, var(--fx-panel));
}
html[data-fx~="panel"][data-fx-level*="panel:"] [data-look~="panel"] {
  background:
    radial-gradient(
      55% 70% at 0% 0%,
      color-mix(
        in srgb,
        var(--arc-on-ink) calc(9% * var(--fx-panel)),
        transparent
      ),
      transparent 70%
    ),
    var(--code-bg);
}
html[data-fx~="panel"][data-fx-level*="panel:"] [data-look~="cta"] {
  background:
    radial-gradient(
      60% 110% at 100% 0%,
      color-mix(
        in srgb,
        var(--arc) min(100%, calc(26% * var(--fx-panel))),
        transparent
      ),
      transparent 65%
    ),
    radial-gradient(
      45% 90% at 0% 100%,
      color-mix(
        in srgb,
        var(--arc-2) min(100%, calc(16% * var(--fx-panel))),
        transparent
      ),
      transparent 65%
    ),
    var(--code-bg);
}

/* tarjetas: how much colour on the card's edge and in its shadow */
html[data-fx~="tarjetas"][data-fx-level*="tarjetas:"]
  :is(.card, [data-look~="card"]) {
  background:
    linear-gradient(var(--surface-1), var(--surface-1)) padding-box,
    linear-gradient(
        140deg,
        color-mix(
          in srgb,
          var(--arc) min(100%, calc(85% * var(--fx-tarjetas))),
          transparent
        ),
        var(--hairline) 45%,
        color-mix(
          in srgb,
          var(--arc-2) min(100%, calc(70% * var(--fx-tarjetas))),
          transparent
        )
      )
      border-box;
  box-shadow: 0 calc(18px * max(1, var(--fx-tarjetas)))
    calc(40px * max(1, var(--fx-tarjetas))) -30px
    color-mix(
      in srgb,
      var(--arc) min(100%, calc(80% * var(--fx-tarjetas))),
      transparent
    );
}
html[data-fx~="tarjetas"][data-fx-level*="tarjetas:"]
  :is(.card, [data-look~="card"]):hover {
  box-shadow: 0 calc(26px * max(1, var(--fx-tarjetas)))
    calc(50px * max(1, var(--fx-tarjetas))) -28px
    color-mix(
      in srgb,
      var(--arc-2) min(100%, calc(80% * var(--fx-tarjetas))),
      transparent
    );
}

/* trazos: how far and how strongly the lines and the markers glow */
html[data-fx~="trazos"][data-fx-level*="trazos:"] [data-look~="line"] {
  filter: drop-shadow(
      0 0 calc(5px * var(--fx-trazos))
        color-mix(
          in srgb,
          var(--arc) min(100%, calc(100% * var(--fx-trazos))),
          transparent
        )
    )
    drop-shadow(
      0 0 calc(14px * var(--fx-trazos))
        color-mix(
          in srgb,
          var(--arc-2) min(100%, calc(100% * var(--fx-trazos))),
          transparent
        )
    );
}
html[data-fx~="trazos"][data-fx-level*="trazos:"] [data-look~="point"] {
  filter: drop-shadow(
    0 0 calc(6px * var(--fx-trazos))
      color-mix(
        in srgb,
        var(--arc-2) min(100%, calc(100% * var(--fx-trazos))),
        transparent
      )
  );
}

/* grano: how much the grain shows */
html[data-fx~="grano"][data-fx-level*="grano:"] body::after {
  opacity: calc(0.07 * var(--fx-grano));
}
html[data-fondo="oscuro"][data-fx~="grano"][data-fx-level*="grano:"]
  body::after {
  opacity: calc(0.09 * var(--fx-grano));
}

/* ---- esquinas: the radii every component reads ---- */
html[data-esquinas="rectas"] {
  --r-sm: 0px;
  --r-md: 0px;
  --r-lg: 0px;
  --r-xl: 0px;
}
html[data-esquinas="precisas"] {
  --r-sm: 3px;
  --r-md: 4px;
  --r-lg: 6px;
  --r-xl: 8px;
}
html[data-esquinas="suaves"] {
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
}
html[data-esquinas="redondas"] {
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --btn-radius: var(--r-pill);
}

/* The dark background also darkens the browser's own parts (form controls, scrollbars). */
html[data-fondo="oscuro"] {
  color-scheme: dark;
}
