:root {
  --page-bg: #0c0a09;
  --ipad-bg: #000;
  --ink: #f4f0e9;
  --editor-bg: rgba(24,24,23,.55);
  --editor-ink: #f1eee8;
  --editor-muted: #bdb7ae;
  --editor-edge: rgba(237,230,218,.15);
}
:root[data-theme="light"] {
  color-scheme: light;
  --page-bg: #fff;
  --ipad-bg: #fff;
  --ink: #171717;
  --editor-bg: rgba(240,240,238,.60);
  --editor-ink: #242422;
  --editor-muted: #51514d;
  --editor-edge: rgba(45,45,40,.18);
}
:root, body { background: var(--page-bg); }
.image-section--second { background: var(--ipad-bg); }
.ipad-heading { color: var(--ink); }
.theme-photo { transition: opacity .3s ease; }
.image-section--first > .theme-photo { position: absolute; inset: 0; }
.theme-photo--light { opacity: 0; }
[data-theme="light"] .theme-photo--light { opacity: 1; }
[data-theme="light"] .theme-photo--night { opacity: 0; }
.image-section--first::after { transition: opacity .3s ease; }
[data-theme="light"] .image-section--first::after { opacity: 0; }
.theme-switch {
  display: flex; justify-self: start; align-items: center; gap: 2px;
  padding: 4px; border: 1px solid rgba(255,255,255,.34); border-radius: 999px;
  background: rgba(60,55,48,.5); color: #fff;
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08); pointer-events: auto;
}
.theme-switch button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.theme-switch button[aria-pressed="true"] { background: rgba(235,228,215,.2); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.theme-switch svg, .theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle { background: transparent; cursor: pointer; position: relative; }
.theme-toggle::after { content: ''; position: absolute; width: 44px; height: 44px; left: 50%; top: 50%; transform: translate(-50%,-50%); }
.theme-switch button:hover, .theme-toggle:hover { background: rgba(150,145,135,.22); }
.theme-switch button:focus-visible, .theme-toggle:focus-visible, .language-switch button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.language-switch { position: fixed; z-index: 11; right: max(24px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); min-height: 44px; background: rgba(32,28,24,.8); }
.language-switch__option { min-height: 44px; min-width: 34px; }
.language-switch { padding-block: 0; }
.studio-editor { --edge: var(--editor-edge); --muted: var(--editor-muted); color: var(--editor-ink); background: var(--editor-bg); }
body, .image-section--second, .ipad-heading, .studio-editor, .editor-topbar, .editor-pages, .editor-inspector, .editor-canvas, .editor-tools, .editor-bottom-edge, .menu-pill, .theme-switch, .language-switch { transition: background-color .3s ease, color .3s ease, border-color .3s ease; }
[data-theme="light"] .theme-switch, [data-theme="light"] .language-switch, [data-theme="light"] .menu-pill { background: rgba(245,244,240,.82); color: #22221f; border-color: rgba(45,45,40,.25); }
[data-theme="light"] .theme-switch button[aria-pressed="true"] { background: rgba(65,65,60,.14); box-shadow: inset 0 0 0 1px rgba(45,45,40,.1); }
[data-theme="light"] .menu-link { color: #292925; }
[data-theme="light"] .menu-link.is-active, [data-theme="light"] .menu-link:hover { background: rgba(65,65,60,.12); color: #111; }
[data-theme="light"] .language-switch__option.is-current { color: #111; }
[data-theme="light"] .editor-logo { filter: brightness(0); }
[data-theme="light"] .project-showcase { background: #d9d5ce; }
[data-theme="light"] .studio-editor { border-color: rgba(255,255,255,.55); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 26px 80px rgba(30,30,25,.16); }
[data-theme="light"] .editor-topbar { background: rgba(255,255,255,.18); }
[data-theme="light"] .editor-pages, [data-theme="light"] .editor-inspector { background: rgba(235,235,231,.14); }
[data-theme="light"] .editor-canvas { background: rgba(225,225,221,.1); }
[data-theme="light"] .editor-tools { background: rgba(243,243,240,.78); border-color: rgba(60,60,55,.2); }
[data-theme="light"] .editor-bottom-edge { background: rgba(230,230,225,.35); }
[data-theme="light"] .editor-readout, [data-theme="light"] .editor-page:not(.selected) { color: #484842; }
[data-theme="light"] .studio-editor .selected, [data-theme="light"] .device-switch button[aria-pressed="true"] { background: rgba(70,70,65,.14); color: #171717; box-shadow: inset 0 0 0 1px rgba(40,40,35,.08); }
[data-theme="light"] .device-switch button:hover { color: #111; }
[data-theme="light"] .device-switch button:focus-visible { outline-color: #222; }
[data-theme="light"] .property-value { background: rgba(255,255,255,.30); }
[data-theme="light"] .preview-board { background: #f5f4f0; border-color: rgba(65,65,60,.22); }
[data-theme="light"] .studio-editor[data-preview="phone"] .preview-board { border-color: #d6d5d0; }
@media (max-width: 760px) {
  .theme-switch { grid-column: 1; grid-row: 1; padding: 3px; }
  .language-switch { right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); padding-block: 0; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
