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

:root {
  --fg: #2a2825;
  --fg-muted: #6b6660;
  --fg-faint: #a8a29d;
  --bg: #f0ede6;
  --bg-elevated: rgba(42, 40, 37, 0.03);
  --surface: rgba(42, 40, 37, 0.05);
  --surface-strong: rgba(42, 40, 37, 0.03);
  --accent: #2a2825;
  --accent-soft: rgba(42, 40, 37, 0.08);
  --border: rgba(42, 40, 37, 0.08);
  --border-hover: rgba(42, 40, 37, 0.18);
  --fill: rgba(42, 40, 37, 0.04);
  --fill-hover: rgba(42, 40, 37, 0.08);
  --press-fill: rgba(42, 40, 37, 0.03);
  --gradient-cool: 116, 108, 101;
  --gradient-warm: 99, 89, 85;
  --gradient-smoke: 91, 81, 77;
  --ui-link: var(--fg-muted);
  --ui-link-hover: var(--fg);
  --ui-label: var(--fg-faint);
  --ui-sep: var(--border-hover);
  --ui-accent-link: var(--fg);
  --ui-border: var(--border);
  --ui-border-strong: var(--border-hover);
  --ui-surface: var(--surface);
  --ui-surface-strong: var(--surface-strong);
  --ui-source-hover: rgba(42, 40, 37, 0.03);
  --error: #b07040;
  --font: "IBM Plex Mono", "SF Mono", "Consolas", monospace;
}

html {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

a {
  color: inherit;
}

.header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.header h1 {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.signup {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
  flex-shrink: 0;
}

.signup input {
  font-family: var(--font);
  font-size: 11px;
  color: var(--fg);
  background: transparent;
  border: none;
  border-bottom: 0.5px solid var(--ui-border);
  padding: 2px 0;
  width: 160px;
  outline: none;
  transition: border-color 0.15s;
}

.signup input::placeholder {
  color: var(--ui-label);
}

.signup input:focus {
  border-bottom-color: var(--ui-border-strong);
}

.signup button {
  font-family: var(--font);
  font-size: 11px;
  color: var(--ui-link);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  letter-spacing: 0.03em;
  transition: color 0.15s;
}

.signup button:hover {
  color: var(--ui-link-hover);
}

.signup-status {
  font-size: 10px;
  color: var(--fg-faint);
}

.signup-status.error {
  color: var(--error);
}

.press {
  padding: 0;
  margin-bottom: 28px;
}

.press-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.press-links {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.press-links a {
  font-size: 11px;
  color: var(--ui-link);
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}

.press-links a:hover {
  color: var(--ui-link-hover);
}

.press-text,
.footer-text,
.project-link-muted,
.card-link-muted {
  color: var(--fg-faint);
}

.press-links .sep,
.footer-links .sep {
  font-size: 10px;
  color: var(--ui-sep);
  user-select: none;
}

.press-sources {
  font-size: 11px;
  color: var(--ui-accent-link);
  text-decoration: none;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  margin-left: auto;
  animation: sources-pulse 3s ease-in-out infinite;
}

.press-sources:hover {
  color: var(--ui-link-hover);
  animation: none;
}

@keyframes sources-pulse {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 1; }
}

.press-depth {
  font-size: 10px;
  color: var(--ui-label);
  white-space: nowrap;
  margin-left: auto;
  flex-shrink: 0;
  cursor: pointer;
  transition: color 0.15s;
}

.press-depth:hover {
  color: var(--ui-link-hover);
}


.press-archive {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, margin-top 0.3s ease;
  margin-top: 0;
}

.press.open .press-archive {
  max-height: 70vh;
  margin-top: 14px;
  overflow-y: auto;
}

.press.open .press-depth::after {
  content: " ×";
}

.press-archive-inner {
  border-top: 0.5px dashed var(--ui-border);
  padding-top: 12px;
}

.press-archive-year {
  font-size: 10px;
  font-weight: 500;
  color: var(--ui-label);
  letter-spacing: 0.08em;
  margin: 14px 0 6px;
}

.press-archive-year:first-child {
  margin-top: 0;
}

.press-archive-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
}

.press-archive-item a {
  font-size: 12px;
  color: var(--ui-link);
  text-decoration: none;
  transition: color 0.15s;
  line-height: 1.4;
}

.press-archive-item a:hover,
.footer-links a:hover,
.detail-back:hover,
.project-link:hover,
.mcp-hint a:hover,
.card-open-link:hover {
  color: var(--ui-link-hover);
}

.press-archive-item .outlet {
  font-size: 10px;
  color: var(--ui-label);
  flex-shrink: 0;
  min-width: 90px;
}

.year-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--ui-label);
  letter-spacing: 0.08em;
  margin: 32px 0 10px;
}

.year-label:first-of-type {
  margin-top: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}

.card {
  position: relative;
  aspect-ratio: 1;
  border: 0.5px solid var(--card-border, var(--border));
  background: var(--card-surface, transparent);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}

.card:hover {
  border-color: var(--card-border-hover, var(--border-hover));
  background: var(--card-surface-hover, transparent);
}

