:root {
  color-scheme: dark;
  --page: #102d25;
  --panel: #1a4034;
  --well: #123127;
  --text: #fbf2d9;
  --muted: #c2d2bd;
  --line: #5e806b;
  --gold: #f1c369;
  --surround: #c9a06a;
  --dark-ink: #202e23;
  font: 100%/1.55 system-ui,-apple-system,sans-serif;
  color: var(--text);
  background: var(--page);
}
* { box-sizing: border-box; }
body,h1,h2,h3,p { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: .22em; }
button,input,textarea,select { color: inherit; font: inherit; }
button { cursor: pointer; border: 1px solid var(--line); border-radius: .35rem; background: transparent; padding: .62rem .95rem; }
button:disabled { opacity: .65; cursor: default; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
::selection { color: var(--page); background: var(--gold); }
.skip { position: absolute; top: -6rem; left: 1rem; z-index: 2; background: var(--gold); color: var(--dark-ink); padding: .5rem; }
.skip:focus { top: .5rem; }
.masthead,main,footer { width: min(80rem,92%); margin-inline: auto; }
.masthead,footer,.masthead nav { display: flex; align-items: center; flex-wrap: wrap; }
.masthead,footer { justify-content: space-between; gap: .75rem 1.5rem; }
.masthead { padding: 1.15rem 0; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: baseline; gap: .8rem; text-decoration: none; white-space: nowrap; }
.brand b { font: 800 2.4rem/1 system-ui,sans-serif; letter-spacing: -.11em; }
.brand b span { color: #dc8968; }
.brand-name { font-size: clamp(1.22rem,1.6vw,1.5rem); line-height: 1; font-weight: 550; letter-spacing: -.045em; }
.masthead nav { gap: 1.4rem; font-size: .93rem; }
.masthead nav a { text-decoration: none; }
.masthead nav a:hover { text-decoration: underline; }
.nav-export { border-color: var(--gold); color: var(--gold); font-weight: 650; }
.nav-export:hover { background: var(--gold); color: var(--dark-ink); }

.workbench { display: grid; grid-template-columns: minmax(0,.94fr) minmax(0,1.06fr); align-items: start; margin: clamp(1rem,2.7vw,2.4rem) 0; background: var(--panel); border: 1px solid var(--line); border-radius: .85rem; overflow: hidden; }
.editor { min-width: 0; padding: clamp(1.45rem,3.4vw,3.3rem); }
.editor:has(#choose:not([hidden])) { align-self: center; }
#choose h1 { font: 400 clamp(4.1rem,6vw,6rem)/.94 Georgia,serif; letter-spacing: -.07em; }
#choose h1 em { color: var(--gold); white-space: nowrap; }
.lede { max-width: 36ch; margin: 1rem 0 1.6rem; color: var(--muted); font-size: clamp(1rem,1.35vw,1.13rem); }
#choose label[for=prompt] { display: block; margin: 0 0 .5rem; font-size: 1.13rem; font-weight: 650; }
#prompt,#design,#start-design,#write input,#write textarea,.host-choice select {
  width: 100%; padding: .65rem .8rem; color: var(--text); background: var(--well);
  border: 1px solid #88a18a; border-radius: .35rem; line-height: 1.45;
}
::placeholder { color: #afc2ad; opacity: 1; }
#prompt { display: block; min-height: 4.5rem; resize: vertical; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-top: 1rem; }
.primary { color: var(--dark-ink); background: var(--gold); border-color: var(--gold); font-weight: 700; }
.primary:hover { background: #ffda8f; border-color: #ffda8f; }
#choose .primary { padding-inline: 1.25rem; }
#choose .primary span { margin-left: .6rem; }
.start-layout { display: inline-flex; align-items: baseline; gap: .35rem; color: var(--muted); font-size: .88rem; }
#start-design { width: auto; max-width: 100%; padding: .42rem .2rem; color: var(--text); background: var(--panel); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.secondary:hover,.funding-editor button:hover { background: #315443; }
.editor h2,.publishing h2,.gallery h2 { font: 400 clamp(1.9rem,3vw,2.65rem)/1.1 Georgia,serif; letter-spacing: -.045em; }
.hint,.field-hint,.host-choice p,.host-choice a { color: var(--muted); }
.hint { margin: .7rem 0 1.3rem; }
.field-hint,.host-choice p,.host-choice a { font-size: .9rem; }
#write>label,.host-choice label { display: block; margin: 1rem 0 .3rem; font-size: .94rem; font-weight: 650; }
#write small { font-weight: 400; }
#write textarea { resize: vertical; min-height: 5rem; }
.field-hint,#download-status,#publish-status { margin-top: .45rem; }
.summary { border-left: 3px solid var(--gold); padding: .45rem .8rem; font-weight: 650; overflow-wrap: anywhere; }
#publish-panel,.host-choice { margin: 1rem 0; }
.host-choice p { margin: .6rem 0 .3rem; }
fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.funding-editor { margin: 1.45rem 0; }
.funding-editor > legend { padding: 0; font: 400 1.4rem/1.15 Georgia,serif; }
.fund-row { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: .55rem; margin: .8rem 0; padding: .6rem .85rem .85rem; border: 1px solid var(--line); border-radius: .35rem; }
.fund-row legend { padding: 0 .35rem; font-size: .85rem; font-weight: 650; }
.fund-row label { font-size: .85rem; }
.fund-row label:nth-of-type(3) { grid-column: 1/-1; }
.fund-row button { justify-self: start; padding: .3rem .5rem; font-size: .85rem; }

.preview,dialog { color-scheme: light; color: var(--dark-ink); background: var(--surround); }
.preview { align-self: stretch; min-width: 0; padding: clamp(1rem,2.1vw,1.85rem); }
.preview header,dialog header { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; margin-bottom: .75rem; }
.preview h2,dialog h2 { margin-right: auto; font-size: 1rem; font-weight: 700; }
.preview button,dialog button { padding: .44rem .62rem; border-color: #715b3c; font-size: .875rem; }
.preview button:hover,dialog button:hover { background: #e2bd8a; }
.preview :focus-visible,dialog :focus-visible { outline-color: var(--dark-ink); }
iframe { display: block; width: 100%; height: 32rem; border: 1px solid #805f3f; border-radius: .3rem; background: #ebdcbb; }
dialog { width: min(70rem,96vw); max-height: 96vh; padding: 1rem; border: 1px solid #805f3f; border-radius: .6rem; }
dialog::backdrop { background: #061b15cf; }
dialog iframe { height: 75vh; }

.gallery { margin: clamp(2rem,4vw,3.5rem) 0; }
.gallery h2 { margin-bottom: 1rem; }
.campaign-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1rem; }
.campaign-card { display: block; overflow: hidden; padding-bottom: 1.25rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--panel); text-decoration: none; }
.campaign-card img { display: block; width: 100%; height: clamp(8rem,13vw,12rem); object-fit: cover; }
.venture img { background: #30283e; object-fit: contain; padding: .9rem; }
.recovery img { object-fit: contain; background: #e8b796; }
.campaign-card span,.campaign-card h3,.campaign-card p { display: block; margin: .45rem 1rem 0; }
.campaign-card span { margin-top: 1rem; font-size: .83rem; color: var(--gold); }
.campaign-card h3 { font: 400 1.5rem/1.1 Georgia,serif; }
.campaign-card p,.publishing p,footer { color: var(--muted); }
.campaign-card:is(:hover,:focus-visible) { border-color: var(--gold); }
.campaign-card:is(:hover,:focus-visible) h3 { text-decoration: underline; text-underline-offset: .15em; }
.publishing { margin: clamp(2rem,4vw,3.5rem) 0; max-width: 47rem; }
.publishing p { margin-top: .75rem; }
footer { border-top: 1px solid var(--line); padding: 1.2rem 0 1.8rem; font-size: .9rem; }

@media(max-width:64rem) { .campaign-list { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:48rem) {
  .masthead { padding: .85rem 0; }
  .masthead nav { gap: 1rem; }
  .workbench { grid-template-columns: 1fr; }
  .editor { padding: clamp(1.05rem,4vw,2rem); }
  #choose h1 { font-size: clamp(2.8rem,10.5vw,4.4rem); }
  .lede { margin: .7rem 0 1.1rem; }
  .preview { padding: .85rem; }
  .preview iframe { height: 26rem; }
  .preview button { font-size: .8rem; padding: .4rem .5rem; }
}
@media(max-width:32rem) {
  .brand { gap: .6rem; }
  #choose .actions { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: end; gap: .85rem; }
  #choose .primary { padding-inline: .85rem; }
  .start-layout { display: grid; gap: 0; line-height: 1.25; }
  #start-design { width: 100%; padding-block: .22rem; text-overflow: ellipsis; }
  .campaign-list { grid-template-columns: 1fr; }
  .campaign-card img { height: 11rem; }
  .masthead nav { width: 100%; justify-content: flex-start; }
  .nav-export { margin-left: auto; padding: .4rem .7rem; }
}
