@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,400&family=Work+Sans:wght@300;400;500;600;700&family=Fira+Code:wght@400;500;600&display=swap');

:root {
  --cream: #faf8f4;
  --cream-dark: #f0ece4;
  --ink: #1a1a2e;
  --ink-light: #3a3a52;
  --ink-muted: #6b6b80;
  --coral: #d1495b;
  --coral-light: #e8818c;
  --sage: #606c38;
  --sage-light: #8a9a5b;
  --amber: #c77b30;
  --teal: #2a7f7f;
  --rule: #d4cfc5;
  --card-bg: #ffffff;
  --card-shadow: 0 1px 3px rgba(26, 26, 46, 0.06), 0 4px 16px rgba(26, 26, 46, 0.04);
  --card-shadow-hover: 0 2px 8px rgba(26, 26, 46, 0.08), 0 8px 32px rgba(26, 26, 46, 0.06);
}

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Work Sans', sans-serif;
  color: var(--ink);
  background-color: var(--cream);
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background-image:
    linear-gradient(rgba(26, 26, 46, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 26, 46, 0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center center;
}

/* ─── Page Shell ─── */

.page-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

/* ─── Navigation ─── */

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 3rem;
}

.nav-brand {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.nav-brand-name {
  font-family: 'Newsreader', serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.nav-brand-tag {
  font-family: 'Fira Code', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.2s;
}

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

/* ─── Page Header ─── */

.page-header {
  margin-bottom: 3.5rem;
}

.page-header .overline {
  font-family: 'Fira Code', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--coral);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
  display: block;
}

.page-header h1 {
  font-family: 'Newsreader', serif;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 1rem;
}

.page-header .subtitle {
  font-size: 1.05rem;
  color: var(--ink-light);
  font-weight: 300;
  line-height: 1.6;
  max-width: 640px;
}

.page-header .meta-row {
  display: flex;
  gap: 2rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.meta-item .meta-label {
  font-family: 'Fira Code', monospace;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.meta-item .meta-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
}

/* ─── Experiment Cards (List Page) ─── */

.experiment-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.experiment-card {
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 2.5rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.experiment-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  transition: background-color 0.3s;
}

.experiment-card[data-domain="content"]::before {
  background: var(--coral);
}

.experiment-card[data-domain="growth"]::before {
  background: var(--teal);
}

.experiment-card:has(.card-status.parked)::before {
  background: var(--amber);
}

.experiment-card:hover {
  box-shadow: var(--card-shadow-hover);
  border-color: var(--ink-muted);
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-domain {
  font-family: 'Fira Code', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
}

.card-domain.content {
  color: var(--coral);
  background: rgba(209, 73, 91, 0.08);
}

.card-domain.growth {
  color: var(--teal);
  background: rgba(42, 127, 127, 0.08);
}

.card-status {
  font-family: 'Fira Code', monospace;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sage);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
  display: inline-block;
  animation: pulse-dot 2s ease-in-out infinite;
}

.card-status.parked {
  color: var(--amber);
}
.card-status.parked::before {
  background: var(--amber);
  animation: none;
  opacity: 0.6;
}

.card-status.blocked {
  color: var(--coral);
}
.card-status.blocked::before {
  background: var(--coral);
  animation: none;
  border-radius: 1px;
  transform: rotate(45deg);
}

.card-status.live {
  color: var(--teal);
}
.card-status.live::before {
  background: var(--teal);
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ─── Blocker Block ─── */

.blocker-block {
  background: #fffbf5;
  border: 1px solid var(--amber);
  border-left-width: 3px;
  border-radius: 0 4px 4px 0;
  padding: 1.25rem 1.75rem;
  margin-bottom: 2rem;
}

.blocker-block .blocker-label {
  font-family: 'Fira Code', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  display: block;
  margin-bottom: 0.5rem;
}

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

.blocker-block ul {
  margin-top: 0.5rem;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  color: var(--ink-light);
  line-height: 1.7;
}

/* ─── Data Gap Block ─── */

.data-gap-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.data-gap-item {
  font-size: 0.9rem;
  color: var(--ink-light);
  line-height: 1.6;
  padding: 1rem 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: var(--card-shadow);
}

.data-gap-item .gap-label {
  font-family: 'Fira Code', monospace;
  font-size: 0.63rem;
  font-weight: 600;
  color: var(--coral);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: block;
  margin-bottom: 0.3rem;
}

.data-gap-item .gap-fix {
  font-family: 'Fira Code', monospace;
  font-size: 0.63rem;
  font-weight: 500;
  color: var(--sage);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
  margin-top: 0.4rem;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.card-title {
  font-family: 'Newsreader', serif;
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.card-hypothesis {
  font-size: 0.92rem;
  color: var(--ink-light);
  line-height: 1.65;
  margin-bottom: 1.5rem;
  font-style: italic;
  font-family: 'Newsreader', serif;
}

.card-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.card-metric {
  background: var(--cream);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.card-metric .metric-label {
  font-family: 'Fira Code', monospace;
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.card-metric .metric-baseline {
  font-family: 'Fira Code', monospace;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}

.card-metric .metric-target {
  font-family: 'Fira Code', monospace;
  font-size: 0.72rem;
  color: var(--sage);
  font-weight: 500;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-footer-meta {
  display: flex;
  gap: 1.5rem;
}

.card-footer-meta span {
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-weight: 400;
}

.card-cta {
  font-family: 'Fira Code', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s, gap 0.2s;
}

.experiment-card:hover .card-cta {
  color: var(--ink);
  gap: 0.6rem;
}

/* ─── Detail Page ─── */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Fira Code', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  letter-spacing: 0.05em;
  margin-bottom: 2rem;
  transition: color 0.2s, gap 0.2s;
}

.back-link:hover {
  color: var(--ink);
  gap: 0.7rem;
}

.detail-section {
  margin-bottom: 3rem;
}

.detail-section .section-label {
  font-family: 'Fira Code', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
  display: block;
}

.hypothesis-block {
  font-family: 'Newsreader', serif;
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--ink-light);
  padding: 1.5rem 2rem;
  background: var(--card-bg);
  border-left: 3px solid var(--coral);
  border-radius: 0 4px 4px 0;
  box-shadow: var(--card-shadow);
}

.hypothesis-block.teal {
  border-left-color: var(--teal);
}

/* ─── Assumptions ─── */

.assumptions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.assumption-item {
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.5rem 2rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 1.5rem;
  align-items: start;
  box-shadow: var(--card-shadow);
}

.assumption-number {
  font-family: 'Newsreader', serif;
  font-size: 2rem;
  font-weight: 300;
  color: var(--rule);
  line-height: 1;
  grid-row: span 2;
  padding-top: 0.15rem;
}

.assumption-verb {
  font-family: 'Fira Code', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
}

.assumption-verb.increase { color: var(--sage); }
.assumption-verb.reduce { color: var(--coral); }

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

.assumption-text strong {
  color: var(--ink);
  font-weight: 600;
}

.assumption-text .mono {
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ─── Design Table ─── */

.design-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.design-table th,
.design-table td {
  text-align: left;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.design-table th {
  font-family: 'Fira Code', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: var(--cream-dark);
  width: 160px;
}

.design-table td {
  font-size: 0.9rem;
  color: var(--ink-light);
  line-height: 1.55;
}

.design-table tr:last-child th,
.design-table tr:last-child td {
  border-bottom: none;
}

/* ─── Metrics Grid ─── */

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

.metric-card {
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  position: relative;
}

.metric-card .metric-rank {
  font-family: 'Fira Code', monospace;
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
}

.metric-card .metric-name {
  font-family: 'Newsreader', serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--ink);
}

.metric-card .metric-source {
  font-family: 'Fira Code', monospace;
  font-size: 0.65rem;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.metric-card .metric-why {
  font-size: 0.82rem;
  color: var(--ink-light);
  line-height: 1.55;
}

.metric-card.primary {
  border-color: var(--coral);
  border-width: 1px 1px 1px 3px;
}

.metric-card.primary-teal {
  border-color: var(--teal);
  border-width: 1px 1px 1px 3px;
}

/* ─── Risks ─── */

.risks-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.risk-item {
  font-size: 0.9rem;
  color: var(--ink-light);
  line-height: 1.6;
  padding: 1rem 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  box-shadow: var(--card-shadow);
}

.risk-icon {
  font-size: 0.7rem;
  color: var(--amber);
  flex-shrink: 0;
  margin-top: 0.35rem;
  width: 8px;
  height: 8px;
  background: var(--amber);
  border-radius: 1px;
  transform: rotate(45deg);
}

/* ─── Dependencies ─── */

.deps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  counter-reset: dep;
}

.dep-item {
  font-size: 0.9rem;
  color: var(--ink-light);
  line-height: 1.6;
  padding: 0.75rem 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  display: flex;
  gap: 1rem;
  align-items: baseline;
  box-shadow: var(--card-shadow);
  counter-increment: dep;
}

.dep-item::before {
  content: counter(dep);
  font-family: 'Fira Code', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.dep-item strong {
  font-weight: 600;
  color: var(--ink);
}

/* ─── Pre-launch Checklist Button ─── */

.launch-checklist-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.2rem 0.65rem;
  background: rgba(199, 123, 48, 0.1);
  border: 1px solid rgba(199, 123, 48, 0.3);
  border-radius: 2px;
  font-family: 'Fira Code', monospace;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  line-height: 1.6;
}

.launch-checklist-btn:hover {
  background: rgba(199, 123, 48, 0.18);
  border-color: var(--amber);
}

/* ─── Modal ─── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 8px 48px rgba(26, 26, 46, 0.18);
  width: 100%;
  max-width: 520px;
  margin: 1.5rem;
  overflow: hidden;
  transform: translateY(14px);
  transition: transform 0.25s ease;
}

.modal-overlay.open .modal-box {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.75rem;
  border-bottom: 1px solid var(--rule);
  background: var(--cream-dark);
}

.modal-title {
  font-family: 'Fira Code', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--ink-muted);
  line-height: 1;
  padding: 0 0.2rem;
  transition: color 0.15s;
}

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

.modal-checklist {
  list-style: none;
  padding: 1.25rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-check-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.check-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
  margin-top: 0.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: white;
}

.modal-check-item.done .check-icon {
  background: var(--sage);
  border-color: var(--sage);
}

.check-owner {
  font-family: 'Fira Code', monospace;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--coral);
  display: block;
  margin-bottom: 0.2rem;
}

.check-text {
  font-size: 0.88rem;
  color: var(--ink-light);
  line-height: 1.55;
  display: block;
}

.modal-check-item.done .check-owner,
.modal-check-item.done .check-text {
  color: var(--ink-muted);
  text-decoration: line-through;
}

/* ─── Footer ─── */

.page-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-footer span {
  font-family: 'Fira Code', monospace;
  font-size: 0.65rem;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
}

/* ─── Animations ─── */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fade-up 0.5s ease-out forwards;
  opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.12s; }
.animate-in:nth-child(3) { animation-delay: 0.19s; }
.animate-in:nth-child(4) { animation-delay: 0.26s; }
.animate-in:nth-child(5) { animation-delay: 0.33s; }
.animate-in:nth-child(6) { animation-delay: 0.40s; }
.animate-in:nth-child(7) { animation-delay: 0.47s; }

/* ─── Responsive ─── */

@media (max-width: 720px) {
  html { font-size: 15px; }
  .page-shell { padding: 2rem 1.25rem 4rem; }
  .page-header h1 { font-size: 2.2rem; }
  .card-metrics { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr; }
  .page-header .meta-row { flex-wrap: wrap; gap: 1rem; }
  .nav-bar { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .card-footer { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}