.card-top,
.card-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.card-top {
  gap: 5px;
}

.card-bottom {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-name-link {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
  width: fit-content;
}

.card-meta {
  font-size: 10px;
  color: var(--ui-label);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card-location {
  font-size: 10px;
  color: var(--fg-muted);
  line-height: 1.35;
}

.card-year {
  font-size: 10px;
  color: var(--ui-label);
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.card-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-fill-bg, var(--fill));
  transition: background 0.15s;
}

.card:hover .card-fill {
  background: var(--card-fill-hover-bg, var(--fill-hover));
}

@keyframes gold-pulse {
  0%, 100% { border-color: rgba(185, 160, 70, 0.25); }
  50% { border-color: rgba(185, 160, 70, 0.55); }
}

.card[data-year="2026"] {
  animation: gold-pulse 3s ease infinite;
  border-width: 1px;
}

.card[data-year="2026"] .card-fill {
  background: rgba(185, 160, 70, 0.07);
}

.card[data-year="2026"]:hover {
  border-color: rgba(185, 160, 70, 0.6);
  animation: none;
}

.card[data-year="2026"]:hover .card-fill {
  background: rgba(185, 160, 70, 0.12);
}

.card[data-year="2026"] .card-meta {
  color: rgba(165, 140, 50, 0.8);
}

.upcoming-row {
  display: flex;
  align-items: baseline;
  margin-bottom: 28px;
}

.upcoming-line {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 11px;
  color: var(--ui-label);
  flex-wrap: wrap;
  flex: 1;
}

.press-sources-mobile {
  display: none;
}

.upcoming-year {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ui-label);
}

.upcoming-sep {
  color: var(--ui-label);
}

.upcoming-locations {
  font-size: 11px;
  color: var(--fg-muted);
}

.project-summary {
  font-size: 11px;
  color: var(--fg-muted);
  line-height: 1.5;
}

.card-stats,
.project-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.card-stat,
.project-stat {
  font-size: 10px;
  color: var(--ui-label);
}

.card-stat b,
.project-stat b {
  font-weight: 500;
  color: var(--ui-link);
}

.card-mcp-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ui-label);
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.card:hover .card-mcp-dot {
  opacity: 1;
}

.card-links,
.project-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: baseline;
}

.card-links {
  gap: 10px;
}

.project-links {
  font-size: 11px;
  line-height: 1.45;
}

.card-name-link,
.card-link,
.detail-back,
.project-link,
.footer-links a,
.mcp-hint a {
  color: var(--ui-link);
  text-decoration: none;
  transition: color 0.15s;
}

.card-name-link {
  color: var(--fg);
}

.card-link,
.project-link {
  border-bottom: 0.5px solid transparent;
}

.card-name-link:hover,
.card-link:hover,
.project-link:hover {
  border-bottom-color: var(--ui-link);
}

.footer-links {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 0.5px solid var(--ui-border);
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-size: 11px;
  flex-wrap: wrap;
}

.mcp-hint {
  margin-top: 8px;
  font-size: 11px;
  color: var(--ui-label);
}

.mcp-hint a {
  border-bottom: 0.5px solid var(--ui-border);
  transition: color 0.15s, border-color 0.15s;
}

.mcp-details {
  margin-top: 12px;
  font-size: 11px;
  color: var(--ui-label);
}

.mcp-details summary {
  cursor: pointer;
  color: var(--ui-link);
  transition: color 0.15s;
}

.mcp-details summary:hover {
  color: var(--ui-link-hover);
}

.mcp-details p {
  margin: 8px 0 4px;
  line-height: 1.5;
}

.mcp-details a {
  color: var(--ui-link);
  text-decoration: none;
  border-bottom: 0.5px solid var(--ui-border);
  transition: color 0.15s, border-color 0.15s;
}

.mcp-details a:hover {
  color: var(--ui-link-hover);
}

.mcp-details pre {
  margin: 4px 0 12px;
  padding: 8px 10px;
  background: var(--ui-surface);
  border: 0.5px solid var(--ui-border);
  border-radius: 3px;
  font-size: 10px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
  user-select: all;
}

.mcp-details ul {
  margin: 4px 0 0;
  padding-left: 16px;
  line-height: 1.7;
}

.mcp-details code {
  font-size: 10px;
}

.mcp-details em {
  font-style: italic;
}

.detail-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.detail-back {
  font-size: 11px;
}

.project-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-title {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.project-meta {
  font-size: 11px;
  color: var(--ui-label);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.project-links a {
  font-size: 11px;
}

pre.raw-json {
  font-family: var(--font);
  font-size: 11px;
  line-height: 1.5;
  overflow-x: auto;
  padding: 14px;
  border: 0.5px solid var(--ui-border);
  background: var(--ui-surface-strong);
}

/* ── Sources page ───────────────────────────────────────────────────────── */

.sources-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sources-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sources-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.sources-page-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ui-label);
}

.sources-count {
  font-size: 10px;
  color: var(--ui-label);
}


