:root {
  --blue: #00AFF0;
  --blue-dark: #0092d4;
  --blue-light: #5bc4f7;
  --bg-white: #ffffff;
  --bg-grey: #f5f5f5;
  --bg-feed: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #71717a;
  --border: #e5e5e5;
  --radius: 8px;
  --font: "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-feed);
  -webkit-font-smoothing: antialiased;
}

body.loader-done .loader {
  pointer-events: none;
  opacity: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  padding: 0.75rem 1rem;
  background: var(--blue);
  color: var(--bg-white);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Loader: fullscreen logo zoom */
.loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-white);
  transition: opacity 0.6s ease-out;
}

.loader-logo {
  animation: loader-pulse 2s ease-in-out 4 forwards;
  transform-origin: center;
}

@media (prefers-reduced-motion: reduce) {
  .loader-logo {
    animation: none;
    transform: scale(1);
  }
}

.loader-logo-img {
  display: block;
  width: 70vmin;
  max-width: 70vw;
  height: auto;
}

@keyframes loader-pulse {
  0%, 100% {
    transform: scale(0.88);
    opacity: 0.9;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo-img {
  display: block;
  height: 2rem;
  width: auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

body.signed-in .btn-sign-in {
  display: none;
}

/* Hero: two columns */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 70vh;
}

@media (min-width: 768px) {
  .hero {
    grid-template-columns: 42% 1fr;
    min-height: 85vh;
  }
}

.hero-brand {
  position: relative;
  background: var(--blue);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.hero-brand-pattern {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'%3E%3Cpath fill='%23ffffff' fill-opacity='0.06' d='M0 200 Q100 100 200 200 T400 200 L400 400 L0 400 Z'/%3E%3Cpath fill='%23ffffff' fill-opacity='0.04' d='M0 250 Q150 150 300 250 T400 250 L400 400 L0 400 Z'/%3E%3C/svg%3E");
  background-size: cover;
  pointer-events: none;
}

.hero-brand-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 320px;
}

.hero-logo {
  margin-bottom: 1.5rem;
}

.hero-logo-img {
  display: block;
  max-width: min(90%, 320px);
  height: auto;
  margin: 0 auto;
  filter: brightness(0) invert(1);
}

.hero-tagline {
  margin: 0;
  font-size: 1.125rem;
  color: var(--bg-white);
  line-height: 1.5;
  opacity: 0.95;
}

.hero-right {
  background: var(--bg-white) url("images/Tied%20Up.png") center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.hero-right-inner {
  width: 100%;
  max-width: 360px;
  background: rgba(255, 255, 255, 0.94);
  padding: 1.5rem;
  border-radius: var(--radius);
}

.hero-right-heading {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hero-right-lead {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.hero-right-list {
  margin: 0 0 1.5rem;
  padding-left: 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.hero-right-list li {
  margin-bottom: 0.5rem;
}

.hero-right .btn-block {
  margin-bottom: 0;
}

.hero-right-try {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.hero-right .btn-sign-in {
  margin-bottom: 0.75rem;
}

/* Signed-in app layout */
.main-content {
  display: block;
  position: relative;
  z-index: 0;
}

.sidebar-left,
.sidebar-right {
  display: none;
}

body.signed-in .hero {
  display: none;
}

body.signed-in .main-content {
  display: grid;
  grid-template-columns: 1fr;
  min-height: calc(100vh - 60px);
}

@media (min-width: 900px) {
  body.signed-in .main-content {
    grid-template-columns: 220px 1fr 280px;
  }
}

body.signed-in .sidebar-left,
body.signed-in .sidebar-right {
  display: flex;
}

.sidebar-left {
  flex-direction: column;
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  padding: 1rem 0.75rem;
  gap: 1rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.5rem;
}

.sidebar-username {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.sidebar-nav-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar-nav-list li {
  margin-bottom: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--radius);
}

.sidebar-link:hover {
  background: var(--bg-grey);
  text-decoration: none;
}

.sidebar-link-active {
  color: var(--blue);
  font-weight: 600;
}

.sidebar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  font-size: 1.125rem;
  line-height: 1;
  color: var(--text-muted);
}

.sidebar-link-active .sidebar-icon {
  color: var(--blue);
}

.sidebar-left .btn-sign-out {
  margin-top: auto;
  width: 100%;
}

.sidebar-right {
  flex-direction: column;
  background: var(--bg-white);
  border-left: 1px solid var(--border);
  padding: 1rem;
  align-items: stretch;
}

.sidebar-right-heading {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.suggested-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.suggested-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.suggested-item:last-of-type {
  border-bottom: none;
}

.suggested-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: 1 1 0;
  min-width: 0;
}

.suggested-item .btn {
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 0.375rem 0.625rem;
  min-height: 32px;
  white-space: nowrap;
}

.sidebar-right .suggested-item .btn-primary {
  background: transparent;
  color: var(--blue);
  border: 1px solid var(--border);
}

.sidebar-right .suggested-item .btn-primary:hover {
  background: rgba(0, 175, 240, 0.08);
}

.suggested-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.suggested-handle {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.suggested-bio {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.sidebar-show-more {
  margin-top: 0.5rem;
  padding: 0.5rem;
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--blue);
  background: none;
  border: none;
  cursor: default;
  text-align: left;
}

.feed-composer {
  display: none;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-white);
  gap: 0.75rem;
}

body.signed-in .feed-composer {
  display: flex;
}

body.signed-in .feed-inner {
  max-width: none;
}

.feed-composer-inner {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-grey);
  border-radius: var(--radius);
}

.feed-composer-placeholder {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.625rem 1.25rem;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-block {
  width: 100%;
  margin-bottom: 1rem;
}

.btn-primary {
  background: var(--blue);
  color: var(--bg-white);
}

.btn-primary:hover {
  background: var(--blue-dark);
  color: var(--bg-white);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--blue);
  border: 2px solid currentColor;
}

/* Feed */
.feed {
  background: var(--bg-feed);
  padding: 0 0 3rem;
}

.feed-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.feed-post {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.post-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--bg-white);
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-avatar-alt {
  background: var(--text-muted);
  font-size: 0.75rem;
}

.post-avatar-img {
  display: block;
  object-fit: cover;
  background: var(--bg-grey);
}

.post-meta {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.post-username {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

.post-time {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.post-text {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.post-media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: var(--bg-grey);
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-media-video {
  background: var(--bg-grey);
}

a.post-media {
  text-decoration: none;
  color: inherit;
}

a.post-media:hover {
  text-decoration: none;
}

.post-media-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  z-index: 0;
}

.play-icon {
  position: relative;
  z-index: 1;
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.post-media-label {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  z-index: 1;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
}

.post-actions {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.post-likes,
.post-comments {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.post-action-sep {
  margin: 0 0.35rem;
  color: var(--text-muted);
}

.post-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.post-buttons a {
  text-decoration: none;
}

.post-buttons a:hover {
  text-decoration: none;
}

.btn-post {
  font-size: 0.8125rem;
  padding: 0.5rem 0.75rem;
  min-height: 36px;
  background: var(--bg-grey);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  opacity: 0.85;
}

.feed-cta {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--bg-grey);
  border-radius: var(--radius);
  text-align: center;
}

.feed-cta-text {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.feed-cta .btn {
  margin: 0;
}

/* Footer */
.site-footer {
  padding: 1.5rem 1.5rem 2rem;
  background: var(--bg-grey);
  border-top: 1px solid var(--border);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.5rem;
  margin-bottom: 0.25rem;
}

.footer-nav a {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.footer-nav a:hover {
  color: var(--blue);
}

.footer-copy {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

.footer-copy a {
  font-weight: 600;
}

/* Reveal page */
.reveal-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.reveal-page .site-footer {
  margin-top: auto;
}

.reveal-page main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem 4rem;
}

.reveal {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.reveal-inner {
  padding: 0 1rem;
}

.reveal-heading {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text-primary);
}

.reveal-lead {
  margin: 0 0 1.25rem;
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.reveal-text {
  margin: 0 0 2rem;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.reveal-cta {
  margin-bottom: 2rem;
}

.reveal-cta .btn {
  margin-bottom: 0.5rem;
}

.reveal-cta-note {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.reveal-back {
  margin: 0;
  font-size: 0.9375rem;
}

.reveal-back a {
  color: var(--text-muted);
}

.reveal-share {
  margin-bottom: 2rem;
}

.reveal-share-text {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.reveal-share-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.reveal-share-actions .btn {
  font-size: 0.8125rem;
  padding: 0.5rem 1rem;
  min-height: 36px;
}

.reveal-back a:hover {
  color: var(--blue);
}
