/* Pieceling Puzzles - site.css
   Tokens from tokens.json. Two grounds: Cream (default) and Charcoal (.charcoal).
   Hard rules: tokens-only colours, brass gradient only on plaques, 1px hairlines
   at 10%, control outlines at 30%, shadows only on loose pieces and frames. */

/* ---------- fonts (Source Serif 4, SIL OFL, self-hosted; opsz axis on) ---------- */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(../fonts/source-serif-4-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(../fonts/source-serif-4-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/source-serif-4-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/source-serif-4-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- tokens ---------- */
:root {
  --ground: #F0EBDE;
  --text: #1C1C1E;
  --hairline: rgba(28,28,30,0.10);
  --outline: rgba(28,28,30,0.30);
  --underline: rgba(28,28,30,0.35);
  --button-fill: rgb(28,28,31);
  --button-text: #F0EBDE;
  --frame-shadow: 0 2px 4px rgba(28,20,10,0.16), 0 28px 56px -16px rgba(28,20,10,0.40);

  --board: #3E4A57;
  --frame: #1C1C1E;
  --fillet: rgba(237,233,225,0.14);
  --brass: linear-gradient(180deg, #D9BC74 0%, #A9863F 100%);
  --engraving: rgb(41,31,13);
  --engraving-highlight: 0 1px 0 rgba(255,238,196,0.35);

  --serif: 'Source Serif 4', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Helvetica, sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1);
}
.charcoal {
  --ground: #232325;
  --text: #EDE9E1;
  --hairline: rgba(237,233,225,0.10);
  --outline: rgba(237,233,225,0.30);
  --underline: rgba(237,233,225,0.35);
  --button-fill: #EDE9E1;
  --button-text: #1C1C1E;
  --frame-shadow: 0 0 0 1px rgba(237,233,225,0.08), 0 2px 4px rgba(0,0,0,0.30), 0 28px 56px -16px rgba(0,0,0,0.60);
}

/* ---------- base ---------- */
html { scroll-behavior: smooth; }
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.skip-link {
  position: absolute; left: 16px; top: 16px; z-index: 20;
  transform: translateY(-200%);
  padding: 8px 12px; border-radius: 8px;
  background: var(--button-fill); color: var(--button-text);
  font: 500 15px/20px var(--sans); text-decoration: none;
}
.skip-link:focus { transform: none; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- type ---------- */
.eyebrow { font: 500 15px/20px var(--sans); }
.h1 { font: 600 clamp(48px,8vw,112px)/1.02 var(--serif); letter-spacing: -0.022em; text-wrap: balance; max-width: 12ch; }
.h2 { font: 600 clamp(40px,6vw,80px)/1.04 var(--serif); letter-spacing: -0.018em; text-wrap: balance; }
.h3 { font: 600 24px/32px var(--serif); }
.h4 { font: 600 28px/36px var(--serif); }
.lead { font: 400 clamp(19px,1.9vw,24px)/1.45 var(--sans); max-width: 34em; text-wrap: pretty; }
.body { font: 400 17px/26px var(--sans); text-wrap: pretty; }
.small { font: 400 15px/24px var(--sans); }
.caption { font: 400 12px/16px var(--sans); }
.muted { opacity: 0.6; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 20px; border-radius: 8px;
  font: 500 15px/20px var(--sans); text-decoration: none; cursor: pointer;
  white-space: nowrap; flex: none;
}
.btn-primary { border: none; background: var(--button-fill); color: var(--button-text); }
.btn-primary:hover, .btn-primary:active { opacity: 0.86; }
.btn-secondary { border: 1px solid var(--outline); background: transparent; color: var(--text); }
.btn-secondary:hover { border-color: var(--text); }
.link {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
  text-decoration-color: var(--underline);
}
.link:hover { text-decoration-color: var(--text); }
.field {
  height: 40px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--outline); background: transparent; color: var(--text);
  font: 400 15px/20px var(--sans); outline: none; width: 100%;
}
.field::placeholder { color: var(--text); opacity: 0.55; }
.field:focus { border-color: var(--text); }
.field:focus-visible { outline: none; }
.label { font: 500 13px/20px var(--sans); }
.tag { font: 500 13px/20px var(--sans); border: 1px solid var(--outline); border-radius: 8px; padding: 5px 12px; }

/* ---------- header ---------- */
.site-header { background: var(--ground); color: var(--text); }
.site-header .inner {
  max-width: 1280px; margin: 0 auto; padding: 28px 40px;
  display: flex; justify-content: space-between; align-items: center; gap: 20px 40px; flex-wrap: wrap;
}
.site-nav { display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap; font: 400 14px/20px var(--sans); }
.site-nav a { text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }

/* Logo 3b "Signature". S = font-size; minimum 48px. */
.logo { font-size: 48px; line-height: 1; text-decoration: none; color: inherit; display: block; }
.logo .stack { display: inline-flex; flex-direction: column; align-items: stretch; gap: 0.16em; }
.logo .word {
  font-family: var(--serif); font-weight: 600; line-height: 1; letter-spacing: -0.012em;
  white-space: nowrap; display: inline-block;
}
.logo .dot { position: relative; display: inline-block; }
.logo .dot svg {
  position: absolute; left: 50%; top: 0.12em; width: 0.17em; height: 0.17em;
  transform: translateX(-44%); overflow: visible;
}
.logo .rule { display: block; height: max(1px, 0.008em); background: currentColor; opacity: 0.35; }
.logo .row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.2em;
  font-family: var(--serif); line-height: 1.2; white-space: nowrap;
}
.logo .puzzles { font-size: 0.2em; font-weight: 600; letter-spacing: 0.42em; }
.logo .made { font-size: 0.13em; font-style: italic; letter-spacing: 0.02em; }

/* ---------- sections ---------- */
.section {
  background: var(--ground); color: var(--text);
  padding: clamp(100px,14vw,180px) 40px;
  border-top: 1px solid var(--hairline);
}
.section > .inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; flex-direction: column; gap: clamp(60px,8vw,100px);
}
.head { display: flex; flex-direction: column; gap: 24px; max-width: 880px; }
.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 40px; }
.point { border-top: 1px solid var(--hairline); padding-top: 24px; display: flex; flex-direction: column; gap: 12px; }

