/* looseleaf.css: what AgentCake's page (/agentcake) takes from Looseleaf, a hand-drawn component library by Kevin Ngo
 * (https://github.com/kevintngo/looseleaf @ 4bdb647, MIT License, Copyright (c) 2026 Looseleaf contributors; the
 * licence and what was taken are in THIRD_PARTY_NOTICES.txt), as plain CSS: its colour, shadow and motion tokens
 * (--ll-*, from src/styles/looseleaf.css), its Kevin Sans faces (public/fonts/kevin-sans.css, the font files served
 * from /fonts/) and its rules for the layers of a drawing (rest, hover, pressed, focus), which ink.js beside this file
 * draws ahead of time and these rules show and hide. The values are Looseleaf's; the selectors are rewritten for the
 * page's hosts ([data-ink-ready]), and the plain outlines a host keeps before its drawing is ready are the page's. */

@font-face { font-family: "Kevin Sans"; src: url("/fonts/kevinsans-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Kevin Sans"; src: url("/fonts/kevinsans-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Kevin Sans Hand"; src: url("/fonts/kevinsans-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; size-adjust: 88%; ascent-override: 120.45%; descent-override: 60.23%; line-gap-override: 0%; }
@font-face { font-family: "Kevin Sans Hand"; src: url("/fonts/kevinsans-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; size-adjust: 88%; ascent-override: 120.45%; descent-override: 60.23%; line-gap-override: 0%; }
@font-face { font-family: "Kevin Sans Script"; src: url("/fonts/kevinsans-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; size-adjust: 75%; ascent-override: 128%; descent-override: 40%; line-gap-override: 0%; }
@font-face { font-family: "Kevin Sans Script"; src: url("/fonts/kevinsans-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; size-adjust: 75%; ascent-override: 128%; descent-override: 40%; line-gap-override: 0%; }
@font-face { font-family: "Kevin Sans Type"; src: url("/fonts/kevinsans-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; size-adjust: 82%; ascent-override: 85.37%; descent-override: 36.59%; line-gap-override: 0%; }
@font-face { font-family: "Kevin Sans Type"; src: url("/fonts/kevinsans-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; size-adjust: 82%; ascent-override: 85.37%; descent-override: 36.59%; line-gap-override: 0%; }

:root {
  color-scheme: light;

  /* surfaces */
  --ll-paper: #f8f5ee;
  --ll-paper-shade: #ece6da;
  --ll-slip: #fbf8f1;
  --ll-card: #fbf6e9;
  --ll-graph: #f4f7ef;
  --ll-kraft: #dcc8a3;
  --ll-photo: #fffdf6;
  --ll-check-rule: #7fa37c;

  /* sticky notes */
  --ll-sticky-yellow: #f7e38a;
  --ll-sticky-green: #cfe6a8;
  --ll-sticky-orange: #f7c08e;
  --ll-sticky-blue: #bcd8f0;

  /* inks */
  --ll-ink: #2a2420;
  --ll-ink-soft: #4a423b;
  --ll-ink-muted: #4a433c;
  --ll-ink-you: #2c4f9e;
  --ll-pencil: #6b6660;
  --ll-pencil-text: #5a554e;
  --ll-pencil-mark: #8e887f;
  --ll-green: #3b7a4b;
  --ll-marker: #df6b3c;
  --ll-hi: #f8dc4c;
  --ll-focus: #2c4f9e;
  --ll-link-hover: #1f3b7a;

  /* accents */
  --ll-tomato: #e8483a;
  --ll-tangerine: #f59a2f;
  --ll-lemon: #fbd63a;
  --ll-grass: #5db85c;

  --ll-tape: rgb(246 244 236 / 0.5);
  --ll-tape-edge: rgb(140 135 120 / 0.35);

  --ll-shade: 58 44 30;
  --ll-shadow-k: 1;
  --ll-hi-select: color-mix(in srgb, var(--ll-hi) 62%, transparent);

  --ll-shadow-sticky: 0 1px 1px rgb(var(--ll-shade) / calc(0.2 * var(--ll-shadow-k))), 0 9px 10px -7px rgb(var(--ll-shade) / calc(0.34 * var(--ll-shadow-k)));
  --ll-drop-sticker: drop-shadow(0 1px 0.6px rgb(var(--ll-shade) / calc(0.26 * var(--ll-shadow-k)))) drop-shadow(0 3px 3px rgb(var(--ll-shade) / calc(0.14 * var(--ll-shadow-k))));
  --ll-sticky-sheen: linear-gradient(to bottom, rgb(255 252 235 / 0.14), transparent 30%, transparent 78%, rgb(120 92 20 / 0.07));

  --ll-hover-tilt: -0.9deg;
  --ll-hover-misreg: 0.35;
  --ll-press-misreg: -0.78;
  --ll-press-sink: 1px;

  --ll-motion: 1;
  --ll-ease-out: ease-out;
  --ll-ease-settle: cubic-bezier(0.2, 0.9, 0.25, 1.12);
  --ll-dur-press: calc(0.09s * var(--ll-motion));
  --ll-dur-hover: calc(0.12s * var(--ll-motion));
  --ll-dur-fade: calc(0.15s * var(--ll-motion));

  --font-hand: "Kevin Sans Hand", "Kevin Sans", "Bradley Hand", cursive;
  --font-script: "Kevin Sans Script", "Kevin Sans", "Bradley Hand", cursive;
  --font-type: "Kevin Sans Type", "Kevin Sans", "Bradley Hand", cursive;
}

/* A drawing and its layers */
[data-draw] { position: relative; isolation: isolate; }
svg[data-ink] {
  position: absolute;
  z-index: -1;
  overflow: visible;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  transition: rotate var(--ll-dur-hover) var(--ll-ease-settle);
}
svg[data-ink][data-front] { z-index: 2; }

svg[data-ink] [data-layer]:not([data-layer="rest"]) {
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--ll-dur-press) var(--ll-ease-out), visibility 0s linear var(--ll-dur-press);
}
svg[data-ink] [data-part],
svg[data-ink] [data-layer="rest"] { transition: translate var(--ll-dur-hover) var(--ll-ease-settle); }

@media (hover: hover) {
  [data-ink-ready]:hover > svg[data-ink] [data-layer="hover"] {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--ll-dur-fade) var(--ll-ease-out), visibility 0s;
  }
  [data-ink-ready]:hover > svg[data-ink]:has([data-layer="hover"]) { rotate: var(--ll-hover-tilt); }
  [data-ink-ready]:hover > svg[data-ink] [data-part="fill"] {
    translate: calc(var(--mx, 0) * var(--ll-hover-misreg) * 1px) calc(var(--my, 0) * var(--ll-hover-misreg) * 1px);
  }
}

[data-ink-ready]:active > svg[data-ink] [data-layer="pressed"] {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--ll-dur-press) var(--ll-ease-out), visibility 0s;
}
[data-ink-ready]:active > svg[data-ink]:has([data-layer="hover"]) { rotate: none; transition: rotate var(--ll-dur-press) var(--ll-ease-out); }
[data-ink-ready]:active > svg[data-ink] [data-part="fill"] {
  translate: calc(var(--mx, 0) * var(--ll-press-misreg) * 1px) calc(var(--my, 0) * var(--ll-press-misreg) * 1px);
  transition: translate var(--ll-dur-press) var(--ll-ease-out);
}
[data-ink-ready]:active > svg[data-ink] [data-layer="rest"] {
  translate: calc(var(--ll-press-sink) * 0.6) var(--ll-press-sink);
  transition: translate var(--ll-dur-press) var(--ll-ease-out);
}
[data-ink-ready]:active > svg[data-ink] [data-layer="hover"] {
  opacity: 0;
  visibility: hidden;
}

:is(:focus-visible, :has(> :is(input, textarea, select):focus-visible)) > svg[data-ink] [data-layer="focus"] {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--ll-dur-fade) var(--ll-ease-out), visibility 0s;
}

/* Before the drawing is ready (or without scripts) a host keeps a plain pencil outline, as Looseleaf's do. */
:is(.btn, .pill, .field):not([data-ink-ready]) { outline: 1.5px solid var(--ll-pencil-mark); outline-offset: -1.5px; }
:is(.btn, .pill, .field):not([data-ink-ready]):focus-visible { outline: 2px solid var(--ll-focus); outline-offset: 2px; }
/* Once it is ready, the drawn blue ring is the focus ring. */
:is(.btn, .pill)[data-ink-ready]:focus-visible,
.field[data-ink-ready] > input:focus-visible { outline: none; }

@media (prefers-reduced-motion: reduce) {
  :root { --ll-motion: 0; }
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  svg[data-ink]:not([data-front]) { display: none; }
  :is(.btn, .pill, .field) { outline: 1px solid ButtonBorder; outline-offset: -1px; }
  :is(.btn, .pill):focus-visible, .field > input:focus-visible { outline: 3px solid Highlight; outline-offset: 2px; }
}
