/* See Through Play: the Color Room. One world: daylight through translucent tiles; colour only arrives as tile light. */
@font-face { font-family: 'Manrope'; src: url('/assets/fonts/manrope-latin.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Syne'; src: url('/assets/fonts/syne-800-latin.woff2') format('woff2'); font-weight: 800; font-display: swap; }

:root {
  --wall: #eef0ec; --wall-2: #e3e6e0; --ink: #17161b; --ink-2: #4a4851; --on-ink: #f3f4f0; --on-ink-2: #b9bbc2;
  --r: #f2384a; --r-deep: #b81427; --b: #2f6bff; --y: #ffc400; --t: #11b5a4;
  --wash-r: #f6d3d3; --wash-b: #d6e0f5; --wash-y: #f6e7b8;
  --shade: rgb(23 22 27 / .16); --tile-r: rgb(242 56 74 / .22); --tile-r-edge: rgb(184 20 39 / .5);
  --display: 'Syne', 'Arial Black', sans-serif; --body: 'Manrope', system-ui, sans-serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --gutter: clamp(16px, 4vw, 64px); --max: 1280px; --measure: 68ch;
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scrollbar-color: var(--ink-2) var(--wall-2); accent-color: var(--r-deep); caret-color: var(--r-deep); }
body { margin: 0; background: var(--wall); color: var(--ink); font: 400 17px/1.6 var(--body); }
::selection { background: var(--wash-r); color: var(--ink); }
img { max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--b); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; text-wrap: balance; overflow-wrap: break-word; min-width: 0; margin: 0; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: var(--s4); top: -100px; background: var(--ink); color: var(--on-ink); padding: var(--s3) var(--s4); z-index: 10; }
.skip:focus { top: var(--s4); }