/* hero */
.hero {
  background: var(--ground); color: var(--text);
  padding: clamp(60px,9vw,120px) 40px clamp(100px,12vw,160px);
}
.hero .inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: clamp(48px,6vw,80px); text-align: center;
}
.hero .head { align-items: center; max-width: none; }
.hero .lead { max-width: 32em; }
.hero .board-wrap { width: 100%; max-width: 900px; display: flex; flex-direction: column; gap: 20px; align-items: center; }

/* artists */
.artists-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%,380px),1fr)); gap: 80px; align-items: center; }
.stats { display: flex; flex-direction: column; gap: 40px; }
.stat { font: 600 clamp(72px,10vw,136px)/0.95 var(--serif); letter-spacing: -0.03em; }
.stat-body { font: 400 19px/28px var(--sans); max-width: 22em; text-wrap: pretty; }
.invite { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.framed-column { display: flex; flex-direction: column; align-items: center; gap: 40px; padding: 20px 0; }

/* framed picture + plaque */
.frame { background: var(--frame); padding: 22px; box-shadow: var(--frame-shadow); }
.frame .fillet { border: 1px solid var(--fillet); padding: 3px; }
.frame-artist { width: min(100%, 360px); }
.plaque {
  background: var(--brass); padding: 14px 28px 15px; border-radius: 2px;
  color: var(--engraving); text-shadow: var(--engraving-highlight);
  text-align: center; display: flex; flex-direction: column; gap: 2px; white-space: nowrap;
}
.plaque .name { font: 600 17px/20px var(--serif); }
.plaque .title { font: italic 400 14px/20px var(--serif); }
.plaque .detail { font: 400 12px/16px var(--serif); letter-spacing: 0.02em; }

/* placeholders: hairline outline, no fill, a caption */
.placeholder {
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 1px solid var(--hairline); width: 100%; padding: 12px;
  font: 400 12px/16px var(--sans); opacity: 0.6;
}
.placeholder.on-frame { border: none; color: #EDE9E1; }
.ratio-4-5 { aspect-ratio: 4 / 5; }
.ratio-5-4 { aspect-ratio: 5 / 4; }
.ratio-4-3 { aspect-ratio: 4 / 3; }

/* devices */
.devices-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%,320px),1fr)); gap: 60px; align-items: end; }
.device { display: flex; flex-direction: column; gap: 20px; }
.cq { container-type: inline-size; width: 100%; }
.ipad { background: #1C1C1E; border-radius: 4.4cqw; padding: 2cqw; box-shadow: 0 0 0 1px var(--hairline); }
.ipad .screen { position: relative; aspect-ratio: 4 / 3; border-radius: 2.4cqw; overflow: hidden; background: var(--board); }
.ipad .screen .board { position: absolute; inset: 0; width: 100%; height: 100%; }
.ipad .overlay {
  position: absolute; left: 0; right: 0; top: 0; height: 6cqw;
  display: flex; align-items: center; justify-content: space-between; padding: 0 3cqw;
  color: #EDE9E1; font: 500 1.5cqw/1 var(--sans); pointer-events: none;
}
.ipad .overlay .title { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.7cqw; }
.mac .bezel {
  width: 86%; margin: 0 auto; background: #1C1C1E; border-radius: 2.4cqw 2.4cqw 0 0;
  padding: 1.5cqw 1.5cqw 2.2cqw; box-shadow: 0 0 0 1px var(--hairline);
}
.mac .screen { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 0.4cqw; }
.mac .finish-screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: #F0EBDE; color: #1C1C1E; }
.mac .titlebar {
  height: 4cqw; flex: none; display: flex; align-items: center; gap: 0.8cqw; padding: 0 1.4cqw;
  border-bottom: 1px solid rgba(28,28,30,0.10);
}
.mac .titlebar .dot { width: 1cqw; height: 1cqw; border-radius: 50%; border: 1px solid rgba(28,28,30,0.30); }
.mac .titlebar .name { flex: 1; text-align: center; font: 500 1.3cqw/1 var(--sans); }
.mac .titlebar .spacer { width: 4.6cqw; }
.mac .stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.6cqw; }
.mac .frame-small { background: #1C1C1E; padding: 1.6cqw; box-shadow: 0 1px 2px rgba(28,20,10,0.16), 0 1.6cqw 3.2cqw -1cqw rgba(28,20,10,0.40); }
.mac .frame-small .fillet { border: 1px solid var(--fillet); padding: 0.25cqw; }
.mac .frame-small img { width: 30cqw; height: auto; aspect-ratio: 800 / 637; object-fit: cover; }
.mac .plaque { padding: 1cqw 2cqw 1.1cqw; gap: 0.15cqw; }
.mac .plaque .name { font: 600 1.3cqw/1.2 var(--serif); }
.mac .plaque .title { font: italic 400 1.05cqw/1.3 var(--serif); }
.mac .plaque .detail { font: 400 0.9cqw/1.3 var(--serif); letter-spacing: 0.02em; }
.mac .base { height: 1.8cqw; background: #1C1C1E; border-radius: 0 0 1.4cqw 1.4cqw; box-shadow: 0 0 0 1px var(--hairline); }

/* collections */
.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%,300px),1fr)); gap: 48px 20px; }
.collection-item { display: flex; flex-direction: column; gap: 12px; }
.collection-item img { width: 100%; height: auto; aspect-ratio: 5 / 4; object-fit: cover; }
.collection-item .meta { display: flex; justify-content: space-between; gap: 12px; }
.collection-item .meta > div { display: flex; flex-direction: column; }
.collection-item .work { font: italic 400 17px/24px var(--serif); }
.collection-item .maker { font: 400 13px/20px var(--sans); }
.collection-item .kind { font: 400 12px/24px var(--sans); flex: none; white-space: nowrap; }

