:root {
  color-scheme: dark;
  --ink: #edf3ee;
  --muted: #aab9ae;
  --paper: #111713;
  --surface: #1b241e;
  --control: #151d18;
  --line: #334139;
  --control-line: #587060;
  --hover: #26392d;
  --link: #c1dfb9;
  --focus: #cbe38c;
  --selected: #cce397;
  --selected-ink: #253521;
  --tag-paper: #293d30;
  --tag-ink: #c1dfb9;
  --hero: #254637;
  --hero-end: #182b21;
  --hero-line: #3a5545;
  --shadow: #0007;
  --art-base: #466653;
  --art-stripe: #263c30;
  --art-shade: #344f40;
  --lime: #e9f49b;
  --lime-hover: #f5ffc2;
  --lime-ink: #233326;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
:root[data-theme="light"] {
  color-scheme: light;
  --ink: #202820;
  --muted: #586058;
  --paper: #f6f4ef;
  --surface: #fffefa;
  --control: #fbfaf6;
  --line: #dadcd2;
  --control-line: #bac5bb;
  --hover: #eaf0e0;
  --link: #28523f;
  --focus: #438059;
  --selected: #2b4a3c;
  --selected-ink: #fff;
  --tag-paper: #eaf0e0;
  --tag-ink: #355738;
  --hero: #2b4a3c;
  --hero-end: #2b4a3c;
  --hero-line: #2b4a3c;
  --shadow: #18241a2b;
  --art-base: #b7c99d;
  --art-stripe: #dce5c7;
  --art-shade: #829878;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.wrap { width: min(1180px, calc(100% - 64px)); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); }
.top-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: inline-flex; gap: 9px; align-items: center; font-size: 23px; font-weight: 800; letter-spacing: -.05em; }
.mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--lime); color: var(--lime-ink); font-size: 24px; line-height: 1; }
.top nav a { font-size: 14px; font-weight: 650; }
.top nav { display: flex; align-items: center; gap: 18px; margin-inline-start: auto; }
.top nav .nav-add { padding: 8px 12px; border-radius: 9px; border: 1px solid var(--control-line); color: var(--link); }
.top nav .nav-add:hover { background: var(--hover); text-decoration: none; }
.top nav .nav-account[aria-current="page"] { color: var(--link); }
.top nav a:hover, .back:hover { text-decoration: underline; }
.theme-toggle {
  display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px;
  padding: 0; border: 1px solid var(--control-line); border-radius: 9px;
  background: var(--surface); color: var(--link); cursor: pointer;
  font: 20px/1 "Segoe UI Symbol", system-ui, sans-serif;
}
.theme-toggle:hover { background: var(--hover); }
.theme-toggle[hidden], .theme-moon, [data-theme="light"] .theme-sun { display: none; }
[data-theme="light"] .theme-moon { display: block; }
.intro { margin-top: 28px; border: 1px solid var(--hero-line); border-radius: 22px; padding: 44px 52px; min-height: 370px; background: linear-gradient(120deg, var(--hero), var(--hero-end)); color: #f4f8f2; overflow: hidden; display: grid; align-items: center; grid-template-columns: 1.08fr 1fr; gap: 30px; }
h1, h2, h3, p { margin: 0; }
.intro h1 { font-size: clamp(44px, 6.05vw, 82px); line-height: .97; letter-spacing: -.075em; font-weight: 790; }
.intro h1 span { color: var(--lime); }
.intro p { max-width: 390px; margin: 22px 0 25px; font-size: 17px; line-height: 1.53; color: #eef3ea; }
.button { display: inline-flex; align-items: center; gap: 18px; background: var(--lime); color: var(--lime-ink); border-radius: 10px; padding: 12px 16px; font-weight: 750; font-size: 14px; }
.button:hover { background: var(--lime-hover); }
.intro-art { display: grid; grid-template: repeat(2, 130px) / 1.2fr 1fr; gap: 10px; transform: rotate(-6deg) scale(1.05); }
.intro-art .art { min-width: 0; border-radius: 12px; border: 1px solid #ffffff3d; }
.intro-art .art:first-child { grid-row: span 2; }
#projects, .more { padding-top: 38px; scroll-margin-top: 18px; }
h2 { font-size: clamp(25px, 4vw, 36px); letter-spacing: -.055em; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 17px 0 20px; }
.filters button { cursor: pointer; border: 1px solid var(--control-line); color: var(--ink); background: var(--control); padding: 8px 14px; border-radius: 100px; font-size: 14px; font-weight: 650; }
.filters button[aria-pressed="true"] { background: var(--selected); border-color: var(--selected); color: var(--selected-ink); }
.filters button:hover:not([aria-pressed="true"]) { background: var(--hover); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; overflow: hidden; transition: box-shadow .18s, transform .18s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 22px var(--shadow); }
.card .art { width: 100%; aspect-ratio: 2.12; background-position: center; background-size: cover; }
.art { background-color: #456b5b; background-position: center; background-size: cover; }
.art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.art-photo { background-color: #98745a; background-image: url("/images/covers/photo.webp"); }
.art-audio { background-color: #294b53; background-image: url("/images/covers/audio.webp"); }
.art-text { background-color: #a85b48; background-image: url("/images/covers/text.webp"); }
.art-data { background-color: #233951; background-image: url("/images/covers/data.webp"); }
.art-space { background-color: #272846; background-image: url("/images/covers/space.webp"); }
.art-default { background-image: repeating-linear-gradient(120deg, var(--art-base) 0 26px, var(--art-stripe) 26px 52px, var(--art-shade) 52px 78px); }
.card-info { display: flex; flex-direction: column; align-items: flex-start; flex: 1; padding: 15px 17px 16px; }
.category, .tag { color: var(--tag-ink); background: var(--tag-paper); border-radius: 100px; padding: 3px 9px; font-size: 12px; font-weight: 750; }
.card h3 { margin-top: 7px; letter-spacing: -.035em; font-size: 22px; }
.card p { color: var(--muted); line-height: 1.45; font-size: 14px; margin: 6px 0 13px; }
.open { margin-top: auto; display: flex; gap: 7px; font-size: 14px; font-weight: 750; color: var(--link); }
.footer { margin-top: 54px; border-top: 1px solid var(--line); min-height: 75px; display: flex; align-items: center; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 13px; }
.footer .brand { color: var(--ink); font-size: 19px; }
.player-heading { padding: 24px 0 18px; }
.back { color: var(--link); font-size: 14px; font-weight: 700; }
.player-title { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.player-heading h1 { font-size: clamp(31px, 6vw, 57px); letter-spacing: -.065em; line-height: 1.1; }
.player-heading > h1 { margin-top: 10px; }
.player-heading p { color: var(--muted); margin-top: 7px; }
.project-back { display: inline-block; margin: 24px 0 16px; }
.project-details {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 36px); align-items: center;
  padding: clamp(16px, 3vw, 28px); border: 1px solid var(--line); border-radius: 20px; background: var(--surface);
}
.project-details .art { aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; }
.project-info { min-width: 0; overflow-wrap: anywhere; }
.project-info h1 { font-size: clamp(29px, 4vw, 49px); line-height: 1.06; letter-spacing: -.055em; }
.project-info p { margin: 12px 0 20px; color: var(--muted); line-height: 1.55; white-space: pre-line; }
.project-start { justify-content: center; min-height: 48px; }
.login-gate {
  position: fixed; width: min(440px, calc(100% - 32px)); max-width: none; margin: auto;
  padding: clamp(20px, 5vw, 30px); border: 1px solid var(--control-line); border-radius: 18px;
  background: var(--surface); color: var(--ink); box-shadow: 0 16px 48px var(--shadow);
}
.login-gate::backdrop { background: #070b08b8; }
.login-gate h2 { padding-right: 28px; font-size: clamp(24px, 5vw, 31px); line-height: 1.15; }
.login-gate p { margin: 12px 0 20px; color: var(--muted); line-height: 1.5; }
.login-gate .button { min-height: 44px; justify-content: center; }
.login-gate-close {
  position: absolute; top: 10px; right: 10px; width: 40px; height: 40px;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; font-size: 24px;
}
.login-gate-close:hover { background: var(--hover); }
.project-counts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
  margin: 22px 0 0; padding-top: 14px; border-top: 1px solid var(--line);
}
.project-counts dt { color: var(--muted); font-size: 13px; }
.project-counts dd { margin: 4px 0 0; font-size: 21px; font-weight: 750; font-variant-numeric: tabular-nums; }
.project-counts [data-count="active"] { color: var(--link); }
.frame-box { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; overflow: hidden; }
.frame-box iframe { display: block; width: 100%; border: 0; height: clamp(500px, 78vh, 770px); color-scheme: light; }
.run-page { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.run-bar { flex: 0 0 auto; display: flex; padding: 3px 8px; border-bottom: 1px solid var(--line); }
.run-back {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px;
  color: var(--link); font-size: 27px; line-height: 1;
}
.run-back:hover { background: var(--hover); }
.project-run { flex: 1; min-height: 0; }
.project-run > iframe { display: block; width: 100%; height: 100%; border: 0; color-scheme: light; }
.project-run:not(:has(iframe)) { padding: 16px; color: var(--muted); }
.more .grid { margin-top: 15px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 10px; }
.stat { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; }
.stat strong { font-size: 30px; }
.stat small, .report p { color: var(--muted); }
.report { margin-top: 30px; }
.table-wrap { overflow: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 12px 10px 0; }
.author-heading { padding-bottom: 23px; }
.author-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 820px; }
.author-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
a.author-choice:hover { border-color: var(--control-line); box-shadow: 0 8px 19px var(--shadow); }
.author-choice h2 { font-size: 27px; }
.author-choice p { color: var(--muted); line-height: 1.5; margin-bottom: 8px; }
.choice-icon { display: grid; place-items: center; min-width: 40px; height: 40px; border-radius: 10px; background: var(--lime); color: var(--lime-ink); font-weight: 750; }
.author-form { display: grid; gap: 17px; max-width: 760px; }
.author-panel { display: grid; gap: 13px; min-width: 0; margin: 0; padding: 15px 18px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.author-panel legend { padding: 0 6px; font-weight: 750; font-size: 18px; }
.author-panel label { display: grid; gap: 6px; font-size: 14px; font-weight: 650; min-width: 0; }
.author-panel input, .author-panel textarea, .author-panel select { min-width: 0; width: 100%; border: 1px solid var(--control-line); border-radius: 8px; padding: 8px 10px; color: var(--ink); background: var(--control); font: inherit; font-weight: 400; }
.author-panel textarea { resize: vertical; }
.author-panel input::placeholder, .author-panel textarea::placeholder { color: var(--muted); opacity: 1; }
.author-panel summary { cursor: pointer; font-weight: 750; }
.author-panel[open] > summary { margin-bottom: 7px; }
.author-options { display: grid; gap: 9px; }
.author-form [hidden], .build-panel [hidden] { display: none; }
.build-panel { max-width: 760px; }
.fields-row { display: grid; gap: 13px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-help, .author-status { color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.5; }
.field-help code { overflow-wrap: anywhere; }
.author-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.author-actions .button { border: 0; cursor: pointer; }
.author-actions .publish-button { background: var(--selected); color: var(--selected-ink); }
.author-actions .publish-button:hover:not(:disabled) { filter: brightness(1.08); }
.author-actions .button:disabled { opacity: .55; cursor: default; }
#author-preview { margin-top: 25px; max-width: 760px; }
#author-preview h2 { margin-bottom: 12px; }
#preview-frame iframe { height: 385px; min-height: 0; }
.hosted-preview-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 13px; }
.hosted-preview-actions + .author-status { margin-top: 10px; }
.author-guide { max-width: 760px; line-height: 1.6; }
.guide-nav { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 14px 0; border-block: 1px solid var(--line); }
.guide-nav a { color: var(--link); font-size: 14px; font-weight: 650; }
.guide-nav a:hover { text-decoration: underline; }
.guide-section { margin-top: 26px; scroll-margin-top: 16px; }
.guide-section h2 { font-size: clamp(24px, 4vw, 30px); line-height: 1.2; }
.guide-section h3 { margin-top: 18px; font-size: 17px; }
.guide-section p, .guide-section pre { margin-top: 10px; }
.guide-section ol { padding-inline-start: 23px; }
.guide-section li + li { margin-top: 7px; }
.guide-section pre {
  overflow: auto; margin-bottom: 0; padding: 13px 15px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); font-size: 13px;
}
.guide-section p code, .guide-section li code { overflow-wrap: anywhere; }
.guide-section .button { margin-top: 14px; }
.account-page { max-width: 470px; margin: 20px auto 0; }
.account-panel { padding: clamp(16px, 4vw, 26px); gap: 20px; }
.account-form, .account-providers { display: grid; gap: 12px; }
.account-form input { min-height: 42px; }
.account-form .button, .account-panel > .button { justify-content: center; border: 0; cursor: pointer; }
.account-modes { display: flex; gap: 8px; }
.account-modes button, .account-provider {
  border: 1px solid var(--control-line); border-radius: 9px; padding: 9px 12px;
  background: var(--control); color: var(--ink); cursor: pointer; font-size: 14px; font-weight: 650;
}
.account-modes button[aria-pressed="true"] { border-color: var(--selected); background: var(--selected); color: var(--selected-ink); }
.account-provider { text-align: center; }
.account-provider:hover:not(:disabled), .account-modes button:hover:not([aria-pressed="true"]):not(:disabled) { background: var(--hover); }
.account-panel button:disabled { opacity: .58; cursor: default; }
.account-providers { padding-top: 16px; border-top: 1px solid var(--line); }
.account-status { font-size: 14px; line-height: 1.5; color: var(--link); }
.account-status:empty { margin-top: -20px; }
.account-name { font-size: 25px; overflow-wrap: anywhere; }
.account-info { display: grid; gap: 14px; margin: 0; }
.account-info dt { font-size: 13px; color: var(--muted); }
.account-info dd { margin: 2px 0 0; font-weight: 650; overflow-wrap: anywhere; }
.wallet-panel { margin-bottom: 16px; padding: clamp(16px, 4vw, 26px); gap: 16px; }
.wallet-overview { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.wallet-overview h2 { font-size: clamp(18px, 5vw, 23px); letter-spacing: -.025em; }
.wallet-overview p { color: var(--muted); font-size: 13px; }
.wallet-coin {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--lime); color: var(--lime-ink); font-size: 23px; font-weight: 850;
  box-shadow: inset 0 0 0 3px var(--lime), inset 0 0 0 4px #798748;
}
.wallet-balance { color: var(--link); font-size: clamp(22px, 6vw, 34px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wallet-form { display: grid; gap: 10px; }
.wallet-form[hidden] { display: none; }
.wallet-form .button { border: 0; cursor: pointer; justify-content: center; }
.wallet-form .button:disabled, .wallet-packages:disabled { opacity: .66; }
.wallet-packages { min-width: 0; padding: 0; border: 0; margin: 0; }
.wallet-packages legend { margin-bottom: 8px; padding: 0; font-size: 14px; }
.wallet-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wallet-options label { position: relative; }
.wallet-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.wallet-options span {
  display: grid; place-items: center; min-height: 38px; border: 1px solid var(--control-line);
  border-radius: 9px; background: var(--control); cursor: pointer;
}
.wallet-options input:checked + span { background: var(--tag-paper); border-color: var(--selected); color: var(--tag-ink); }
.wallet-options input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
.wallet-status:empty { margin-top: -16px; }
.wallet-history { border-top: 1px solid var(--line); padding-top: 14px; }
.wallet-history h3 { font-size: 15px; }
.wallet-history ul { list-style: none; margin: 8px 0 0; padding: 0; }
.wallet-history li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14px; }
.wallet-history li + li { border-top: 1px solid var(--line); }
.wallet-history time { display: block; color: var(--muted); font-size: 12px; }
.wallet-history strong { color: var(--link); }
@media (max-width: 840px) {
  .wrap { width: calc(100% - 38px); }
  .intro { padding: 36px 30px; }
  .intro-art { grid-template-rows: repeat(2, 95px); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .project-details { grid-template-columns: minmax(0, 1fr); }
  .project-start { width: 100%; }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 26px); }
  .top-inner { min-height: 59px; gap: 10px; }
  .top nav { gap: 8px; }
  .top nav a { font-size: 12px; }
  .top nav .nav-add { padding: 7px 8px; }
  .author-choices, .fields-row { grid-template-columns: minmax(0, 1fr); }
  .intro { display: block; margin-top: 14px; padding: 25px 19px; border-radius: 16px; }
  .intro p { font-size: 15px; margin: 16px 0; }
  .intro-art { margin-top: 24px; transform: none; grid-template: 68px / repeat(3, 1fr); }
  .intro-art .art:first-child { grid-row: auto; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .card .art { aspect-ratio: 2.5; }
  .frame-box iframe { height: min(700px, 78vh); min-height: 465px; }
}
@media (max-width: 500px) {
  .top-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding-block: 10px; }
  .top nav { grid-row: 2; grid-column: 1 / -1; margin: 0; flex-wrap: wrap; }
  .theme-toggle { grid-row: 1; grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }
