/* Spellbound Jigsaws — landing page.
   Direction: colour chapters (tasteskill seed 214210189). Each chapter is one flat field taken from a
   settlement's own paintings; the Stillstone glow is kept for buttons alone. Brand faces: Cinzel + Cormorant. */

:root {
  --stone: #e9e7e1;        /* ground: the pale Stillstone */
  --stone-2: #dcd9d1;      /* one tone step down, for tiles on the ground */
  --ink: #15171d;
  --paper: #f4f4f2;
  --night: #15171d;
  --fenwrack: #243840;     /* storm slate */
  --cindergate: #8c2d1b;   /* forge ember */
  --delvfell: #c9d8e2;     /* glacier ice */
  --aldminster: #f1d7c8;   /* dawn cloud */
  --reckvane: #d9a441;     /* planet amber */
  --accent: #6fe0d6;       /* Stillstone glow: buttons only */
  --accent-strong: #9ff0e8;
  --accent-ink: #0a0a0a;

  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --text: "Cormorant Garamond", Garamond, Georgia, serif;
  --step-small: 1rem;
  --step-body: clamp(1.1875rem, 1.1rem + 0.3vw, 1.3125rem);
  --step-lead: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);
  --step-head: clamp(1.875rem, 1.2rem + 2.2vw, 3.25rem);
  --step-display: clamp(2.25rem, 0.9rem + 5.2vw, 6rem);

  --m: clamp(16px, 2.4vw, 36px);
  --gap: clamp(16px, 1.8vw, 28px);
  --section: clamp(96px, 11vw, 200px);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-ui: 240ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--stone); color: var(--ink);
  font-family: var(--text); font-size: var(--step-body); font-weight: 500; line-height: 1.5;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }

