/* =========================================================
   The Daily Ten — Dark Liquid Glass Design System
   ========================================================= */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,600;0,6..72,700;1,6..72,400&family=Outfit:wght@300;400;500;600&display=swap');

/* --- Design Tokens --- */
:root {
  --bg-base:        #0a0a0f;
  --glass-bg:       rgba(255, 255, 255, 0.055);
  --glass-bg-h:     rgba(255, 255, 255, 0.09);
  --glass-border:   rgba(255, 255, 255, 0.10);
  --glass-border-h: rgba(255, 255, 255, 0.20);
  --glass-shadow:   0 8px 40px rgba(0, 0, 0, 0.45);
  --glass-inset:    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --blur:           blur(40px) saturate(1.6);
  --font-serif:     'Newsreader', Georgia, serif;
  --font-sans:      'Outfit', system-ui, sans-serif;
  --ease-out:       cubic-bezier(0.16, 1, 0.3, 1);
  --radius:         16px;
  --radius-sm:      8px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-base);
  color: #e2e8f0;
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Ambient Background Orbs --- */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
  animation: drift linear infinite;
}
.orb-1 {
  width: 560px; height: 560px;
  background: radial-gradient(circle, #1e3a5f 0%, transparent 70%);
  top: -180px; left: -200px;
  animation-duration: 32s;
  animation-delay: -8s;
}
.orb-2 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, #2d1b69 0%, transparent 70%);
  top: 30%; right: -120px;
  animation-duration: 40s;
  animation-delay: -20s;
}
.orb-3 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #1b3d2f 0%, transparent 70%);
  bottom: -100px; left: 20%;
  animation-duration: 28s;
  animation-delay: -14s;
}
.orb-4 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #1e3a5f 0%, transparent 70%);
  top: 60%; left: 60%;
  animation-duration: 36s;
  animation-delay: -4s;
  opacity: 0.25;
}
.orb-5 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, #2d1b69 0%, transparent 70%);
  bottom: 20%; right: 15%;
  animation-duration: 44s;
  animation-delay: -26s;
  opacity: 0.20;
}

/* --- Page wrapper --- */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(10, 10, 15, 0.6);
  backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.neon-logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
}

.logo-ten {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  margin-bottom: 6px;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: #c4c9d4;
}

.header-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: #94a3b8;
  backdrop-filter: blur(8px);
}

.refresh-btn {
  margin-left: auto;
  padding: 8px 20px;
  border-radius: 20px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: #e2e8f0;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s, background 0.2s;
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 7px;
}
.refresh-btn:hover {
  background: var(--glass-bg-h);
  border-color: rgba(108, 180, 238, 0.45);
  box-shadow: 0 0 18px rgba(108, 180, 238, 0.25);
}
.refresh-btn:active { transform: scale(0.97); }
.refresh-btn .spinner {
  width: 12px; height: 12px;
  border: 1.5px solid rgba(255,255,255,0.3);
  border-top-color: #6cb4ee;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.refresh-btn.loading .spinner { display: block; }
.refresh-btn.loading .btn-label { display: none; }

/* =========================================================
   CATEGORY NAV
   ========================================================= */
.cat-nav {
  position: sticky;
  top: 65px;
  z-index: 99;
  padding: 10px 24px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  background: rgba(10, 10, 15, 0.5);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.cat-nav::-webkit-scrollbar { display: none; }

.cat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: #94a3b8;
  backdrop-filter: blur(8px);
  transition: all 0.18s;
  flex-shrink: 0;
}
.cat-pill:hover {
  background: var(--glass-bg-h);
  color: #e2e8f0;
}
.cat-pill.active {
  background: var(--glass-bg-h);
  color: #e2e8f0;
  border-color: var(--glass-border-h);
}
.cat-pill .cat-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* =========================================================
   MAIN CONTENT
   ========================================================= */
.main-content {
  flex: 1;
  padding: 32px 24px 64px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Page heading */
.page-heading {
  margin-bottom: 28px;
}
.page-heading h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 4px;
}
.page-heading .subtitle {
  font-size: 0.85rem;
  color: #64748b;
}
.page-heading .back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: #6cb4ee;
  text-decoration: none;
  margin-bottom: 12px;
  transition: opacity 0.2s;
}
.page-heading .back-link:hover { opacity: 0.75; }

/* =========================================================
   STORY GRID
   ========================================================= */
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

/* =========================================================
   STORY CARD
   ========================================================= */
.story-card {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  backdrop-filter: var(--blur);
  box-shadow: var(--glass-shadow), var(--glass-inset);
  cursor: pointer;
  transition: transform 0.25s var(--ease-out),
              box-shadow 0.25s ease,
              border-color 0.25s ease;
  transform-style: preserve-3d;
  will-change: transform;
  text-decoration: none;
  display: block;
  color: inherit;
  overflow: hidden;
}
.story-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: radial-gradient(
    circle 200px at var(--rx, 50%) var(--ry, 0%),
    rgba(255,255,255,0.045) 0%,
    transparent 60%
  );
  pointer-events: none;
  transition: opacity 0.3s;
  opacity: 0;
}
.story-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), var(--glass-inset);
  border-color: var(--glass-border-h);
}
.story-card:hover::before { opacity: 1; }
.story-card:active { transform: translateY(-2px); }

/* story number */
.story-num {
  font-family: var(--font-serif);
  font-size: 4.2rem;
  font-weight: 700;
  color: rgba(255,255,255,0.12);
  line-height: 1;
  margin-bottom: 14px;
  letter-spacing: -0.04em;
  position: relative;
}

/* category pill inside card */
.card-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  margin-bottom: 10px;
  text-decoration: none;
  transition: background 0.2s;
  color: inherit;
}
.card-cat-pill:hover { background: rgba(255,255,255,0.12); }
.card-cat-pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
}

/* headline */
.story-headline {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  color: #f1f5f9;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* summary */
.story-summary {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  line-height: 1.65;
  color: #94a3b8;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* meta row */
.story-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.story-source {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}
.story-source:hover { color: #6cb4ee; }
.story-time {
  font-size: 0.72rem;
  color: #475569;
  font-weight: 400;
}

/* shimmer loading state */
.story-card.shimmer {
  pointer-events: none;
}
.story-card.shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.04) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer-sweep 1.4s ease-in-out infinite;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  position: relative;
  z-index: 1;
  padding: 28px 24px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.footer-inner {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.7;
}
.footer-inner .mark { font-family: var(--font-serif); }
.footer-inner a { color: #6cb4ee; text-decoration: none; }

/* =========================================================
   EMPTY / LOADING
   ========================================================= */
.last-updated {
  font-size: 0.72rem;
  color: #334155;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.last-updated .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}