/* CLOENNE · color — watercolor.css
 * The "watercolour studio" look: cold-press paper, ink, pencil, dabs, one brush stroke per button.
 * Pairs with watercolor.js (CLOENNE_WC), which injects the SVG filters this file references.
 *
 * Tokens (on :root) — --wc-paper, --wc-ink, --wc-muted, --wc-faint, --wc-pencil, --wc-accent, --wc-hand/--wc-serif/--wc-sans
 *
 * Classes
 *  .wc-paper        put on <body> by CLOENNE_WC.installPaper(): cream paper + full-page grain overlay (::after, multiply)
 *  .wc-title        Newsreader 300 heading, LEFT aligned; <em> inside = the one italic accent word
 *  .wc-season       two-line season reveal: "Otoño" + <em>Suave</em> on its own indented line
 *  .wc-wash         the soft wet-into-wet band behind the reveal (an <img>/<canvas> from washDataURL, absolutely
 *                   positioned inside a position:relative;overflow:hidden parent; warped by #wc-bloom)
 *  .wc-dab          an <img> (dabDataURL) or <canvas> (paintDab) holding one dab; block-level, no background
 *  .wc-inline       a 16px dab that sits INSIDE a sentence
 *  .wc-dabs         loose row of palette dabs sharing ONE caption baseline; children are .wc-sw
 *  .wc-sw           one palette entry: <div class="wc-sw"><div class="dw"><img class="wc-dab"></div><span class="nm">name</span><code>#hex</code></div>
 *  .wc-dabs--small  the avoid row (46px dabs, pencil × via .wc-avoid)
 *  .wc-avoid        wrapper around a small dab that draws a pencil × over it (::after)
 *  .wc-stroke       a button whose background is ONE flat brush stroke (strokeDataURL / applyStroke); ink text, Newsreader italic
 *  .wc-link         secondary action: plain ink link in Newsreader italic with a pencil underline
 *  .wc-ul           pencil underline on any inline word (used for the photo chips)
 *  .wc-chip         tappable pencil-underlined word (Mejilla · Cabello · Ojos · Papel blanco); [aria-pressed=true] = thicker line
 *  .wc-rule         a pencil line (block, full width); .wc-rule--grow uses --p (0..1) to draw only part of it (progress)
 *  .wc-counter      small dab counter for progress (row of .wc-dab, done ones opaque)
 *  .wc-note         a pencil note in Caveat Brush (ration: ≤ 2 per screen); .wc-note--tilt rotates it slightly
 *  .wc-arrow        a small pencil arrow (SVG <use href="#wc-arrow">), next to a .wc-note
 *  .wc-torn         torn-paper note (SVG displacement on ::before); the only "card" allowed on the page
 *  .wc-sheet        a photo shown as a straight-cut sheet of paper with a soft shadow (no frame, no vignette)
 *  .wc-marker       tap marker on the photo: a pencil circle with a tiny dab of the sampled colour (set --c)
 *  .wc-x            inline pencil × (SVG <use href="#wc-x">), e.g. for a "remove" action
 *  .wc-sr           visually hidden text
 */