.display, .head, .wordmark, .pick, .tile-name, .tin-name, .foot-name, summary {
  font-family: var(--display); font-weight: 600; letter-spacing: -0.01em;
}
.display { font-size: var(--step-display); line-height: 1; letter-spacing: -0.02em; }
.head { font-size: var(--step-head); line-height: 1.05; }
.lead { font-size: var(--step-lead); line-height: 1.35; max-width: 34ch; }
.small { font-size: var(--step-small); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 12px 16px; z-index: 10; }
.skip:focus { left: 8px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 0;
  font-family: var(--display); font-size: var(--step-small); font-weight: 700; letter-spacing: 0.02em;
  text-decoration: none; cursor: pointer;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease;
}
.button:active { transform: scale(0.97); }
.button-ink { background: var(--ink); color: var(--paper); }
.link {
  text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  transition: text-decoration-color var(--t-hover) ease;
}
@media (hover: hover) and (pointer: fine) {
  .button:hover { background: var(--accent-strong); }
  .button-ink:hover { background: #2a2e38; }
  .link:hover { text-decoration-color: currentColor; }
}

/* ---------- Masthead: header on a mosaic of the five settlements ---------- */
.masthead { position: relative; }
.bar { position: absolute; inset: 0 0 auto 0; z-index: 2; display: flex; align-items: stretch; min-height: 64px; }
.wordmark {
  display: flex; align-items: center; padding: 0 var(--m); background: var(--ink); color: var(--paper);
  font-size: 1.125rem; font-weight: 700; letter-spacing: 0.04em; text-decoration: none; white-space: nowrap;
}
.bar-tab {
  display: flex; align-items: center; gap: clamp(16px, 2vw, 32px); padding: 0 clamp(18px, 2vw, 32px);
  background: var(--cindergate); color: var(--paper); width: 42%; margin-right: auto;
  font-size: var(--step-body); font-weight: 600;
}
.bar-tab .link { text-decoration-color: transparent; }
.bar > .button { align-self: center; margin-right: var(--m); }
.mosaic {
  display: grid; height: 52svh; min-height: 380px;
  grid-template-columns: repeat(6, 1fr); grid-template-rows: 1fr 1fr;
  grid-template-areas: "a a b c d e" "f g b h i i";
}
.m { display: block; overflow: hidden; }
.m img { width: 100%; height: 100%; object-fit: cover; }
.m-a { grid-area: a; } .m-b { grid-area: b; background: var(--cindergate); }
.m-c { grid-area: c; } .m-d { grid-area: d; background: var(--delvfell); }
.m-e { grid-area: e; } .m-f { grid-area: f; background: var(--reckvane); }
.m-g { grid-area: g; } .m-h { grid-area: h; background: var(--fenwrack); }
.m-i { grid-area: i; }
.m-a img { object-position: 62% 40%; }
.m-i img { object-position: 50% 45%; }

.hero {
  display: grid; grid-template-columns: 36% 1fr; column-gap: var(--gap); align-items: start;
  padding: clamp(48px, 6vw, 96px) var(--m) clamp(64px, 6vw, 104px);
}
.standfirst { max-width: 30ch; padding-top: 0.6em; }
.hero h1 { font-family: var(--display); font-size: var(--step-display); font-weight: 600; line-height: 0.98; letter-spacing: -0.03em; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: clamp(28px, 3vw, 44px); }

.lines .line { display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.lines [data-line], .lines [data-line-scroll] { display: block; }

/* ---------- The realm: the panorama is the shop's map ---------- */
.realm {
  --f: var(--cindergate); --fi: var(--paper);
  background: var(--f); color: var(--fi);
  padding: var(--section) 0 var(--section);
  transition: background-color 700ms var(--ease-out), color 400ms ease;
}
.realm[data-current="fenwrack"]   { --f: var(--fenwrack);   --fi: var(--paper); }
.realm[data-current="cindergate"] { --f: var(--cindergate); --fi: var(--paper); }
.realm[data-current="delvfell"]   { --f: var(--delvfell);   --fi: var(--ink); }
.realm[data-current="aldminster"] { --f: var(--aldminster); --fi: var(--ink); }
.realm[data-current="reckvane"]   { --f: var(--reckvane);   --fi: var(--ink); }
.realm-head { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: end; padding: 0 var(--m) clamp(36px, 4vw, 64px); }
.realm-head .lead { justify-self: end; }

.pano { position: relative; overflow: hidden; cursor: pointer; }
.pano-track { position: relative; }
.pano-track img { width: 100%; height: auto; }
.pano-shade { position: absolute; top: 0; bottom: 0; background: #0b0c10; opacity: 0.58; transition: opacity 600ms var(--ease-out); pointer-events: none; }
.pano-shade[data-region="fenwrack"]   { left: 0;   width: 20%; }
.pano-shade[data-region="cindergate"] { left: 20%; width: 22%; }
.pano-shade[data-region="delvfell"]   { left: 42%; width: 20%; }
.pano-shade[data-region="aldminster"] { left: 62%; width: 17%; }
.pano-shade[data-region="reckvane"]   { left: 79%; width: 21%; }
.realm[data-current="fenwrack"] .pano-shade[data-region="fenwrack"],
.realm[data-current="cindergate"] .pano-shade[data-region="cindergate"],
.realm[data-current="delvfell"] .pano-shade[data-region="delvfell"],
.realm[data-current="aldminster"] .pano-shade[data-region="aldminster"],
.realm[data-current="reckvane"] .pano-shade[data-region="reckvane"] { opacity: 0; }

.picker { display: grid; grid-template-columns: repeat(5, 1fr); }
.pick {
  display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 0 8px;
  font-size: clamp(1rem, 0.8rem + 0.6vw, 1.375rem); text-decoration: none; color: var(--fi);
  transition: background-color var(--t-ui) var(--ease-out), color var(--t-ui) var(--ease-out);
}
.pick[aria-current="true"] { background: var(--fi); color: var(--f); }
@media (hover: hover) and (pointer: fine) {
  .pick:not([aria-current="true"]):hover { background: color-mix(in srgb, var(--fi) 14%, transparent); }
}

.panels { padding: clamp(56px, 6vw, 96px) var(--m) 0; }
.panel { --pf: var(--f); --pfi: var(--fi); background: var(--pf); color: var(--pfi); }
#fenwrack { --pf: var(--fenwrack); --pfi: var(--paper); }
#cindergate { --pf: var(--cindergate); --pfi: var(--paper); }
#delvfell { --pf: var(--delvfell); --pfi: var(--ink); }
#aldminster { --pf: var(--aldminster); --pfi: var(--ink); }
#reckvane { --pf: var(--reckvane); --pfi: var(--ink); }
.panel + .panel { margin-top: var(--section); }
.js .panel { background: transparent; color: inherit; }
.js .panel + .panel { margin-top: 0; }
.js .panel[hidden] { display: none; }
.panel {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); row-gap: clamp(28px, 3vw, 48px);
  scroll-margin-top: 24px;
}
.panel-text { grid-column: 1 / span 4; display: flex; flex-direction: column; gap: 20px; }
.panel-text .display { font-size: var(--step-head); }
.wall { grid-column: 5 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px 10px; }
.tile-link { display: block; text-decoration: none; }
.tile-pic { display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; }
.tile-pic img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease-soft); }
@media (hover: hover) and (pointer: fine) { .tile-link:hover img { transform: scale(1.05); } .tile-link:hover .tile-name { text-decoration: underline; text-underline-offset: 0.2em; } }
.tile-cap { display: flex; flex-direction: column; gap: 2px; padding-top: 12px; font-size: var(--step-small); line-height: 1.3; }
.tile-name { font-size: var(--step-small); font-weight: 600; }
.tile-word[data-tone="0"] .tile-pic { background: var(--stone); color: var(--ink); }
.tile-word[data-tone="1"] .tile-pic { background: var(--night); color: var(--paper); }
.tile-word .tile-pic { align-content: center; gap: 6px; padding: 12px; text-align: center; }
.word { font-family: var(--display); font-weight: 600; font-size: clamp(1.75rem, 0.9rem + 2.4vw, 3.25rem); line-height: 1; letter-spacing: -0.02em; }
.word-cap { font-size: var(--step-small); line-height: 1.25; }
.panel.is-entering .tile { animation: tile-in 700ms var(--ease-expo) both; }
.panel.is-entering .tile:nth-child(2) { animation-delay: 60ms; }
.panel.is-entering .tile:nth-child(3) { animation-delay: 120ms; }
.panel.is-entering .tile:nth-child(4) { animation-delay: 180ms; }
.panel.is-entering .tile:nth-child(5) { animation-delay: 240ms; }
.panel.is-entering .tile:nth-child(6) { animation-delay: 300ms; }
.panel.is-entering .tile:nth-child(7) { animation-delay: 360ms; }
.panel.is-entering .tile:nth-child(8) { animation-delay: 420ms; }
@keyframes tile-in { from { opacity: 0; transform: translateY(24px); } }

