/* Stillsnote — warm graphite, editorial */
:root {
  --bg: #35302C;
  --panel: #3D3732;
  --deep: #2A2420;
  --line: #5A524B;
  --line-strong: #6E645B;
  --text: #EFE8DE;
  --muted: #BDB2A5;
  --accent: #E8A066;
  --accent-ink: #2A2420;
  --danger: #F0A08A;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: Manrope, system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 15px; line-height: 1.55;
  background-image: radial-gradient(ellipse at 90% 0%, rgba(214, 140, 72, 0.18), rgba(214, 140, 72, 0) 45%);
  background-attachment: fixed;
}
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
}
[hidden] { display: none !important; }
a { color: var(--text); }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.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; }

/* Type */
.display { font-family: var(--serif); font-weight: 500; font-size: clamp(44px, 6vw, 76px); line-height: 1; letter-spacing: -0.5px; margin: 0; }
.display-md { font-family: var(--serif); font-weight: 500; font-size: clamp(36px, 4.2vw, 50px); line-height: 1; margin: 10px 0 0; }
.display-sm { font-family: var(--serif); font-weight: 500; font-size: clamp(38px, 4.5vw, 54px); line-height: 1; margin: 10px 0 0; }
.display-xs { font-family: var(--serif); font-weight: 500; font-size: 34px; line-height: 1.05; margin: 8px 0 0; }
em { font-style: italic; }
.eyebrow { display: block; font-size: 11px; letter-spacing: 4px; text-transform: uppercase; font-weight: 600; color: var(--accent); }
.eyebrow.light { color: #F0B884; }
.eyebrow-muted { font-size: 11px; letter-spacing: 4px; text-transform: uppercase; color: var(--muted); }
.eyebrow-muted.light { color: #D9D0C4; }
.muted { color: var(--muted); margin: 10px 0 0; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.label-lg { display: block; font-weight: 600; font-size: 16px; margin-bottom: 8px; }
.lede { font-size: 17px; color: var(--muted); max-width: 520px; margin: 22px 0 0; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: 8px; color: var(--text); }
.spark { width: 22px; height: 22px; fill: var(--accent); flex: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 24px;
  border-radius: 0; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  font-size: 12px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
}
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-primary { background: var(--text); color: var(--deep); }
.btn-primary:hover { background: #fff; color: var(--deep); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: #F0B47F; color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--text); color: var(--text); }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 11px; }
.btn-text { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 11px; letter-spacing: 3px; text-transform: uppercase; min-height: 44px; padding: 0 4px; }
.btn-text:hover { color: var(--text); }
.grow { flex: 1; }
.row-btns { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.fill { fill: currentColor; stroke: none; width: 16px; height: 16px; }
.icon-lg { width: 52px; height: 52px; fill: none; stroke: var(--text); stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }
.btn.loading::after { content: ''; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Forms */
.stack { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.field > span { font-weight: 600; letter-spacing: 0.3px; }
.field small { font-weight: 400; }
.field.inline { flex-direction: row; align-items: center; gap: 10px; }
input[type=text], input[type=email], input[type=date], select, textarea {
  width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 0; color: var(--text);
  padding: 12px 14px; font-size: 15px; min-height: 46px;
}
.field.inline input, .field.inline select { width: auto; }
textarea { resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: #9C9286; }
input[type=date] { color-scheme: dark; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.hp { position: absolute; left: -9999px; }
.form-msg { margin: 0; font-size: 14px; min-height: 1em; }
.form-msg.error { color: var(--danger); }
.form-msg.ok { color: #CFE3B8; }

/* Gate */
.gate { min-height: 100vh; display: flex; flex-direction: column; padding: 40px; max-width: 1360px; margin: 0 auto; }
.gate-inner { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 64px; align-items: center; padding: 40px 0; }
.gate-copy .brand { margin-bottom: 48px; }
.gate-points { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; max-width: 520px; border-top: 1px solid var(--line); }
.gate-points li { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; display: flex; gap: 14px; }
.gate-points span { color: var(--accent); font-size: 11px; letter-spacing: 3px; font-weight: 600; padding-top: 2px; }
.gate-card { background: var(--panel); border: 1px solid var(--line); padding: 32px; max-width: 480px; width: 100%; justify-self: end; }
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.tabs button, .tabs-line button {
  background: none; border: 0; border-bottom: 1px solid transparent; margin-bottom: -1px; padding: 0 0 12px; min-height: 44px; cursor: pointer;
  font-size: 11px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: var(--muted);
}
.tabs button[aria-selected=true], .tabs-line button[aria-selected=true] { color: var(--text); border-bottom-color: var(--text); }

/* Shell */
.shell { max-width: 1360px; margin: 0 auto; padding: 36px 40px 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line-strong); }
.nav { display: flex; gap: 28px; flex-wrap: wrap; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a[aria-current=page] { color: var(--text); border-bottom-color: var(--text); }
.account { display: flex; align-items: center; gap: 16px; }
.usage { font-size: 11px; letter-spacing: 2px; color: var(--muted); }
.view { padding-top: 40px; }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 64px; padding: 22px 0 40px; border-top: 1px solid var(--line); font-size: 11px; letter-spacing: 3px; color: var(--muted); }
.demo-banner { background: var(--accent); color: var(--accent-ink); text-align: center; font-size: 12px; letter-spacing: 2px; padding: 8px; font-weight: 600; }

/* Layout */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 40px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 40px; align-items: start; margin-top: 28px; }
.col { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.ruled { padding-bottom: 22px; border-bottom: 1px solid var(--line-strong); margin-bottom: 32px; }
.block { border-top: 1px solid var(--line-strong); padding-top: 22px; display: flex; flex-direction: column; gap: 16px; }
.between { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pill-tag { padding: 7px 12px; border: 1px solid var(--line); font-size: 11px; letter-spacing: 3px; color: #CFC6BA; }

/* Dropzone */
.dropzone { position: relative; min-height: 520px; border: 1px solid #4F4842; background: var(--panel); display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; }
.dropzone.drag { border-color: var(--accent); background: #443D37; }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.drop-empty { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 24px; }
.drop-title { font-family: var(--serif); font-size: 32px; font-weight: 500; }
.corner { position: absolute; width: 28px; height: 28px; border-color: #CFC6BA; border-style: solid; border-width: 0; z-index: 2; pointer-events: none; }
.corner.tl { top: 22px; left: 22px; border-top-width: 1px; border-left-width: 1px; }
.corner.tr { top: 22px; right: 22px; border-top-width: 1px; border-right-width: 1px; }
.corner.bl { bottom: 22px; left: 22px; border-bottom-width: 1px; border-left-width: 1px; }
.corner.br { bottom: 22px; right: 22px; border-bottom-width: 1px; border-right-width: 1px; }
#preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #1E1A17; }

/* Vibes / radio chips */
.vibes { border: 0; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vibes legend { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 10px; float: left; width: 100%; }
.vibes label { position: relative; cursor: pointer; }
.vibes input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.vibes span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); font-size: 13px; }
.vibes input:checked + span { background: var(--text); color: var(--deep); border-color: var(--text); font-weight: 600; }
.vibes input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Read panel */
.read-panel { position: relative; overflow: hidden; background: var(--deep); padding: 28px 30px; }
.read-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.read-body { position: relative; display: flex; flex-direction: column; gap: 16px; }
.read-summary { margin: 0; color: #D9D0C4; max-width: 46ch; }
.chips-outline { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-outline span { padding: 8px 12px; border: 1px solid rgba(241, 236, 228, 0.35); font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }
.grade { display: flex; align-items: center; gap: 16px; }
.grade-swatches { display: flex; }
.grade-swatches span { width: 40px; height: 24px; }
.grade-swatches span:first-child { outline: 1px solid var(--text); outline-offset: 3px; margin-right: 8px; }

/* Caption + tags */
.caption-box { background: var(--panel); border-color: #4F4842; font-size: 17px; padding: 20px 22px; min-height: 220px; }
.tabs-line { display: flex; gap: 22px; flex-wrap: wrap; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); font-size: 14px; padding-left: 14px; }
.tag .tier { font-size: 10px; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; margin-left: 6px; }
.tag button { background: none; border: 0; color: var(--muted); cursor: pointer; width: 36px; height: 38px; font-size: 18px; line-height: 1; }
.tag button:hover { color: var(--text); }
.tag.static { padding: 8px 14px; }
.tag-add { display: flex; gap: 8px; max-width: 360px; }
.tag-add input { min-height: 44px; }
.save-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; padding-top: 6px; }

/* Next scenes */
.next-scenes { margin-top: 80px; }
.scene-grid { display: grid; grid-template-columns: 1.2fr 1fr 0.8fr; gap: 6px; }
.scene { position: relative; display: block; height: 380px; overflow: hidden; text-decoration: none; background-size: cover; background-position: center; }
.scene::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(20, 16, 13, 0.72), rgba(20, 16, 13, 0) 55%); transition: opacity 0.2s; }
.scene:hover::after { opacity: 0.8; }
.scene-label { position: absolute; left: 28px; bottom: 26px; z-index: 1; display: flex; flex-direction: column; gap: 4px; color: #F1ECE4; }
.scene-title { font-family: var(--serif); font-size: 34px; line-height: 1.05; }
.scene-planner { background-color: #B9B3AB; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 520 380' preserveAspectRatio='xMidYMid slice'><g transform='rotate(-9 260 190)'><rect x='-30' y='-80' width='120' height='560' fill='%232A2622'/><rect x='70' y='-80' width='120' height='560' fill='%23C2804F'/><rect x='170' y='-80' width='120' height='560' fill='%238E949A'/><circle cx='230' cy='250' r='40' fill='%231E1E1E'/><circle cx='224' cy='242' r='8' fill='%23E39A52'/><rect x='270' y='-80' width='120' height='560' fill='%232F3A36'/><rect x='290' y='40' width='80' height='90' fill='none' stroke='%23C9D2CE' stroke-width='3'/><rect x='370' y='-80' width='120' height='560' fill='%23C9C6C2'/><path d='M40 260 L80 220 L120 245 L170 210 L170 480 L40 480Z' fill='%232C211A'/></g></svg>"); }
.scene-trends { background-color: #3A322C; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 380' preserveAspectRatio='xMidYMid slice'><rect width='600' height='380' fill='%233A322C'/><rect y='60' width='600' height='22' fill='%234A4038'/><rect y='130' width='600' height='22' fill='%234A4038'/><rect y='200' width='600' height='22' fill='%234A4038'/><circle cx='430' cy='40' r='12' fill='%23E39A52' opacity='0.8'/><circle cx='478' cy='46' r='14' fill='%23E39A52' opacity='0.6'/><circle cx='530' cy='38' r='10' fill='%23E39A52' opacity='0.8'/><rect x='220' y='230' width='220' height='150' rx='10' fill='%23151515'/><circle cx='380' cy='310' r='44' fill='%231E1E1E' stroke='%233E3E3E' stroke-width='7'/></svg>"); }
.scene-creative { background-color: #9AA0A6; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 380' preserveAspectRatio='xMidYMid slice'><rect width='300' height='380' fill='%239AA0A6'/><circle cx='160' cy='100' r='44' fill='%233A2C24'/><path d='M40 380 C 50 200, 270 200, 280 380 Z' fill='%231E1E20'/><path d='M110 210 L140 380 M210 210 L180 380' stroke='%23D9D4CC' stroke-width='10'/><rect x='120' y='280' width='80' height='46' rx='6' fill='%23111'/><circle cx='160' cy='303' r='15' fill='%232B2B2B' stroke='%23E39A52' stroke-width='2'/></svg>"); }

/* Planner */
.feed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; background: var(--deep); padding: 3px; }
.feed-cell { position: relative; aspect-ratio: 4 / 5; background: var(--panel); overflow: hidden; border: 0; padding: 0; cursor: pointer; }
.feed-cell img { width: 100%; height: 100%; object-fit: cover; }
.feed-cell .date { position: absolute; left: 6px; bottom: 6px; font-size: 10px; letter-spacing: 1px; background: rgba(20, 16, 13, 0.75); color: var(--text); padding: 2px 6px; }
.feed-cell.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; letter-spacing: 2px; cursor: default; }
.draft-list { display: flex; flex-direction: column; }
.draft { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.draft img, .draft .noimg { width: 64px; height: 80px; object-fit: cover; background: var(--panel); }
.draft .meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.draft .cap { margin: 6px 0 8px; font-size: 14px; color: #D9D0C4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.draft .controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.draft .controls input, .draft .controls select { min-height: 40px; padding: 6px 10px; font-size: 13px; width: auto; }
.status { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; padding: 3px 8px; border: 1px solid var(--line-strong); }
.status.Ready { border-color: var(--accent); color: var(--accent); }
.status.Posted { color: var(--muted); }
.direction p { margin: 0; }
.direction h3, .ideas h3 { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 20px 0 8px; }
.list-ruled { display: flex; flex-direction: column; margin-top: 8px; }
.list-ruled .item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.list-ruled .item:first-child { border-top: 1px solid var(--line); }
.item-title { font-family: var(--serif); font-size: 22px; line-height: 1.2; }
.item-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.item-tip { font-size: 14px; margin-top: 6px; }

/* Trends */
.niche-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.niche-filter button { min-height: 40px; padding: 0 14px; background: none; border: 1px solid var(--line); cursor: pointer; font-size: 12px; letter-spacing: 1px; color: var(--text); }
.niche-filter button[aria-pressed=true] { background: var(--text); color: var(--deep); border-color: var(--text); font-weight: 600; }
.trend-summary { font-family: var(--serif); font-size: 24px; line-height: 1.35; max-width: 60ch; margin: 28px 0 0; }
.trend-tag-note { display: block; font-size: 12px; color: var(--muted); }
.sources { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); }
.sources ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; columns: 2; column-gap: 40px; }
.sources a { color: var(--muted); }

/* Creative */
.ideas .concept { padding: 16px 0; border-bottom: 1px solid var(--line); }
.ideas ol { margin: 0; padding-left: 20px; }
.ideas ol li { padding: 6px 0; }
.ideas .copyable { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }

/* Style form */
.style-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 22px 32px; max-width: 980px; }
.style-form .wide { grid-column: 1 / -1; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--text); color: var(--deep); padding: 12px 20px; font-size: 14px; font-weight: 600; z-index: 60; }

/* Empty states */
.empty-note { color: var(--muted); font-size: 14px; padding: 18px 0; }

@media (max-width: 760px) {
  .gate, .shell { padding: 24px 20px 0; }
  .gate-card { justify-self: stretch; padding: 24px; }
  .gate-points { grid-template-columns: 1fr; }
  .dropzone { min-height: 380px; }
  .scene-grid { grid-template-columns: 1fr; }
  .scene { height: 240px; }
  .nav { gap: 18px; overflow-x: auto; flex-wrap: nowrap; width: 100%; order: 3; }
  .sources ul { columns: 1; }
  .read-panel { padding: 22px; }
}
