* { box-sizing: border-box; }
:root { color-scheme: light; --ink: #392c36; --muted: #715e65; --line: #d9caca; --accent: #833b5a; }
body { margin: 0; color: var(--ink); background: #f8f4ed; font: 500 15px/1.45 "Instrument Sans", system-ui, sans-serif; }
.sheet { max-width: 1640px; margin: auto; padding: 0 clamp(20px, 4.1vw, 76px) 32px; }
.masthead { display: flex; align-items: center; justify-content: space-between; min-height: 72px; border-bottom: 1px solid var(--line); }
.masthead a { color: inherit; text-decoration: none; font-size: 14px; }
.masthead a:hover { text-decoration: underline; text-underline-offset: 4px; }
.masthead a span { display: inline-block; margin-right: 8px; }
.masthead > span { font: italic 24px/1.1 "Instrument Serif", Georgia, serif; }
main { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(250px, .85fr); align-items: center; gap: clamp(28px, 5vw, 88px); margin-top: clamp(24px, 4vh, 54px); }
.stage { position: relative; overflow: hidden; isolation: isolate; height: clamp(465px, 76vh, 826px); min-width: 0; border-radius: 26px;
  background: radial-gradient(ellipse at 40% 24%, #fff2df 0%, #f6decf 47%, #dfbdbb 100%); }
#viewport { position: absolute; inset: 0; cursor: grab; touch-action: none; border-radius: inherit; }
#viewport:active { cursor: grabbing; }
canvas { width: 100%; height: 100%; display: block; }
.stage-tools { position: absolute; top: 22px; left: 22px; right: 22px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.stage-tools > * { pointer-events: auto; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, #viewport:focus-visible, label:has(input:focus-visible) { outline: 3px solid #864b68; outline-offset: 3px; }
#viewport:focus-visible { outline-offset: -4px; }
.angle, .companion { display: inline-flex; align-items: center; border: 1px solid #bba4a49c; background: #fff9f0d9; border-radius: 40px; }
.angle { padding: 3px; }
.angle button { border: 0; border-radius: 30px; background: transparent; padding: 6px 13px; font-size: 13px; }
.angle button[aria-pressed="true"] { background: #513a47; color: #fff7f2; }
.companion { gap: 8px; padding: 8px 13px; cursor: pointer; font-size: 13px; }
.companion input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch { position: relative; width: 24px; height: 14px; border-radius: 12px; background: #ad9b9f; }
.switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 10px; height: 10px; background: #fff9ed; border-radius: 50%; }
.companion input:checked + .switch { background: #52674d; }
.companion input:checked + .switch::after { transform: translateX(10px); }
.gesture { position: absolute; bottom: 17px; left: 0; right: 0; text-align: center; color: #65515b; font-size: 12px; pointer-events: none; }
.load { position: absolute; top: 44%; width: 100%; margin: 0; padding: 16px; text-align: center; }
.profile { padding-right: min(2vw, 28px); }
.species { display: block; color: var(--accent); font-size: 14px; }
.species span { margin: 0 6px; color: #9b7f89; }
h1 { font: 400 clamp(74px, 7.7vw, 141px)/.92 "Instrument Serif", Georgia, serif; letter-spacing: -.051em; margin: 12px 0 20px; }
.story { margin: 0 0 32px; color: #604e57; line-height: 1.6; max-width: 36ch; font-size: clamp(15px, 1.12vw, 18px); }
.design-group { padding: 19px 0 20px; border-top: 1px solid var(--line); }
h2 { margin: 0 0 14px; font-weight: 600; font-size: 14px; }
.palette { display: flex; flex-wrap: wrap; gap: clamp(12px, 1.6vw, 31px); list-style: none; margin: 0; padding: 0; }
.palette li { display: grid; gap: 6px; font-size: 11px; color: var(--muted); }
.palette i { width: 32px; height: 32px; border-radius: 50%; border: 1px solid #55374422; }
.raspberry { background: #bf537e; } .rose { background: #eb83a1; } .cream { background: #ffe4d6; } .plum { background: #703454; }
.actions > div { display: flex; flex-wrap: wrap; gap: 8px; }
.actions button { padding: 9px 19px; border: 1px solid #ba9da9; background: transparent; border-radius: 22px; font-size: 14px; }
.actions button:hover, .actions button:active { background: #f0e1e1; }
.actions button[aria-pressed="true"] { color: #fff8f5; background: var(--accent); border-color: var(--accent); }
.room-entry { display: inline-flex; align-items: center; gap: 12px; padding: 10px 17px; margin-top: 16px; border-radius: 22px; background: var(--accent); color: #fff8f5; font-size: 14px; font-weight: 600; text-decoration: none; }
.room-entry:hover { background: #683348; }
@media (max-width: 760px) {
  .sheet { padding: 0 16px 22px; } .masthead { min-height: 55px; } .masthead > span { font-size: 21px; }
  main { display: flex; flex-direction: column; align-items: stretch; margin-top: 16px; gap: 22px; }
  .stage { height: clamp(310px, 49svh, 460px); border-radius: 19px; }
  .stage-tools { top: 12px; left: 12px; right: 12px; } .gesture { bottom: 10px; }
  .profile { display: flex; flex-direction: column; padding: 0 4px; } .identity { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 18px; }
  .identity h1 { order: -1; margin: 0; font-size: 61px; } .story { margin: 12px 0 20px; max-width: 54ch; }
  .palette { gap: 24px; } .design-group { order: 2; padding: 15px 0; } .actions { order: 1; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