/* ---------- The tin: two objects, two fields ---------- */
.tin { display: grid; grid-template-columns: 1fr 1fr; }
.tin-panel { display: flex; flex-direction: column; min-height: 92svh; padding: clamp(40px, 4vw, 64px) var(--m) clamp(28px, 2.4vw, 40px); gap: clamp(28px, 3vw, 44px); }
.tin-object { background: var(--night); color: var(--paper); }
.tin-film { background: var(--stone); color: var(--ink); }
.tin-frame { flex: 1; min-height: 320px; overflow: hidden; }
.tin-frame img { width: 100%; height: 100%; object-fit: cover; object-position: 35% 55%; }
.film-frame { flex: 1; display: flex; justify-content: center; min-height: 320px; padding-top: clamp(0px, 3vw, 64px); }
.film-frame video { height: 100%; max-height: 74svh; width: auto; aspect-ratio: 9 / 16; object-fit: cover; background: #b78955; }
.tin-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.tin-cap { display: flex; flex-direction: column; gap: 4px; }
.tin-name { font-size: var(--step-lead); line-height: 1.15; }

/* ---------- Made for the table: rows on an axis ---------- */
.made { background: var(--fenwrack); color: var(--paper); padding: var(--section) var(--m); display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); }
.made-title { grid-column: 1 / -1; padding-bottom: clamp(64px, 8vw, 140px); }
.row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: start; }
.row + .row { margin-top: clamp(64px, 7vw, 120px); }
.row-text { grid-column: 1 / span 7; display: flex; flex-direction: column; gap: 16px; }
.row-text p { max-width: 42ch; font-size: var(--step-lead); line-height: 1.35; }
.row-pic { grid-column: 8 / -1; width: 100%; height: auto; object-fit: cover; }
.pic-portrait { aspect-ratio: 5 / 4; }
.pic-wide { aspect-ratio: 16 / 9; }
.pic-square { aspect-ratio: 4 / 3; }
.row:nth-of-type(4n+2) .row-pic { grid-column: 8 / -1; }
.row:nth-of-type(4n+3) .row-pic { grid-column: 9 / -1; }
.row:nth-of-type(4n) .row-pic { grid-column: 7 / span 5; }
.row:nth-of-type(4n+1) .row-pic { grid-column: 9 / -1; }

