:root {
  --bg: #222b38;
  --bg-top: #2a3442;
  --bg-soft: #273445;
  --card: #2b3648;
  --card-hover: #334155;
  --text: #e5e7eb;
  --muted: #aeb8c5;
  --border: #425268;
  --accent: #60a5fa;
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  --radius: 18px;
  --max-width: 1100px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', Arial, sans-serif;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 100%);
  color: var(--text);
  line-height: 1.6;
}

/* HEADER */
header {
  background: #243040;
  color: var(--text);
  padding: 2.6rem 1.2rem 2rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.logo {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 6px;
}

.logo-text {
  font-family: 'Cormorant', Georgia, serif;
  font-size: 42px;
  font-style: italic;
  font-weight: 600;
  color: #ffffff;
  line-height: 1;
}

.anchor-icon {
  display: inline-flex;
  align-items: flex-end;
  margin-bottom: 3px;
}

.logo-tagline {
  font-size: 11px;
  color: #94A3B8;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.site-tagline {
  margin: 4px 0 0;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* NAV */
nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(36, 48, 64, 0.92);
  backdrop-filter: blur(10px);
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-btn,
.level-tab {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 10px 16px;
  cursor: pointer;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  font-family: inherit;
}

.nav-btn:hover,
.level-tab:hover,
.nav-btn.active,
.level-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.nav-btn:hover,
.level-tab:hover {
  transform: translateY(-1px);
}

/* MAIN */
main {
  max-width: var(--max-width);
  margin: 40px auto;
  padding: 0 20px 56px;
}

/* IMPORTANT: only active section should show */
.section {
  display: none;
}

.section.active {
  display: block;
}

.section h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 2rem;
  letter-spacing: -0.02em;
}

.section > p {
  color: var(--muted);
  margin-top: 0;
}

/* CARDS */
.card,
.article-card,
.article-display {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card {
  padding: 28px;
  margin-top: 20px;
}

.hero-card {
  padding: 24px;
}

/* IDIOM BANNER */
.tagline {
  width: 100%;
}

.idiom-banner {
  overflow: hidden;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.14), rgba(96, 165, 250, 0.06));
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 14px;
  padding: 12px 0;
}

.idiom-track {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  height: 32px;
}

.idiom-item-1,
.idiom-item-2 {
  position: absolute;
  top: 0;
  white-space: nowrap;
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 500;
  color: var(--muted);
}

.idiom-item-1 {
  animation: idiom-scroll-1 28s linear infinite;
}

.idiom-item-2 {
  animation: idiom-scroll-2 28s linear infinite;
}

.idiom-label {
  color: #ffffff;
  font-weight: 800;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  padding: 4px 10px;
  border-radius: 999px;
  margin-right: 10px;
}

.idiom-name {
  color: #fde68a;
  font-weight: 800;
}

@keyframes idiom-scroll-1 {
  0% {
    left: 100%;
  }
  100% {
    left: -220%;
  }
}

@keyframes idiom-scroll-2 {
  0% {
    left: 220%;
  }
  100% {
    left: -100%;
  }
}

/* WORD OF THE DAY */
#word-of-day h3 {
  margin-top: 0;
}

#daily-word {
  font-size: 1.35rem;
  color: #bfdbfe;
}

#daily-definition {
  margin-top: 8px;
  color: var(--muted);
}

/* BUTTON GROUPS */
.level-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

/* ARTICLE CARDS */
.article-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 22px;
}

.article-card {
  padding: 22px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: var(--card-hover);
}

.article-card h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.article-card p {
  margin: 0;
  color: var(--muted);
}

.article-meta {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.16);
  color: #bfdbfe;
  font-size: 0.82rem;
  font-weight: 700;
}

/* ARTICLE DISPLAY */
.article-display {
  padding: 28px;
  margin-top: 28px;
}

.article-display h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.5rem;
}

.article-body {
  margin-top: 20px;
}

.article-body p {
  color: var(--text);
  margin-bottom: 16px;
}

/* VOCAB / DISCUSSION */
.vocab-box,
.discussion-box {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.vocab-box h4,
.discussion-box h4 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1rem;
}

.vocab-box ul,
.discussion-box ol {
  margin: 0;
  padding-left: 20px;
}

.vocab-box li,
.discussion-box li {
  margin-bottom: 10px;
}

.vocab-box li strong {
  color: #dbeafe;
}

/* AUDIO */
audio {
  width: 100%;
  margin-top: 16px;
  margin-bottom: 10px;
}

.audio-select,
select {
  width: 100%;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  background: var(--bg-soft);
  color: var(--text);
  margin-top: 8px;
  font-family: inherit;
}

.audio-select:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
}

.explore-more-label {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

#featured-audio-display {
  border: 1px solid rgba(96, 165, 250, 0.45);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.12), var(--shadow);
}

/* SPEAKER BUTTON */
.speaker-btn {
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 0.9rem;
  border-radius: 8px;
  background: rgba(96, 165, 250, 0.12);
  color: white;
  border: 1px solid var(--border);
}

.speaker-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* SONG SECTION */
.song-header {
  margin-bottom: 20px;
}

.song-header h3 {
  margin: 0 0 4px;
  font-size: 1.3rem;
}

.song-artist {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
}

.song-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

.song-lyrics {
  line-height: 1.8;
  color: var(--text);
  font-size: 0.97rem;
}

.song-lyrics p {
  margin: 0 0 16px;
}

@media (max-width: 700px) {
  .song-body {
    grid-template-columns: 1fr;
  }
}

/* IFRAME */
iframe {
  margin-top: 14px;
  background: transparent;
  border-radius: 14px;
  width: 100%;
  max-width: 100%;
  display: block;
}

/* READ LEVELS */
.read-level {
  display: block;
}

.active-band {
  display: block;
}

/* FOOTER */
footer {
  text-align: center;
  padding: 26px 18px;
  background: #243040;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* HOME PAGE CENTER FIX */
#home.section.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

#home > .card {
  width: min(100%, 820px);
  margin-left: auto;
  margin-right: auto;
}

#home .hero-card {
  width: min(100%, 820px);
}

#home h3,
#home p {
  text-align: center;
}

#home p {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

#home .level-tabs {
  justify-content: center;
}

#home .level-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#home > .card > .level-tab {
  margin-left: auto;
  margin-right: auto;
}
}

/* RESPONSIVE */
@media (max-width: 700px) {
  header {
    padding: 2.2rem 1rem 1.7rem;
  }

  main {
    padding: 0 16px 44px;
  }

  .card,
  .article-card,
  .article-display {
    padding: 20px;
  }

  .idiom-track {
    height: 34px;
  }

  .idiom-item-1,
  .idiom-item-2 {
    font-size: 0.92rem;
  }
}

@media (max-width: 600px) {
  nav {
    justify-content: center;
  }

  .article-list {
    grid-template-columns: 1fr;
  }

  .level-tabs {
    justify-content: center;
  }

  .audio-select,
  select {
    max-width: 100%;
  }

  .idiom-label {
    padding: 3px 8px;
    margin-right: 8px;
  }

  .idiom-item-1,
  .idiom-item-2 {
    font-size: 0.88rem;
  }
}