/* SPDX-License-Identifier: AGPL-3.0-or-later */
/* at.lens.css - experience themes */

/*
 * ============================ THE LENS CONTRACT ============================
 *
 * Lens is the sixth L control, but unlike the first five it is a CHORD of
 * them -- a whole interaction model with a psychology behind it, sourced
 * 1:1 from experience_themes.json.
 *
 * It works two ways at once, and the split is the whole idea:
 *
 *   1. SEEDS.   Choosing a lens sets Layout / Lattice / Layer / Look / Life
 *               plus density, size, and tabs to that model's best fit. From
 *               then on the axes are yours -- changing one is a refinement,
 *               not a fight. The readout shows the drift.
 *
 *   2. TOKENS.  A lens also carries what no single axis owns: pacing, and
 *               how loudly the interface is allowed to speak. Those keep
 *               applying after you drift, which is what makes a composition
 *               still feel like that experience even once you have
 *               repainted it.
 *
 * The handoff is a fallback chain, not a cascade trick:
 *
 *     var(--lens-enter-time, var(--enter-time, 420ms))
 *      ^ the experience    ^ the look's own    ^ the floor
 *
 * Read left to right that is exactly the rule: the lens sets the pace, the
 * look sets the character, and neither has to know the other exists. A
 * `@layer` would have been the wrong tool here -- every look declares
 * --enter-time, so a layered lens would always lose.
 *
 * This axis sheet loads after Life so its handful of rules can refine the
 * composition it seeds.
 */

/* --- Productive / Data-Dense ------------------------------------------
   Speed, efficiency, utility, reduced cognitive latency. */
[data-lens="productive-data-dense"] {
  --lens-enter-time: 140ms;
  --lens-enter-ease: var(--motion-ease-linear);
  --lens-stagger-step: 18ms;
  --lens-drawer-time: 140ms;
  --lens-drawer-ease: var(--motion-ease-linear);
  --transition-interaction: 80ms var(--motion-ease-linear);
  --transition-element: 120ms var(--motion-ease-linear);
  --transition-structural: 160ms var(--motion-ease-standard);
  /* A tool does not put on a show when a panel opens. */
  --lens-recede: 0.6;
  --lens-alert-volume: 1;
}

/* --- Expressive / Gamified --------------------------------------------
   Delight, dopamine reward loops, retention. */
[data-lens="expressive-gamified"] {
  --lens-enter-time: 520ms;
  --lens-enter-ease: var(--motion-ease-rubber);
  --lens-stagger-step: 80ms;
  --lens-drawer-time: 520ms;
  --lens-drawer-ease: var(--motion-ease-rubber);
  --transition-interaction: 260ms var(--motion-ease-spring);
  --transition-element: 400ms var(--motion-ease-spring);
  --transition-structural: 620ms var(--motion-ease-rubber);
  /* The page gets out of the way with enthusiasm. */
  --lens-recede: 1.3;
  --lens-alert-volume: 1.6;
}

/* --- Cinematic / Luxury -----------------------------------------------
   Prestige, status, slow-paced artistic immersion. */
[data-lens="cinematic-luxury"] {
  --lens-enter-time: 900ms;
  --lens-enter-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --lens-stagger-step: 130ms;
  --lens-drawer-time: 820ms;
  --lens-drawer-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-interaction: 400ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-element: 600ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-structural: 900ms cubic-bezier(0.16, 1, 0.3, 1);
  /* The world behind the subject falls a full plane away. */
  --lens-recede: 1.6;
  --lens-alert-volume: 0.5;
}

/* --- Stealth / Terminal -----------------------------------------------
   Zero distraction, zero latency, technical nostalgia. */
[data-lens="stealth-terminal"] {
  --lens-enter-time: 120ms;
  --lens-enter-ease: steps(3, end);
  --lens-stagger-step: 22ms;
  --lens-drawer-time: 90ms;
  --lens-drawer-ease: steps(4, end);
  --transition-interaction: 0ms steps(1, end);
  --transition-element: 0ms steps(1, end);
  --transition-structural: 60ms steps(2, end);
  /* Nothing recedes. The page was never scenery. */
  --lens-recede: 0.15;
  --lens-alert-volume: 1.2;
}

/* --- Institutional / Reassuring ---------------------------------------
   Safety, cognitive accessibility, anxiety reduction. */
[data-lens="institutional-reassuring"] {
  --lens-enter-time: 300ms;
  --lens-enter-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --lens-stagger-step: 55ms;
  --lens-drawer-time: 300ms;
  --lens-drawer-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-interaction: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-element: 260ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-structural: 340ms cubic-bezier(0.4, 0, 0.2, 1);
  /* Enough recede to say 'this is on top', no more. */
  --lens-recede: 1;
  --lens-alert-volume: 1.4;
}

/* How insistent an alert is allowed to be is a property of the EXPERIENCE,
   not of the component or of the motion score. A luxury alert whispers; a
   gamified one shouts. Life still decides the shape; the lens sets the
   volume, which is the one thing neither look nor life can express. */
[data-lens] [data-state="alert"] {
  animation-duration: calc(2.4s / var(--lens-alert-volume, 1));
}

/* --lens-recede is the same idea spent on depth instead of on attention, and
   it is the fourth voice in a crossing no single axis can hold:
 *
 *   Layer  publishes how far in front of the page a projection stands
 *   Look   knows what that much of its own air looks like
 *   Life   decides how long the page takes to get there
 *   Lens   decides how far it is ALLOWED to go
 *
 * A stealth interface refuses the whole gesture -- the page is not scenery
 * and does not perform. A cinematic one drops it a full plane. Neither of
 * those is a colour, a duration or a distance, so none of the other three
 * could have expressed it; it is a statement about the experience, which is
 * the only thing this file is for. The value is consumed in at.look.css. */


/**
 * Copyright © 2026 MENTIC LLC
 * Created by Matthew Quarneri
 *
 * Dual licensed under AGPL-3.0 or a MENTIC LLC commercial license.
 * See LICENSE for licensing terms.
 */