:root {
  --coral: #ff6b6b;
  --gold: #ffd93d;
  --text: #1d1d1f;
  --text-secondary: #6b7280;
  --muted: rgba(0,0,0,0.65);
  --bg: #fffdf8;
  --border: rgba(0,0,0,0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Top Gradient Stripe */
.top-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(270deg, var(--coral), var(--gold));
  background-size: 300% 300%;
  animation: moveStripe 8s linear infinite;
  z-index: 1000;
}

@keyframes moveStripe {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* Header */
.platform-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 4px;
  z-index: 100;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.logo-icon {
  font-size: 1.5rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

.subscribe-button {
  background: linear-gradient(135deg, var(--coral), var(--gold));
  color: #fff;
  border: none;
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  transition: transform 0.2s;
}

.subscribe-button:hover {
  transform: scale(1.05);
}

.header-cta-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.header-cta-text {
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0;
  white-space: nowrap;
}

/* Tabs */
.tabs-container {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 69px;
  z-index: 99;
}

.tabs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 2rem;
}

.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 1rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--text);
  border-bottom-color: var(--coral);
}

/* Main Layout */
.platform-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
}

.content-wrapper {
  min-width: 0;
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Stories List */
.stories-list {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.story-item {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  cursor: pointer;
}

.story-item:last-child {
  border-bottom: none;
}

.story-item:hover {
  background: rgba(255, 107, 107, 0.03);
}

.story-item.locked {
  cursor: not-allowed;
  opacity: 0.7;
}

.story-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.story-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.story-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.story-item:hover .story-title {
  color: var(--coral);
}

.story-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.category-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.2);
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--coral);
  flex-shrink: 0;
}

.story-source {
  font-weight: 500;
  color: var(--text-secondary);
}

.story-time {
  color: var(--text-secondary);
}

/* Loading and Error States */
.loading-state {
  text-align: center;
  padding: 3rem 2rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0,0,0,0.1);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

.error-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--coral);
}

/* Pagination */
.pagination {
  margin-top: 2rem;
  text-align: center;
}

.load-more-button {
  background: #fff;
  border: 1px solid var(--border);
  padding: 0.75rem 2rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text);
}

.load-more-button:hover {
  background: linear-gradient(135deg, var(--coral), var(--gold));
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
}

/* Subscription Gate */
.subscription-gate {
  background: linear-gradient(180deg, rgba(255,107,107,0.08), rgba(255,217,61,0.08));
  border: 2px dashed var(--coral);
  border-radius: 20px;
  padding: 3rem 2rem;
  text-align: center;
  margin-top: 2rem;
}

.gate-content {
  max-width: 500px;
  margin: 0 auto;
}

.gate-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.gate-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.gate-content p {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.cta-button {
  background: linear-gradient(135deg, var(--coral), var(--gold));
  color: #fff;
  border: none;
  padding: 1rem 2.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: all .25s ease;
  box-shadow: 0 4px 15px rgba(255,107,107,.3);
}

.cta-button:hover {
  transform: scale(1.05);
}

/* Archive */
.archive-header {
  text-align: center;
  margin-bottom: 2rem;
}

.archive-header h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.archive-header p {
  color: var(--text-secondary);
}

.archive-list {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
}

.archive-item {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.archive-item:last-child {
  border-bottom: none;
}

.archive-item:hover {
  background: rgba(255, 107, 107, 0.05);
  border-radius: 8px;
  transform: translateX(4px);
}

.archive-issue {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.archive-date {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.text-muted {
  color: var(--text-secondary);
  text-align: center;
}

/* About */
.about-content {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3rem;
  max-width: 700px;
}

.about-content h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.about-content p {
  color: rgba(0,0,0,.7);
  line-height: 1.7;
  margin-bottom: 1.2rem;
}

.divider {
  font-size: 1.5rem;
  margin: 2rem 0;
  text-align: center;
}

/* Sidebar */
.platform-sidebar {
  position: sticky;
  top: 150px;
  height: fit-content;
}

.sidebar-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.sidebar-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.sidebar-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.sidebar-email-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s;
  background: white;
  color: var(--text);
}

.sidebar-email-input:focus {
  outline: none;
  border-color: var(--coral);
}

.sidebar-card .cta-button {
  width: 100%;
  background: linear-gradient(135deg, var(--coral), var(--gold));
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 2px 8px rgba(255,107,107,0.2);
}

.sidebar-card .cta-button:hover {
  transform: scale(1.02);
}

.recent-digests {
  margin-bottom: 1rem;
}

.digest-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}

.digest-item:last-child {
  border-bottom: none;
}

.digest-item:hover {
  background: rgba(0,0,0,0.02);
}

.digest-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.digest-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.view-all-link {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  color: var(--coral);
  text-decoration: none;
  font-weight: 600;
  margin-top: 0.5rem;
  transition: opacity 0.2s;
}

.view-all-link:hover {
  opacity: 0.8;
}

.text-muted {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: center;
}

/* Signup Overlay (same as landing page) */
.signup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center;
}

.signup-overlay.active {
  display: flex;
}

.signup-container {
  background: #fff;
  border-radius: 20px;
  padding: 3.5rem;
  max-width: 520px;
  width: 90%;
  position: relative;
  overflow: hidden;
  animation: fadeIn .3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.close-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0,0,0,.05);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.3rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.close-button:hover {
  background: rgba(0,0,0,.1);
}

.form-input {
  width: 100%;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.1);
  margin-bottom: 1.5rem;
  font-size: 1rem;
  font-family: inherit;
}

.next-button {
  background: linear-gradient(135deg, var(--coral), var(--gold));
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: .8rem 2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-size: 1rem;
  margin-top: 1rem;
}

.next-button:hover {
  transform: scale(1.05);
}

.next-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: scale(1);
}

.progress-bar {
  height: 6px;
  width: 0;
  background: linear-gradient(90deg, var(--coral), var(--gold));
  border-radius: 3px;
  transition: width .3s ease;
  margin-bottom: 1.5rem;
}

.signup-step {
  display: none;
  gap: 1.25rem;
}

.signup-step.active {
  display: flex;
  flex-direction: column;
  animation: fadeIn .25s ease-out;
}

.signup-step h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.checkbox-label {
  display: block;
  padding: 0.75rem;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.checkbox-label:hover {
  background: rgba(255,107,107,.05);
  border-color: var(--coral);
}

.checkbox-label input {
  margin-right: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .platform-main {
    grid-template-columns: 1fr;
  }

  .platform-sidebar {
    position: static;
  }

  .header-nav {
    gap: 0.75rem;
  }

  .nav-link {
    display: none;
  }

  .tabs {
    gap: 1rem;
  }

  .tab {
    font-size: 0.85rem;
  }

  .story-item {
    padding: 1rem;
  }

  .about-content {
    padding: 2rem;
  }

  .signup-container {
    padding: 2rem 1.5rem;
  }
}
