/* === TrendLens — Editorial Design Dashboard === */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
  --bg: #FAFAF7;
  --text: #2D2D2D;
  --text-muted: #6B6B6B;
  --text-light: #999;
  --accent: #7B8B6F;
  --accent-light: #e8ede4;
  --accent-dark: #5a6b4f;
  --border: #E5E3DE;
  --card-bg: #FFFFFF;
  --card-hover: #F7F6F2;
  --rising: #7B8B6F;
  --stable: #B8A88A;
  --declining: #C4857A;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Optima', 'Candara', 'Segoe UI', sans-serif;
  --max-width: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* === HEADER === */
.tl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 2rem;
}

.tl-back {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.tl-back:hover { color: var(--accent); }

.tl-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tl-logo { width: 36px; height: 36px; }

.tl-wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  color: var(--text);
}

.tl-date {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* === HERO === */
.tl-hero {
  text-align: center;
  padding: 3rem 2rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.tl-hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.2;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.tl-hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* === TOGGLE === */
.tl-toggle-bar {
  display: flex;
  justify-content: center;
  padding: 2rem 2rem 1rem;
}

.tl-toggle {
  display: inline-flex;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}

.tl-toggle button {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 400;
  padding: 0.75rem 2.5rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.3s, background 0.3s;
  position: relative;
  z-index: 1;
  letter-spacing: 0.03em;
}

.tl-toggle button.active {
  color: #fff;
  background: var(--accent);
  border-radius: 100px;
}

/* === SECTION WRAPPERS === */
.tl-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 2rem 3rem;
}

.tl-section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.tl-section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* === TOP 5 CARDS === */
.tl-top5 {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tl-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 2.25rem;
  cursor: pointer;
  transition: box-shadow 0.3s, transform 0.2s;
}

.tl-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.tl-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.tl-rank {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 3rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.35;
  min-width: 52px;
  text-align: center;
}

.tl-card-main { flex: 1; }

.tl-trend-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.tl-trend-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.tl-card-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

/* Confidence bar */
.tl-confidence {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  max-width: 240px;
}

.tl-confidence-label {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.tl-confidence-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.tl-confidence-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.6s ease;
}

.tl-confidence-value {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 36px;
}

/* Momentum badge */
.tl-momentum {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.tl-momentum.rising { background: rgba(123,139,111,0.12); color: var(--rising); }
.tl-momentum.stable { background: rgba(184,168,138,0.15); color: var(--stable); }
.tl-momentum.declining { background: rgba(196,133,122,0.15); color: var(--declining); }

/* Expand arrow */
.tl-expand-hint {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-left: auto;
  transition: transform 0.3s;
}

.tl-card.expanded .tl-expand-hint { transform: rotate(180deg); }

/* === EXPANDED DETAIL === */
.tl-card-detail {
  display: none;
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.tl-card.expanded .tl-card-detail { display: block; }

.tl-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.tl-detail-section h4 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.65rem;
  color: var(--text);
  letter-spacing: 0.02em;
}

.tl-relevance {
  grid-column: 1 / -1;
  background: var(--accent-light);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.5rem;
}

.tl-relevance h4 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent-dark);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tl-relevance p {
  font-size: 0.9rem;
  color: var(--accent-dark);
  line-height: 1.5;
}

/* Tags */
.tl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tl-tag {
  font-size: 0.78rem;
  padding: 0.2rem 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
}

/* Source list */
.tl-source-list {
  list-style: none;
}

.tl-source-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

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

.tl-source-pub {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.tl-source-title {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}

.tl-source-title a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.tl-source-title a:hover { border-bottom-color: var(--accent); }

.tl-source-excerpt {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.25rem;
  line-height: 1.5;
}

.tl-source-date {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 0.15rem;
}

/* Designers list */
.tl-designers {
  list-style: none;
}

.tl-designer-item {
  font-size: 0.88rem;
  padding: 0.3rem 0;
  color: var(--text-muted);
}

.tl-designer-item span { color: var(--accent); font-size: 0.8rem; }

/* === EMERGING & DECLINING === */
.tl-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.tl-col-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tl-col-title .icon { font-size: 1.1rem; }

.tl-mini-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.75rem;
  transition: box-shadow 0.2s;
}

.tl-mini-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.04); }

.tl-mini-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tl-mini-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.tl-mini-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.6rem;
}

.tl-mini-source {
  font-size: 0.72rem;
  color: var(--text-light);
}

.tl-mini-note {
  font-size: 0.8rem;
  color: var(--accent-dark);
  background: var(--accent-light);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  margin-top: 0.6rem;
  line-height: 1.45;
}

/* === SOURCES INSPIRATION SECTION === */
.tl-sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.tl-pub-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: box-shadow 0.2s;
}

.tl-pub-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.04); }

.tl-pub-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.15rem;
}

.tl-pub-focus {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.tl-pub-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.tl-pub-link:hover { border-bottom-color: var(--accent); }

/* Designer profile cards */
.tl-designer-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.tl-designer-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}

.tl-designer-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.tl-designer-focus {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.tl-designer-project {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 0.35rem;
}

.tl-designer-ig {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
}

.tl-designer-ig:hover { text-decoration: underline; }

/* === DIVIDER === */
.tl-divider {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.tl-divider hr {
  border: none;
  border-top: 1px solid var(--border);
}

/* === FOOTER === */
.tl-footer {
  text-align: center;
  padding: 3rem 2rem 2rem;
  font-size: 0.78rem;
  color: var(--text-light);
}

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

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .tl-header { padding: 1rem 1.25rem; }
  .tl-hero { padding: 2rem 1.25rem 1rem; }
  .tl-section { padding: 1.5rem 1.25rem 2rem; }
  
  .tl-card { padding: 1.5rem; }
  .tl-rank { font-size: 2.2rem; min-width: 38px; }
  .tl-trend-name { font-size: 1.15rem; }
  
  .tl-card-meta { flex-wrap: wrap; gap: 0.75rem; }
  
  .tl-detail-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .tl-two-col { grid-template-columns: 1fr; gap: 1.5rem; }
  
  .tl-toggle button { padding: 0.6rem 1.5rem; font-size: 0.9rem; }
  
  .tl-sources-grid { grid-template-columns: 1fr; }
  .tl-designer-cards { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .tl-card-header { gap: 1rem; }
  .tl-rank { font-size: 1.8rem; min-width: 30px; }
  .tl-brand { gap: 0.5rem; }
  .tl-wordmark { font-size: 1.2rem; }
  .tl-logo { width: 28px; height: 28px; }
}

/* === FADE-IN ANIMATION === */
.tl-fadein {
  opacity: 0;
  transform: translateY(16px);
  animation: tlFadeIn 0.5s ease forwards;
}

@keyframes tlFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

.tl-fadein:nth-child(1) { animation-delay: 0.05s; }
.tl-fadein:nth-child(2) { animation-delay: 0.1s; }
.tl-fadein:nth-child(3) { animation-delay: 0.15s; }
.tl-fadein:nth-child(4) { animation-delay: 0.2s; }
.tl-fadein:nth-child(5) { animation-delay: 0.25s; }
