@font-face {
  font-family: 'Geist Variable';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('./fonts/geist-latin-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Geist Mono Variable';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('./fonts/geist-mono-latin-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/instrument-serif-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/instrument-serif-latin-400-italic.woff2') format('woff2');
}

:root {
  color-scheme: light;
  font-family: 'Geist Variable', system-ui, sans-serif;
  --ink: #12182a;
  --muted: #575d6d;
  --line: #dedfdc;
  --paper: #f6f4ee;
  --panel: #fff;
  --accent: #293bd8;
  --accent-dark: #2230b5;
  --tint: #eef0ff;
  --mono: 'Geist Mono Variable', ui-monospace, monospace;
  background: var(--paper);
  color: var(--ink);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, p, fieldset { margin: 0; }
body { line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, select, summary { cursor: pointer; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
a { color: var(--accent-dark); text-underline-offset: .22em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#workspace, #about, #preview, #brief-title { scroll-margin-top: 1.25rem; }

.shell { width: min(1240px, calc(100% - 72px)); margin-inline: auto; }
.skip-link { position: absolute; inset: .5rem auto auto .5rem; z-index: 5; color: #fff; background: var(--accent); padding: .75rem 1rem; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.site-header { border-bottom: 1px solid #e5e2da; background: #fbfaf6; }
.header-inner { display: flex; min-height: 73px; gap: 1rem; align-items: center; justify-content: space-between; }
.wordmark, .header-inner nav { display: flex; align-items: center; gap: .75rem; }
.wordmark { font-size: 1.55rem; font-weight: 700; letter-spacing: -.065em; color: var(--ink); text-decoration: none; }
.wordmark img { display: block; }
.wordmark-studio { margin-inline-start: .48rem; color: var(--muted); font: 500 .66rem var(--mono); letter-spacing: .075em; text-transform: uppercase; }
.header-inner nav { gap: clamp(1rem, 3vw, 2rem); }
.header-inner nav a { color: var(--ink); font-weight: 550; font-size: .875rem; text-decoration: none; }
.header-inner nav a:hover { color: var(--accent); }
.header-inner .tools-link { padding: .58rem .9rem; border: 1px solid #dbdcd9; border-radius: 7px; background: #fff; }
.header-inner .tools-link:hover { border-color: #a3ace8; }

.hero { position: relative; isolation: isolate; overflow: hidden; margin-block: 24px 26px; min-height: 350px; display: grid; align-items: center; border: 1px solid #e2ddd1; border-radius: 15px; background: #f3efe6; }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% center; z-index: -1; }
.hero-copy { padding: 42px clamp(25px, 5vw, 64px); }
.eyebrow { color: var(--accent-dark); font: 650 .735rem var(--mono); letter-spacing: .15em; text-transform: uppercase; }
h1 { margin-block: .78rem .85rem; max-width: 10em; font-family: 'Instrument Serif', Georgia, serif; font-size: clamp(3.35rem, 6.2vw, 6rem); font-weight: 400; letter-spacing: -.036em; line-height: .89; }
h1 em { font-weight: inherit; color: var(--accent); }
.hero-summary { color: #3f4350; max-width: 37ch; font-size: clamp(.98rem, 1.5vw, 1.1rem); line-height: 1.5; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.editor { display: grid; gap: 18px; min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; min-width: 0; box-shadow: 0 4px 13px #25283a06; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: .55rem; min-height: 72px; padding: 12px 22px; border-bottom: 1px solid #ececea; }
.panel-title { display: flex; align-items: center; gap: .72rem; min-width: 0; }
.panel-title h2 { font-size: 1.27rem; line-height: 1.2; font-weight: 670; letter-spacing: -.045em; }
.icon-tile { width: 36px; height: 36px; display: grid; flex: none; place-items: center; color: var(--accent-dark); border-radius: 8px; background: var(--tint); --icon-fill: var(--tint); }
.panel-body { padding: 20px 22px 22px; }
.stack { display: grid; gap: 16px; }
.field { display: grid; gap: .45rem; min-width: 0; }
.field-heading { display: flex; gap: .5rem; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.field label, .preset-picker legend { color: #272c3a; font-size: .9rem; font-weight: 620; }
.field :is(textarea, input, select) { width: 100%; min-width: 0; border: 1px solid #d9dbdf; border-radius: 7px; padding: .69rem .74rem; background: #fcfcfd; color: var(--ink); font-size: 1rem; }
.field :is(select, input) { min-height: 44px; }
.field select { appearance: none; padding-inline-end: 2rem; background: #fcfcfd url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23545b74' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5'/%3E%3C/svg%3E") right .7rem center / 1rem no-repeat; }
.field textarea { min-height: 104px; resize: vertical; }
.field textarea::placeholder, .field input::placeholder { color: #676d7c; }
.field :is(textarea, input, select):focus { border-color: var(--accent); background-color: #fff; outline-offset: 1px; }
.field select:disabled { color: #6b707b; background-color: #f2f2f4; cursor: default; }
.platform-field { max-width: 19rem; }
.text-button { display: inline-flex; gap: .35rem; align-items: center; min-height: 32px; color: var(--accent-dark); border: 0; background: transparent; padding: .1rem .15rem; font-size: .875rem; font-weight: 620; }
.text-button:hover { text-decoration: underline; text-underline-offset: .2em; }
.text-button.reset { color: var(--muted); }
.reset svg { width: 16px; height: 16px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.button { min-height: 43px; padding: .62rem .9rem; border-radius: 7px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: .48rem; font-size: .875rem; font-weight: 630; line-height: 1.28; text-decoration: none; }
.button svg { width: 17px; height: 17px; flex: none; }
.button-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
.button-secondary { background: #fff; border-color: #d8dbe2; color: #282f44; }
.button-secondary:hover:not(:disabled) { background: #f5f6ff; border-color: #a3ace8; color: var(--accent-dark); }
.button-primary:disabled { background: #e3e6f6; border-color: #e3e6f6; color: #505987; }
.button-secondary:disabled { background: #fafafa; color: #656b7b; }
.ai-note { color: var(--muted); font-size: .82rem; }
.direction-message { padding: .7rem .8rem; border-radius: 6px; font-size: .875rem; color: #253690; background: #eef0ff; }
.direction-message.is-error { color: #802b24; background: #fcf0eb; }

.group { border-top: 1px solid #e9e9ed; }
.group summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: .6rem; font-size: .9rem; font-weight: 590; list-style: none; }
.group summary::-webkit-details-marker { display: none; }
.group summary:hover { color: var(--accent-dark); }
.group summary svg { flex: none; color: #565f7c; }
.group[open] summary svg { transform: rotate(180deg); }
.copy-group { margin-block-end: -.5rem; }
.group-content { padding-block: .4rem 1rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem .75rem; }
.preset-picker { border: 0; padding: 0; min-width: 0; }
.preset-picker legend { padding: 0; margin-bottom: .6rem; }
.presets { display: flex; flex-wrap: wrap; gap: .4rem; }
.preset { min-height: 36px; padding: .4rem .72rem; border: 1px solid #d9dce6; background: #fff; color: #31394d; border-radius: 999px; font-size: .875rem; font-weight: 540; }
.preset:hover { border-color: #a3ace8; color: var(--accent-dark); }
.preset[aria-pressed='true'] { border-color: #a1aae9; color: var(--accent-dark); background: var(--tint); }
.checkboxes { display: grid; gap: .65rem; }
.checkboxes label { display: flex; align-items: start; gap: .5rem; font-size: .9rem; }
.checkboxes input { accent-color: var(--accent); width: 1.125rem; height: 1.125rem; margin: .14rem 0 0; flex: none; }
.project-actions { padding-top: .9rem; border-top: 1px solid #e9e9ed; }

.preview { position: sticky; top: 18px; }
.variant { display: inline-flex; align-items: center; padding: 3px; gap: 1px; background: #f1f2f7; border: 1px solid #e8eaf1; border-radius: 8px; }
.variant button { padding: .3rem .59rem; min-height: 30px; border: 0; border-radius: 5px; color: #505870; background: transparent; font-size: .85rem; font-weight: 590; }
.variant button[aria-pressed='true'] { background: #fff; color: var(--accent-dark); box-shadow: 0 1px 4px #24315c17; }
.preview-body { display: grid; gap: .85rem; }
.brief-notes { margin: 0; padding: .6rem .8rem .6rem 1.75rem; border-left: 2px solid #a1aae9; background: #f4f5fe; color: #39466c; font-size: .85rem; line-height: 1.5; }
.brief-notes li + li { margin-top: .3rem; }
.prompt-paper { display: grid; border: 1px solid #dde2f1; border-radius: 8px; overflow: hidden; background: #f8f9ff; }
.empty-prompt { display: grid; justify-items: center; align-content: center; gap: .3rem; padding: 1.25rem; min-height: 203px; text-align: center; }
.empty-icon { display: grid; place-items: center; margin-bottom: .5rem; width: 40px; height: 40px; color: var(--accent); background: #eaedff; border-radius: 50%; }
.empty-prompt strong { font-size: 1.025rem; letter-spacing: -.025em; }
.empty-prompt p { font-size: .9rem; color: var(--muted); }
.prompt-content { min-height: 203px; max-height: min(36vh, 370px); overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; padding: 1rem; color: #232e53; font: .855rem/1.65 var(--mono); }
.prompt-content:focus-visible { outline-offset: -3px; }
.prompt-meta { display: flex; justify-content: space-between; gap: .5rem; padding: .6rem 1rem; border-top: 1px solid #dde2f1; color: #515c7c; font: .77rem var(--mono); }
.export-actions > * { flex: 1; }
.chat-handoff { display: flex; align-items: baseline; justify-content: space-between; gap: .55rem; padding-top: .15rem; }
.chat-handoff p { font-size: .82rem; line-height: 1.45; color: var(--muted); }
.chat-handoff a { flex: none; font-size: .83rem; font-weight: 640; }
.chat-handoff a:hover { text-decoration-thickness: 2px; }
.mobile-preview-link, .mobile-brief-link { display: none; }

.site-footer { margin-top: 35px; padding: 20px 0 25px; border-top: 1px solid #deddd6; display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: .9rem 1.5rem; }
.footer-brand { display: flex; align-items: center; gap: .7rem; }
.footer-brand img { flex: none; }
.footer-brand strong { font-size: .875rem; }
.footer-brand p, .privacy { font-size: .82rem; color: var(--muted); }
.privacy { display: flex; align-items: center; gap: .38rem; }
.privacy svg { flex: none; width: 15px; }
.no-script { padding: .85rem; }
.toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 3; max-width: min(28rem, calc(100% - 2rem)); border-radius: 8px; background: #151e3c; color: #fff; box-shadow: 0 5px 25px #131b3d36; font-size: .94rem; }
.toast:not(:empty) { padding: .8rem 1rem; }

@media (max-width: 1000px) {
  .shell { width: calc(100% - 48px); }
  .hero { min-height: 305px; }
  .hero-art { object-position: 66% center; }
  .panel-heading, .panel-body { padding-inline: 16px; }
}

@media (min-width: 801px) and (max-height: 630px) {
  .preview { position: static; }
}

@media (max-width: 800px) {
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .preview { position: static; }
  .mobile-preview-link:not([hidden]) { display: inline-flex; padding-inline: .3rem; }
  .mobile-brief-link { display: inline-flex; }
  .prompt-content { max-height: 24rem; }
  .chat-handoff { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .shell { width: calc(100% - 28px); }
  .header-inner { min-height: 63px; }
  .wordmark { gap: .5rem; font-size: 1.42rem; }
  .wordmark img { width: 33px; height: 33px; }
  .wordmark-studio, .header-inner .about-link { display: none; }
  .header-inner .tools-link { padding: .48rem .65rem; }
  .hero { margin-block: 14px 16px; display: flex; flex-direction: column; align-items: stretch; min-height: 0; }
  .hero-copy { padding: 26px 19px 12px; }
  h1 { font-size: clamp(3rem, 11vw, 4.2rem); margin-block: .65rem; }
  .hero-art { position: static; order: 2; width: 100%; height: clamp(112px, 34vw, 190px); object-position: right center; object-fit: cover; }
  .panel-heading { min-height: 62px; }
  .panel-body { padding-block: 16px; }
  .panel-title h2 { font-size: 1.18rem; }
  .icon-tile { width: 30px; height: 30px; }
  .field select { padding-inline-start: .5rem; background-position: right .45rem center; }
  .site-footer { margin-top: 22px; }
}

@media (max-width: 345px) {
  .field-grid { grid-template-columns: minmax(0, 1fr); }
  .panel-heading, .panel-body { padding-inline: 12px; }
  .variant button { padding-inline: .4rem; }
}