/* scotland */
.scotland-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%,380px),1fr)); gap: 60px 80px; align-items: center; }

/* pricing */
.pricing-block { display: flex; flex-direction: column; gap: 40px; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%,320px),1fr)); gap: 20px; }
.card { border: 1px solid var(--hairline); border-radius: 12px; padding: 40px; display: flex; flex-direction: column; gap: 32px; }
@supports (grid-template-rows: subgrid) {
  /* share row tracks across the two cards so the lists line up */
  .card { display: grid; grid-template-rows: subgrid; grid-row: span 3; row-gap: 32px; align-content: start; }
}
.card .name-block { display: flex; flex-direction: column; gap: 4px; }
.card .price-block { display: flex; flex-direction: column; gap: 10px; }
.card .price-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.card .price { font: 600 clamp(56px,6vw,80px)/1 var(--serif); letter-spacing: -0.02em; }
.card ul { display: flex; flex-direction: column; }
.card li { border-top: 1px solid var(--hairline); padding: 14px 0; font: 400 17px/24px var(--sans); }
.note { font: 400 15px/24px var(--sans); max-width: 44em; text-wrap: pretty; }

/* faq */
.faq-list { display: flex; flex-direction: column; border-bottom: 1px solid var(--hairline); }
.faq-list details { border-top: 1px solid var(--hairline); }
.faq-list summary {
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
  padding: 24px 0; cursor: pointer; font: 600 clamp(20px,2vw,24px)/1.35 var(--serif);
}
.faq-list summary .plus { font: 300 26px/1 var(--sans); flex: none; }
.faq-list p { margin: 0 0 28px; font: 400 17px/26px var(--sans); max-width: 40em; text-wrap: pretty; }