.sources-search {
  font-family: var(--font);
  font-size: 11px;
  background: transparent;
  border: 0.5px solid transparent;
  border-bottom-color: var(--ui-border);
  border-radius: 0;
  color: var(--fg);
  padding: 6px 0;
  outline: none;
  width: 100%;
  max-width: 300px;
  transition: border-color 0.15s;
}

.sources-search::placeholder {
  color: var(--fg-faint);
}

.sources-search:focus {
  border-bottom-color: var(--ui-border-strong);
}

.sources-list {
  display: flex;
  flex-direction: column;
}

.sources-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 0.5px solid var(--ui-border);
  transition: background 0.15s;
}

.sources-item:first-child {
  border-top: 0.5px solid var(--ui-border);
}

.sources-item:hover {
  background: var(--ui-source-hover);
}

.sources-item-main {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.sources-outlet {
  font-size: 10px;
  color: var(--ui-label);
  flex-shrink: 0;
  width: 120px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
}

.sources-title {
  font-size: 12px;
  color: var(--ui-link);
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  flex: 1;
}

a.sources-title:hover {
  color: var(--ui-link-hover);
}

.sources-item-meta {
  display: flex;
  gap: 6px;
  align-items: baseline;
  flex-shrink: 0;
}

.sources-type {
  font-size: 9px;
  color: var(--ui-label);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sources-tag {
  font-size: 9px;
  color: var(--ui-label);
  text-decoration: none;
  transition: color 0.15s;
}

.sources-tag:hover {
  color: var(--ui-link);
}

.preview-cycler {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 0.5px solid var(--ui-border);
  background: rgba(240, 237, 230, 0.92);
  backdrop-filter: blur(10px);
  color: var(--fg);
  font-family: var(--font);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.preview-cycler button {
  font: inherit;
  color: var(--ui-link);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.preview-cycler button:hover {
  color: var(--ui-link-hover);
}

.preview-cycler-label {
  min-width: 118px;
  color: var(--ui-label);
}

.sources-empty {
  font-size: 11px;
  color: var(--fg-faint);
  padding: 20px 0;
}

@media (max-width: 600px) {
  body {
    padding: 20px 16px 64px;
  }

  /* Header: name top-left, signup below full-width */
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 22px;
  }

  .header h1 {
    font-size: 14px;
  }

  .signup {
    margin-left: 0;
    width: 100%;
    gap: 6px;
    flex-wrap: nowrap;
  }

  /* 16px prevents iOS zoom; wrap in a container that scales it back down visually */
  .signup {
    font-size: 0;
  }

  .signup input {
    -webkit-appearance: none;
    border-radius: 0;
    width: auto;
    flex: 1;
    min-width: 0;
    font-size: 11px;
  }

  .signup button {
    font-size: 11px;
  }

  /* Viewport meta disables zoom so we can use real sizes */

  .signup button {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Press: keep label + depth on one row, links below */
  .press {
    padding: 0;
    margin-bottom: 22px;
  }

  .press-row {
    gap: 0;
    row-gap: 6px;
  }

  .press-label {
    flex: 1;
  }

  /* Depth toggle stays on the same line as the label */
  .press-depth {
    margin-left: 0;
    order: 2;
  }

  .press-sources:not(.press-sources-mobile) {
    display: none;
  }

  .press-sources-mobile {
    display: inline;
    margin-left: auto;
    flex-shrink: 0;
  }

  /* Links wrap to their own row */
  .press-links {
    order: 3;
    width: 100%;
    flex-basis: 100%;
    gap: 4px;
  }

  .press-archive-item {
    flex-direction: column;
    gap: 1px;
    padding: 6px 0;
  }

  .press-archive-item .outlet {
    min-width: 0;
    font-size: 9px;
    letter-spacing: 0.04em;
  }

  /* Year labels */
  .year-label {
    font-size: 9px;
    letter-spacing: 0.06em;
    margin: 22px 0 8px;
  }

  /* 2-column card grid */
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
  }

  .card {
    padding: 10px;
    aspect-ratio: 1;
  }

  .card-name-link {
    font-size: 12px;
    line-height: 1.25;
  }

  .card-meta {
    font-size: 10px;
  }

  .card-location {
    font-size: 10px;
  }

  .card-year {
    font-size: 10px;
  }

  .card-stat {
    font-size: 10px;
  }

  /* Upcoming line */
  .upcoming-row {
    margin-top: 10px;
    margin-bottom: 22px;
  }

  .upcoming-line {
    font-size: 10px;
  }

  /* Detail page */
  .project-title {
    font-size: 17px;
  }

  .footer-links {
    margin-top: 36px;
    font-size: 10px;
  }

  .mcp-hint {
    font-size: 10px;
  }

  /* Sources page */
  .sources-item {
    flex-direction: row;
    gap: 8px;
    align-items: baseline;
  }

  .sources-outlet {
    width: auto;
    min-width: 0;
    font-size: 9px;
    flex-shrink: 0;
    text-align: left;
  }

  .sources-title {
    font-size: 11px;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    text-align: right;
    margin-left: auto;
  }

  .sources-search {
    font-size: 16px;
    max-width: 100%;
  }
}
