:root {
  --bg: #0B0B0D;
  --surface: #131316;
  --surface-2: #1B1B20;
  --line: #26262C;
  --text: #F2F2F4;
  --muted: #8E8E99;
  --accent: #E8E8EE;
  --ok: #4CC38A;
  --warn: #E0A63C;
  --bad: #E2685F;
  --radius: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Manrope, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { text-wrap: balance; margin: 0; }
p { text-wrap: pretty; }

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--surface-2); color: var(--text);
  padding: 8px 12px; border-radius: 8px; z-index: 50;
}
.skip:focus { left: 12px; }

.hidden { display: none !important; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(11, 11, 13, 0.72);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto;
  padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--text); color: #0B0B0D;
  display: grid; place-items: center;
  font-weight: 700; font-size: 16px;
}
.brand-text { font-weight: 600; letter-spacing: -0.01em; }
.brand-sub { color: var(--muted); font-weight: 500; margin-left: 6px; font-size: 14px; }
.topnav { display: flex; align-items: center; gap: 8px; }
.navlink { color: var(--muted); font-size: 14px; font-weight: 500; padding: 8px 10px; border-radius: 8px; transition: color .3s var(--ease), background .3s var(--ease); }
.navlink:hover { color: var(--text); background: var(--surface-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 8px 12px; font-size: 16px; font-weight: 600;
  transition: transform .3s var(--ease), background .3s var(--ease), opacity .3s var(--ease), border-color .3s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.btn-primary { background: var(--text); color: #0B0B0D; }
.btn-primary:hover { opacity: .88; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { font-size: 14px; padding: 6px 10px; }
.btn-danger { background: transparent; color: var(--bad); border-color: rgba(226,104,95,.4); }
.btn-danger:hover { background: rgba(226,104,95,.1); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- hero ---------- */
.hero { max-width: 1080px; margin: 0 auto; padding: 72px 20px 40px; }
.hero-title {
  font-size: 48px; line-height: 1.06; letter-spacing: -0.03em;
  max-width: 680px; font-weight: 700;
  background: linear-gradient(to right, #FFFFFF, #9B9B9B);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin: 16px 0 0; max-width: 680px; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-note { margin: 16px 0 0; color: var(--muted); font-size: 14px; min-height: 20px; }

/* ---------- layout ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 20px; }
.section-title { font-size: 24px; letter-spacing: -0.02em; }
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
}

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
input[type="text"], input[type="password"], textarea, select {
  width: 100%; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: 16px;
  transition: border-color .3s var(--ease);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--muted); }
textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.formrow { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.formrow > .field { flex: 1 1 200px; margin-bottom: 0; }

.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; margin-bottom: 16px; width: fit-content; }
.tab { border: 0; background: transparent; color: var(--muted); padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; transition: all .3s var(--ease); }
.tab.active { background: var(--surface); color: var(--text); }

.hint { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.error { color: var(--bad); font-size: 14px; margin: 8px 0 0; }

/* ---------- verify banner ---------- */
.verify {
  background: var(--surface); border: 1px solid rgba(224,166,60,.35);
  border-radius: var(--radius); padding: 20px;
}
.verify-title { font-size: 18px; font-weight: 600; margin: 0 0 8px; }
.codebox {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface-2); border: 1px dashed var(--line);
  border-radius: 10px; padding: 12px 14px; margin: 12px 0;
}
.codebox code { font-family: ui-monospace, monospace; font-size: 20px; letter-spacing: .08em; font-weight: 600; }
.steps-mini { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.steps-mini li { margin-bottom: 4px; }

/* ---------- compose ---------- */
.compose-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.counter { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--bad); font-weight: 600; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 12px 0 16px; }
.tpl {
  border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 12px; padding: 12px; text-align: left;
  transition: transform .3s var(--ease), border-color .3s var(--ease);
}
.tpl:hover { transform: translateY(-2px); }
.tpl.active { border-color: var(--text); }
.tpl-swatch { height: 44px; border-radius: 8px; margin-bottom: 8px; border: 1px solid rgba(255,255,255,.06); }
.tpl-name { font-size: 14px; font-weight: 600; display: block; }
.tpl-blurb { font-size: 12px; color: var(--muted); display: block; margin-top: 2px; }

/* ---------- tagline reveal ---------- */
.reveal { max-width: 1080px; margin: 0 auto; padding: 80px 20px 40px; }
.reveal-text {
  font-size: 40px; line-height: 1.14; letter-spacing: -0.025em;
  font-weight: 700; max-width: 680px; margin: 0;
}
.reveal-text .w { color: rgba(242,242,244,.28); transition: color .5s var(--ease); }
.reveal-text .w.on { color: var(--text); }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.step-num {
  display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 8px; background: var(--surface-2); color: var(--muted);
  font-size: 14px; font-weight: 600; margin-bottom: 12px;
}
.step h3 { font-size: 16px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 14px; margin: 0; }

/* ---------- feed ---------- */
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.feed-filter { display: flex; gap: 6px; }
.chip {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 500;
  transition: all .3s var(--ease);
}
.chip.active { background: var(--text); color: #0B0B0D; border-color: var(--text); }

.feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card {
  border-radius: var(--radius); padding: 24px;
  min-height: 220px; display: flex; flex-direction: column; justify-content: space-between;
  border: 1px solid rgba(255,255,255,.07);
  transition: transform .5s var(--ease);
}
.card:hover { transform: translateY(-3px); }
.card-body { white-space: pre-wrap; word-break: break-word; }
.card-foot { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-meta { font-size: 13px; opacity: .6; }
.like {
  background: transparent; border: 1px solid currentColor; color: inherit;
  border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; opacity: .75;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.like:hover { opacity: 1; }
.like:active { transform: scale(0.96); }
.like.on { opacity: 1; }

.empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-title { font-weight: 600; margin: 0 0 4px; }
.empty-sub { color: var(--muted); font-size: 14px; margin: 0; }
.feed-more { text-align: center; margin-top: 20px; }

/* ---------- mine ---------- */
.mine { display: grid; gap: 12px; }
.mine-row {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.mine-body { font-size: 14px; color: var(--muted); margin: 4px 0 0; max-width: 640px; }
.badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.badge.pending { color: var(--warn); border-color: rgba(224,166,60,.4); }
.badge.approved { color: var(--ok); border-color: rgba(76,195,138,.4); }
.badge.published { color: var(--ok); border-color: rgba(76,195,138,.4); }
.badge.rejected, .badge.failed { color: var(--bad); border-color: rgba(226,104,95,.4); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); margin-top: 48px; }
.foot-inner {
  max-width: 1080px; margin: 0 auto; padding: 32px 20px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.foot-brand { font-weight: 700; margin: 0 0 4px; }
.foot-note { color: var(--muted); font-size: 14px; margin: 0; max-width: 420px; }
.foot-links { display: flex; gap: 16px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.foot-links a:hover { color: var(--text); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; z-index: 60; max-width: 90vw;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- skeleton ---------- */
.skel { background: var(--surface-2); border-radius: var(--radius); min-height: 220px; animation: pulse 1.4s var(--ease) infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

@media (max-width: 640px) {
  .hero { padding: 48px 20px 24px; }
  .hero-title { font-size: 36px; }
  .hero-sub { font-size: 16px; }
  .reveal-text { font-size: 30px; }
  .reveal { padding: 56px 20px 24px; }
  .brand-sub { display: none; }
}

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