/* contact */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%,380px),1fr)); gap: 40px 80px; }
.contact-col { border-top: 1px solid var(--hairline); padding-top: 24px; display: flex; flex-direction: column; gap: 20px; }
.contact-col .intro { display: flex; flex-direction: column; gap: 8px; }
.signup { display: flex; flex-direction: column; gap: 8px; }
.signup .row { display: flex; gap: 12px; flex-wrap: wrap; }
.signup .field { flex: 1; min-width: 200px; width: auto; }
.signup .status { font: 500 17px/26px var(--sans); }
.signup .status.error { font-weight: 400; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* finish */
.finish { padding: clamp(100px,14vw,180px) 40px 34vh; }
.finish .inner { align-items: center; gap: 60px; text-align: center; }
.finish .head { align-items: center; }
.finish .lead { max-width: 32em; }
.finish .board-wrap { width: 100%; max-width: 900px; }
.finish-plaque { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.finish-plaque.is-visible { opacity: 1; transform: none; }

/* footer */
.site-footer { background: var(--ground); color: var(--text); border-top: 1px solid var(--hairline); padding: 60px 40px; }
.site-footer .inner { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 40px; }
.site-footer .row1 { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.app-icon { width: 48px; height: 48px; flex: none; border-radius: 22.37%; box-shadow: 0 0 0 1px var(--hairline); }
.site-footer .id { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.site-footer .id .name { font: 600 17px/24px var(--serif); }
.site-footer .id .line { font: 400 13px/20px var(--sans); }
.site-footer nav { display: flex; gap: 24px; font: 400 13px/20px var(--sans); }
.site-footer nav a { text-decoration: none; }
.site-footer nav a:hover { text-decoration: underline; }
.site-footer .row2 {
  border-top: 1px solid var(--hairline); padding-top: 20px;
  display: flex; justify-content: space-between; gap: 12px 40px; flex-wrap: wrap;
  font: 400 12px/16px var(--sans);
}

/* ---------- the travelling piece ---------- */
.travel-piece {
  position: fixed; left: 0; top: 0; z-index: 5; pointer-events: none; opacity: 0; will-change: transform;
}
.static-piece { display: none; }

/* ---------- reveals (only once JS has set them up) ---------- */
.js-reveal [data-reveal] { opacity: 0; transform: translateY(48px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.js-reveal [data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- reduced motion / no JS: piece static in the hero, finish complete ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .travel-piece { display: none; }
  .static-piece { display: block; }
  .finish-plaque { opacity: 1; transform: none; transition: none; }
  .js-reveal [data-reveal] { opacity: 1; transform: none; transition: none; }
}
.no-js .travel-piece { display: none; }
.no-js .static-piece { display: block; }
.no-js .finish-plaque { opacity: 1; transform: none; }

/* ---------- privacy page ---------- */
.prose { max-width: 40em; display: flex; flex-direction: column; gap: 40px; }
.prose .block { border-top: 1px solid var(--hairline); padding-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.prose p + p { margin-top: 8px; }

/* ---------- narrow screens ---------- */
@media (max-width: 600px) {
  .plaque { white-space: normal; }
}
