/* HaughtCity — one stylesheet, no build step.
   The same token set, surfaces and brand gradient as HaughtStudio, so the two
   services read as one product. Surfaces run darkest to lightest, the brand
   gradient is used sparingly (the primary action, a user's own emphasis), and
   the feed stays quiet so the content is the loudest thing on the page. */

/* ---------------------------------------------------------------- tokens */

:root {
  /* Surfaces, darkest to lightest. */
  --bg: #0b0912;
  --bg-drawer: #0a0810;
  --surface: #14111c;
  --card: #1b1826;
  --card-2: #221d30;
  --card-3: #2a2438;

  /* The logo's own purples. */
  --purple-900: #2b0f52;
  --purple-700: #4c1d95;
  --purple-500: #7c5ce6;
  --purple-400: #8b6be8;
  --purple-300: #a98cf0;

  /* Brand accent is a gradient, used sparingly. */
  --accent: #8b5cf6;
  --accent-2: #5b9af5;
  --grad: linear-gradient(100deg, #8a6be8 0%, #5b9af5 100%);
  --grad-soft: linear-gradient(100deg, rgba(138, 107, 232, 0.18), rgba(91, 154, 245, 0.18));

  /* Text. */
  --text: #f3f1f8;
  --text-dim: #9c96ae;
  --text-faint: #6e6880;

  /* Semantic. */
  --gold: #f0c24b;
  --danger: #e5484d;
  --ok: #46b17b;
  --warn: #e2a33c;

  /* Lines and shape. */
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --radius: 14px;
  --radius-lg: 18px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);

  --drawer-w: 272px;
  --topbar-h: 56px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* ------------------------------------------------------------ city accents */

.accent-violet { --post-accent: #8b5cf6; }
.accent-ocean  { --post-accent: #3b82f6; }
.accent-forest { --post-accent: #22a06b; }
.accent-rose   { --post-accent: #e5488b; }
.accent-ember  { --post-accent: #f0764b; }
.accent-mint   { --post-accent: #35b6a3; }
.accent-sunset { --post-accent: #f0a24b; }
.accent-slate  { --post-accent: #8b93a7; }

/* ------------------------------------------------------------------ base */

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0 0 0.75em; }
p:last-child { margin-bottom: 0; }

a { color: var(--purple-300); text-decoration: none; }
a:hover { text-decoration: none; }

button, input, textarea, select { font: inherit; color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.09);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.16); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.mono { font-family: var(--mono); font-size: 0.86em; letter-spacing: 0.01em; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----------------------------------------------------------------- layout */

.app { display: flex; height: 100%; height: 100dvh; min-height: 0; }

.drawer {
  width: var(--drawer-w);
  flex: 0 0 var(--drawer-w);
  background: var(--bg-drawer);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
}

.topbar {
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20, 17, 28, 0.9), rgba(11, 9, 18, 0.65));
  backdrop-filter: blur(8px);
}

.topbar-title { font-size: 16px; font-weight: 650; min-width: 0; }

.view { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.view-inner { max-width: 760px; margin: 0 auto; padding: 22px 18px 64px; }

.scrim {
  position: fixed; inset: 0;
  background: rgba(4, 3, 8, 0.62);
  z-index: 40;
}

/* --------------------------------------------------------------- sidebar */

.brand { padding: 14px 14px 12px; }
.brand-link { display: flex; align-items: center; gap: 11px; color: inherit; }
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--card-2);
  display: grid; place-items: center;
  flex: 0 0 38px;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-text { min-width: 0; display: flex; flex-direction: column; }
.brand-name {
  font-weight: 700; font-size: 16px;
  color: var(--purple-300);
  letter-spacing: -0.01em;
}
.brand-sub { font-size: 11.5px; color: var(--text-faint); font-family: var(--mono); margin-top: -1px; }

.drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 16px; }
.drawer-foot { padding: 10px; border-top: 1px solid var(--line); }

.primary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 8px);
  margin: 4px 4px 14px;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  font-weight: 650;
  font-size: 14.5px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(110, 90, 230, 0.28);
}
.primary-action:hover { filter: brightness(1.06); }
.primary-action:active { transform: translateY(1px); }
.primary-action .icon { width: 17px; height: 17px; }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14.5px;
}
.nav-row:hover { background: rgba(255, 255, 255, 0.045); color: var(--text); }
.nav-row.active { background: var(--card-2); color: var(--text); }
.nav-row .icon { flex: 0 0 18px; opacity: 0.85; }

.section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 18px 11px 7px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
}
.section-label .icon { width: 13px; height: 13px; }

.city-list { display: flex; flex-direction: column; gap: 2px; }

.city-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  border-radius: 10px;
  color: var(--text-dim);
}
.city-row:hover { background: rgba(255, 255, 255, 0.045); }
.city-row.active { background: var(--card-2); color: var(--text); }
.city-icon {
  width: 26px; height: 26px;
  flex: 0 0 26px;
  border-radius: 8px;
  background: var(--card-2);
  display: grid; place-items: center;
  font-size: 14px;
}
.city-row.active .city-icon { background: var(--card-3); }
.city-row-text { min-width: 0; display: flex; flex-direction: column; }
.city-row-name { font-size: 13.5px; font-weight: 550; color: var(--text); }
.city-row-sub { font-size: 11.5px; color: var(--text-faint); }