/* ---------- Who makes them ---------- */
.story { background: var(--aldminster); color: var(--ink); padding: var(--section) var(--m); }
.story .head { margin-bottom: clamp(32px, 3.4vw, 56px); }
.story-text { columns: 2; column-gap: clamp(32px, 4vw, 64px); font-size: var(--step-lead); line-height: 1.32; }
.story-text p { text-align: justify; hyphens: auto; }
.story-text strong { font-weight: 700; }
mark { color: inherit; padding: 0 0.1em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hl-ice { background: var(--delvfell); }
.hl-ochre { background: var(--reckvane); }
.hl-stone { background: var(--fenwrack); color: var(--paper); }
.story-close { margin-top: 1em; break-inside: avoid; }
.hl-accent {
  background: var(--accent); color: var(--accent-ink); padding: 0.05em 0.2em; text-decoration: none;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background-color var(--t-hover) ease;
}
@media (hover: hover) and (pointer: fine) { .hl-accent:hover { background: var(--accent-strong); } }

/* ---------- 10% off: the sign-up ---------- */
.join { background: var(--reckvane); color: var(--ink); padding: var(--section) var(--m); display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); row-gap: clamp(40px, 5vw, 80px); }
.join h2 { grid-column: 1 / -1; font-size: clamp(2.75rem, 0.6rem + 8vw, 8.5rem); line-height: 0.95; letter-spacing: -0.03em; }
.join-body { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: start; }
.join-body .lead { grid-column: 1 / span 5; }
.join-form { grid-column: 7 / -1; display: flex; flex-direction: column; gap: 12px; }
.join-form label { font-size: var(--step-small); font-weight: 700; }
.join-fields { display: flex; gap: 10px; flex-wrap: wrap; }
.join-fields input {
  flex: 1 1 260px; min-width: 0; min-height: 56px; padding: 0 18px; border: 0; border-radius: 0;
  background: var(--paper); color: var(--ink); font: 500 1.125rem var(--text);
}
.join-fields input::placeholder { color: #5b5a57; }
.join-fields .button { min-height: 56px; }
.join-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.join-claim .button { min-height: 56px; }

/* ---------- Good to know ---------- */
.faq { padding: var(--section) var(--m); display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); align-items: start; }
.faq-title { grid-column: 1 / span 4; position: sticky; top: 96px; }
.faq-list { grid-column: 5 / -1; display: flex; flex-direction: column; gap: 8px; }
details { background: var(--stone-2); transition: background-color var(--t-ui) var(--ease-out); }
details[open] { background: var(--accent); color: var(--accent-ink); }
summary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; padding: 18px 24px;
  font-size: 1.125rem; cursor: pointer; list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+"; flex: none; font-family: var(--text); font-size: 2rem; font-weight: 500; line-height: 1;
  transition: transform var(--t-ui) var(--ease-out);
}
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 24px 24px; max-width: 52ch; }

