:root {
  --bg: #0b0b0c; --fg: #f2f2f0; --muted: #8e8e93; --line: #232326; --accent: #ff5a36; --card: #151517;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #fafaf8; --fg: #151517; --muted: #6b6b70; --line: #e5e5e1; --card: #fff; color-scheme: light; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: auto; background: var(--card); }

.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(env(safe-area-inset-top) + 14px) 20px 14px; max-width: 720px; margin: 0 auto;
}
.brand { font-weight: 700; letter-spacing: -0.02em; font-size: 18px; }
.pill {
  background: var(--fg); color: var(--bg); border: 0; border-radius: 999px;
  padding: 8px 16px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}

.feed { max-width: 720px; margin: 0 auto; padding: 0 16px 48px; display: grid; gap: 20px; }
.card { background: var(--card); border-radius: 20px; overflow: hidden; border: 1px solid var(--line); }
.card img { aspect-ratio: 4 / 3; object-fit: cover; }
.card-text { padding: 16px 18px 18px; }
.card h2 { margin: 2px 0 4px; font-size: 22px; letter-spacing: -0.02em; line-height: 1.2; }
.card p { margin: 0 0 8px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
time, .count { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.empty { text-align: center; color: var(--muted); padding: 80px 20px; }
.empty a { color: var(--accent); }

.post { max-width: 720px; margin: 0 auto; }
.post-head { padding: 8px 20px 24px; }
.post-head h1 { margin: 4px 0 8px; font-size: 34px; line-height: 1.1; letter-spacing: -0.03em; }
.caption { margin: 0; font-size: 18px; color: var(--muted); white-space: pre-wrap; }
.post > img { margin-bottom: 6px; }
@media (min-width: 740px) { .post > img { border-radius: 12px; margin-bottom: 12px; } }
.post-foot { padding: 28px 20px 64px; text-align: center; }

.compose { max-width: 520px; margin: 0 auto; padding: 8px 20px 48px; }
.compose h1 { font-size: 30px; letter-spacing: -0.03em; margin: 0 0 20px; }
form { display: grid; gap: 14px; }
input[type=text], input[type=password], input[type=date], textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--fg); background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; appearance: none;
}
textarea { resize: vertical; }
.picker {
  display: grid; place-items: center; gap: 2px; padding: 34px 16px; cursor: pointer;
  border: 2px dashed var(--line); border-radius: 20px; text-align: center;
}
.picker-cta { font-weight: 700; font-size: 20px; }
.picker-hint { color: var(--muted); font-size: 14px; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.thumbs:empty { display: none; }
.thumbs div { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--card); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs button {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 16px; line-height: 1;
}
.primary {
  background: var(--accent); color: #fff; border: 0; border-radius: 16px; padding: 16px;
  font: inherit; font-size: 18px; font-weight: 700; cursor: pointer;
}
.primary:disabled { opacity: .4; }
.err { color: #ff6b6b; margin: 0; min-height: 1.5em; }
.hint { color: var(--muted); font-size: 13px; margin: -8px 4px 0; min-height: 0; }
.hint:empty { display: none; }
.post-foot { display: flex; gap: 10px; justify-content: center; }
.pill.danger { background: transparent; color: #ff6b6b; border: 1px solid currentColor; }
.brand { min-width: 0; line-height: 1.25; padding-right: 12px; }
.pill { flex-shrink: 0; white-space: nowrap; }

/* Feed masthead */
.masthead {
  position: relative; max-width: 720px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 40px) 20px 28px;
}
.masthead h1 {
  margin: 0; font-size: clamp(38px, 11vw, 64px); line-height: 1.02;
  font-weight: 800; letter-spacing: -0.04em; text-wrap: balance;
}
.masthead .byline {
  margin: 12px 0 0; color: var(--accent); font-weight: 600; font-size: 15px;
  text-transform: uppercase; letter-spacing: 0.12em;
}
.masthead .pill { position: absolute; top: calc(env(safe-area-inset-top) + 14px); right: 20px; }

.pill.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.cancel { text-align: center; color: var(--muted); padding: 4px; }
