:root {
  --bg: #f4f1ea;
  --bg-soft: #f9f6f1;
  --paper: #fffdfa;
  --ink: #18211d;
  --muted: #51635b;
  --line: #d8d6cc;
  --brand: #0f7a56;
  --brand-2: #1f4dc6;
  --accent: #bd5f26;
  --shadow: 0 18px 48px rgba(26, 35, 29, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Sora", sans-serif;
  background:
    radial-gradient(1200px 500px at 10% 0%, #e5f6ee 0%, transparent 55%),
    radial-gradient(1000px 480px at 100% 0%, #e8edff 0%, transparent 50%),
    radial-gradient(900px 420px at 50% 100%, #fff0e3 0%, transparent 48%),
    var(--bg);
}

.mesh {
  position: fixed;
  inset: -10% -5% auto;
  height: 320px;
  background: linear-gradient(110deg, rgba(15, 122, 86, 0.12), rgba(31, 77, 198, 0.14), rgba(189, 95, 38, 0.14));
  filter: blur(54px);
  pointer-events: none;
}

.shell {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 16px 56px;
}

.hero {
  background: rgba(255, 253, 250, 0.78);
  border: 1px solid rgba(216, 214, 204, 0.9);
  border-radius: 26px;
  padding: 20px;
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
  animation: rise 0.5s ease both;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.hero-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tag {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
  font-weight: 700;
}

.sync {
  font-size: 12px;
  color: var(--muted);
}

.lang-toggle {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2px;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: #3f544b;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.lang-btn.active {
  background: linear-gradient(135deg, #e7f0ff, #ecfff5);
  color: #1f3f8e;
  font-weight: 600;
}

.hero h1 {
  margin: 10px 0 8px;
  font: 700 clamp(2rem, 5.8vw, 3.45rem) / 1.05 "Fraunces", serif;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0;
  max-width: 780px;
  color: var(--muted);
  line-height: 1.6;
}

.value-pills {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.value-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #c9d6f0;
  background: linear-gradient(135deg, #ffffff, #f4f7ff);
  color: #294074;
  font-size: 12px;
  font-weight: 600;
}

.cta-row {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

#refreshBtn {
  border: 0;
  background: linear-gradient(135deg, var(--brand), #0f9b6b);
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
}

.ghost-link {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--paper);
  border-radius: 12px;
  padding: 9px 14px;
  text-decoration: none;
  font-size: 14px;
}

.origin-card {
  margin-top: 14px;
  border-left: 4px solid var(--accent);
  background: linear-gradient(120deg, #fff7ef, #fffdfa);
  border-radius: 14px;
  padding: 12px 14px;
}

.subscribe-card {
  margin-top: 12px;
  border-left: 4px solid var(--brand-2);
  background: linear-gradient(120deg, #eef2ff, #fffdfa);
  border-radius: 14px;
  padding: 12px 14px;
}

.origin-title {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8f4a1f;
  font-weight: 700;
}

.origin-text {
  margin: 6px 0 0;
  color: #4c3b30;
  line-height: 1.5;
}

.subscribe-form {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.subscribe-form input {
  min-width: 260px;
  flex: 1;
  border: 1px solid #cad4f3;
  background: #fff;
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
}

.subscribe-form button {
  border: 0;
  background: linear-gradient(135deg, var(--brand-2), #3a73ff);
  color: #fff;
  border-radius: 10px;
  padding: 9px 13px;
  font-weight: 600;
  cursor: pointer;
}

.subscribe-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #42537a;
}

.stats {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}

.stat-k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.stat-v {
  margin-top: 6px;
  font: 700 1.45rem/1 "Fraunces", serif;
}

.marquee-wrap {
  margin-top: 12px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.84);
}

.marquee {
  white-space: nowrap;
  overflow: hidden;
}

.marquee-track {
  display: inline-flex;
  gap: 8px;
  padding: 10px 14px;
  animation: ticker 36s linear infinite;
}

.feed-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 11px;
  border: 1px solid #cfd8d2;
  color: #2c4339;
  font-size: 12px;
  background: #f5faf7;
}

.layout {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 0.92fr 1.48fr;
  gap: 12px;
}

.panel {
  background: rgba(255, 253, 250, 0.9);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fffdfa, #fbf8f3);
}

.panel-head h2 {
  margin: 0;
  font: 700 1.14rem/1 "Fraunces", serif;
}

.small-meta {
  font-size: 12px;
  color: var(--muted);
}

.scroll {
  max-height: 74vh;
  overflow: auto;
}

.entry,
.day {
  padding: 14px 16px;
  border-bottom: 1px dashed #e4e1d7;
  animation: rise 0.35s ease both;
}

.entry-head,
.day-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.entry-feed {
  margin: 0;
  font-size: 12px;
  color: var(--brand);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.entry-time,
.day-total {
  font-size: 12px;
  color: #6b7d74;
  white-space: nowrap;
}

.entry-title {
  margin-top: 6px;
  display: inline-block;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  line-height: 1.35;
}

.entry-title:hover {
  color: var(--brand-2);
}

.entry-title-translation {
  margin: 6px 0 0;
  color: #5f6f97;
  font-size: 13px;
  line-height: 1.4;
}

.entry-tldr,
.entry-why,
.entry-action,
.tweet-preview,
.day-feeds {
  margin: 8px 0 0;
  color: #33463d;
  font-size: 14px;
  line-height: 1.5;
}

.entry-action {
  color: #2e433a;
}

.tweet-row {
  margin-top: 10px;
  border: 1px solid #d9dde9;
  background: #fbfcff;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.entry-copy-kind,
.day-copy-kind {
  border: 1px solid #c0cbed;
  background: #fff;
  color: #24345d;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  min-width: 180px;
}

.tweet-preview {
  margin: 0;
  color: #2b3e5b;
  font-size: 13px;
  line-height: 1.45;
}

.tweet-preview-row {
  margin-top: 8px;
  border-left: 3px solid #dce5ff;
  padding-left: 8px;
}

.tweet-btn {
  border: 1px solid #b8c5ff;
  background: #fff;
  color: #24345d;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.entry-image-btn,
.day-image-btn {
  border: 1px solid #9db2f7;
  background: linear-gradient(135deg, #f8fbff, #edf2ff);
  color: #1f3c83;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.entry-image-btn:disabled,
.day-image-btn:disabled {
  opacity: 0.72;
  cursor: progress;
}

.day-date {
  margin: 0;
  font-weight: 700;
}

.day-feeds {
  color: #3f544b;
  font-size: 13px;
}

.day-summary-label {
  margin: 10px 0 0;
  color: #546d62;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

.day-summary {
  margin: 6px 0 0;
  color: #23382f;
  font-size: 14px;
  line-height: 1.55;
}

.day-points {
  margin: 8px 0 0 16px;
  padding: 0;
}

.day-points li {
  margin: 5px 0;
  color: #2f4339;
  font-size: 13px;
}

.day-copy-tools {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.day-copy-btn {
  border: 1px solid #c0cbed;
  background: #fff;
  color: #24345d;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.day-copy-preview-wrap {
  margin-top: 8px;
  border-left: 3px solid #dce5ff;
  padding-left: 8px;
}

.day-copy-preview {
  margin: 0;
  color: #2b3e5b;
  font-size: 13px;
  line-height: 1.45;
}

.empty {
  padding: 22px 16px;
  color: var(--muted);
  font-size: 14px;
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

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

@media (prefers-reduced-motion: reduce) {
  .marquee-track,
  .entry,
  .day,
  .hero {
    animation: none;
  }
}

@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout { grid-template-columns: 1fr; }
  .scroll { max-height: none; }
  .hero-controls { width: 100%; justify-content: space-between; }
}
