/* The Design Studio page: a workbench on the left, the live website on the right.
   Each change opens the new design through a lens from the side the choice was made. */

/* The preview's own typefaces, self-hosted (SIL Open Font License, licences beside the files). Loaded only when a design uses them. */
@font-face { font-family: "Manrope"; src: url(/assets/fonts/studio/manrope.woff2?v=8c2def024c) format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(/assets/fonts/studio/instrument-serif.woff2?v=5eb09b5ac0) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(/assets/fonts/studio/instrument-serif-italic.woff2?v=5a51946dff) format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: "Unbounded"; src: url(/assets/fonts/studio/unbounded.woff2?v=22f9b928aa) format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url(/assets/fonts/studio/fredoka.woff2?v=99d6c78e04) format("woff2"); font-weight: 400 700; font-display: swap; }

.ph-studio { padding-bottom: clamp(26px, 3vw, 44px); }
.ph-studio h1 { font-size: clamp(2.8rem, 6.6vw, 7rem); max-width: 11.09em; }
.bench { display: grid; grid-template-columns: minmax(340px, 470px) minmax(0, 1fr); gap: clamp(18px, 2.6vw, 40px); padding: 0 var(--gutter) clamp(70px, 9vw, 130px); align-items: start; }

/* ---------- controls ---------- */
.bench-ctl { position: relative; display: grid; gap: 22px; padding: clamp(16px, 1.8vw, 24px); border-radius: 26px; background: var(--bg-2); border: 1px solid var(--line); min-width: 0; }
.sx-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sx-steps button { display: grid; gap: 3px; justify-items: start; text-align: left; min-height: 64px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: transparent; color: var(--text-2); cursor: pointer; font: inherit; transition: border-color .3s, background-color .3s, color .3s, transform .3s var(--ease); }
.sx-steps button:hover { border-color: var(--line-2); color: var(--text); }
.sx-steps .n { font: 500 .7rem/1 var(--font-mono); letter-spacing: .1em; color: var(--text-3); }
.sx-steps .t { font: 600 .95rem/1.15 var(--font-text); }
.sx-steps .v { font-size: .74rem; line-height: 1.2; color: var(--text-3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 1.2em; }
.sx-steps button[aria-selected="true"] { border-color: var(--sun); background: color-mix(in srgb, var(--sun) 9%, transparent); color: var(--text); }
.sx-steps button[aria-selected="true"] .n, .sx-steps button.done .n { color: var(--sun-txt); }
.sx-steps button.done .n::after { content: " ✓"; }

.sx-panel { display: grid; gap: 24px; min-width: 0; }
.sx-panel:not([hidden]) { animation: sx-in .55s var(--ease); }
@keyframes sx-in { from { opacity: 0; transform: translateY(12px); filter: blur(4px); } }
.sx-title { font-size: clamp(1.9rem, 2.7vw, 2.7rem); line-height: 1; }
.bench fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.bench legend { padding: 0; margin-bottom: 12px; font: 500 .74rem/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.bench .opt { text-transform: none; letter-spacing: 0; font-family: var(--font-text); }
/* preview mock-ups: the small label keeps 4.5:1 on any palette the visitor picks */
.ms .ms-tag { color: color-mix(in oklch, var(--p) 45%, var(--fg)); }
.hint { margin: 10px 0 0; font-size: .86rem; color: var(--text-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.bench input[type="radio"], .bench input[type="checkbox"]:not(#q-consent) { position: absolute; opacity: 0; pointer-events: none; }

.sx-chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.sx-chips .chip { position: relative; min-height: 40px; padding: 0 14px; font-size: .9rem; }
.sx-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sx-card { position: relative; display: block; cursor: pointer; }
.sx-card > span { display: grid; gap: 4px; height: 100%; padding: 13px 14px; border-radius: 16px; border: 1px solid var(--line-2); transition: border-color .3s, background-color .3s, transform .35s var(--ease); }
.sx-card b { font-weight: 600; font-size: .98rem; line-height: 1.2; }
.sx-card small { color: var(--text-3); font-size: .8rem; line-height: 1.35; }
.sx-card:hover > span { border-color: var(--text-3); transform: translateY(-2px); }
.sx-card input:checked + span { border-color: var(--sun); background: color-mix(in srgb, var(--sun) 10%, transparent); }
.sx-card input:focus-visible + span, .sx-spec input:focus-visible ~ .aa, .seg input:focus-visible + span, .sw input:focus-visible + .sw-dot { outline: 2px solid var(--sun); outline-offset: 3px; }
.sx-cards.sm small { display: none; }

/* style specimens: each card speaks in its own voice */
.sx-specs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sx-spec { position: relative; display: grid; gap: 6px; justify-items: center; padding: 14px 6px 10px; border-radius: 16px; border: 1px solid var(--line-2); cursor: pointer; transition: border-color .3s, background-color .3s, transform .35s var(--ease); }
.sx-spec:hover { border-color: var(--text-3); transform: translateY(-2px); }
.sx-spec:has(input:checked) { border-color: var(--sun); background: color-mix(in srgb, var(--sun) 10%, transparent); }
.sx-spec .aa { font-size: 2.1rem; line-height: 1; height: 2.3rem; display: grid; place-items: center; }
.sx-spec .nm { font-size: .78rem; color: var(--text-2); }
.sx-spec[data-style="minimal"] .aa { font: 300 2.1rem/1 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: -.02em; }
.sx-spec[data-style="luxury"] .aa { font: italic 500 2.3rem/1 var(--font-accent); }
.sx-spec[data-style="bold"] .aa { font: 600 2.1rem/1 var(--font-display); }
.sx-spec[data-style="playful"] .aa { font: 800 2.1rem/1 "Trebuchet MS", ui-rounded, "Comic Sans MS", sans-serif; transform: rotate(-6deg); }
.sx-spec[data-style="corporate"] .aa { font: 650 2rem/1 "Segoe UI", Roboto, Arial, sans-serif; }
.sx-spec[data-style="editorial"] .aa { font: 400 2.2rem/1 Georgia, "Times New Roman", serif; }
.sx-spec[data-style="organic"] .aa { font: italic 400 2.2rem/1 "Iowan Old Style", "Palatino Linotype", Georgia, serif; }
.sx-spec[data-style="futuristic"] .aa { font: 500 1.7rem/1 var(--font-mono); letter-spacing: .08em; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sw { position: relative; display: inline-grid; place-items: center; cursor: pointer; }
.sw-dot { width: 38px; height: 38px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .18); transition: transform .3s var(--ease), box-shadow .3s; }
.sw:hover .sw-dot { transform: scale(1.1); }
.sw input:checked + .sw-dot { box-shadow: 0 0 0 3px var(--bg-2), 0 0 0 5px var(--sun); }
.sw-dot[data-c="#0EA5E9"] { background: #0ea5e9; } .sw-dot[data-c="#2563EB"] { background: #2563eb; } .sw-dot[data-c="#7C3AED"] { background: #7c3aed; } .sw-dot[data-c="#10B981"] { background: #10b981; }
.sw-dot[data-c="#F59E0B"] { background: #f59e0b; } .sw-dot[data-c="#E11D48"] { background: #e11d48; } .sw-dot[data-c="#EC4899"] { background: #ec4899; } .sw-dot[data-c="#111827"] { background: #111827; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .3); }
.sw-custom { display: inline-flex; gap: 8px; padding: 0 12px 0 4px; min-height: 44px; border-radius: 999px; border: 1px solid var(--line-2); font-size: .86rem; color: var(--text-2); }
.sw-custom input[type="color"] { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.sw-custom input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.sw-custom input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.sw-custom input[type="color"]::-moz-color-swatch { border: 0; border-radius: 50%; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border-radius: 999px; border: 1px solid var(--line-2); }
.seg label { position: relative; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px; font-size: .88rem; color: var(--text-2); transition: background-color .3s, color .3s; }
.seg label:hover span { color: var(--text); }
.seg input:checked + span { background: var(--text); color: var(--bg); }

/* motion cards show what they mean */
.sx-cards.motion .mo { position: relative; display: block; width: 26px; height: 26px; margin-bottom: 6px; }
.mo i { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--sun); }
[data-motion="subtle"] .mo i { animation: mo-fade 2.4s ease-in-out infinite; }
[data-motion="rich"] .mo i { animation: mo-bounce 1.1s cubic-bezier(.3, 0, .3, 1) infinite alternate; }
[data-motion="immersive"] .mo { perspective: 60px; }
[data-motion="immersive"] .mo i { width: 22px; height: 22px; margin: -11px 0 0 -11px; background: none; border: 2px solid var(--sun); animation: mo-spin 2.6s linear infinite; }
@keyframes mo-fade { 50% { opacity: .15; transform: scale(.7); } }
@keyframes mo-bounce { from { transform: translateY(7px); } to { transform: translateY(-7px) scale(1.1); } }
@keyframes mo-spin { to { transform: rotateY(1turn) rotateX(.25turn); } }

.sx-me { display: grid; gap: 16px; }
.logo-up { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.logo-up .hint { margin: 0; flex-basis: 100%; }
.logo-thumb { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.mini { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font: 500 .86rem/1 var(--font-text); cursor: pointer; transition: border-color .25s, background-color .25s; }
.mini:hover { border-color: var(--text-3); background: color-mix(in srgb, var(--text) 5%, transparent); }
.mini:disabled { opacity: .4; cursor: default; }
.chip-x { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--sun); background: color-mix(in srgb, var(--sun) 10%, transparent); color: var(--text); font: 500 .85rem/1 var(--font-text); cursor: pointer; }

.sx-secs { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.sx-secs li { display: grid; grid-template-columns: 2rem minmax(0, 1fr) repeat(3, 32px); gap: 6px; align-items: center; padding: 6px 6px 6px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); animation: sx-in .4s var(--ease); }
.sx-secs .num { font: 500 .72rem/1 var(--font-mono); color: var(--sun-txt); }
.sx-secs b { font-weight: 600; font-size: .95rem; }
.sx-secs button { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; font-size: .9rem; }
.sx-secs button:hover:not(:disabled) { border-color: var(--sun); color: var(--sun-txt); }
.sx-secs button:disabled { opacity: .25; cursor: default; }
.sx-add .hint { margin: 0 4px 0 0; }
.add-row { display: flex; gap: 8px; margin-top: 12px; }
.add-row input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font: 500 .92rem var(--font-text); }
.add-row input:focus { outline: none; border-color: var(--sun); }
.starters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.starters .hint { margin: 0; flex-basis: 100%; }
.bench .field select { width: 100%; padding: 12px 0 14px; border: 0; border-bottom: 2px solid var(--line-2); background: transparent; color: var(--text); font: 500 1.1rem var(--font-text); border-radius: 0; }
.bench .field select:focus { outline: none; border-color: var(--sun); }
.bench .field select option { background: var(--bg-2); color: var(--text); }
.bench .field input, .bench .field textarea { font-size: 1.05rem; }
.grid2, .row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.row2 .seg span { padding: 0 11px; font-size: .82rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: .92rem; color: var(--text-2); cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--sun); flex: none; }
.next-list { margin: 4px 0 0; padding-left: 1.2em; display: grid; gap: 6px; color: var(--text-2); font-size: .92rem; }
.next-list li::marker { color: var(--sun-txt); font-family: var(--font-mono); }

.sx-nav { position: sticky; bottom: 12px; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; margin: 0 -6px; border-radius: 999px; background: color-mix(in srgb, var(--bg-2) 86%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--line); }
.sx-save { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: 0; font-size: .84rem; color: var(--text-3); }
.sx-done { display: grid; gap: 14px; padding: 22px; border-radius: 20px; border: 1px solid var(--sun); background: color-mix(in srgb, var(--sun) 7%, transparent); }
.sx-done p { margin: 0; color: var(--text-2); }
.sx-done .sum-title { font: 600 1.4rem/1.2 var(--font-text); color: var(--text); }
.sx-done:focus { outline: none; }

/* ---------- the stage ---------- */
.bench-stage { position: sticky; top: 84px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; height: calc(100vh - 100px); min-height: 560px; min-width: 0; }
.stage-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sx-code { padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-2); font: 500 .76rem/1 var(--font-mono); letter-spacing: .06em; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.device { display: flex; flex-direction: column; width: 100%; min-height: 0; margin: 0 auto; border-radius: 18px; border: 1px solid var(--line-2); background: var(--bg-2); overflow: hidden; box-shadow: var(--shadow); view-transition-name: sx-device; }
.device[data-device="phone"] { max-width: 390px; border: 9px solid #0c0b09; border-radius: 40px; background: #0c0b09; }
.dev-bar { display: flex; align-items: center; gap: 7px; height: 36px; flex: none; padding: 0 14px; border-bottom: 1px solid var(--line); }
.dev-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.dev-url { margin: 0 auto; padding-right: 40px; font: 500 .72rem/1 var(--font-mono); color: var(--text-3); }
.device[data-device="phone"] .dev-bar { height: 26px; justify-content: center; border: 0; }
.device[data-device="phone"] .dev-bar i, .device[data-device="phone"] .dev-url { display: none; }
.device[data-device="phone"] .dev-bar::before { content: ""; width: 86px; height: 20px; border-radius: 999px; background: #000; }
.dev-screen { position: relative; flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; background: #fbfaf8; view-transition-name: sx-screen; scrollbar-width: thin; }
.device[data-device="phone"] .dev-screen { border-radius: 0 0 30px 30px; }
.dev-screen .ms { min-height: 100%; }
.dev-wait { margin: 0; padding: 30px; color: var(--text-2); }
.sx-ready .dev-wait { display: none; }

/* the lens: a new design opens from where the choice was made */
::view-transition-old(sx-screen) { animation: none; }
::view-transition-new(sx-screen) { animation: sx-lens .85s var(--ease) both; }
@keyframes sx-lens {
  from { clip-path: circle(0% at var(--lens-x, 0px) var(--lens-y, 50%)); filter: blur(8px) saturate(1.3); }
  to { clip-path: circle(150% at var(--lens-x, 0px) var(--lens-y, 50%)); filter: none; }
}
::view-transition-group(sx-device), ::view-transition-group(sx-screen) { animation-duration: .6s; animation-timing-function: var(--ease); }

.sx-sum { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--bg-2); }
.gauge { position: relative; width: 62px; height: 62px; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-width: 7; }
.gauge .trk { stroke: var(--line-2); }
.gauge .val { stroke: var(--sun); stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .8s var(--ease); }
.gauge b { position: absolute; inset: 0; display: grid; place-items: center; font: 500 .74rem/1 var(--font-mono); }
.sum-copy { min-width: 0; }
.sum-copy .k { margin: 0 0 4px; }
.sum-title { margin: 0; font: 600 1.08rem/1.2 var(--font-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-meta { margin: 2px 0 6px; font-size: .8rem; color: var(--text-3); }
.sum-chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.sum-chips .tag { padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line-2); font-size: .74rem; color: var(--text-2); }
.sum-swatch { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .25); }
.sum-think { margin: 6px 0 0; font-size: .8rem; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sum-think b { color: var(--text-2); font-weight: 600; }

.sx-after { margin-top: 0; }

@media (max-width: 1080px) {
  .bench { grid-template-columns: minmax(0, 1fr); }
  .bench-stage { position: relative; top: auto; order: -1; height: auto; min-height: 0; grid-template-rows: auto auto auto; }
  .device { height: min(72vh, 640px); }
  .device[data-device="phone"] { height: min(76vh, 720px); }
  .sx-sum { grid-template-columns: auto minmax(0, 1fr); }
  .sx-sum .btn { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .stage-bar { flex-wrap: wrap; }
  .dev-seg { flex-wrap: nowrap; }
  .dev-seg span { padding: 0 12px; }
  .sx-code { max-width: 100%; font-size: .68rem; }
  .sx-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sx-steps button { min-height: 54px; padding: 8px 9px; }
  .sx-steps .v { display: none; }
  .sx-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sx-cards { grid-template-columns: 1fr; }
  .sx-cards.sm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2, .row2 { grid-template-columns: 1fr; }
  .device { height: 68vh; }
}
@media (prefers-reduced-motion: reduce) {
  .sx-panel:not([hidden]), .sx-secs li { animation: none; }
  .mo i { animation: none !important; }
  ::view-transition-new(sx-screen) { animation: none; }
}

/* ---------- Templates: real previews of ready-made starting points ---------- */
.templates { padding: 0 0 clamp(40px, 6vw, 80px); }
.templates .band-head { padding: 0 var(--gutter); margin-bottom: 26px; }
.tpl-rail { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(260px, 26vw, 360px); gap: 16px; overflow-x: auto; padding: 4px var(--gutter) 18px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.tpl-card { scroll-snap-align: start; display: grid; grid-template-rows: auto 1fr; gap: 14px; }
.tpl-frame { border-radius: 16px; overflow: hidden; border: 1px solid var(--line-2); background: var(--bg-2); transition: transform .5s var(--ease), border-color .3s; }
.tpl-card:hover .tpl-frame { transform: translateY(-4px); border-color: var(--text-3); }
.tpl-screen { position: relative; aspect-ratio: 16 / 11; overflow: hidden; background: #fbfaf8; }
.tpl-screen img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.tpl-meta { display: grid; gap: 6px; align-content: start; justify-items: start; }
.tpl-meta h3 { margin: 0; font: 600 1.2rem/1.2 var(--font-text); }
.tpl-meta p { margin: 0 0 6px; color: var(--text-2); font-size: .95rem; }
.tpl-blank { align-content: center; justify-items: start; padding: 26px; border-radius: 16px; border: 1px dashed var(--line-2); }
.tpl-blank p { margin: 0 0 14px; color: var(--text-2); }