.hint { font-size: 12.5px; color: var(--text-faint); line-height: 1.45; }
.hint.pad { margin: 0 11px; }

.who { display: flex; align-items: center; gap: 10px; padding: 4px 6px 10px; min-width: 0; }
.who-text { min-width: 0; display: flex; flex-direction: column; }
.who-name { font-size: 13.5px; font-weight: 600; }
.who-sub { font-size: 11.5px; color: var(--text-faint); }

/* ------------------------------------------------------------------ bits */

.icon { width: 18px; height: 18px; flex: 0 0 auto; display: block; }
.icon-lg { width: 26px; height: 26px; }
.icon-xl { width: 30px; height: 30px; }
.sm-icon { width: 15px; height: 15px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  flex: 0 0 auto;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }

.menu-btn { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--card-3); }
.btn.primary {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  font-weight: 650;
  box-shadow: 0 8px 22px rgba(110, 90, 230, 0.25);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--text-dim); }
.btn.ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.btn.wide { width: 100%; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn .icon { width: 16px; height: 16px; }
.btn:disabled { opacity: 0.5; cursor: default; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 18px 20px; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 12.5px;
}
.chip.plain { background: transparent; border-color: transparent; }
.chip:hover { color: var(--text); }
.who-chip { max-width: 180px; }

.avatar {
  width: 42px; height: 42px;
  flex: 0 0 42px;
  border-radius: 12px;
  background: var(--card-3);
  display: grid; place-items: center;
  font-size: 20px;
  font-weight: 650;
  color: var(--purple-300);
  overflow: hidden;
}
.avatar.sm { width: 32px; height: 32px; flex-basis: 32px; border-radius: 9px; font-size: 15px; }
.avatar.xs { width: 22px; height: 22px; flex-basis: 22px; border-radius: 7px; font-size: 11px; }

.badge {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 2px 6px;
}

/* ---------------------------------------------------------------- inputs */

.field { display: flex; flex-direction: column; gap: 6px; }

.label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.input, .textarea, .select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--text);
  outline: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--purple-500);
  box-shadow: 0 0 0 3px rgba(124, 92, 230, 0.18);
}
.input::placeholder { color: var(--text-faint); }

.search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 420px;
  margin: 0 auto;
}
.search-icon {
  position: absolute;
  left: 11px;
  width: 15px; height: 15px;
  color: var(--text-faint);
  pointer-events: none;
}
.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 14px 8px 34px;
  color: var(--text);
  outline: none;
  font-size: 13.5px;
}
.search-input:focus { border-color: var(--purple-500); box-shadow: 0 0 0 3px rgba(124, 92, 230, 0.18); }
.search-input::placeholder { color: var(--text-faint); }