:root{
  --wc-paper:#f8f1e3;
  --wc-paper-2:#fffaf0;
  --wc-ink:#4a2f2c;
  --wc-muted:#74615a;
  --wc-faint:#9d8a81;
  --wc-pencil:#6b5b55;
  --wc-accent:#8f5e4e;
  --wc-hand:"Caveat Brush","ZCOOL KuaiLe",cursive;
  --wc-serif:"Newsreader","Iowan Old Style","Songti SC","Noto Serif SC",Georgia,serif;
  --wc-sans:"Mulish",system-ui,-apple-system,"PingFang SC","Noto Sans SC",sans-serif;
  /* pencil strokes as data URIs (filters live inside the SVG, so they work as backgrounds) */
  --wc-line:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 350 10' preserveAspectRatio='none'><filter id='p' x='-5%' y='-40%' width='110%' height='180%'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='2'/><feDisplacementMap in='SourceGraphic' scale='1.8'/></filter><path d='M2 5c60-2 120 1 175 0s115-2 171 1' fill='none' stroke='%239a8a80' stroke-width='1.1' stroke-linecap='round' filter='url(%23p)'/></svg>");
  --wc-line-short:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 8' preserveAspectRatio='none'><filter id='p' x='-5%' y='-40%' width='110%' height='180%'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='3'/><feDisplacementMap in='SourceGraphic' scale='1.6'/></filter><path d='M2 5c40-3 90-2 196-1' fill='none' stroke='%236b5b55' stroke-width='1.3' stroke-linecap='round' filter='url(%23p)'/></svg>");
  --wc-line-thick:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 8' preserveAspectRatio='none'><filter id='p' x='-5%' y='-40%' width='110%' height='180%'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='3'/><feDisplacementMap in='SourceGraphic' scale='1.6'/></filter><path d='M2 5c40-3 90-2 196-1' fill='none' stroke='%234a2f2c' stroke-width='2.4' stroke-linecap='round' filter='url(%23p)'/></svg>");
  --wc-cross:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'><filter id='p' x='-10%' y='-10%' width='120%' height='120%'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='2'/><feDisplacementMap in='SourceGraphic' scale='1.8'/></filter><path d='M9 8c6 7 15 18 23 24M31 9c-7 7-14 14-23 22' fill='none' stroke='%234e403a' stroke-width='2.1' stroke-linecap='round' opacity='.82' filter='url(%23p)'/></svg>");
  --wc-circle:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'><filter id='p' x='-10%' y='-10%' width='120%' height='120%'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='5'/><feDisplacementMap in='SourceGraphic' scale='1.6'/></filter><path d='M22 5c9-1 17 7 17 16s-7 18-17 18S4 31 5 21 13 6 22 5' fill='none' stroke='%236b5b55' stroke-width='1.6' stroke-linecap='round' filter='url(%23p)'/></svg>");
}

/* ---------- paper ---------- */
html:has(> body.wc-paper){background:var(--wc-paper)}
.wc-paper{
  background:var(--wc-paper);
  color:var(--wc-ink);
  position:relative;
  min-height:100vh;
  min-height:100dvh;
}
/* cold-press grain: fine tooth + slow mottling, multiplied over everything (photos included, like a print on paper) */
.wc-paper::after{
  content:"";position:absolute;inset:0;z-index:2147483000;pointer-events:none;mix-blend-mode:multiply;opacity:.75;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .62 0 0 0 0 .52 0 0 0 0 .42 0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='420' height='420'><filter id='m'><feTurbulence type='fractalNoise' baseFrequency='.012' numOctaves='2' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .55 0 0 0 0 .45 0 0 0 0 .36 0 0 0 .18 0'/></filter><rect width='100%' height='100%' filter='url(%23m)'/></svg>");
}
.wc-defs{position:absolute;width:0;height:0;overflow:hidden}

/* ---------- type ---------- */
.wc-title{
  font-family:var(--wc-serif);font-weight:300;font-style:normal;color:var(--wc-ink);
  margin:0;letter-spacing:-.01em;line-height:1.1;text-align:left;
}
.wc-title em{font-style:italic;font-weight:300;color:var(--wc-accent)}
.wc-season{
  font-family:var(--wc-serif);font-weight:300;margin:0;letter-spacing:-.015em;line-height:.95;text-align:left;
  font-size:clamp(3.4rem,15vw,4.7rem);color:var(--wc-ink);
}
.wc-season em{display:block;font-style:italic;font-weight:300;color:var(--wc-accent);padding-left:1.15em}
.wc-hand{font-family:var(--wc-hand);color:var(--wc-pencil);font-weight:400;line-height:1.1}
.wc-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}

