/* Versed look (14 Nov 2026), shared by Versed Tools and Versed Study. Loaded after study.css (and tools.css
   on the tool pages) and before a product's own look file: tools-look.css on the tools, study-look.css on Study.

   Same family as the Versed Learn lessons:
   - chunky "3D" push buttons: a face sitting on a darker edge, pressed down on touch;
   - a colour used with meaning (the Learn lesson palette: teal, violet, amber, pink, blue), each in
     three parts: --hf a soft wash, --hl an edge / line, --hi words and icons;
   - lime still means "do this" (the main button), never a family colour;
   - big friendly round shapes and calm panels, no hard offset shadows;
   - a cream page that looks as good as the dark one.

   The page colour: html[data-theme="cream"|"dark"] when the student chose one (set before the page
   paints by the one-line script in each <head>, from `study.tools.theme`), else the device's own
   light / dark setting. tools/common.js (Tools) and js/common.js (Study) keep it in step, draw the
   switch in the header, and share the choice across both sites through the `versed_ui` cookie.

   Every rule that changes layout sits inside @media screen, so a printed page stays plain. */

/* ---------- colour tokens ---------- */
:root {
  --act: #C6FF3D; --act-ink: #0E0D17; --act-rim: #C6FF3D; --act-edge: #87AD29;
  --field: #16152A; --rim: #3D3A66; --edge: #2A2848; --focus: #C6FF3D;
  /* the suite's --dim (#5E5B7E) is 2.6:1 on the dark page, too faint for the small notes it is used for */
  --dim: #8E8BB0;
  --soft: #F4F2FF14;
  --glow1: rgba(139,123,255,.22); --glow2: rgba(198,255,61,.10);
  --teal-f: #1A343D; --teal-l: #4ECDC4; --teal-i: #7FDAD3;
  --violet-f: #2E2A5C; --violet-l: #8B7BFF; --violet-i: #B3A9FF;
  --amber-f: #3A2D20; --amber-l: #E0A030; --amber-i: #FFC866;
  --pink-f: #40223F; --pink-l: #F0589F; --pink-i: #FF8FC4;
  --blue-f: #1F3156; --blue-l: #5AA9FF; --blue-i: #8CC3FF;
  --right-f: #16362F; --right-l: #34C98A; --right-i: #6FE5A8;
  --hf: var(--card2); --hl: var(--rim); --hi: var(--text);
}
/* Cream: the Learn cream page, with cards a touch lighter than the page so they read as things you can tap. */
html[data-theme="cream"] {
  --bg: #FFF8ED; --bg2: #FCF0DD; --card: #FFFDF8; --card2: #FCF0DD; --line: #E8D5B7; --text: #2D2006; --muted: #5A4A2E; --dim: #7A6A4C;
  /* the suite's bright hues are for a dark page; on cream the deeper members of the same families */
  --lime: #4F7A05; --pink: #C7357F; --cyan: #1C6F9E; --amber: #8A5200; --violet: #4F3BC4; --green: #0F6E48; --red: #B23A1B;
  --act-rim: #4F7A05; --act-edge: #7FA320;
  --field: #FFFFFF; --rim: #D9C29C; --edge: #E3CFAE; --focus: #4F3BC4;
  --soft: #2D20060D;
  --glow1: rgba(255,200,102,.28); --glow2: rgba(78,205,196,.14);
  --teal-f: #D9F2EE; --teal-l: #16867D; --teal-i: #0B6860;
  --violet-f: #E9E5FF; --violet-l: #6A56E0; --violet-i: #4F3BC4;
  --amber-f: #FBE4B3; --amber-l: #A8660A; --amber-i: #8A5200;
  --pink-f: #FBDDEA; --pink-l: #C7357F; --pink-i: #A8215F;
  --blue-f: #DCEBFB; --blue-l: #2F74C0; --blue-i: #1C5A9E;
  --right-f: #DDF5E6; --right-l: #1E8A5C; --right-i: #0F6E48;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  html:not([data-theme]) {
    --bg: #FFF8ED; --bg2: #FCF0DD; --card: #FFFDF8; --card2: #FCF0DD; --line: #E8D5B7; --text: #2D2006; --muted: #5A4A2E; --dim: #7A6A4C;
    --lime: #4F7A05; --pink: #C7357F; --cyan: #1C6F9E; --amber: #8A5200; --violet: #4F3BC4; --green: #0F6E48; --red: #B23A1B;
    --act-rim: #4F7A05; --act-edge: #7FA320;
    --field: #FFFFFF; --rim: #D9C29C; --edge: #E3CFAE; --focus: #4F3BC4;
    --soft: #2D20060D;
    --glow1: rgba(255,200,102,.28); --glow2: rgba(78,205,196,.14);
    --teal-f: #D9F2EE; --teal-l: #16867D; --teal-i: #0B6860;
    --violet-f: #E9E5FF; --violet-l: #6A56E0; --violet-i: #4F3BC4;
    --amber-f: #FBE4B3; --amber-l: #A8660A; --amber-i: #8A5200;
    --pink-f: #FBDDEA; --pink-l: #C7357F; --pink-i: #A8215F;
    --blue-f: #DCEBFB; --blue-l: #2F74C0; --blue-i: #1C5A9E;
    --right-f: #DDF5E6; --right-l: #1E8A5C; --right-i: #0F6E48;
    color-scheme: light;
  }
}

