:root {
  color-scheme: light;
  --text: #101114;
  --muted: #5f6570;
  --accent: #758c89;
  --accent-dark: #4c585e;
  --bg: #f6f8ee;
  --card: #ffffff;
  --border: #e3e6ee;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

[hidden] {
  display: none !important;
}

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

a:hover {
  color: var(--accent-dark);
}

main {
  padding: 3rem 0 4rem;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.auth-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

html.auth-pending #auth-signin,
html.auth-pending #stream-unauthenticated,
html.auth-pending #streams-unauthenticated {
  display: none !important;
}

.auth-profile {
  position: relative;
}

.profile-button {
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 999px;
}

.profile-button img {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.15);
  display: block;
}

.profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.35rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  min-width: 140px;
  display: none;
  z-index: 20;
}

.profile-menu.is-open {
  display: block;
}

.profile-menu a,
.profile-menu button {
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  border-radius: 0.5rem;
  display: block;
  text-decoration: none;
}

.profile-menu a:hover,
.profile-menu button:hover {
  background: #f1f3f9;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
}

.logo img {
  width: min(190px, 40vw);
  height: auto;
  display: block;
}

.tagline {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.hero {
  background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%);
  border-bottom: 1px solid var(--border);
  padding: 4rem 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  margin: 0.6rem 0 1rem;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 600px;
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
}

.button.secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.button.danger {
  background: #b42318;
  border-color: #b42318;
  color: #fff;
}

.button.danger:hover {
  background: #97180f;
  border-color: #97180f;
}

.button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.7;
}

.content-section {
  padding: 3rem 0;
}

.content-section.alt {
  background: #ffffff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: start;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.card ul,
.benefits {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.benefits {
  list-style: disc;
}

.prompt-list {
  list-style: none;
  padding-left: 0;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.prompt-list li {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.prompt-list li p {
  margin: 0;
  color: var(--muted);
}

.prompt-placeholder {
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px dashed var(--border);
  background: #f1f3f9;
  aspect-ratio: 4 / 3;
}

.prompt-placeholder img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.prompt-examples {
  margin-top: 2.5rem;
}

.placeholder {
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px dashed var(--border);
  background: #f1f3f9;
}

.placeholder img {
  width: 100%;
  display: block;
  height: auto;
}

.meta {
  font-size: 0.95rem;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.prompt-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.prompt-form label {
  font-weight: 600;
}

.prompt-form textarea {
  width: 100%;
  min-height: 220px;
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: #f8f9fc;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  resize: vertical;
}

.prompt-form textarea::placeholder {
  color: var(--muted);
}

.content {
  background: var(--card);
  border-radius: 1rem;
  padding: 2.5rem;
  border: 1px solid var(--border);
}

.hash-image {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.hash-image-placeholder {
  max-width: 620px;
  padding: 2rem;
  border-radius: 0.75rem;
  border: 1px dashed var(--border);
  background: #f8fafc;
  color: var(--text);
  text-align: center;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.hash-image-placeholder p {
  margin: 0;
  font-weight: 600;
}

.hash-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.hash-image img {
  max-width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 0.75rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.hash-locked {
  margin-top: 2rem;
  padding: 2rem;
  border-radius: 0.75rem;
  background: #0f172a;
  color: #e2e8f0;
  text-align: center;
}

.streams-list {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.streams-loading {
  margin-top: 2rem;
  padding: 2rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text);
  text-align: center;
  display: grid;
  gap: 0.75rem;
  justify-items: center;
}

.streams-message {
  margin-top: 2rem;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.prompt-message {
  margin-top: 1rem;
  justify-content: flex-start;
}

.streams-message.success {
  border-color: #b6f0c2;
  background: #f0fff4;
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid #dbe2ef;
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.stream-card {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 0.5rem;
}

.stream-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.stream-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.stream-preview {
  margin: 0.5rem 0 0.75rem;
  color: var(--text);
}

.stream-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.streams-pending {
  margin-bottom: 2rem;
}

.streams-pending h2,
#streams-live-section h2 {
  margin-bottom: 0.5rem;
}

.stream-status {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--accent);
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--muted);
  background: #fff;
}

@media (max-width: 720px) {
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .tagline {
    font-size: 0.9rem;
  }

  .prompt-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