.topbar-end { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ------------------------------------------------------------- page shells */

.page-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.page-head .icon { width: 26px; height: 26px; color: var(--purple-300); }
.page-head h1 { font-size: 25px; }
.page-lede { color: var(--text-dim); font-size: 14.5px; max-width: 62ch; margin: 0 0 20px; }
.page-foot {
  margin-top: 26px;
  color: var(--text-faint);
  font-size: 12.5px;
  line-height: 1.55;
  max-width: 72ch;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.section-heading {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 24px 0 10px;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 40px 24px;
  color: var(--text-dim);
}
.empty .icon { color: var(--text-faint); }
.empty h3 { color: var(--text); font-size: 17px; }

.notice { display: flex; gap: 14px; align-items: flex-start; border-color: rgba(70, 177, 123, 0.3); }
.notice > .icon { color: var(--ok); margin-top: 2px; }
.notice h3 { font-size: 17px; margin-bottom: 6px; }

.form { display: flex; flex-direction: column; gap: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.form-error {
  background: rgba(229, 72, 77, 0.1);
  border: 1px solid rgba(229, 72, 77, 0.35);
  color: #ffd9da;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}

/* ------------------------------------------------------------------ feed */

.feed { display: flex; flex-direction: column; gap: 10px; }

.post {
  display: flex;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 10px 10px;
}
.post:hover { border-color: var(--line-strong); }

.post-vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 0 0 38px;
  padding-top: 2px;
}
.vote-btn {
  border: 0;
  background: transparent;
  color: var(--text-faint);
  border-radius: 8px;
  padding: 4px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.vote-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.vote-btn.up.on { color: var(--purple-300); }
.vote-btn.down.on { color: var(--accent-2); }
.vote-score { font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.vote-score.small { font-size: 12px; }

.post-main { flex: 1; min-width: 0; }

.post-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-faint);
  flex-wrap: wrap;
}
.post-city { color: var(--post-accent, var(--purple-300)); font-weight: 600; }
.post-city:hover { text-decoration: underline; }
.post-author { color: var(--text-dim); }
.dot { opacity: 0.5; }

.post-title {
  display: block;
  margin: 5px 0 2px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}
.post-title:hover { color: var(--purple-300); }

.post-body {
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 8px 0 4px;
  max-width: 68ch;
}

.post-thumb {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 4px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--post-accent, var(--purple-500));
}
.post-thumb-lg { padding: 40px 24px; justify-content: center; flex-direction: column; gap: 6px; }
.post-thumb-icon { color: var(--post-accent, var(--text-dim)); display: grid; place-items: center; }
.post-thumb-label { font-weight: 600; font-size: 14px; }
.post-thumb-note { font-size: 12px; color: var(--text-faint); margin-left: auto; }
.post-thumb-lg .post-thumb-note { margin-left: 0; }

.post-actions { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.post-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-faint);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
}
.post-action:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }

.post-single { padding: 18px 20px 12px 12px; }
.post-single .post-title-single { font-size: 24px; line-height: 1.28; margin: 8px 0 4px; }

/* -------------------------------------------------------------- comments */

.comments { display: flex; flex-direction: column; gap: 8px; }
.comment {
  display: flex;
  gap: 10px;
  padding: 12px 14px 12px 10px;
  margin-left: calc(var(--depth, 0) * 20px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.comment-vote { display: flex; flex-direction: column; align-items: center; gap: 1px; flex: 0 0 30px; }
.comment-main { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-faint); margin-bottom: 4px; }
.comment-body { font-size: 14.5px; line-height: 1.6; color: var(--text); }

/* ----------------------------------------------------------- cities */

.city-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

.city-card {
  display: flex;
  gap: 13px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--post-accent, var(--purple-500));
  border-radius: var(--radius);
  color: inherit;
}
.city-card:hover { border-color: var(--line-strong); background: var(--card-2); }
.city-card-icon {
  width: 44px; height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  background: var(--card-2);
  display: grid; place-items: center;
  font-size: 22px;
}
.city-card-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.city-card-name { font-size: 15.5px; font-weight: 650; }
.city-card-members { font-size: 12px; color: var(--text-faint); }
.city-card-tagline { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

.city-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--post-accent, var(--purple-500));
  border-radius: var(--radius);
  margin-bottom: 18px;
}
.city-head-icon {
  width: 56px; height: 56px;
  flex: 0 0 56px;
  border-radius: 14px;
  background: var(--card-2);
  display: grid; place-items: center;
  font-size: 28px;
}
.city-head-text { flex: 1; min-width: 0; }
.city-head-text h1 { font-size: 24px; }
.city-head-text .dim { font-size: 13.5px; margin: 3px 0 0; }
.city-head-meta { font-size: 12px; color: var(--text-faint); margin: 6px 0 0; }

/* ---------------------------------------------------------------- toasts */

.toast-root {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 60;
  pointer-events: none;
}
.toast {
  background: var(--card-3);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  animation: toast-in 0.16s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .drawer {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    box-shadow: var(--shadow);
  }
  body.drawer-open .drawer { transform: translateX(0); }
  .menu-btn { display: inline-grid; }
  .topbar-title { font-size: 15px; }
  .search { max-width: none; }
}

@media (max-width: 560px) {
  .view-inner { padding: 18px 12px 56px; }
  .search { display: none; }
  .who-chip span:last-child { display: none; }
  .post { padding: 12px 12px 8px 6px; }
  .post-vote { flex-basis: 32px; }
  .post-title { font-size: 16px; }
}