/* ---------- wash behind the reveal ---------- */
.wc-wash{
  position:absolute;left:-40px;top:-30px;width:calc(100% + 80px);height:380px;z-index:0;pointer-events:none;
  display:block;filter:url(#wc-bloom);
}
.wc-wash + *{position:relative;z-index:1}

/* ---------- dabs ---------- */
.wc-dab{display:block;background:none;border:0;padding:0;margin:0;user-select:none;-webkit-user-drag:none;-webkit-touch-callout:none}
img.wc-dab{height:auto}
.wc-inline{display:inline-block;width:16px;height:16px;vertical-align:-3px;margin:0 .12em 0 .2em}

/* palette row: dabs loose in height, names + hex on ONE baseline per row */
.wc-dabs{display:flex;align-items:flex-start;margin-left:-6px;flex-wrap:nowrap}
.wc-dabs .wc-sw{flex:none;width:33.333%;max-width:124px;position:relative;min-width:0}
.wc-dabs .wc-sw .dw{height:98px;display:flex;align-items:flex-end}
.wc-dabs .wc-sw .dw .wc-dab{width:88px;height:80px}
.wc-dabs .wc-sw .nm{display:block;font-family:var(--wc-serif);font-size:.9rem;line-height:1.15;margin-top:4px;color:var(--wc-ink);padding-right:8px;overflow-wrap:break-word;hyphens:auto}
.wc-dabs .wc-sw code{display:block;margin-top:1px;font-family:var(--wc-sans);font-size:.72rem;letter-spacing:.06em;color:var(--wc-faint)}
/* the cluster breathes: slightly different sizes and lifts, deterministic per position */
.wc-dabs .wc-sw:nth-child(1) .dw .wc-dab{width:102px;height:90px;margin-left:-2px}
.wc-dabs .wc-sw:nth-child(2) .dw .wc-dab{width:86px;height:78px;margin-left:2px;margin-bottom:6px}
.wc-dabs .wc-sw:nth-child(3) .dw .wc-dab{width:96px;height:84px;margin-left:-4px;margin-bottom:2px}
.wc-dabs.r2{margin-top:10px;margin-left:14px}
.wc-dabs.r2 .wc-sw:nth-child(1) .dw .wc-dab{width:90px;height:82px;margin-left:0;margin-bottom:3px}
.wc-dabs.r2 .wc-sw:nth-child(2) .dw .wc-dab{width:104px;height:92px;margin-left:-6px;margin-bottom:0}
.wc-dabs.r2 .wc-sw:nth-child(3) .dw .wc-dab{width:84px;height:76px;margin-left:2px;margin-bottom:7px}
@media (max-width:359px){ .wc-dabs .wc-sw .dw .wc-dab, .wc-dabs .wc-sw:nth-child(n) .dw .wc-dab, .wc-dabs.r2 .wc-sw:nth-child(n) .dw .wc-dab{width:76px;height:68px} }

/* avoid row: small dabs, pencil × on top, staggered like dabs on a test sheet */
.wc-dabs--small{display:flex;align-items:flex-end;gap:6px;margin:0;max-width:330px}
.wc-dabs--small .wc-avoid:nth-child(2){margin-bottom:6px}
.wc-dabs--small .wc-avoid:nth-child(4){margin-bottom:4px}
.wc-dabs--small .wc-avoid:nth-child(5){margin-bottom:8px}
.wc-avoid{position:relative;display:inline-block;width:46px;height:44px;flex:none}
.wc-avoid .wc-dab{width:46px;height:44px}
.wc-avoid::after{content:"";position:absolute;left:5px;top:3px;width:38px;height:38px;background:var(--wc-cross) no-repeat center/contain;pointer-events:none}

/* small dab counter for progress (replaces a progress bar) */
.wc-counter{display:flex;align-items:center;gap:4px;margin:0}
.wc-counter .wc-dab{width:14px;height:14px;opacity:.28;transition:opacity .35s ease}
.wc-counter .wc-dab.on{opacity:1}

/* ---------- buttons & links ---------- */
.wc-stroke{
  position:relative;display:inline-block;background:none;border:0;cursor:pointer;
  padding:10px 38px 12px 22px;min-height:44px;line-height:1.1;
  font-family:var(--wc-serif);font-style:italic;font-weight:400;font-size:1.25rem;color:var(--wc-ink);
  text-decoration:none;-webkit-tap-highlight-color:transparent;
  background-repeat:no-repeat;background-size:100% 100%;background-position:center;
}
.wc-stroke:focus-visible{outline:2px solid var(--wc-accent);outline-offset:4px;border-radius:14px}
.wc-stroke:active{transform:translateY(1px)}
.wc-stroke[disabled],.wc-stroke[aria-disabled=true]{opacity:.55;cursor:default}
.wc-link{
  display:inline-block;background:none;border:0;padding:8px 0 6px;min-height:44px;cursor:pointer;
  font-family:var(--wc-serif);font-style:italic;font-size:1.12rem;color:var(--wc-ink);text-decoration:none;
  background:var(--wc-line-short) no-repeat left bottom 6px/100% 7px;-webkit-tap-highlight-color:transparent;
}
.wc-link:focus-visible{outline:2px solid var(--wc-accent);outline-offset:4px}
.wc-ul{background:var(--wc-line-short) no-repeat left bottom/100% 6px;padding-bottom:3px}
.wc-chip{
  display:inline-block;background:none;border:0;cursor:pointer;min-height:44px;padding:10px 2px 8px;margin-right:14px;
  font-family:var(--wc-sans);font-size:.98rem;color:var(--wc-muted);-webkit-tap-highlight-color:transparent;
  background:var(--wc-line-short) no-repeat left bottom 8px/100% 6px;
}
.wc-chip[aria-pressed=true],.wc-chip.on{color:var(--wc-ink);background-image:var(--wc-line-thick)}
.wc-chip:focus-visible{outline:2px solid var(--wc-accent);outline-offset:2px}

/* ---------- pencil lines & notes ---------- */
.wc-rule{display:block;height:10px;width:100%;margin:0;background:var(--wc-line) no-repeat left center/100% 10px}
.wc-rule--grow{background-size:calc(var(--p,0) * 100%) 10px;transition:background-size .45s ease}
.wc-note{font-family:var(--wc-hand);color:var(--wc-pencil);font-size:1.3rem;line-height:1.1;font-weight:400;display:inline-block;white-space:nowrap}
.wc-note--tilt{transform:rotate(-2deg)}
.wc-note--tilt-r{transform:rotate(1.5deg)}
.wc-note--block{display:block;white-space:normal;max-width:36ch}
.wc-arrow{display:inline-block;width:50px;height:40px;color:var(--wc-pencil);vertical-align:middle}
.wc-x{display:inline-block;width:22px;height:22px;color:var(--wc-pencil);vertical-align:middle}

/* ---------- torn-paper note ---------- */
.wc-torn{position:relative;padding:26px 26px 26px 28px;margin:26px 10px 0 -2px;isolation:isolate;transform:rotate(-1.1deg)}
.wc-torn::before{content:"";position:absolute;inset:0;background:var(--wc-paper-2);z-index:-1;filter:url(#wc-torn) drop-shadow(0 3px 4px rgba(70,45,35,.14))}
.wc-torn > :first-child{margin-top:0}

/* ---------- the photo as a sheet of paper ---------- */
.wc-sheet{display:block;position:relative;width:100%;margin:0;box-shadow:0 2px 3px rgba(70,45,35,.10),0 10px 24px -12px rgba(70,45,35,.28);background:var(--wc-paper-2)}
.wc-sheet img,.wc-sheet canvas{display:block;width:100%;height:auto}
.wc-marker{
  position:absolute;width:44px;height:44px;margin:-22px 0 0 -22px;pointer-events:none;
  background:var(--wc-circle) no-repeat center/100% 100%;
}
.wc-marker::after{content:"";position:absolute;left:50%;top:50%;width:14px;height:14px;margin:-7px 0 0 -7px;background:var(--c,transparent) no-repeat center/contain}

@media (prefers-reduced-motion:reduce){
  .wc-counter .wc-dab,.wc-rule--grow{transition:none}
  .wc-stroke:active{transform:none}
}
