:root {
  --ink: #1a1a1a;
  --ink-light: #4a4a4a;
  --ink-muted: #8a8a8a;
  --paper: #fafaf8;
  --paper-warm: #f5f4f0;
  --accent: #e85d04;
  --accent-hover: #d45303;
  --border: #e5e4e0;
  --border-dark: #d0cfc8;
  --success: #2d6a4f;
  --tag-bg: #f0efe8;
}

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

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}

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

.logo {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: var(--ink-light);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-primary:hover {
  background: #333;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border-dark);
}

.btn-secondary:hover {
  background: var(--paper-warm);
}

.btn-accent {
  background: var(--accent);
  color: white;
}

.btn-accent:hover {
  background: var(--accent-hover);
}

/* Hero */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 2rem 4rem;
  padding-top: 8rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-content {
  max-width: 520px;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 3.5rem;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.hero h1 em {
  font-style: italic;
}

.hero-description {
  font-size: 1.15rem;
  color: var(--ink-light);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.tone-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.tone-chip {
  border: 1px solid var(--border);
  background: var(--paper-warm);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
  position: relative;
}

.tone-chip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.75rem;
  line-height: 1.3;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tone-chip::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--ink);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tone-chip:hover::after,
.tone-chip:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

.tone-chip:hover::before,
.tone-chip:focus-visible::before {
  opacity: 1;
}

.signup-form {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.signup-form input {
  flex: 1;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border-dark);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background: white;
  transition: border-color 0.2s;
}

.signup-form input:focus {
  outline: none;
  border-color: var(--ink);
}

.signup-form button {
  white-space: nowrap;
}

.signup-note {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* Digest Preview */
.digest-preview {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  overflow: hidden;
  transform: perspective(1000px) rotateY(-2deg) rotateX(1deg);
  transition: transform 0.4s ease;
}

.digest-preview:hover {
  transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.digest-header {
  background: var(--paper-warm);
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.digest-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.digest-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.25rem;
}

.digest-date {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.digest-body {
  padding: 1.5rem;
}

.digest-section {
  margin-bottom: 1.5rem;
}

.digest-section:last-child {
  margin-bottom: 0;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.digest-headline {
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  line-height: 1.4;
}

.digest-summary {
  font-size: 0.85rem;
  color: var(--ink-light);
  line-height: 1.5;
}

.ticker {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  background: var(--tag-bg);
}

.ticker.up { color: var(--success); }
.ticker.down { color: #c1121f; }

/* Sources Band */
.sources-band {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
  text-align: center;
}

.sources-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}

.sources-logos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem 1.5rem;
  align-items: stretch;
  justify-items: center;
}

.source-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  min-height: 44px;
  min-width: 120px;
  width: 100%;
  max-width: 180px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.03em;
}

.source-logo img {
  height: 20px;
  width: auto;
  max-width: 120px;
  filter: grayscale(1);
  opacity: 0.75;
}

/* Features Section */
.features {
  background: white;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 5rem 2rem;
}

.features-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.features h2 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 2.25rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
}

.feature {
  text-align: center;
}

.feature-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.feature h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature p {
  font-size: 0.95rem;
  color: var(--ink-light);
  line-height: 1.6;
}

/* Sample Section */
.sample-section {
  padding: 5rem 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.sample-section h2 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 2.25rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 1rem;
}

.sample-section > p {
  text-align: center;
  color: var(--ink-light);
  margin-bottom: 2.5rem;
}

.sample-digest {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.sample-digest-header {
  background: var(--paper-warm);
  padding: 2rem;
  border-bottom: 1px solid var(--border);
}

.sample-digest-header h3 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.editors-note {
  font-size: 0.95rem;
  color: var(--ink-light);
  font-style: italic;
  line-height: 1.6;
}

.sample-digest-content {
  padding: 2rem;
}

.sample-story {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.sample-story:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.sample-story-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.sample-story h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.sample-story p {
  font-size: 0.9rem;
  color: var(--ink-light);
  line-height: 1.6;
}

.sample-sources {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.source-tag {
  font-size: 0.75rem;
  color: var(--ink-muted);
  background: var(--tag-bg);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* CTA Section */
.cta-section {
  background: var(--ink);
  color: var(--paper);
  padding: 5rem 2rem;
  text-align: center;
}

.cta-section h2 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 400;
  margin-bottom: 1rem;
}

.cta-section p {
  color: rgba(255,255,255,0.7);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.cta-form {
  display: flex;
  gap: 0.75rem;
  max-width: 450px;
  margin: 0 auto;
}

.cta-form input {
  flex: 1;
  padding: 0.875rem 1rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background: rgba(255,255,255,0.1);
  color: white;
}

.cta-form input::placeholder {
  color: rgba(255,255,255,0.5);
}

.cta-form input:focus {
  outline: none;
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.15);
}

/* Footer */
footer {
  padding: 2rem;
  border-top: 1px solid var(--border);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

footer a {
  color: var(--ink-muted);
  text-decoration: none;
}

footer a:hover {
  color: var(--ink);
}

/* Navigation state */
.nav-user {
  display: none;
  align-items: center;
  gap: 1rem;
}

.nav-user.active {
  display: flex;
}

.nav-user-name {
  font-weight: 500;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 6rem 1.5rem 2rem;
    padding-top: 7rem;
    gap: 2.5rem;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-description {
    font-size: 1.05rem;
  }

  .tone-chips {
    justify-content: center;
  }

  .signup-form {
    flex-direction: column;
  }

  .signup-form input {
    width: 100%;
  }

  .signup-form button {
    width: 100%;
  }

  .digest-preview {
    transform: none;
    max-width: 100%;
    margin: 0 auto;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .signup-page {
    flex-direction: column;
  }

  .signup-left {
    padding: 2rem 1.5rem;
    min-height: auto;
  }

  .signup-left h2 {
    font-size: 1.75rem;
  }

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

  .dashboard-content {
    grid-template-columns: 1fr;
  }

  .topics-grid {
    grid-template-columns: 1fr;
  }

  nav {
    padding: 1rem 1.25rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-links a:not(.btn) {
    font-size: 0.8rem;
  }

  .btn {
    padding: 0.625rem 1rem;
    font-size: 0.85rem;
  }

  .sample-section {
    padding: 3rem 1.5rem;
  }

  .sample-digest-header,
  .sample-digest-content {
    padding: 1.5rem;
  }

  .cta-section {
    padding: 3rem 1.5rem;
  }

  .cta-section h2 {
    font-size: 2rem;
  }

  .cta-form {
    flex-direction: column;
  }

  .cta-form input,
  .cta-form button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 2rem 1.25rem 1.5rem;
    padding-top: 8rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .eyebrow {
    font-size: 0.7rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .digest-preview {
    font-size: 0.9rem;
  }

  .digest-header {
    padding: 1rem 1.25rem;
  }

  .digest-body {
    padding: 1.25rem;
  }

  .digest-title {
    font-size: 1.1rem;
  }

  .section-label {
    font-size: 0.65rem;
  }

  .digest-headline {
    font-size: 0.9rem;
  }

  .digest-summary {
    font-size: 0.8rem;
  }

  .features {
    padding: 3rem 1.25rem;
  }

  .features h2 {
    font-size: 1.75rem;
  }

  .sample-section h2,
  .cta-section h2 {
    font-size: 1.75rem;
  }

  .signup-left {
    padding: 1.5rem 1.25rem;
  }

  .signup-left h2 {
    font-size: 1.5rem;
  }

  .signup-benefits li {
    font-size: 0.9rem;
  }

  .signup-right {
    padding: 1.5rem 1.25rem;
  }

  .signup-form-container h3 {
    font-size: 1.5rem;
  }

  .topics-container {
    max-height: 240px;
  }

  .topic-chip {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
  }

  .dashboard-header {
    padding: 1.25rem;
  }

  .dashboard-content {
    padding: 1.25rem;
  }

  .dashboard-card {
    padding: 1.25rem;
  }

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

/* Login Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

.modal {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  position: relative;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--ink-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.modal-close:hover {
  color: var(--ink);
}

.modal h3 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.modal > p {
  color: var(--ink-light);
  margin-bottom: 1.5rem;
}

.modal .form-group {
  margin-bottom: 1rem;
}

.modal-footer-text {
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-top: 1.5rem;
  margin-bottom: 0;
}

.modal-footer-text a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.modal-footer-text a:hover {
  text-decoration: underline;
}
