:root {
  color-scheme: light;
  --page: #f5f5f5; --ink: #353733; --muted: #757c70;
  --glass: rgb(255 255 255 / .62); --edge: rgb(255 255 255 / .92);
  --radius: 22px; --inset: 7px;
  --ease: cubic-bezier(.22,1,.36,1); --fast: 150ms; --settle: 320ms;
  --shadow: 0 0 0 1px rgb(42 49 38 / .045), 0 2px 3px -2px rgb(42 49 38 / .14), 0 8px 13px -9px rgb(42 49 38 / .16), 0 22px 30px -22px rgb(42 49 38 / .19), 0 38px 60px -40px rgb(42 49 38 / .13), inset 0 1px 0 white, inset 0 -1px 2px rgb(42 49 38 / .065);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font: 13px/1.5 -apple-system,BlinkMacSystemFont,'Helvetica Neue',sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button,input { font: inherit; }
button,a,input { -webkit-tap-highlight-color: transparent; }
button:focus-visible,a:focus-visible,input:focus-visible { outline: 2px solid #687364; outline-offset: 5px; }
.skip-link { position: fixed; top: 12px; left: 24px; z-index: 10; padding: 10px 16px; background: var(--ink); color: white; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
header { display: flex; align-items: center; gap: 28px; min-height: 88px; padding: 0 40px; }
.wordmark { font-size: 18px; letter-spacing: -.7px; white-space: nowrap; }
.wordmark strong { font-weight: 650; }
.experiment-heading { display: flex; align-items: center; gap: 24px; color: var(--muted); }
.experiment-heading>span { color: #c2c6bf; }
h1 { font-size: 13px; font-weight: 400; margin: 0; }
button,.snapshot-actions a { min-height: 36px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink); padding: 7px 12px; cursor: pointer; transition: transform var(--settle) var(--ease), background-color var(--settle) var(--ease), color var(--fast) var(--ease), opacity var(--settle) var(--ease), border-color var(--settle) var(--ease); }
button:hover:not(:disabled),.snapshot-actions a:hover { background: rgb(255 255 255 / .85); border-color: var(--edge); }
button:active:not(:disabled),.snapshot-actions a:active { transform: scale(.97); transition-duration: var(--fast); }
button:disabled { opacity: .4; cursor: default; }
.layout-switch { margin-left: auto; display: flex; align-items: center; gap: 9px; color: var(--muted); min-height: 44px; }
.layout-switch svg { stroke: currentColor; stroke-width: 1.3; }
main { padding: 20px 40px 0; display: grid; gap: 24px; grid-template-columns: minmax(0,1fr); align-items: start; }
.preview { min-width: 0; border: 1px solid var(--edge); border-radius: var(--radius); padding: var(--inset); background: var(--glass); box-shadow: var(--shadow); view-transition-name: preview; }
.canvas-frame { position: relative; overflow: hidden; border-radius: calc(var(--radius) - var(--inset)); background: #626961; height: clamp(320px,calc(100svh - 320px),760px); }
.canvas-frame::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 1px 3px rgb(20 30 20 / .2), inset 0 0 0 1px rgb(30 40 30 / .07), inset 0 -1px 1px rgb(255 255 255 / .55); }
canvas { display: block; width: 100%; height: 100%; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-height: 50px; padding: 7px 5px 0; }
.toolbar button { font-size: 12px; }
.toolbar output { margin-left: auto; padding: 0 12px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.panel { view-transition-name: controls; display: grid; grid-template-columns: 1fr 1.5fr 1fr auto; gap: 32px; align-items: start; min-width: 0; padding: 26px 24px; border: 1px solid var(--edge); border-radius: var(--radius); background: var(--glass); box-shadow: var(--shadow); }
fieldset { padding: 0; border: 0; margin: 0; min-width: 0; }
legend { font-size: 12px; font-weight: 500; padding: 0; margin-bottom: 20px; }
.control { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin-bottom: 16px; }
.control label,.color label { font-size: 12px; color: var(--muted); }
.control output { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
input[type=range] { appearance: none; -webkit-appearance: none; grid-column: 1/-1; width: 100%; height: 20px; margin: 0; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: #dce0d8; box-shadow: inset 0 1px 2px #333b2c0e; }
input[type=range]::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; border: 1px solid #ffffff; background: #fafbf8; box-shadow: 0 1px 2px #29342030,0 3px 6px #29342014; transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.18); box-shadow: 0 0 0 5px #6e7a5f12,0 2px 4px #29342025; }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: #dce0d8; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; border: 1px solid white; background: #fafbf8; box-shadow: 0 1px 3px #29342030; }
.color { display: flex; align-items: center; justify-content: space-between; min-height: 37px; gap: 12px; }
input[type=color] { width: 30px; height: 28px; border: 1px solid #e2e5de; border-radius: 8px; padding: 3px; background: white; cursor: pointer; transition: transform var(--fast) var(--ease); }
input[type=color]:hover { transform: scale(1.08); }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 4px; }
#reset { align-self: end; font-size: 11px; color: var(--muted); white-space: nowrap; }
body[data-layout=side] main { grid-template-columns: minmax(0,1fr) 294px; }
body[data-layout=side] .canvas-frame { height: max(420px,calc(100svh - 198px)); }
body[data-layout=side] .panel { display: flex; flex-direction: column; gap: 22px; padding: 23px; max-height: calc(100svh - 122px); overflow-y: auto; scrollbar-width: thin; }
body[data-layout=side] fieldset { width: 100%; }
body[data-layout=side] legend { margin-bottom: 14px; }
body[data-layout=side] #reset { align-self: stretch; }
footer { padding: 24px 40px; font-size: 11px; color: var(--muted); }
footer p { margin: 0; }
footer a { text-decoration: underline; text-underline-offset: 3px; }
.error { color: #944b39; padding: 10px; margin: 0; }
.error[hidden] { display: none; }
dialog { width: min(800px,calc(100% - 40px)); padding: 8px; border: 1px solid var(--edge); border-radius: var(--radius); background: #f8f9f6; color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: #30372e55; backdrop-filter: blur(6px); }
dialog[open] { animation: dialog-in 320ms var(--ease); }
dialog[open]::backdrop { animation: backdrop-in 320ms var(--ease); }
dialog.closing { animation: dialog-in 180ms ease-in reverse both; }
dialog.closing::backdrop { animation: backdrop-in 180ms ease-in reverse both; }
dialog img { display: block; width: 100%; border-radius: 15px; }
.snapshot-actions { display: flex; justify-content: space-between; align-items: center; padding: 8px; }
dialog p { margin: 0 16px 14px; font-size: 11px; color: var(--muted); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
::view-transition-group(preview),::view-transition-group(controls) { animation-duration: 560ms; animation-timing-function: var(--ease); }
::view-transition-old(preview),::view-transition-new(preview),::view-transition-old(controls),::view-transition-new(controls) { height: 100%; animation-duration: 360ms; }
@media(max-width:1100px) { .panel { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; } #reset { grid-column: 1/-1; justify-self: end; } }
@media(max-width:819px) {
  header { padding: 0 24px; min-height: 76px; gap: 20px; }
  .experiment-heading { gap: 16px; }
  .layout-switch { display: none; }
  main,body[data-layout=side] main { padding: 12px 24px 0; grid-template-columns: minmax(0,1fr); gap: 20px; }
  .canvas-frame,body[data-layout=side] .canvas-frame { height: clamp(300px,52svh,540px); }
  .panel,body[data-layout=side] .panel { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); max-height: none; padding: 22px; gap: 24px; }
  .panel fieldset:nth-child(2) { grid-column: 2; grid-row: span 2; }
  #reset,body[data-layout=side] #reset { grid-column: 1/-1; justify-self: end; }
  footer { padding: 24px; }
}
@media(max-width:420px) { .panel,body[data-layout=side] .panel { grid-template-columns: 1fr; } .panel fieldset:nth-child(2) { grid-column: auto; grid-row: auto; } .toolbar output { width: 100%; margin: 4px 0; } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation: none !important; transition: none !important; } ::view-transition-group(*),::view-transition-old(*),::view-transition-new(*) { animation: none !important; } }
