:root {
  --ivory: #f5f0e6;
  --paper: #fbf8f0;
  --paper-deep: #ebe2d3;
  --ink: #2a211b;
  --muted: #746b62;
  --terracotta: #b65f3d;
  --sage: #73816d;
  --line: rgba(42, 33, 27, .16);
  --shadow: 0 20px 60px rgba(70, 48, 31, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ivory); color: var(--ink); font-family: "DM Sans", sans-serif; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.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; }
.grain { position: fixed; inset: 0; opacity: .22; pointer-events: none; z-index: 20; mix-blend-mode: multiply; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E"); }

.site-header { height: 82px; padding: 0 clamp(24px, 5vw, 76px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: "Newsreader", serif; font-size: 26px; font-weight: 500; letter-spacing: -.04em; }
.brand-mark { width: 27px; height: 27px; position: relative; display: inline-block; }
.brand-mark i { width: 15px; height: 20px; border-radius: 50% 0 50% 50%; position: absolute; transform: rotate(45deg); background: var(--terracotta); top: 1px; left: 1px; }
.brand-mark i:last-child { background: var(--sage); transform: rotate(225deg); left: 11px; top: 7px; mix-blend-mode: multiply; }
nav { display: flex; gap: 34px; font-size: 13px; }
nav a { color: var(--muted); position: relative; }
nav a:hover, nav a.active { color: var(--ink); }
nav a.active::after { content: ""; position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--terracotta); left: 50%; top: 25px; }
.submit-link { font-size: 13px; border: 0; border-bottom: 1px solid var(--ink); padding: 0 0 3px; background: transparent; color: var(--ink); cursor: pointer; }
.submit-link span { color: var(--terracotta); margin-left: 5px; }

.hero { min-height: 380px; padding: 66px clamp(24px, 8vw, 126px) 58px; position: relative; border-bottom: 1px solid var(--line); overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); column-gap: 8vw; align-content: center; }
.hero::after { content: "01 — FIND\A 02 — COMPARE\A 03 — COPY & CREATE"; white-space: pre; position: absolute; right: clamp(24px, 8vw, 126px); bottom: 58px; color: #9a8e82; font: 400 9px/2.3 "DM Mono"; letter-spacing: .13em; }
.hero-kicker, .eyebrow { text-transform: uppercase; letter-spacing: .18em; font: 500 10px "DM Mono", monospace; color: var(--terracotta); }
.hero-kicker { display: flex; align-items: center; gap: 12px; grid-column: 1; }
.hero-kicker span { display: inline-block; width: 32px; height: 1px; background: var(--terracotta); }
.hero h1 { font: 400 clamp(54px, 6.2vw, 88px)/.86 "Newsreader", serif; letter-spacing: -.055em; margin: 24px 0 0; max-width: 760px; position: relative; z-index: 2; grid-column: 1; }
.hero h1 em { font-weight: 400; color: var(--terracotta); }
.hero > p { font: 400 17px/1.65 "Newsreader", serif; color: var(--muted); max-width: 430px; margin: 36px 0 42px; position: relative; z-index: 2; grid-column: 2; grid-row: 1 / span 2; align-self: end; }
.scroll-cue { display: inline-flex; gap: 15px; align-items: center; margin: 0; font-size: 12px; position: relative; z-index: 2; grid-column: 1; width: max-content; }
.scroll-cue span { border-bottom: 1px solid var(--ink); padding-bottom: 3px; }
.scroll-cue i { font-style: normal; color: var(--terracotta); }

.library { padding: 94px clamp(24px, 5vw, 76px) 120px; }
.section-heading { display: flex; justify-content: space-between; gap: 30px; align-items: end; }
.section-heading h2 { font: 400 clamp(38px, 4.3vw, 62px)/1 "Newsreader", serif; letter-spacing: -.04em; margin: 13px 0 0; }
.collection-count { font-size: 11px; color: var(--muted); margin: 0 0 8px; }
.collection-count strong { color: var(--ink); font-family: "DM Mono"; font-size: 16px; margin-right: 5px; }
.controls { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin: 56px 0 36px; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.filters, .control-end { display: flex; align-items: center; gap: 8px; }
.filter { border: 0; background: transparent; padding: 9px 14px; border-radius: 999px; color: var(--muted); cursor: pointer; font-size: 12px; }
.filter:hover { color: var(--ink); }
.filter.active { background: var(--ink); color: var(--paper); }
.search-box { width: 215px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding: 7px 0; }
.search-box svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.search-box input { border: 0; outline: 0; background: transparent; min-width: 0; width: 100%; color: var(--ink); font-size: 11px; }
.search-box input::placeholder { color: #958b80; }
.sort-box { color: var(--muted); font-size: 10px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.sort-box select { border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; cursor: pointer; }

.prompt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 58px 28px; }
.prompt-card { min-width: 0; opacity: 0; transform: translateY(16px); animation: reveal .55s ease forwards; }
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }
.card-media { aspect-ratio: 16/10; position: relative; background: var(--paper-deep); overflow: hidden; cursor: ew-resize; }
.card-media::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(42,33,27,.06); pointer-events: none; }
.compare-layer { position: absolute; inset: 0; overflow: hidden; }
.compare-layer.output { width: 100%; clip-path: inset(0 0 0 var(--split, 50%)); border-left: 1px solid rgba(255,255,255,.8); filter: drop-shadow(-2px 0 4px rgba(0,0,0,.13)); }
.compare-layer img { width: 100%; height: 100%; object-fit: contain; display: block; }
.compare-layer.output img { width: calc(100vw); max-width: none; }
.full-pair { display: flex; aspect-ratio: 3/2; cursor: default; background: #ded5c7; }
.full-panel { width: 50%; height: 100%; display: grid; place-items: center; overflow: hidden; }
.full-panel + .full-panel { border-left: 1px solid rgba(255,255,255,.7); }
.full-panel img { width: 100%; height: 100%; object-fit: contain; display: block; }
.full-pair .image-label.after { top: 14px; bottom: auto; right: auto; left: calc(50% + 14px); }
.compare-handle { position: absolute; left: var(--split, 50%); top: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; background: var(--paper); border: 1px solid rgba(42,33,27,.2); box-shadow: 0 2px 10px rgba(0,0,0,.18); display: grid; place-items: center; font-size: 11px; pointer-events: none; }
.image-label { position: absolute; top: 14px; z-index: 3; color: white; background: rgba(31,25,20,.68); backdrop-filter: blur(4px); border-radius: 999px; padding: 6px 9px; font: 500 8px "DM Mono"; letter-spacing: .12em; text-transform: uppercase; }
.image-label.before { left: 14px; }
.image-label.after { right: 14px; }
.view-button { position: absolute; right: 14px; bottom: 14px; z-index: 4; border: 0; background: rgba(251,248,240,.92); color: var(--ink); border-radius: 999px; padding: 9px 12px; font-size: 10px; cursor: pointer; box-shadow: 0 3px 14px rgba(0,0,0,.12); }
.card-topline { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 18px; }
.category { color: var(--terracotta); font: 500 9px "DM Mono"; letter-spacing: .13em; text-transform: uppercase; }
.card-number { color: #948a7f; font: 400 9px "DM Mono"; }
.prompt-card h3 { font: 500 27px/1.08 "Newsreader", serif; letter-spacing: -.025em; margin: 10px 0 9px; }
.prompt-preview { color: var(--muted); font: 400 13px/1.62 "Newsreader", serif; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 42px; }
.card-footer { margin-top: 18px; padding-top: 13px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.card-actions { display: flex; gap: 8px; }
.action-button { background: transparent; border: 0; padding: 5px 2px; color: var(--ink); cursor: pointer; font-size: 10px; display: inline-flex; align-items: center; gap: 7px; }
.copy-btn { border-bottom: 1px solid var(--ink); }
.copy-btn:hover { color: var(--terracotta); border-color: var(--terracotta); }
.rate-btn { position: absolute; right: 14px; top: 14px; z-index: 5; border: 0; border-radius: 999px; padding: 9px 12px; background: rgba(42,33,27,.88); color: var(--paper); box-shadow: 0 3px 14px rgba(0,0,0,.2); backdrop-filter: blur(5px); }
.rate-btn:hover, .rate-btn.rated { color: white; background: var(--terracotta); }
.rate-btn .arrow { font-size: 13px; }
.image-label.after { top: auto; bottom: 14px; }
.view-button { left: 50%; right: auto; transform: translateX(-50%); }
.primary-actions { display: flex; align-items: stretch; gap: 8px; }
.copy-btn { border: 1px solid var(--ink); background: var(--ink); color: var(--paper); padding: 11px 15px; font-size: 11px; }
.copy-btn:hover { color: white; background: var(--terracotta); border-color: var(--terracotta); }
.ai-menu { position: relative; }
.ai-menu summary { list-style: none; height: 100%; border: 1px solid var(--ink); padding: 11px 14px; font-size: 11px; cursor: pointer; white-space: nowrap; }
.ai-menu summary::-webkit-details-marker { display: none; }
.ai-menu[open] summary { background: var(--paper-deep); }
.ai-options { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 8; min-width: 196px; padding: 7px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.ai-options button { width: 100%; border: 0; background: transparent; text-align: left; padding: 10px; cursor: pointer; color: var(--ink); font-size: 11px; display: flex; justify-content: space-between; }
.ai-options button:hover { background: var(--paper-deep); }
.author-line { color: #948a7f; font: 400 9px "DM Mono"; margin-top: 8px; }
.tags { display: flex; gap: 6px; }
.tags span { border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px; font-size: 8px; color: var(--muted); }
.empty-state { text-align: center; padding: 90px 20px; }
.empty-state span { color: var(--terracotta); font-size: 38px; }
.empty-state h3 { font: 400 31px "Newsreader"; margin: 8px 0; }
.empty-state p { color: var(--muted); font-size: 12px; }

footer { padding: 38px clamp(24px, 5vw, 76px); display: flex; align-items: center; justify-content: space-between; gap: 30px; color: var(--muted); font-size: 9px; }
.footer-brand { color: var(--ink); transform: scale(.85); transform-origin: left; }

.prompt-dialog { width: min(1080px, calc(100% - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; background: var(--paper); color: var(--ink); box-shadow: 0 30px 100px rgba(32,24,18,.35); overflow: auto; }
.prompt-dialog::backdrop { background: rgba(39,31,25,.65); backdrop-filter: blur(5px); }
.dialog-close { position: sticky; float: right; top: 14px; margin: 14px 14px -50px 0; z-index: 10; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: rgba(251,248,240,.9); cursor: pointer; font-size: 22px; line-height: 1; }
.dialog-layout { display: grid; grid-template-columns: 1.08fr .92fr; min-height: 640px; }
.dialog-visual { min-height: 640px; position: sticky; top: 0; height: min(760px, calc(100vh - 32px)); background: var(--paper-deep); overflow: hidden; cursor: ew-resize; }
.dialog-visual .compare-layer.output img { width: min(1080px, calc(100vw - 32px)); }
.dialog-visual .compare-handle { width: 42px; height: 42px; }
.full-dialog-view { cursor: default; padding: 54px 24px 74px; display: grid; place-items: center; background: #ded5c7; }
.full-dialog-image { width: 100%; height: 100%; object-fit: contain; display: block; }
.full-view-tabs { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 4; display: flex; padding: 4px; background: rgba(251,248,240,.92); border: 1px solid var(--line); box-shadow: 0 5px 20px rgba(42,33,27,.13); }
.full-view-tabs button { border: 0; background: transparent; color: var(--muted); padding: 9px 12px; cursor: pointer; font-size: 9px; white-space: nowrap; }
.full-view-tabs button.active { background: var(--ink); color: var(--paper); }
.dialog-details { padding: 58px 44px; }
.dialog-details h2 { font: 400 42px/1 "Newsreader"; letter-spacing: -.035em; margin: 12px 0 14px; }
.dialog-intro { font: 400 15px/1.6 "Newsreader"; color: var(--muted); }
.dialog-meta { display: flex; gap: 8px; margin: 25px 0 35px; }
.dialog-meta span { border: 1px solid var(--line); border-radius: 999px; padding: 7px 9px; font-size: 9px; color: var(--muted); }
.prompt-label { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 20px; margin-bottom: 12px; font: 500 9px "DM Mono"; letter-spacing: .15em; text-transform: uppercase; color: var(--terracotta); }
.dialog-prompt { white-space: pre-wrap; font: 400 12px/1.7 "DM Mono"; color: #514940; max-height: 340px; overflow: auto; background: var(--ivory); border: 1px solid var(--line); padding: 18px; }
.dialog-actions { display: flex; gap: 10px; margin-top: 18px; }
.dialog-actions button { border: 1px solid var(--ink); background: var(--ink); color: var(--paper); padding: 12px 16px; cursor: pointer; font-size: 11px; }
.dialog-actions .modal-rate { background: transparent; color: var(--ink); }
.dialog-actions .modal-rate.rated { color: var(--terracotta); border-color: var(--terracotta); }
.dialog-actions .ai-menu summary { display: grid; place-items: center; border: 1px solid var(--ink); padding: 12px 16px; }
.dialog-actions .ai-options button { border: 0; background: transparent; color: var(--ink); padding: 10px; }
.dialog-actions .ai-options button:hover { background: var(--paper-deep); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: var(--paper); border-radius: 999px; padding: 11px 18px; font-size: 11px; z-index: 50; opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.submit-dialog { width: min(760px, calc(100% - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; background: var(--paper); color: var(--ink); box-shadow: 0 30px 100px rgba(32,24,18,.35); overflow: auto; }
.submit-dialog::backdrop { background: rgba(39,31,25,.65); backdrop-filter: blur(5px); }
.submit-dialog form { padding: 58px clamp(24px, 6vw, 66px) 60px; }
.submit-heading h2 { font: 400 clamp(38px, 5vw, 54px)/1 "Newsreader"; letter-spacing: -.04em; margin: 12px 0; }
.submit-heading p { color: var(--muted); font: 400 14px/1.6 "Newsreader"; max-width: 500px; margin: 0 0 34px; }
.form-row { margin: 0 0 20px; }
.form-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-row label { display: grid; gap: 8px; color: var(--muted); font: 500 9px "DM Mono"; letter-spacing: .1em; text-transform: uppercase; }
.form-row input, .form-row select, .form-row textarea { width: 100%; border: 1px solid var(--line); background: var(--ivory); color: var(--ink); padding: 13px 14px; outline: none; text-transform: none; letter-spacing: 0; font: 400 13px/1.5 "DM Sans"; resize: vertical; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--terracotta); box-shadow: 0 0 0 2px rgba(182,95,61,.08); }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 24px; }
.upload-box { aspect-ratio: 4/3; border: 1px dashed #a99d91; background: var(--ivory); position: relative; overflow: hidden; cursor: pointer; }
.upload-box input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-preview { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 7px; color: var(--muted); text-align: center; background-size: cover; background-position: center; }
.upload-preview.has-image::after { content: "Replace image"; position: absolute; right: 9px; bottom: 9px; background: rgba(42,33,27,.8); color: white; padding: 6px 8px; font: 400 8px "DM Mono"; }
.upload-preview.has-image > * { display: none; }
.upload-preview b { font: 300 25px "DM Sans"; color: var(--terracotta); }
.upload-preview strong { font: 500 12px "DM Sans"; color: var(--ink); }
.upload-preview small { font-size: 9px; }
.submit-note { color: var(--muted); font-size: 9px; margin: 15px 0 24px; }
.submit-note span { color: var(--terracotta); margin-right: 5px; }
.submit-form-button { width: 100%; border: 0; background: var(--ink); color: var(--paper); padding: 16px 18px; cursor: pointer; display: flex; justify-content: space-between; }
.submit-form-button:hover { background: var(--terracotta); }

@media (max-width: 850px) {
  .site-header nav { display: none; }
  .hero { padding-top: 58px; grid-template-columns: 1fr .75fr; }
  .prompt-grid { gap: 46px 18px; }
  .controls { align-items: flex-start; }
  .control-end { flex-direction: column; align-items: flex-end; }
  .dialog-layout { grid-template-columns: 1fr; }
  .dialog-visual { position: relative; height: 58vh; min-height: 430px; }
}

@media (max-width: 620px) {
  .site-header { height: 70px; }
  .brand { font-size: 23px; }
  .submit-link { font-size: 0; }
  .submit-link::before { content: "Submit"; font-size: 11px; }
  .hero { min-height: 430px; padding-top: 52px; grid-template-columns: 1fr; display: block; }
  .hero::after { display: none; }
  .hero h1 { font-size: clamp(54px, 17vw, 76px); }
  .hero > p { margin: 25px 0; max-width: 340px; }
  .scroll-cue { margin-top: 10px; }
  .library { padding-top: 72px; }
  .section-heading { align-items: start; flex-direction: column; }
  .controls { flex-direction: column; }
  .filters { width: 100%; overflow-x: auto; }
  .filter { white-space: nowrap; }
  .control-end { flex-direction: row; width: 100%; align-items: center; }
  .search-box { flex: 1; }
  .prompt-grid { grid-template-columns: 1fr; }
  .card-media { aspect-ratio: 4/3; }
  .card-media.full-pair { aspect-ratio: 3/2; }
  .tags { display: none; }
  .card-footer { align-items: flex-end; }
  .primary-actions { flex: 1; }
  .copy-btn { flex: 1; }
  .ai-menu summary { padding-inline: 11px; }
  footer { align-items: flex-start; flex-direction: column; }
  .dialog-details { padding: 40px 22px; }
  .dialog-visual { min-height: 350px; height: 52vh; }
  .form-row.two-col, .upload-grid { grid-template-columns: 1fr; }
  .upload-box { aspect-ratio: 16/9; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
