:root {
  color-scheme: dark;
  --bg: #080a10;
  --panel: rgba(18, 21, 31, 0.78);
  --panel-strong: rgba(24, 28, 40, 0.92);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f7f7fb;
  --muted: #9298a9;
  --muted-strong: #bdc1ce;
  --lime: #c9ff48;
  --violet: #8a75ff;
  --pink: #ff67b3;
  --danger: #ff6b7a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 17px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% -10%, rgba(138, 117, 255, 0.17), transparent 30rem),
    radial-gradient(circle at 95% 10%, rgba(201, 255, 72, 0.08), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.aurora {
  position: fixed;
  border-radius: 999px;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.16;
}
.aurora-one { width: 28rem; height: 28rem; background: var(--violet); left: 28%; top: 35%; }
.aurora-two { width: 22rem; height: 22rem; background: var(--pink); right: -8rem; bottom: 5%; opacity: 0.09; }

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 760px) 300px;
  gap: 28px;
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px;
}

.sidebar, .right-rail { position: sticky; top: 28px; align-self: start; }
.sidebar {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px);
  padding: 10px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  background: var(--lime);
  color: #10120d;
  box-shadow: 0 0 34px rgba(201, 255, 72, 0.19);
}
.brand-mark svg { width: 29px; fill: currentColor; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark.mini { width: 30px; height: 30px; border-radius: 10px; font-weight: 900; }

.nav-stack { display: grid; gap: 7px; margin-top: 54px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 13px 15px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  text-align: left;
  transition: 160ms ease;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.05); transform: translateX(2px); }
.nav-item.is-active { color: #11140d; background: var(--lime); font-weight: 750; }
.nav-icon { display: grid; place-items: center; width: 22px; font-size: 22px; line-height: 1; }

.sidebar-card, .rail-card, .composer-card, .chirp-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(28, 32, 45, 0.78), rgba(15, 18, 27, 0.72));
  box-shadow: inset 0 1px rgba(255,255,255,.025), var(--shadow);
  backdrop-filter: blur(24px);
}
.sidebar-card {
  margin-top: auto;
  padding: 18px;
  border-radius: var(--radius-md);
}
.sidebar-card p, .sidebar-footer { color: var(--muted); font-size: 12px; line-height: 1.55; }
.sidebar-card-title { display: block; margin-top: 10px; font-size: 14px; line-height: 1.35; }
.sidebar-card p { margin: 8px 0 0; }
.sidebar-footer { margin: 16px 0 0; padding-left: 4px; }

.eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
}

.main-column { min-width: 0; padding-bottom: 80px; }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 68px; margin-bottom: 22px; }
.topbar h1 { margin: 5px 0 0; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.045em; }
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 230px;
  padding: 7px 12px 7px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  cursor: pointer;
  transition: 160ms ease;
}
.user-pill:hover { border-color: var(--line-strong); background: rgba(255,255,255,.065); transform: translateY(-1px); }
.user-pill-copy { display: grid; min-width: 0; text-align: left; }
.user-pill-copy strong, .user-pill-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-pill-copy strong { font-size: 12px; }
.user-pill-copy small { color: var(--muted); font-size: 10px; margin-top: 2px; }

.avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 15px;
  overflow: hidden;
  background-color: var(--lime);
  color: transparent;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--avatar-ring, var(--lime)) 46%, transparent), inset 0 1px rgba(255,255,255,.25);
}
.avatar > img,
.avatar > .avatar-fallback {
  display: block;
  width: 100%;
  height: 100%;
}
.avatar > img { object-fit: cover; }
.avatar > .avatar-fallback { padding: 7px; fill: #0b0e15; }
.avatar-small { width: 34px; height: 34px; border-radius: 12px; font-size: 11px; }

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  min-height: 285px;
  overflow: hidden;
  padding: 42px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 85% 18%, rgba(201,255,72,.2), transparent 15rem),
    linear-gradient(135deg, rgba(43, 36, 82, .94), rgba(22, 25, 37, .94) 58%, rgba(29, 38, 31, .94));
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.06);
}
.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to right, transparent, black);
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 2; }
.hero-copy h2 { margin: 12px 0 16px; font-size: clamp(43px, 6vw, 72px); line-height: .92; letter-spacing: -.075em; }
.hero-copy h2 span { color: var(--lime); }
.hero-copy > p:last-child { max-width: 530px; margin: 0; color: #c8cbd4; font-size: 14px; line-height: 1.65; }
.sparkle { position: absolute; left: -22px; top: -26px; color: var(--lime); font-size: 18px; }

.hero-orbit { position: relative; z-index: 1; min-height: 200px; }
.hero-bird {
  position: absolute;
  left: 50%; top: 50%;
  display: grid; place-items: center;
  width: 108px; height: 108px;
  border-radius: 38% 62% 60% 40% / 45% 42% 58% 55%;
  background: var(--lime);
  color: #12150d;
  font-size: 58px;
  font-weight: 950;
  transform: translate(-50%, -50%) rotate(-8deg);
  box-shadow: 0 28px 60px rgba(0,0,0,.35), 0 0 50px rgba(201,255,72,.15);
}
.orbit { position: absolute; left: 50%; top: 50%; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; transform: translate(-50%,-50%) rotate(-18deg); }
.orbit-a { width: 230px; height: 118px; }
.orbit-b { width: 170px; height: 250px; transform: translate(-50%,-50%) rotate(35deg); }
.floating-chip { position: absolute; padding: 8px 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; background: rgba(10,12,19,.72); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.chip-one { right: 2%; top: 18%; transform: rotate(6deg); }
.chip-two { left: -1%; bottom: 17%; transform: rotate(-8deg); }

.composer-card { margin-top: 20px; padding: 24px; border-radius: var(--radius-lg); }
.composer-head { display: flex; align-items: center; gap: 14px; }
.composer-head h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.composer-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
textarea {
  display: block;
  width: 100%;
  min-height: 94px;
  margin-top: 17px;
  resize: vertical;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 19px;
  line-height: 1.5;
}
textarea::placeholder { color: #666c7c; }
textarea:disabled { cursor: not-allowed; opacity: .58; }
.composer-actions { display: flex; justify-content: flex-end; align-items: center; padding-top: 16px; border-top: 1px solid var(--line); }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: 160ms ease;
}
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button-primary { background: var(--lime); color: #11140d; box-shadow: 0 10px 28px rgba(201,255,72,.12); }
.button-primary:hover:not(:disabled) { box-shadow: 0 14px 34px rgba(201,255,72,.2); }
.button-ghost { border-color: var(--line); background: rgba(255,255,255,.03); }
.button-full { width: 100%; margin-top: 8px; }

.feed-section { margin-top: 34px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 15px; }
.section-heading h2 { margin: 5px 0 0; font-size: 27px; letter-spacing: -.05em; }
.feed-tools { display: flex; align-items: center; gap: 8px; }
.sort-button, .icon-button {
  height: 38px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  cursor: pointer;
  transition: 150ms ease;
}
.sort-button { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 12px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.icon-button { display: grid; place-items: center; width: 38px; border-radius: 12px; font-size: 17px; }
.sort-button:hover, .icon-button:hover { border-color: var(--line-strong); background: rgba(255,255,255,.07); }

.feed { display: grid; gap: 11px; }
.chirp-card { display: grid; grid-template-columns: 45px minmax(0, 1fr); gap: 14px; padding: 19px; border-radius: 20px; transition: 170ms ease; animation: chirp-in 350ms both; }
.chirp-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.chirp-content { min-width: 0; }
.chirp-meta { display: flex; justify-content: space-between; gap: 12px; }
.chirp-meta > div { display: flex; align-items: center; gap: 7px; min-width: 0; }
.chirp-author { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.chirp-handle, .chirp-time { color: var(--muted); font-size: 10px; }
.chirp-body { margin: 10px 0 13px; color: #e8e9ef; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.chirp-footer { display: flex; align-items: center; gap: 15px; min-height: 20px; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; cursor: pointer; }
.text-button:hover { color: var(--text); }
.text-button.danger:hover { color: var(--danger); }
.empty-state { padding: 70px 30px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); text-align: center; }
.empty-state > span { color: var(--lime); font-size: 35px; }
.empty-state h3 { margin: 10px 0 6px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }
.skeleton { position: relative; overflow: hidden; min-height: 108px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); animation: shimmer 1.3s infinite; }

.right-rail { display: grid; gap: 16px; }
.rail-card { padding: 21px; border-radius: var(--radius-lg); }
.rail-card-heading { display: flex; justify-content: space-between; align-items: start; }
.rail-card h2 { margin: 5px 0 0; font-size: 18px; letter-spacing: -.035em; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 999px; background: rgba(201,255,72,.08); color: var(--lime); font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.live-badge i { width: 5px; height: 5px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 21px; }
.stats-grid > div { padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.stats-grid strong { display: block; font-size: 22px; letter-spacing: -.06em; }
.stats-grid span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.mini-chart { display: flex; align-items: end; gap: 5px; height: 54px; margin-top: 18px; }
.mini-chart span { flex: 1; min-height: 4px; border-radius: 4px 4px 2px 2px; background: linear-gradient(to top, var(--violet), var(--lime)); opacity: .82; transform-origin: bottom; animation: bar-grow 500ms both; }
.tip-card { display: flex; gap: 14px; background: linear-gradient(145deg, rgba(53, 40, 75, .78), rgba(19, 20, 29, .88)); }
.tip-icon { display: grid; place-items: center; flex: 0 0 auto; width: 39px; height: 39px; border-radius: 14px; background: rgba(138,117,255,.2); color: #b8aaff; }
.tip-card p { margin: 9px 0 0; color: var(--muted-strong); font-size: 11px; line-height: 1.6; }
.modal {
  width: min(430px, calc(100% - 28px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background: rgba(15, 18, 27, .95);
  color: var(--text);
  box-shadow: 0 40px 120px rgba(0,0,0,.65);
  backdrop-filter: blur(30px);
}
.modal::backdrop { background: rgba(2,3,7,.72); backdrop-filter: blur(9px); }
.modal[open] { animation: modal-in 180ms ease-out; }
.modal-shell { position: relative; padding: 32px; }
.modal-close { position: absolute; right: 18px; top: 18px; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.035); cursor: pointer; }
.modal-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 28px; font-weight: 850; letter-spacing: -.04em; }
.modal h2 { margin: 7px 0 8px; font-size: 31px; letter-spacing: -.06em; }
.modal h2 + p { margin: 0 0 22px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.segmented-control { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 19px; border: 1px solid var(--line); border-radius: 13px; background: rgba(0,0,0,.15); }
.segment { min-height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 800; cursor: pointer; }
.segment.is-active { background: rgba(255,255,255,.09); color: var(--text); box-shadow: 0 5px 16px rgba(0,0,0,.16); }
.form-field { display: grid; gap: 7px; margin-top: 13px; color: var(--muted-strong); font-size: 10px; font-weight: 700; }
.form-field input { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.035); color: var(--text); font-size: 12px; }
.form-field input:focus { border-color: rgba(201,255,72,.55); }
.form-error { min-height: 16px; margin: 10px 0 0; color: var(--danger); font-size: 10px; }
.modal-footnote { margin: 14px 0 0; color: #6f7482; font-size: 9px; text-align: center; }
.profile-summary { display: flex; align-items: center; gap: 13px; margin: 20px 0; padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.025); }
.profile-summary > div { display: grid; gap: 4px; min-width: 0; }
.profile-summary strong { overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.profile-summary span:last-child { color: var(--lime); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }

.toast-region { position: fixed; z-index: 30; right: 20px; bottom: 20px; display: grid; gap: 9px; width: min(340px, calc(100% - 40px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border: 1px solid var(--line-strong); border-radius: 14px; background: rgba(23,26,37,.95); box-shadow: var(--shadow); color: var(--muted-strong); font-size: 11px; animation: toast-in 220ms ease-out; }
.toast::before { content: ""; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px rgba(201,255,72,.45); }
.toast.is-error::before { background: var(--danger); box-shadow: 0 0 12px rgba(255,107,122,.45); }

.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; }

@keyframes chirp-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes bar-grow { from { transform: scaleY(.05); } }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 190px minmax(0, 1fr); max-width: 1080px; }
  .right-rail { display: none; }
}

@media (max-width: 800px) {
  .app-shell { display: block; padding: 16px; }
  .sidebar { position: static; min-height: auto; padding: 0; }
  .sidebar .brand { margin-bottom: 14px; }
  .nav-stack { position: fixed; z-index: 20; left: 50%; bottom: 14px; display: flex; width: min(420px, calc(100% - 28px)); margin: 0; padding: 6px; border: 1px solid var(--line-strong); border-radius: 19px; background: rgba(17,20,29,.9); box-shadow: var(--shadow); backdrop-filter: blur(24px); transform: translateX(-50%); }
  .nav-item { justify-content: center; flex: 1; padding: 11px 8px; }
  .nav-item span:last-child { display: none; }
  .nav-icon { font-size: 20px; }
  .sidebar-card, .sidebar-footer { display: none; }
  .main-column { padding-bottom: 105px; }
  .topbar { margin-top: 12px; }
  .hero-card { grid-template-columns: 1fr; padding: 31px; }
  .hero-orbit { display: none; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .feed-tools { width: 100%; }
}

@media (max-width: 520px) {
  .topbar h1 { font-size: 22px; }
  .topbar .eyebrow { display: none; }
  .user-pill-copy { display: none; }
  .user-pill { padding-right: 7px; }
  .hero-card { min-height: 250px; padding: 27px 24px; border-radius: 25px; }
  .hero-copy h2 { font-size: 48px; }
  .composer-card { padding: 19px; }
  .feed-tools { flex-wrap: wrap; }
  .sort-button { flex: 1; }
  .chirp-card { grid-template-columns: 37px minmax(0,1fr); padding: 16px; }
  .chirp-avatar { width: 37px; height: 37px; border-radius: 12px; }
  .chirp-meta { align-items: start; }
  .chirp-meta > div { display: grid; gap: 2px; }
  .chirp-footer { gap: 12px; flex-wrap: wrap; }
  .modal-shell { padding: 27px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
