/* The landing page's craft layer: the design ideas Harry picked, made permanent. Dot-grid notebook paper
   over a cutting mat, inflated comic headings, pressed-clay buttons, poster paint and felt on the frames,
   glossy clay slabs, torn paper edges, wobbly hand-cut corners, tilted posters, ruler ticks, paper clips,
   stickers peeking over the frames, a pencil cursor and a giant footer wordmark. craft.js adds the pieces
   that need markup or script. */

/* ── Page: dot-grid notebook over a cutting mat ──────────────────────────── */
body { --pg: #fbf9f3; background-color: var(--pg);
  background-image: radial-gradient(#c8c2b4 1.3px, transparent 1.6px), linear-gradient(rgba(0, 0, 0, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 0, 0, 0.045) 1px, transparent 1px);
  background-size: 24px 24px, 120px 120px, 120px 120px; background-position: 12px 12px, 0 0, 0 0; }

/* ── Spacing: headings sit close to their frames, sections closer together ── */
.sec { position: relative; padding-top: clamp(56px, 7vw, 104px); }
.sec-head { margin-bottom: clamp(14px, 1.8vw, 24px); gap: 12px 40px; }
.sec-head .body { padding-bottom: 0.4em; }
.shelf { margin-top: 14px; }
.end-sec { padding-top: clamp(80px, 8vw, 120px); }

/* ── Headings: inflated comic letters ─────────────────────────────────────── */
.sec-head .h2, .cta .h2 { color: var(--sun); paint-order: stroke fill; -webkit-text-stroke: 0.09em var(--ink); text-shadow: 0.05em 0.07em 0 var(--ink); letter-spacing: -0.03em; line-height: 1.02; }
.cta .h2 { color: var(--white); }

/* ── Navbar: just the wordmark and two plain text links. It sticks to the top as you scroll, on a pale
   strip the colour of the page (solid, not a live blur, so scrolling stays smooth). ── */
.top { position: sticky; top: 0; z-index: 60; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding-top: 8px; pointer-events: none; }
.top .wrap { height: auto; display: block; }
.navbar { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 14px; border-radius: 999px;
  background: color-mix(in srgb, var(--pg, #fbf9f3) 94%, transparent); }
.navbar .brand { display: inline-flex; align-items: center; gap: 2px; color: var(--ink); text-decoration: none; }
.brand .wm-small { font-size: 16px; font-weight: 700; letter-spacing: -0.04em; white-space: nowrap; }
.brand .wm-h { width: auto !important; height: 44px !important; margin: -6px 0 -6px !important; }
/* Plain text links, underlined in sun yellow when pointed at. */
.navbar .nav { margin-left: auto; gap: 26px; }
.navbar .nav a { padding: 6px 0; border-radius: 0; font-size: 17px; font-weight: 600; color: var(--ink); text-decoration: none;
  background: linear-gradient(var(--sun), var(--sun)) 0 88% / 0 35% no-repeat; transition: background-size 0.25s; }
.navbar .nav a:hover, .navbar .nav a[aria-current="page"] { background-color: transparent; background-size: 100% 35%; }
@media (max-width: 560px) {
  .brand .wm-small { font-size: 12px; } .brand .wm-h { height: 32px !important; }
  .navbar .nav { gap: 16px; } .navbar .nav a { font-size: 15px; }
}

/* ── Buttons: simple clay pills, all one height and size so they line up wherever they sit together ── */
/* One flat colour, a thin darker edge along the bottom, a small lift when pointed at. Pink for the main
   action, cream for the rest. */
.btn { --clay: #fff7e8; --deep: #d9c7a0; --lab: var(--ink); min-height: 50px; padding: 0 24px; gap: 8px; font-size: 17px; line-height: 1; justify-content: center; white-space: nowrap; vertical-align: middle;
  border: 0; border-radius: 999px; background: var(--clay) !important; color: var(--lab); font-weight: 650; text-shadow: none;
  box-shadow: 0 3px 0 var(--deep); transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s; }
.btn.solid { --clay: #ec5f86; --deep: #b8405f; --lab: var(--white); color: var(--lab); }
.btn.on-color { --clay: #fff7e8; --deep: #d9c7a0; color: var(--lab); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--deep); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--deep); transition-duration: 0.05s; }
@media (prefers-reduced-motion: reduce) { .btn, .btn:hover, .btn:active { transition: none; transform: none; } }

/* ── Frames: poster paint (craft.js adds .paint), felt, glossy slabs, press in ── */
.frame > .b-cursor { position: absolute; z-index: 9; }
:is(.frame, .loop-posters, .cta) { background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 5px), repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.08) 0 2px, transparent 2px 5px);
  box-shadow: inset 0 10px 18px -6px rgba(255, 255, 255, 0.55), inset 0 -14px 22px -8px rgba(0, 0, 0, 0.22); }
:is(.pc, .lp) { box-shadow: inset 0 6px 10px -6px rgba(255, 255, 255, 0.6), inset 0 -8px 14px -8px rgba(0, 0, 0, 0.2); }
/* Frames press in the first time they come on screen. */
.craft-in .pressable { transition: scale 0.7s cubic-bezier(0.3, 1.6, 0.5, 1), rotate 0.7s cubic-bezier(0.3, 1.6, 0.5, 1), opacity 0.4s; }
.craft-in .pressable:not(.seen) { scale: 0.93; rotate: -1deg; opacity: 0.45; }
@media (prefers-reduced-motion: reduce) { .craft-in .pressable:not(.seen) { scale: 1; rotate: 0deg; opacity: 1; } }

/* ── Torn paper edges and wobbly hand-cut corners ────────────────────────── */
:is(.panel, .pc, .lp) { -webkit-mask: linear-gradient(#000, #000) top / 100% calc(100% - 7px) no-repeat, radial-gradient(circle 5px at 50% 0, #000 96%, #0000) bottom / 13px 8px repeat-x; mask: linear-gradient(#000, #000) top / 100% calc(100% - 7px) no-repeat, radial-gradient(circle 5px at 50% 0, #000 96%, #0000) bottom / 13px 8px repeat-x; }
:is(.frame, .loop-posters, .cta) { border-radius: 42px 24px 48px 20px / 26px 44px 22px 38px; }
:is(.panel, .lp) { border-radius: 14px 6px 18px 8px / 8px 16px 6px 14px; }
.pc { border-radius: 16px 6px 20px 9px / 9px 18px 7px 16px; }
:is(.all-insp, .tile, .insp-art) { border-radius: 18px 9px 20px 11px / 11px 18px 9px 20px; }

/* ── Tilted posters: each at its own angle and nudge (set in home.js) ────── */
.pc { rotate: var(--tilt, 0deg); translate: var(--nx, 0) var(--ny, 0); }
.wall { padding: 10px 6px; }
@media (max-width: 620px) { .pc { rotate: calc(var(--tilt, 0deg) * 0.6); translate: 0 0; } }

/* ── Ruler ticks along the top of each frame ─────────────────────────────── */
.ruler-ticks { position: absolute !important; z-index: 2 !important; left: 30px; right: 30px; top: 0; height: 12px; pointer-events: none; opacity: 0.55; color: var(--white);
  background: linear-gradient(90deg, currentColor 1.5px, transparent 1.5px) 0 0 / 50px 12px repeat-x, linear-gradient(90deg, currentColor 1px, transparent 1px) 0 0 / 10px 6px repeat-x; }
.frame.sun .ruler-ticks, .loop-posters .ruler-ticks { color: var(--ink); }

/* ── Paper clips, pins and binder clips on some panels (craft.js varies them) ── */
.clip { position: absolute; z-index: 6; pointer-events: none; height: auto; filter: drop-shadow(1px 3px 2px rgba(0, 0, 0, 0.25)); }
.clip.binder { width: 44px; height: 30px; filter: none; }
.clip.binder::before { content: ""; position: absolute; inset: 8px 0 0; border-radius: 4px 4px 6px 6px; background: linear-gradient(#2b2b2b, #111); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25); }
.clip.binder::after { content: ""; position: absolute; left: 7px; right: 7px; top: -6px; height: 18px; border: 3px solid #9aa0a6; border-bottom: 0; border-radius: 10px 10px 0 0; }

/* ── Stickers peeking round the side of each frame, and draggable ────────── */
.sec-peek { position: absolute !important; z-index: 6 !important; width: clamp(80px, 8.5vw, 124px); top: 34%; pointer-events: auto; cursor: grab; touch-action: none; translate: var(--dx, 0px) var(--dy, 0px); }
.sec-peek.right { right: clamp(-58px, -3.6vw, -26px); rotate: 14deg; }
.sec-peek.left { left: clamp(-58px, -3.6vw, -26px); rotate: -14deg; }
/* Over the top edge, in the gap between the heading (left) and its intro (right), so it covers neither. */
.sec-peek.top { top: auto; bottom: calc(100% - 24px); rotate: -4deg; } .sec-peek.top.l { left: 37%; } .sec-peek.top.r { left: 40%; rotate: 5deg; }
@media (max-width: 760px) { .sec-peek { width: 64px; top: -36px; } .sec-peek.right { right: 14px; } .sec-peek.left { left: 14px; } }
.st { cursor: grab; touch-action: none; margin-left: var(--dx, 0px); margin-top: var(--dy, 0px); }
:is(.st, .sec-peek).dragging { cursor: grabbing; z-index: 20 !important; filter: drop-shadow(0 12px 10px rgba(40, 30, 10, 0.3)); }
.boing { animation: boing 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes boing { 0% { scale: 1; } 30% { scale: 1.08 0.9; } 60% { scale: 0.97 1.04; } 100% { scale: 1; } }

/* ── Pencil cursor: a real CSS cursor (no lag), with a sparkle over anything clickable ── */
html, body { cursor: url(cursor-pencil.png) 2 29, auto; }
:is(a, button, label, summary, select, .tile, .open, .drw, [role="button"], input[type="range"], input[type="checkbox"]), :is(a, button) * { cursor: url(cursor-pencil-go.png) 2 29, pointer; }
:is(input:not([type="range"]):not([type="checkbox"]), textarea) { cursor: text; }
:is(.st, .sec-peek) { cursor: url(cursor-pencil-go.png) 2 29, grab; }
:is(.st, .sec-peek).dragging { cursor: grabbing; }
.scribble-mark { position: fixed; z-index: 199; width: 46px; height: 24px; margin: -12px 0 0 -4px; pointer-events: none; color: #3a3a46; }
.scribble-mark path { stroke-dasharray: 90; stroke-dashoffset: 90; animation: scrib 0.35s ease-out forwards, fadeout 1.2s ease-in 0.5s forwards; }
@keyframes scrib { to { stroke-dashoffset: 0; } }
@keyframes fadeout { to { opacity: 0; } }

/* ── Footer: the links in a row, then the clay wordmark huge, stickers lounging on it ── */
.site-foot { padding: clamp(60px, 7vw, 100px) 0 0; overflow: hidden; }
.foot-row { display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; }
.foot-row .brand { text-decoration: none; color: var(--ink); }
.foot-row .wm-h { height: 44px !important; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot-links a { text-decoration: none; color: var(--ink); font-size: 16px; background: linear-gradient(var(--sun), var(--sun)) 0 100% / 0 40% no-repeat; transition: background-size 0.25s; }
.foot-links a:hover { background-size: 100% 40%; }
.bigclay-wrap { position: relative; width: min(1240px, 96vw); margin: clamp(24px, 4vw, 48px) auto -6%; }
.bigclay { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.st.lounge { translate: -50% -100%; z-index: 2; cursor: grab; }
.foot { padding-bottom: 0; }

/* ── Made for real screens ───────────────────────────────────────────────── */
.uses-frame { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.use { padding: 18px; display: flex; flex-direction: column; gap: 8px; min-height: 220px; }
.use > b { font-size: 18px; letter-spacing: -0.03em; }
.use p { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; } .use p img:last-child:not(:first-child) { margin-left: auto; }
.use.empty, .use.reward { align-items: center; justify-content: center; text-align: center; } .use.empty span, .use.reward span { color: var(--mute); font-size: 14px; }
.use.react .msg { background: var(--paper); padding: 10px 14px; border-radius: 4px 16px 16px 16px; }
.use.react div { display: flex; gap: 6px; flex-wrap: wrap; } .use.react div span { display: inline-flex; align-items: center; gap: 4px; background: var(--paper); border-radius: 999px; padding: 3px 9px 3px 5px; font: 600 12px var(--mono); }
@media (max-width: 900px) { .uses-frame { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .uses-frame { grid-template-columns: minmax(0, 1fr); } .use { min-height: 0; } }
/* ── The browser's size slider ───────────────────────────────────────────── */
.sizer { display: flex; grid-area: search; justify-self: end; align-self: center; align-items: center; gap: 8px; margin-right: 70px; z-index: 2; }
.sizer input { width: 110px; accent-color: var(--ink); } .sizer output { font: 12px var(--mono); width: 2.5ch; }
.tile .cell { scale: var(--tz, 1); }
.all-grid { grid-template-columns: repeat(auto-fill, minmax(calc(76px * var(--tz, 1)), 1fr)) !important; }
@media (max-width: 680px) { .sizer { grid-area: auto; justify-self: start; margin: 0; } }

.btns { align-items: center; }
/* A text link that sits in a row of buttons: the same height, so its words line up with theirs. */
/* One underline under the whole link (a text-decoration would break at the gap before the count). */
.btn.link { --u: var(--sun); padding: 0 6px; box-shadow: none; text-decoration: none; background: linear-gradient(var(--u), var(--u)) 6px calc(50% + 0.78em) / calc(100% - 12px) 2.5px no-repeat !important; }
.btn.link:hover { --u: currentColor; box-shadow: none; }
/* The size slider sits over the right end of the search bar, so the "found" count stops short of it. */
@media (min-width: 681px) { .search .count { margin-right: 210px; } }