/* ---------- Footer: the name first ---------- */
.foot { background: var(--night); color: var(--paper); padding: clamp(72px, 8vw, 140px) var(--m) 40px; overflow: hidden; }
.foot-name { font-size: clamp(2rem, 7.1vw, 9rem); line-height: 1; letter-spacing: -0.03em; white-space: nowrap; }
.foot-row { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); margin-top: 72px; }
.foot-places { grid-column: 1 / span 6; display: flex; flex-direction: column; gap: 10px; font-size: var(--step-lead); }
.foot-links { grid-column: 8 / -1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px var(--gap); align-content: start; }
.foot-legal { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 96px; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .standfirst, .js .actions { animation: fade-up 800ms var(--ease-out) both; animation-delay: 650ms; }
  .js .actions { animation-delay: 750ms; }
  .js .hero [data-line] { transform: translateY(105%); animation: line-up 900ms var(--ease-expo) forwards; animation-delay: calc(var(--i) * 110ms + 250ms); }
  .js [data-line-scroll] { transform: translateY(105%); transition: transform 900ms var(--ease-expo); transition-delay: calc(var(--i) * 110ms); }
  .js .is-in [data-line-scroll] { transform: none; }
  .js .m { animation: tile-rise 1000ms var(--ease-expo) both; }
  .js .m-b, .js .m-c { animation-delay: 70ms; } .js .m-d, .js .m-e { animation-delay: 140ms; }
  .js .m-f, .js .m-g { animation-delay: 210ms; } .js .m-h, .js .m-i { animation-delay: 280ms; }
  .js .m img { animation: drift 24s var(--ease-soft) both; }
  .js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-expo); transition-delay: calc(var(--i, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .js .shutter { clip-path: inset(0 0 100% 0); transition: clip-path 1100ms var(--ease-in-out); }
  .js .shutter img { transform: scale(1.12); transition: transform 1500ms var(--ease-soft); }
  .js .shutter.is-in { clip-path: inset(0); }
  .js .shutter.is-in img { transform: none; }
  .pano-track { transition: transform 900ms var(--ease-in-out); }
}
@keyframes line-up { to { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(20px); } }
@keyframes tile-rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes drift { from { transform: scale(1.08); } to { transform: scale(1); } }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  .bar-tab { width: auto; }
  .hero { grid-template-columns: 1fr; row-gap: 28px; }
  .hero-title { order: -1; }
  .panels { padding-top: clamp(80px, 12vw, 120px); }
  .panel-text { grid-column: 1 / -1; }
  .wall { grid-column: 1 / -1; }
  .row-text { grid-column: 1 / span 7; }
  .row:nth-of-type(n) .row-pic { grid-column: 7 / -1; }
  .faq-title { grid-column: 1 / -1; position: static; margin-bottom: 32px; }
  .faq-list { grid-column: 1 / -1; }
  .join-body .lead { grid-column: 1 / -1; }
  .join-form { grid-column: 1 / -1; margin-top: 28px; }
}

/* ---------- Phone ---------- */
@media (max-width: 680px) {
  .bar { position: relative; min-height: 56px; }
  .bar-tab { display: none; }
  .wordmark { font-size: 1rem; margin-right: auto; }
  .bar > .button { min-height: 44px; padding: 0 16px; }
  .mosaic { height: 38svh; min-height: 240px; grid-template-columns: repeat(3, 1fr); grid-template-areas: "a a b" "d c f"; }
  .m-e, .m-g, .m-h, .m-i { display: none; }
  .realm-head { grid-template-columns: 1fr; }
  .realm-head .lead { justify-self: start; }
  .pano { height: 64vw; }
  .pano-track { height: 100%; width: 256vw; transform: translateX(var(--pan, -86vw)); }
  .pano-track img { height: 100%; width: 100%; object-fit: cover; }
  .picker { grid-template-columns: repeat(6, 1fr); }
  .pick { grid-column: span 2; min-height: 52px; }
  .pick:nth-child(4) { grid-column: 2 / span 2; }
  .wall { grid-template-columns: repeat(2, 1fr); gap: 24px 8px; }
  .tin { grid-template-columns: 1fr; }
  .tin-panel { min-height: 0; }
  .tin-frame { aspect-ratio: 4 / 5; flex: none; }
  .film-frame video { max-height: 70svh; width: 100%; height: auto; }
  .row-text, .row:nth-of-type(n) .row-pic { grid-column: 1 / -1; }
  .row-pic { margin-top: 24px; }
  .row:nth-of-type(3n+2) .row-pic { width: 78%; justify-self: end; }
  .row:nth-of-type(3n) .row-pic { width: 64%; }
  .story-text { columns: 1; }
  .story-text p { text-align: left; }
  .foot-places, .foot-links { grid-column: 1 / -1; }
  .foot-links { margin-top: 40px; }
  .foot-legal { margin-top: 64px; }
}
