/* LiftLog design tokens ("glass"). Every colour/size the components use lives here. */

/* ---------- Wall themes ----------
   Spec values are in the comments. Each wall is darkened just enough that white text stays ≥ 4.5:1 on glass
   (measured on real pixels, see NOTES.md), then given more colour at the same lightness (OKLCH chroma ×1.5–1.6).
   --glow   = light source colour (top-right), --bounce = coloured bounce light (bottom-left),
   --deep   = vignette colour at the edges.
   Adding a theme = one more block + one swatch in Settings. */
:root, [data-theme="sand"] { --wall-top: #624931; --wall-bottom: #4D3725; --light: 255,236,212;   /* spec #7A6452 / #5F4C3E */
  --glow: 255,186,120; --bounce: 214,118,64;  --deep: 22,12,5; }
[data-theme="silver"]      { --wall-top: #494D56; --wall-bottom: #31353D; --light: 240,244,250;   /* spec #737982 / #4E535A */
  --glow: 214,228,252; --bounce: 140,162,210; --deep: 8,11,16; }
[data-theme="sage"]        { --wall-top: #43533B; --wall-bottom: #2F3C25; --light: 236,245,226;   /* spec #66745F / #48543F */
  --glow: 214,242,168; --bounce: 112,170,96;  --deep: 8,15,6; }
[data-theme="ocean"]       { --wall-top: #38516A; --wall-bottom: #253950; --light: 226,238,252;   /* spec #566B82 / #3B4C60 */
  --glow: 140,196,255; --bounce: 72,136,220;  --deep: 4,10,22; }
[data-theme="rose"]        { --wall-top: #6A4350; --wall-bottom: #4D2F39; --light: 255,228,234;   /* spec #82606A / #5E434B */
  --glow: 255,172,196; --bounce: 214,100,146; --deep: 22,6,12; }
[data-theme="graphite"]    { --wall-top: #4A4B50; --wall-bottom: #2C2D31; --light: 235,235,240;   /* spec, already passes */
  --glow: 214,214,232; --bounce: 130,130,166; --deep: 6,6,8; }

/* The wall, top layer first: two diagonal light beams (spec), a glow from the top-right, a coloured bounce
   light from the bottom-left, a vignette for depth, then the vertical gradient. Declared on [data-theme]
   so a swatch with its own data-theme draws its own wall. */
:root, [data-theme] {
  --wall:
    linear-gradient(120deg, rgba(var(--light), 0) 30%, rgba(var(--light), 0.16) 40%, rgba(var(--light), 0) 52%),
    linear-gradient(120deg, rgba(var(--light), 0) 60%, rgba(var(--light), 0.12) 68%, rgba(var(--light), 0) 78%),
    radial-gradient(ellipse 95% 60% at 90% -6%, rgba(var(--glow), 0.30), rgba(var(--glow), 0.10) 45%, rgba(var(--glow), 0) 75%),
    radial-gradient(ellipse 85% 50% at -12% 108%, rgba(var(--bounce), 0.28), rgba(var(--bounce), 0) 70%),
    radial-gradient(ellipse 140% 105% at 50% 38%, rgba(var(--deep), 0) 48%, rgba(var(--deep), 0.60) 100%),
    linear-gradient(180deg, var(--wall-top) 0%, var(--wall-bottom) 100%);
}

/* ---------- Accent ---------- */
:root, [data-accent="white"] { --accent: #FFFFFF; }
[data-accent="honey"]        { --accent: #F3D58A; }
[data-accent="sky"]          { --accent: #8FB0F0; }
[data-accent="peach"]        { --accent: #F0A27A; }

:root {
  --on-accent: #2B2119;

  /* text */
  --text: #FFFFFF;
  --text-2: #F6F1EB;
  --text-3: rgba(246, 241, 235, 0.72);   /* hints, captions */

  /* muscle groups (pastel) */
  --g-chest: #F0A27A;
  --g-back: #8FB0F0;
  --g-legs: #B8D9A8;
  --g-shoulders: #CDB8F0;
  --g-arms: #F3D58A;
  --g-core: #F2A9C0;

  /* glass
     The tint is a touch lower than the spec's 0.10 because the rim light + sheen below add ~0.03 on top;
     together they stay within the contrast budget (white text ≥ 4.5:1 on a beam peak). */
  --glass-bg: rgba(255, 250, 244, 0.07);
  --glass-bg-strong: rgba(255, 250, 244, 0.14);
  --glass-border: rgba(255, 255, 255, 0.30);
  --glass-blur: blur(24px) saturate(150%);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -1px 0 rgba(255, 255, 255, 0.06), 0 20px 48px rgba(30, 18, 10, 0.32);
  /* rim light along the top edge (fades out before the text starts) + a faint diagonal sheen */
  --glass-rim: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0, rgba(255, 255, 255, 0) 14px);
  /* small glint in the top-left corner; gone (0) before the card padding ends, so it never sits under text */
  --glass-glint: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0) 26px);
  --glass-sheen: linear-gradient(125deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.03) 30%, rgba(255, 255, 255, 0) 55%);
  /* edge: bright at the top-left, dim in the middle, catches light again bottom-right */
  --glass-edge: linear-gradient(140deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.30) 28%, rgba(255, 255, 255, 0.08) 62%, rgba(255, 255, 255, 0.40) 100%);
  /* frosted grain (SVG noise), drawn at low opacity */
  --glass-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  /* soft shadow pools on the wall, so the blur behind the glass has something to show (they only darken) */
  --wall-shade:
    radial-gradient(ellipse 60% 45% at 92% 22%, rgba(10, 6, 4, 0.40), rgba(10, 6, 4, 0) 70%),
    radial-gradient(ellipse 55% 40% at 4% 62%, rgba(10, 6, 4, 0.36), rgba(10, 6, 4, 0) 70%),
    radial-gradient(ellipse 70% 35% at 70% 98%, rgba(10, 6, 4, 0.30), rgba(10, 6, 4, 0) 70%);
  --inset-bg: rgba(30, 20, 14, 0.20);
  --inset-border: rgba(255, 255, 255, 0.22);
  --sheet-bg: rgba(28, 24, 22, 0.50);
  --sheet-blur: blur(30px) saturate(130%);
  --track: rgba(255, 255, 255, 0.22);       /* empty part of bars / progress */
  --hairline: rgba(255, 255, 255, 0.16);

  /* radii */
  --r-small: 22px;
  --r-big: 29px;
  --r-inset: 15px;
  --r-sheet: 34px;

  /* type */
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-label: 'Libre Caslon Text', Georgia, serif;
  --fs-title: 34px;
  --fs-ex-title: 26px;
  --fs-body: 16px;
  --fs-small: 15px;
  --fs-label: 13px;

  /* sizes */
  --tap: 44px;
  --log-btn: 68px;
  --tabbar-h: 64px;
}
