@import url('/assets/fonts.css');

:root {
  --ink: #37293b;
  --plum: #84419C;
  --line: #dfd5de;
  --paper: #FAF8FC;
  --muted: #675a67;
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'DM Sans', Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-underline-offset: 4px; }
button, a, select { touch-action: manipulation; }
:focus-visible { outline: 3px solid #783f84; outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.035em; line-height: 1.08; }
.container { width: min(1440px, calc(100% - clamp(36px, 9vw, 148px))); margin-inline: auto; }
.mast { background: var(--plum); color: white; }
.mast-inner { min-height: 70px; display: flex; align-items: center; gap: 20px; }
.mast img { width: 110px; display: block; height: 52px; object-fit: contain; }
.mast-divider { height: 26px; width: 1px; background: #ffffff50; }
.mast-inner > span:last-of-type, .site-link { font-size: 14px; }
.site-link { margin-left: auto; padding: 10px 0; }
.site-link span { margin-left: 6px; }
.intro { padding: clamp(24px, 3vw, 44px) 0 26px; }
h1 { font-size: clamp(36px, 3.8vw, 60px); }
.intro p { color: var(--muted); margin: 9px 0 22px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.choice {
  border: 0; border-radius: 10px; background: var(--base); color: var(--paper-card);
  text-align: left; position: relative; overflow: hidden; isolation: isolate;
  min-height: 100px; padding: 20px clamp(16px, 1.5vw, 24px);
}
.choice:focus-visible { outline: 3px solid #251329; outline-offset: 4px; }
.choice[aria-pressed=true] { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--base); }
.card-name, .card-accent { display: block; position: relative; }
.card-name { font: 400 clamp(23px, 2vw, 31px)/1.12 var(--serif); }
.card-accent { margin-top: 4px; font-size: 14px; }
.card-sample {
  position: absolute; right: -26px; bottom: -35px; width: 35%; height: 111%;
  transform: rotate(23deg); border-radius: 100px 100px 0 0; background: var(--accent);
}
.card-sample::after {
  content: ''; position: absolute; right: -39%; bottom: -13%; width: 90%; height: 95%;
  border-radius: inherit; background: var(--paper-card);
}
.choice:hover .card-sample { transform: translateX(-3px) rotate(23deg); }
.card-check {
  display: none; background: var(--paper-card); color: var(--base); position: absolute;
  top: 9px; right: 9px; border-radius: 50%; width: 23px; height: 23px;
  align-items: center; justify-content: center; font-weight: 700;
}
.choice[aria-pressed=true] .card-check { display: flex; }
.workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 315px); align-items: start; gap: 22px; margin-bottom: 44px; }
.preview-panel, .settings { border: 1px solid var(--line); background: #fff; border-radius: 12px; overflow: hidden; }
.preview-tools, .preview-foot { padding: 8px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.preview-tools { border-bottom: 1px solid var(--line); }
.page-label { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; }
.page-label select { border: 0; background: transparent; color: var(--ink); font-weight: 650; padding: 6px; max-width: 165px; }
.devices { display: flex; gap: 2px; padding: 3px; background: #f2edf2; border-radius: 8px; }
.devices button { background: transparent; border: 0; border-radius: 6px; display: grid; place-items: center; width: 38px; height: 34px; }
.devices button[aria-pressed=true] { background: white; color: var(--plum); box-shadow: 0 1px 4px #30243225; }
.devices svg { height: 18px; width: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.stage { height: clamp(340px, 34vw, 520px); overflow: hidden; display: flex; justify-content: center; align-items: flex-start; background: #eee8ee; position: relative; }
#screen { position: absolute; overflow: hidden; transform-origin: top center; }
iframe { border: 0; background: white; display: block; transform-origin: top left; }
.preview-foot { min-height: 46px; font-size: 13px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.preview-foot > span { color: var(--muted); }
.preview-foot a { font-weight: 650; }
.settings { padding: clamp(18px, 2vw, 26px); }
.settings h2 { font-size: 29px; }
.current-palette { display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); padding: 14px 0 18px; font-size: 14px; }
#palette-sample { height: 21px; width: 32px; border-radius: 20px; background: linear-gradient(to right, var(--base) 50%, var(--accent) 50%); }
.settings label { display: block; font-size: 13px; font-weight: 700; margin: 17px 0 6px; }
.settings select, #share-manual { width: 100%; padding: 10px 12px; border: 1px solid #bdb2be; border-radius: 6px; background: white; color: var(--ink); font-size: 14px; min-height: 44px; }
.film { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0 20px; }
.film button { padding: 0; overflow: hidden; border-radius: 5px; border: 0; background: #e5ded8; aspect-ratio: 1.55; }
.film button[aria-pressed=true] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--plum); }
.film img { width: 100%; height: 100%; object-fit: cover; display: block; }
.actions { display: flex; gap: 7px; flex-direction: column; }
.actions button { min-height: 44px; border-radius: 6px; padding: 9px; background: var(--plum); color: white; border: 1px solid var(--plum); font-size: 14px; font-weight: 650; }
.actions .secondary { background: #fff; color: var(--plum); border-color: #cec5cd; }
.actions button:hover { filter: brightness(.93); }
#notice, #restore { font-size: 13px; color: var(--muted); }
#notice:not(:empty), #restore:not([hidden]), #share-manual:not([hidden]) { display: block; margin-top: 10px; }
.studio-footer { display: flex; gap: 15px; justify-content: space-between; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-block: 20px 30px; }
@media (max-width: 930px) {
  .container { width: calc(100% - 40px); }
  .cards { gap: 10px; }
  .workbench { gap: 14px; grid-template-columns: minmax(0, 1fr) 255px; }
  .card-sample { width: 31%; }
}
@media (max-width: 745px) {
  .container { width: calc(100% - 32px); }
  .mast-inner { min-height: 58px; gap: 11px; }
  .mast img { width: 88px; height: 46px; }
  .mast-inner > span:last-of-type, .site-link { font-size: 12px; }
  .intro { padding-bottom: 17px; }
  .intro p { margin-bottom: 15px; font-size: 14px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice { min-height: 80px; padding: 12px; }
  .card-name { font-size: 23px; }
  .card-accent { font-size: 13px; margin-top: 2px; }
  .card-sample { bottom: -29px; right: -23px; }
  .card-check { width: 19px; height: 19px; font-size: 12px; top: 6px; right: 6px; }
  .workbench { grid-template-columns: 1fr; }
  .stage { height: clamp(245px, 66vw, 380px); }
  .stage.mobile { height: 440px; }
  .film { max-width: 330px; }
  .actions { flex-direction: row; flex-wrap: wrap; }
  .actions button { flex: 1; }
  .preview-tools, .preview-foot { padding: 7px 10px; }
  .preview-foot { gap: 5px 12px; }
}
@media (max-width: 380px) {
  .card-name { font-size: 21px; }
  .page-label { gap: 2px; font-size: 12px; }
  .page-label select { max-width: 110px; }
}