/* Buttons */
.btn { font: 700 1rem/1 var(--body); padding: var(--s4) var(--s5); min-height: 48px; border: 2px solid var(--ink); background: var(--ink); color: var(--on-ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
.btn:hover { background: var(--r-deep); border-color: var(--r-deep); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn[aria-disabled="true"] { background: var(--wall-2); border-color: var(--wall-2); color: var(--ink-2); cursor: default; }
[hidden] { display: none !important; }
.btns { display: flex; flex-wrap: wrap; gap: var(--s3); }

/* Header (inner pages sit it on the wall; the home hero floats it over the fields) */
.top { position: relative; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: var(--s4); padding: var(--s5) var(--gutter); max-width: var(--max); margin: 0 auto; }
.top .mark { white-space: nowrap; font: 800 1.05rem/1 var(--display); text-decoration: none; background: var(--wall); padding: var(--s2) var(--s3); display: inline-flex; align-items: center; gap: var(--s2); }
.top .mark img { width: 20px; height: 20px; display: block; flex: none; }
.top nav { display: flex; gap: var(--s2); }
.top nav a { white-space: nowrap; font: 600 .95rem/1 var(--body); text-decoration: none; background: var(--wall); padding: var(--s3) var(--s4); min-height: 44px; display: inline-flex; align-items: center; }
.top nav a:hover, .top nav a[aria-current="page"] { background: var(--ink); color: var(--on-ink); }
/* The shop link is the one filled item in the menu, so the printables are easy to find. */
.top nav a[href="/magnetic-tile-printables/"] { background: var(--ink); color: var(--on-ink); }
.top nav a[href="/magnetic-tile-printables/"]:hover { background: var(--r-deep); }

/* Fields: translucent tiles laid over the page */
.f { position: absolute; mix-blend-mode: multiply; pointer-events: none; }

/* Home hero */
.room { position: relative; height: 100svh; min-height: 620px; max-height: 1000px; overflow: hidden; isolation: isolate; }
.room .top { position: absolute; z-index: 2; inset: 0 0 auto 0; max-width: none; }
.room .print { position: absolute; right: 5vw; top: 40vh; width: min(30vh, 280px); aspect-ratio: 1; transform: rotate(-4deg); box-shadow: 0 14px 30px var(--shade); z-index: 1; }
.room .print img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.room .print .red { clip-path: inset(0 0 0 46%); }
.room .print i { position: absolute; top: -6%; bottom: -6%; left: 46%; right: -6%; background: var(--tile-r); box-shadow: inset 0 0 0 3px var(--tile-r-edge), 0 8px 18px var(--shade); }
.room .f1 { background: var(--r); opacity: .9; width: 52vw; height: 70vh; left: -6vw; top: -8vh; transform: rotate(-8deg); }
.room .f2 { background: var(--b); opacity: .8; width: 44vw; height: 80vh; left: 34vw; top: 14vh; transform: rotate(6deg); }
.room .f3 { background: var(--y); opacity: .9; width: 46vw; height: 54vh; right: -10vw; top: -10vh; transform: rotate(-3deg); }
.room .f4 { background: var(--t); opacity: .75; width: 30vw; height: 30vw; right: 6vw; bottom: -12vw; transform: rotate(14deg); }
.room .title { position: absolute; z-index: 2; left: var(--gutter); bottom: clamp(24px, 6vh, 64px); width: min(600px, calc(100% - 2 * var(--gutter))); background: var(--wall); padding: var(--s6); }
.room h1 { font-size: clamp(2.6rem, 6vw, 5rem); line-height: .92; margin-bottom: var(--s4); }
.room .title p { margin: 0 0 var(--s5); max-width: 34ch; font-size: 1.1rem; }

/* Bands */
.band { position: relative; padding: clamp(64px, 9vw, 120px) 0; isolation: isolate; overflow-x: clip; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.band h2 { font-size: clamp(2.1rem, 4.4vw, 3.8rem); line-height: .98; margin-bottom: var(--s5); }
.band p { max-width: 46ch; }
.stage { position: relative; justify-self: center; width: min(100%, 460px); }
.stage .f { inset: 10% -12% -10% 14%; background: var(--b); opacity: .55; transform: rotate(5deg); z-index: -1; }
.stage .f.y { inset: -8% 30% 46% -10%; background: var(--y); opacity: .6; transform: rotate(-7deg); }
.ink { background: var(--ink); color: var(--on-ink); }
.ink .lede { color: var(--on-ink-2); margin: 0; }
.ink .rv-status { color: var(--on-ink-2); }

/* Reveal demo */
.rv { margin: 0; }
.rv-stage { position: relative; aspect-ratio: 1; overflow: hidden; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; box-shadow: 0 12px 30px var(--shade); }
.rv-stage img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rv-tile { position: absolute; padding: 0; margin: 0; border: 0; background: var(--tile-r); box-shadow: inset 0 0 0 3px var(--tile-r-edge); mix-blend-mode: multiply; cursor: grab; touch-action: none; }
.rv-tile:focus-visible { outline: 3px solid var(--b); outline-offset: 3px; }
.rv-controls { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.rv-controls button { font: 700 .95rem/1 var(--body); min-height: 44px; padding: 0 var(--s4); border: 2px solid var(--ink); background: var(--wall); color: var(--ink); cursor: pointer; }
.rv-controls button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.rv-status { margin: var(--s2) 0 0; font-size: .95rem; color: var(--ink-2); }

/* Post cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); margin-top: var(--s7); }
.card { text-decoration: none; display: flex; flex-direction: column; gap: var(--s3); }
.card .pane { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--wall); }
.card .pane img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .pane::after { content: ""; position: absolute; mix-blend-mode: multiply; background: var(--wash-r); width: 64%; height: 120%; left: -14%; top: -10%; transform: rotate(-8deg); }
.card:nth-child(3n+2) .pane::after { background: var(--wash-b); width: 70%; height: 70%; left: auto; top: auto; right: -10%; bottom: -14%; transform: rotate(10deg); }
.card:nth-child(3n) .pane::after { background: var(--wash-y); width: 120%; height: 46%; left: -10%; top: -12%; transform: rotate(-4deg); }
.cards .card :is(h2, h3) { font-size: 1.45rem; line-height: 1.08; margin: 0; }
.card:hover :is(h2, h3) { text-decoration: underline; text-decoration-thickness: 2px; }
.card .meta { font-size: .95rem; color: var(--ink-2); }
.ink .card .meta { color: var(--on-ink-2); }
.ink .card:focus-visible { outline-color: var(--y); }
.empty { margin-top: var(--s6); padding: var(--s6); border: 2px dashed currentColor; max-width: 46ch; }

/* Shop band */
.shop .fr { background: var(--r); opacity: .55; width: min(46vw, 620px); aspect-ratio: 1; left: -6vw; top: 12%; transform: rotate(10deg); z-index: -1; }
.pages { position: relative; aspect-ratio: 1 / 1.05; width: min(100%, 520px); }
.pages img { position: absolute; width: 64%; box-shadow: 0 16px 36px var(--shade); }
.pages img:first-child { left: 0; top: 0; }
.pages img:last-child { right: 0; bottom: 0; }
.fact { font: 800 1.2rem/1.3 var(--display); margin: 0 0 var(--s3); }

/* Inner pages */
.page-head { padding: var(--s7) 0 var(--s6); position: relative; isolation: isolate; overflow-x: clip; }
.page-head .f { width: 38vw; max-width: 520px; aspect-ratio: 1.2; right: -6vw; top: -30%; transform: rotate(-8deg); background: var(--y); opacity: .7; z-index: -1; }
.page-head h1 { font-size: clamp(2.4rem, 5.6vw, 4.6rem); line-height: .95; max-width: 16ch; margin-bottom: var(--s4); }
.page-head p { font-size: 1.15rem; max-width: 50ch; margin: 0; }
.crumbs { font-size: .95rem; color: var(--ink-2); margin-bottom: var(--s4); }
.crumbs a { color: var(--ink-2); }
.grid-puzzles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); }
.steps li { counter-increment: s; border-top: 2px solid var(--ink); padding-top: var(--s4); }
.steps li::before { content: counter(s); font: 800 2.4rem/1 var(--display); display: block; margin-bottom: var(--s3); color: var(--r-deep); }
.faq { max-width: var(--measure); }
.faq h3 { font-size: 1.3rem; margin: var(--s6) 0 var(--s2); }
.faq p { margin: 0; }

/* Article */
.article { max-width: var(--measure); padding-bottom: var(--s9); }
.article .lead-art { margin: 0 0 var(--s7); }
.article .lead-art img { width: 100%; display: block; }
.prose { font-size: 1.1rem; line-height: 1.7; }
.prose h2 { font-size: 1.9rem; line-height: 1.1; margin: var(--s7) 0 var(--s4); }
.prose h3 { font-size: 1.35rem; margin: var(--s6) 0 var(--s3); }
.prose p, .prose ul, .prose ol { margin: 0 0 var(--s5); }
.prose li { margin-bottom: var(--s2); }
.prose img { display: block; margin: var(--s6) 0; }
.prose figure { margin: var(--s6) 0; }
.prose figcaption { font-size: .95rem; color: var(--ink-2); margin-top: var(--s2); }
.byline { font-size: .95rem; color: var(--ink-2); margin-top: var(--s4); }

/* Footer */
.foot { border-top: 2px solid var(--ink); }
.foot .wrap { padding-top: var(--s5); padding-bottom: var(--s8); display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s3) var(--s6); font-size: .95rem; color: var(--ink-2); }
.foot nav { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); }

@media (max-width: 860px) {
  .room { height: auto; min-height: 0; max-height: none; padding: 340px 0 var(--s6); }
  .room .print { right: auto; left: 50%; top: 112px; width: 190px; margin-left: -95px; }
  .room .f1 { width: 80vw; height: 300px; left: -10vw; top: -40px; } .room .f2 { width: 70vw; height: 360px; left: 46vw; top: 120px; } .room .f3 { width: 60vw; height: 200px; } .room .f4 { width: 50vw; height: 50vw; bottom: -10vw; }
  .top .mark { font-size: .95rem; }
  .top nav a:not(:last-child) { display: none; }
  .top nav .wide { display: none; }
  .room .title { position: relative; left: 0; bottom: 0; margin: 0 var(--gutter); width: auto; padding: var(--s5); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .stage { order: 2; width: min(100%, 400px); }
  .cards, .grid-puzzles, .steps { grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
  .card { flex-direction: row; gap: var(--s4); align-items: center; }
  .card .pane { width: 38%; flex: none; }
  .cards .card :is(h2, h3) { font-size: 1.15rem; }
  .shop .fr { width: 80vw; }
  .pages { width: min(100%, 400px); justify-self: center; }
  .page-head .f { width: 60vw; top: -10%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Free bundle: corner button and dialog */
.claim { position: fixed; right: var(--s4); bottom: var(--s4); z-index: 20; background: var(--r-deep); border-color: var(--r-deep); box-shadow: 0 6px 20px var(--shade); }
.claim:hover { background: var(--ink); border-color: var(--ink); }
.claim[hidden], .claim-dialog label[hidden] { display: none; }
.claim-dialog form { padding: var(--s6); }
.claim-dialog { width: min(92vw, 460px); padding: 0; border: 2px solid var(--ink); background: var(--wall); color: var(--ink); }
.claim-dialog::backdrop { background: rgb(23 22 27 / .55); }
.claim-dialog h2 { margin: 0 0 var(--s3); font: 800 1.6rem/1.1 var(--display); }
.claim-dialog p { margin: 0 0 var(--s4); }
.claim-dialog label { display: block; margin: 0 0 var(--s4); font-weight: 700; }
.claim-dialog input[type="email"] { display: block; width: 100%; margin-top: var(--s2); min-height: 48px; padding: 0 var(--s3); font: 400 1rem var(--body); border: 2px solid var(--ink); background: #fff; color: var(--ink); }
.claim-dialog .check { display: flex; gap: var(--s3); align-items: flex-start; font-weight: 400; font-size: .95rem; }
.claim-dialog .check input { width: 22px; height: 22px; flex: none; margin: 2px 0 0; }
.claim-dialog .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.claim-msg { min-height: 1.5em; font-weight: 700; }
@media (max-width: 520px) { .claim { padding: var(--s3) var(--s4); min-height: 44px; font-size: .95rem; } }
