:root {
  color-scheme: dark;
  --bg: #080b17;
  --surface: rgba(18, 23, 43, .9);
  --surface-alt: #151b31;
  --result-surface: rgba(10, 14, 31, .86);
  --border: rgba(183, 204, 255, .16);
  --border-strong: rgba(170, 195, 255, .28);
  --text: #f7f8ff;
  --muted: #b9c2d9;
  --dim: #919bb6;
  --cyan: #66edf3;
  --violet: #ae91ff;
  --lime: #d4fc88;
  --danger: #ff9ab4;
  --shadow: 0 24px 70px rgba(0, 0, 0, .32);
  --result-shadow: 0 26px 70px rgba(1, 5, 18, .36), 0 0 0 1px rgba(157, 186, 255, .06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
body::before, body::after { content: ""; position: fixed; z-index: -1; width: 35rem; height: 35rem; border-radius: 50%; filter: blur(80px); opacity: .13; pointer-events: none; }
body::before { top: -16rem; left: -12rem; background: var(--cyan); }
body::after { top: 12rem; right: -18rem; background: var(--violet); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.skip-link { position: fixed; z-index: 10; top: .75rem; left: .75rem; padding: .7rem 1rem; transform: translateY(-160%); border-radius: .5rem; background: var(--cyan); color: #06151a; font-weight: 800; transition: transform .16s ease; }
.skip-link:focus { transform: translateY(0); }
.page-shell { width: min(1440px, calc(100% - 3rem)); margin: 0 auto; padding: 1.5rem 0 3.5rem; }
.hero { display: grid; grid-template-columns: auto 1fr auto; gap: 2rem; align-items: start; padding: 1rem 0 3.2rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -.035em; font-size: 1.1rem; }
.brand-mark { display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid rgba(102, 237, 243, .7); border-radius: .65rem; background: linear-gradient(135deg, rgba(102, 237, 243, .2), rgba(174, 145, 255, .45)); color: var(--cyan); font-size: .9rem; box-shadow: 0 0 22px rgba(102, 237, 243, .16); }
.hero-copy { max-width: 50rem; }
.eyebrow, .result-kicker { margin: 0 0 .42rem; color: var(--cyan); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { max-width: 17ch; margin: 0; font-size: clamp(2.3rem, 5vw, 4.7rem); line-height: .99; letter-spacing: -.065em; }
.hero-summary { max-width: 57ch; margin: 1.15rem 0 0; color: var(--muted); font-size: 1.04rem; }
.hero-actions { display: grid; justify-items: end; gap: .62rem; }
.guide-link { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.35rem; white-space: nowrap; padding: .5rem .78rem; border: 1px solid rgba(102, 237, 243, .36); border-radius: .72rem; background: rgba(102, 237, 243, .08); color: var(--cyan); text-decoration: none; font-size: .8rem; font-weight: 800; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.guide-link:hover { transform: translateY(-1px); border-color: rgba(102, 237, 243, .68); background: rgba(102, 237, 243, .15); }
.guide-link:focus-visible { outline: 3px solid rgba(102, 237, 243, .62); outline-offset: 3px; }
.hero-badge { display: inline-flex; align-items: center; gap: .48rem; white-space: nowrap; margin-top: .25rem; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: 99px; color: var(--muted); font-size: .8rem; }
.status-dot { width: .48rem; height: .48rem; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px var(--lime); }

.workspace { display: grid; grid-template-columns: minmax(280px, .68fr) minmax(0, 1.78fr); align-items: stretch; overflow: hidden; border: 1px solid var(--border); border-radius: 1.5rem; background: rgba(14, 18, 34, .76); box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.brief-panel { padding: clamp(1.5rem, 3vw, 2.5rem); border-right: 1px solid var(--border); background: linear-gradient(160deg, rgba(28, 35, 63, .76), rgba(13, 17, 34, .94)); }
.panel-heading h2, .results-intro h2 { margin: 0; letter-spacing: -.045em; font-size: 1.55rem; line-height: 1.1; }
.panel-heading > p:last-child { margin: .75rem 0 1.65rem; color: var(--muted); font-size: .91rem; }
.field { margin-top: 1rem; }
label { display: block; margin-bottom: .45rem; color: #e2e8f9; font-size: .85rem; font-weight: 700; }
label span { color: var(--cyan); }
input, select, textarea { width: 100%; border: 1px solid rgba(183, 204, 255, .22); border-radius: .7rem; outline: none; background: rgba(4, 7, 18, .43); color: var(--text); padding: .75rem .8rem; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
textarea { resize: vertical; min-height: 5.55rem; }
select { appearance: auto; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); background: rgba(7, 17, 33, .8); box-shadow: 0 0 0 3px rgba(102, 237, 243, .18); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
.field-error { min-height: 1.12rem; margin: .3rem 0 0; color: var(--danger); font-size: .77rem; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .42rem; min-height: 2.8rem; border: 1px solid transparent; border-radius: .72rem; padding: .68rem 1rem; font-weight: 800; font-size: .86rem; transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .copy-button:focus-visible, .remix-button:focus-visible { outline: 3px solid rgba(102, 237, 243, .62); outline-offset: 3px; }
.button-primary { margin-top: 1.25rem; background: linear-gradient(110deg, var(--cyan), #92d8ff 55%, #b59dff); color: #071019; box-shadow: 0 9px 25px rgba(102, 237, 243, .2); }
.button-primary:hover { box-shadow: 0 12px 30px rgba(102, 237, 243, .28); }
.button-secondary { border-color: rgba(174, 145, 255, .62); background: rgba(174, 145, 255, .14); color: #eeeaff; }
.button-secondary:hover { background: rgba(174, 145, 255, .24); }
.button-wide { width: 100%; }
.form-note { margin: .85rem 0 0; color: var(--dim); text-align: center; font-size: .76rem; }

.results-panel { min-width: 0; padding: clamp(1.5rem, 3vw, 2.5rem); background: linear-gradient(135deg, rgba(18, 25, 52, .42), rgba(8, 12, 29, .5)); }
.results-intro { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin: 0 0 1.8rem; }
.results-intro h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
.results-intro > div > p:last-child { margin: .58rem 0 0; color: var(--muted); font-size: .9rem; }
.results-grid { display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(250px, .84fr); gap: 1.15rem; }
.result-card { min-width: 0; border: 1px solid var(--border); border-radius: 1rem; background: var(--result-surface); padding: 1.3rem; box-shadow: 0 10px 28px rgba(1, 5, 18, .18); }
.titles-card { grid-row: span 2; border-color: var(--border-strong); background: linear-gradient(145deg, rgba(25, 35, 70, .94), rgba(9, 14, 32, .96)); box-shadow: var(--result-shadow); }
.card-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 1.2rem; }
.card-heading h3 { margin: 0; letter-spacing: -.035em; font-size: 1.22rem; }
.result-kicker { margin-bottom: .32rem; color: #aebbd9; font-size: .67rem; }
.copy-button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.2rem; flex: none; border: 1px solid transparent; border-radius: .58rem; background: rgba(102, 237, 243, .08); color: var(--cyan); padding: .42rem .55rem; font-size: .76rem; font-weight: 800; line-height: 1; transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease; }
.copy-button:hover { border-color: rgba(102, 237, 243, .25); background: rgba(102, 237, 243, .15); transform: translateY(-1px); }
.copy-button.copied { border-color: rgba(212, 252, 136, .28); background: rgba(212, 252, 136, .12); color: var(--lime); }
.title-groups { display: grid; gap: 1.1rem; }
.title-group + .title-group { padding-top: 1.1rem; border-top: 1px solid rgba(183, 204, 255, .11); }
.group-label { display: flex; align-items: center; gap: .5rem; margin: 0 0 .65rem; color: #edf1ff; font-size: .79rem; font-weight: 800; }
.group-count { display: inline-grid; place-items: center; width: 1.42rem; height: 1.42rem; border-radius: 50%; background: rgba(174, 145, 255, .18); color: #d4c9ff; font-size: .68rem; }
.title-group--searchable .group-count { background: rgba(102, 237, 243, .16); color: var(--cyan); }
.title-group--curiosity-driven .group-count { background: rgba(174, 145, 255, .2); color: #d8ceff; }
.title-group--story-driven .group-count { background: rgba(212, 252, 136, .15); color: var(--lime); }
.result-list, .thumbnail-list { display: grid; gap: .68rem; padding: 0; margin: 0; list-style: none; }
.result-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .65rem; align-items: start; padding: .78rem .82rem; border: 1px solid rgba(183, 204, 255, .08); border-radius: .76rem; background: rgba(27, 35, 63, .58); transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.result-row:hover { border-color: rgba(102, 237, 243, .24); background: rgba(32, 43, 76, .76); transform: translateY(-1px); }
.result-text { min-width: 0; color: #f3f5ff; font-size: .96rem; line-height: 1.55; overflow-wrap: anywhere; word-break: break-word; }
.item-copy { min-width: 2.2rem; padding: .42rem; color: #b7c3dd; font-size: 1rem; }
.item-copy:hover { color: var(--cyan); background: rgba(102, 237, 243, .12); }
.title-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .42rem; }
.remix-button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.2rem; border: 1px solid rgba(174, 145, 255, .34); border-radius: .58rem; background: rgba(174, 145, 255, .12); color: #ded5ff; padding: .42rem .62rem; font-size: .76rem; font-weight: 800; line-height: 1; transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease; }
.remix-button:hover { border-color: rgba(174, 145, 255, .68); background: rgba(174, 145, 255, .22); color: #f2efff; transform: translateY(-1px); }
.remix-panel { display: grid; grid-column: 1 / -1; gap: .62rem; margin-top: .08rem; padding: .82rem; border: 1px solid rgba(174, 145, 255, .22); border-radius: .65rem; background: linear-gradient(135deg, rgba(174, 145, 255, .1), rgba(102, 237, 243, .055)); animation: remix-reveal 180ms cubic-bezier(.2, .75, .3, 1) both; }
.remix-heading { margin: 0; color: #e6e0ff; font-size: .76rem; font-weight: 800; letter-spacing: .01em; }
.remix-list { display: grid; gap: .46rem; padding: 0; margin: 0; list-style: none; }
.remix-variant { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .65rem; align-items: start; padding: .62rem .65rem; border: 1px solid rgba(183, 204, 255, .1); border-radius: .55rem; background: rgba(8, 12, 29, .38); }
.remix-variant-label { color: var(--violet); font-size: .68rem; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.remix-variant-text { min-width: 0; grid-column: 1; color: #eef1ff; font-size: .86rem; line-height: 1.45; overflow-wrap: anywhere; word-break: break-word; }
.remix-variant .copy-button { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.numbered-list { counter-reset: hooks; }
.numbered-list .result-row { counter-increment: hooks; grid-template-columns: auto minmax(0, 1fr) auto; }
.numbered-list .result-row::before { content: counter(hooks, decimal-leading-zero); padding-top: .13rem; color: var(--violet); font-size: .71rem; font-weight: 800; }
.thumbnail-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.thumbnail-list .result-row { align-items: center; padding: .74rem .76rem; background: linear-gradient(135deg, rgba(102, 237, 243, .11), rgba(174, 145, 255, .14)); }
.thumbnail-list .result-row:hover { border-color: rgba(174, 145, 255, .4); background: linear-gradient(135deg, rgba(102, 237, 243, .17), rgba(174, 145, 255, .21)); }
.thumbnail-list .result-text { color: #fbfaff; font-size: .8rem; font-weight: 800; letter-spacing: .025em; line-height: 1.35; text-transform: uppercase; }
.results-footer { display: flex; gap: .55rem; align-items: center; margin-top: 1.25rem; color: var(--dim); font-size: .8rem; }
.results-footer p { margin: 0; }
.spark { color: var(--lime); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.results-refresh .result-card { animation: result-reveal 220ms cubic-bezier(.2, .75, .3, 1) both; }
.results-refresh .titles-card { animation-delay: 0ms; }
.results-refresh .hooks-card { animation-delay: 35ms; }
.results-refresh .thumbnails-card { animation-delay: 70ms; }
@keyframes result-reveal { from { opacity: .66; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes remix-reveal { from { opacity: .4; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 900px) {
  .hero { grid-template-columns: auto 1fr; }
  .hero-actions { grid-column: 2; grid-row: 2; display: flex; justify-self: start; align-items: center; margin-top: -1.35rem; }
  .hero-badge { margin-top: 0; }
  .workspace { grid-template-columns: 1fr; }
  .brief-panel { border-right: 0; border-bottom: 1px solid var(--border); }
}
@media (max-width: 640px) {
  .page-shell { width: min(100% - 1.5rem, 1440px); padding-top: .65rem; }
  .hero { grid-template-columns: 1fr; gap: 1rem; padding: .75rem 0 2rem; }
  .hero-actions { grid-column: 1; grid-row: 2; width: 100%; justify-self: stretch; justify-content: space-between; margin: 0; }
  .hero-copy { grid-column: 1; grid-row: 3; }
  .hero-badge { font-size: .7rem; }
  h1 { font-size: clamp(2.2rem, 12vw, 3.3rem); }
  .workspace { border-radius: 1.05rem; }
  .brief-panel, .results-panel { padding: 1.2rem; }
  .results-intro { display: grid; align-items: start; margin-bottom: 1.4rem; }
  .results-intro .button { width: 100%; min-height: 2.8rem; }
  .results-grid { grid-template-columns: 1fr; gap: 1rem; }
  .titles-card { grid-row: auto; }
  .thumbnail-list { grid-template-columns: 1fr; }
  .title-actions { gap: .35rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .results-refresh .result-card, .remix-panel { animation: none; }
  .button:hover, .copy-button:hover, .remix-button:hover, .guide-link:hover, .result-row:hover { transform: none; }
}
