/* feeed, Phase 1 read-only feed.
   Clean, minimal, Scandinavian. Tokens up top so it is easy to restyle later. */

:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --border: #e7e6e1;
  --text: #1c1c1a;
  --muted: #6b6b66;
  --accent: #2b5cff;
  --radius: 14px;
  --space: 16px;
  --maxw: 620px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space);
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-header .wrap {
  padding-top: 28px;
  padding-bottom: 24px;
}
.header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space);
}
.logo {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.02em;
  font-weight: 650;
  color: var(--text);
  text-decoration: none;
}
.nav {
  display: flex;
  gap: 16px;
  font-size: 15px;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
}
.nav a:hover { color: var(--text); }

/* Account chip (pretend logged in) */
.account {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: var(--text);
}
.account-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--border);
}
.account-handle { color: var(--muted); }
.account a { color: var(--accent); text-decoration: none; }
.linklike {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
}

/* Feed tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin: var(--space) 0 4px;
  border-bottom: 1px solid var(--border);
}
.tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Feed */
.feed {
  padding: var(--space) 0 48px;
  display: flex;
  flex-direction: column;
  gap: var(--space);
}

.status {
  color: var(--muted);
  text-align: center;
  padding: 32px 0;
  font-size: 15px;
}

.post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space);
  cursor: pointer;
}
.post:hover { border-color: #d8d7d2; }
.post.focused {
  cursor: default;
  border-color: var(--accent);
}
.post.focused:hover { border-color: var(--accent); }

/* Thread page */
.back {
  margin: var(--space) 0 0;
  font-size: 14px;
}
.back a { color: var(--muted); text-decoration: none; }
.back a:hover { color: var(--text); }
.replies-title {
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--muted);
}
.reply-block {
  display: flex;
  flex-direction: column;
  gap: var(--space);
  margin-left: 14px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

.post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--border);
  object-fit: cover;
  flex: 0 0 auto;
}
.author { min-width: 0; }
.author .name {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.author .handle {
  color: var(--muted);
  font-size: 13px;
}

.post-text {
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0 0 10px;
  font-size: 15.5px;
}

/* Image embeds */
.post-media {
  margin-top: 10px;
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr 1fr;
  border-radius: 12px;
  overflow: hidden;
}
.post-media.count-1 { grid-template-columns: 1fr; }
.media-item { display: block; min-height: 0; }
.media-item img { display: block; width: 100%; }
.post-media.count-1 .media-item img {
  max-height: 510px;
  object-fit: contain;
  background: var(--border);
}
.post-media:not(.count-1) .media-item { aspect-ratio: 1 / 1; }
.post-media:not(.count-1) .media-item img {
  height: 100%;
  object-fit: cover;
}

/* Link card (external embed) */
.card {
  display: block;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.card:hover { border-color: var(--muted); }
.card-thumb {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}
.card-body { padding: 10px 12px; }
.card-host { color: var(--muted); font-size: 12px; }
.card-title { font-weight: 600; font-size: 14px; margin-top: 2px; }
.card-desc {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Quote post (record embed) */
.quote {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.quote-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin-bottom: 4px;
}
.quote-avatar { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.quote-name { font-weight: 600; }
.quote-handle { color: var(--muted); }
.quote-text {
  margin: 0;
  font-size: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.quote-na { color: var(--muted); font-size: 13px; }

.post-meta {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
}
.post-meta time { margin-left: auto; }

/* Post actions and the per-author follow button */
.act {
  appearance: none;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 12px;
}
.act:hover { border-color: var(--muted); }
.act:disabled { opacity: 0.5; cursor: default; }

.post-head .follow {
  margin-left: auto;
  flex: 0 0 auto;
  align-self: center;
}
.follow.on {
  color: var(--muted);
  background: var(--bg);
}

.post-actions {
  margin-top: 12px;
}
.like .heart { color: var(--muted); }
.like.on .heart { color: #e0245e; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.site-footer .wrap {
  padding-top: 20px;
  padding-bottom: 20px;
}
.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* Landing: hero */
.hero {
  padding: 48px 0 32px;
}
.hero-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.hero-text {
  margin: 12px 0 0;
  max-width: 48ch;
  color: var(--muted);
  font-size: 16px;
}
.hero-actions {
  margin-top: 24px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { filter: brightness(0.95); }

/* Landing: auth */
.auth {
  margin: 8px 0 56px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.auth-title {
  margin: 0;
  font-size: 20px;
}
.auth-note {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 14px;
}

/* Login / signup toggle */
.auth-toggle {
  display: flex;
  gap: 4px;
  margin: 8px 0 20px;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 8px 10px;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.auth-tab.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Handle input with fixed domain suffix */
.handle-row { display: flex; align-items: stretch; }
.handle-row input {
  flex: 1;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.handle-suffix {
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 10px 10px 0;
  background: var(--bg);
  color: var(--muted);
  font-size: 14px;
}
.avail { font-size: 13px; min-height: 1em; color: var(--muted); }
.avail.is-free { color: #1a7f37; }
.avail.is-taken { color: #c0392b; }
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-form[hidden] { display: none; }
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}
.field span { color: var(--muted); }
.field input {
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
}
.auth-form .btn { align-self: flex-start; }
.auth-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.auth-signup {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}
.auth-signup a { color: var(--accent); }