/* A family colour, on anything: <a class="hue-teal">. */
.hue-teal { --hf: var(--teal-f); --hl: var(--teal-l); --hi: var(--teal-i); }
.hue-violet { --hf: var(--violet-f); --hl: var(--violet-l); --hi: var(--violet-i); }
.hue-amber { --hf: var(--amber-f); --hl: var(--amber-l); --hi: var(--amber-i); }
.hue-pink { --hf: var(--pink-f); --hl: var(--pink-l); --hi: var(--pink-i); }
.hue-blue { --hf: var(--blue-f); --hl: var(--blue-l); --hi: var(--blue-i); }

@media screen {
  body {
    background-color: var(--bg); color: var(--text);
    background-image: radial-gradient(60% 40% at 85% -10%, var(--glow1), transparent 60%), radial-gradient(50% 35% at 0% 100%, var(--glow2), transparent 60%);
  }
  a { color: var(--hi, var(--cyan)); }
  .muted a, .small a, .foot a, .tiny a { color: var(--text); }

  /* ---------- focus: one ring everywhere, only for the keyboard ---------- */
  :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 10px; }
  .input:focus, .input:focus-visible, textarea:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent); }

  /* ---------- header ---------- */
  .top { padding: .35rem 0 .9rem; align-items: center; }
  .brand { gap: .55rem; font-size: .92rem; }
  .brand .logo { width: 38px; height: 38px; border-radius: 12px; background: var(--card); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); display: grid; place-items: center; filter: none; }
  .brand .logo img { width: 26px; height: 26px; }
  .brand .teal { color: var(--lime); }
  .top nav { gap: .3rem; align-items: center; }
  .top nav a { color: var(--muted); border-radius: 12px; padding: .4rem .65rem; }
  .top nav a:hover, .top nav a[aria-current] { background: var(--card); color: var(--text); box-shadow: inset 0 0 0 2px var(--line); }
  .theme-btn { width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center; border-radius: 14px; background: var(--card); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); color: var(--text); transition: transform .07s, box-shadow .07s; }
  .theme-btn svg { width: 20px; height: 20px; }
  .theme-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
  @media (max-width: 480px) {
    .top { display: grid; grid-template-columns: 1fr auto; row-gap: .5rem; }
    .top nav { grid-column: 1 / -1; justify-content: flex-start; margin: 0; }
    .top .theme-btn { grid-row: 1; grid-column: 2; }
  }


  /* ---------- cards and panels: rounded, calm, sitting on a soft edge ---------- */
  .card { background: var(--card); border: 2px solid var(--line); border-radius: 22px; box-shadow: 0 4px 0 var(--line); padding: 1.15rem 1.15rem 1.2rem; }
  .card + .card, .card + section, section + .card { margin-top: .9rem; }
  .card .card { box-shadow: none; }
  label.field { color: var(--muted); font-size: .76rem; letter-spacing: .06em; }
  .tip { background: var(--soft); border-radius: 14px; }

  /* ---------- inputs ---------- */
  .input { background: var(--field); border: 2px solid var(--line); border-radius: 16px; color: var(--text); }
  .input::placeholder { color: var(--dim); }
  .input-sm { border-radius: 12px; }
  select.input { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); }
  input[type=range] { background: var(--line); height: 8px; border-radius: 4px; }
  input[type=range]::-webkit-slider-thumb { width: 26px; height: 26px; background: var(--act); border: 3px solid var(--card); box-shadow: 0 0 0 2px var(--act-rim), 0 3px 0 var(--act-edge); }
  input[type=range]::-moz-range-thumb { width: 22px; height: 22px; background: var(--act); border: 3px solid var(--card); box-shadow: 0 0 0 2px var(--act-rim); }
  input[type=checkbox], input[type=radio] { accent-color: var(--lime); }

  /* ---------- push buttons ----------
     The face sits on its edge (a box-shadow, so nothing around it moves) and goes down onto it the moment
     it is touched. Lime is the one main thing to do; a plain button is the card on a soft edge. */
  .btn { border-radius: 16px; font-weight: 700; min-height: 46px; transition: transform .07s ease-out, box-shadow .07s ease-out, filter .12s; -webkit-tap-highlight-color: transparent; }
  .btn-primary, .btn-lime { background: var(--act); color: var(--act-ink); border: 2px solid var(--act-rim); box-shadow: 0 5px 0 var(--act-edge); }
  .btn-primary:hover, .btn-lime:hover { background: var(--act); filter: brightness(1.05); }
  .btn-primary:active, .btn-lime:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--act-edge); }
  .btn-primary:not(.btn-sm), .btn-lime:not(.btn-sm) { min-height: 54px; font-size: 1.04rem; padding: .8rem 1.5rem; }
  .btn-ghost, .btn-dark { background: var(--card); color: var(--text); border: 2px solid var(--rim); box-shadow: 0 4px 0 var(--rim); }
  .btn-ghost:hover { border-color: var(--hl, var(--violet)); }
  .btn-ghost:active, .btn-dark:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--rim); }
  .btn-coral { background: var(--pink-l); color: #fff; border: 2px solid var(--pink-l); box-shadow: 0 5px 0 color-mix(in srgb, var(--pink-l) 62%, #000); }
  .btn-coral:active { transform: translateY(4px); box-shadow: 0 1px 0 color-mix(in srgb, var(--pink-l) 62%, #000); }
  .btn-sm { border-radius: 13px; min-height: 42px; padding: .45rem .95rem; }
  .btn-sm.btn-primary, .btn-sm.btn-lime { box-shadow: 0 4px 0 var(--act-edge); }
  .btn-sm.btn-ghost { box-shadow: 0 3px 0 var(--rim); }
  .btn[aria-pressed="true"], .btn-ghost[aria-pressed="true"] { background: var(--hf); color: var(--text); border-color: var(--hl); box-shadow: 0 3px 0 var(--hl); }
  .btn:disabled, .btn.is-off { opacity: .5; box-shadow: 0 1px 0 var(--rim); transform: none; filter: none; }
  .btn-icon { background: var(--card); color: var(--text); border: 2px solid var(--rim); box-shadow: 0 3px 0 var(--rim); border-radius: 14px; transition: transform .07s, box-shadow .07s; }
  .btn-icon:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--rim); }
  .btn-icon.danger:hover { color: var(--red); }

  /* toast: readable on both pages */
  .toast { background: var(--text); color: var(--bg); border-radius: 16px; box-shadow: 0 6px 0 color-mix(in srgb, var(--text) 70%, #000), 0 12px 30px rgba(0,0,0,.25); }

  /* footer */
  .foot { color: var(--muted); }
  .foot a { color: var(--muted); border-bottom-color: var(--line); }
}

/* ---------- a small moment of delight (Tools: common.js T.cheer; Study: js/cheer.js) ---------- */
@keyframes pet-hop { 0% { transform: translateY(0) scale(1, 1); } 30% { transform: translateY(-14px) scale(.96, 1.05); } 62% { transform: translateY(0) scale(1.06, .94); } 100% { transform: translateY(0) scale(1, 1); } }
@keyframes cheer-pop { 0% { transform: scale(1); } 40% { transform: scale(1.035); } 100% { transform: scale(1); } }
@keyframes spark { 0% { transform: translate(-50%, -50%) scale(.4); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1); opacity: 0; } }
@keyframes note-in { 0% { transform: translate(-50%, 18px); opacity: 0; } 100% { transform: translate(-50%, 0); opacity: 1; } }
.cheer-pop { animation: cheer-pop .38s cubic-bezier(.3,1.5,.5,1); }
.spark { position: fixed; z-index: 120; width: 8px; height: 8px; border-radius: 2px; pointer-events: none; animation: spark .6s cubic-bezier(.2,.8,.3,1) forwards; }
.pet-note {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 110; transform: translate(-50%, 0);
  display: flex; align-items: center; gap: .65rem; width: max-content; max-width: min(92vw, 420px); padding: .55rem 1.1rem .55rem .6rem;
  background: var(--card); color: var(--text); border: 2px solid var(--right-l); border-radius: 20px; box-shadow: 0 5px 0 var(--right-l), 0 14px 32px rgba(0,0,0,.25);
  font-weight: 700; font-size: .95rem; line-height: 1.3; pointer-events: none; animation: note-in .32s cubic-bezier(.3,1.4,.5,1);
}
.pet-note img { width: 40px; height: 46px; image-rendering: pixelated; flex: none; transform-origin: 50% 100%; animation: pet-hop .6s .1s cubic-bezier(.3,1.6,.5,1); }
.pet-note.out { opacity: 0; transition: opacity .3s; }
.pet-hop { animation: pet-hop .6s cubic-bezier(.3,1.6,.5,1); }
.pet-note canvas { width: 44px; height: 44px; image-rendering: pixelated; flex: none; }
@media (prefers-reduced-motion: reduce) {
  /* No moving: a press shades the face instead of pushing it down, and the delight is a plain note. */
  .btn:active, .btn-icon:active, .theme-btn:active { transform: none !important; filter: brightness(.88); }
  .spark { display: none; }
  .pet-note, .pet-note img, .pet-hop, .cheer-pop { animation: none !important; }
}
@media print { .pet-note, .spark, .theme-btn { display: none !important; } }
