/* ekpahal classes — theme tokens */
:root,
html[data-theme="dark"] {
  --bg: #0e1411;
  --bg-accent: #15201b;
  --surface: #18241e;
  --surface-2: #1e2c25;
  --text: #eef3f0;
  --muted: #93a59b;
  --line: rgba(238, 243, 240, 0.12);
  --ember: #d4a04a;
  --ember-deep: #b87d28;
  --danger: #e07a5f;
  --topbar: rgba(14, 20, 17, 0.94);
  --input: #101712;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  --display: "Bricolage Grotesque", sans-serif;
  --body: "Newsreader", Georgia, serif;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f3f6f3;
  --bg-accent: #e7eee8;
  --surface: #ffffff;
  --surface-2: #f0f4f1;
  --text: #15201b;
  --muted: #5a6b62;
  --line: rgba(21, 32, 27, 0.12);
  --ember: #c4892a;
  --ember-deep: #a56f18;
  --danger: #c2410c;
  --topbar: rgba(243, 246, 243, 0.96);
  --input: #ffffff;
  --shadow: 0 10px 28px rgba(21, 32, 27, 0.08);
  color-scheme: light;
}

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

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  width: 100%;
  color: var(--text);
  font-family: var(--body);
  background: var(--bg);
  background-image:
    radial-gradient(900px 420px at 0% 0%, color-mix(in srgb, var(--bg-accent) 80%, transparent), transparent 60%);
  background-attachment: fixed;
}

a { color: inherit; }

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.7rem clamp(0.75rem, 2.5vw, 1.5rem);
  border-bottom: 1px solid var(--line);
  background: var(--topbar);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  justify-self: start;
  font-family: var(--display);
  font-weight: 750;
  letter-spacing: -0.03em;
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  text-decoration: none;
  white-space: nowrap;
  color: var(--text);
  min-width: 0;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 0.45rem;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.85rem;
  align-items: center;
  justify-content: center;
  justify-self: center;
  max-width: 100%;
}

.nav a {
  text-decoration: none;
  font-family: var(--display);
  font-size: 0.88rem;
  color: var(--muted);
  padding: 0.3rem 0.15rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
  border-bottom-color: var(--ember);
}

.theme-btn {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 999px;
  padding: 0.35rem 0.65rem 0.35rem 0.4rem;
  cursor: pointer;
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 650;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.theme-btn:hover { transform: translateY(-1px); }

.theme-btn__track {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: #2a3a32;
  transition: background 0.3s ease;
}

.theme-btn__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #eef3f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.3s ease, background 0.3s ease;
}

/* Day/Night thumb only — must not move the YouTube mode toggle */
html[data-theme="light"] #themeToggle .theme-btn__track {
  background: #f0d089;
}

html[data-theme="light"] #themeToggle .theme-btn__thumb {
  transform: translateX(16px);
  background: #c4892a;
}

.theme-btn__label { min-width: 2.4rem; text-align: left; }

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 60;
  background: linear-gradient(90deg, var(--ember), #f0d089);
  transition: width 0.25s ease;
  pointer-events: none;
}

/* Home: full-bleed two columns — no empty right gutter */
.layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 0.85rem;
  width: 100%;
  max-width: 100%;
  min-height: calc(100dvh - 58px);
  padding: 0.85rem clamp(0.75rem, 2vw, 1.25rem) 1.25rem;
  margin: 0;
}

.sidebar,
.main {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  min-width: 0;
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 0.9rem;
  overflow: auto;
  max-height: calc(100dvh - 82px);
  position: sticky;
  top: 66px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sidebar h2,
.main-head h1 {
  font-family: var(--display);
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--text);
}

.sidebar h2 { font-size: 1.05rem; }

.main-head h1 {
  font-size: clamp(1.05rem, 2.4vw, 1.55rem);
  line-height: 1.2;
}

.hint {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0;
  line-height: 1.4;
}

.yt-mode-btn .theme-btn__label {
  min-width: 3.6rem;
}

.yt-mode-btn .theme-btn__track {
  background: #2a3a32;
}

.yt-mode-btn .theme-btn__thumb {
  transform: translateX(0);
  background: #eef3f0;
}

.yt-mode-btn.is-account .theme-btn__track {
  background: color-mix(in srgb, var(--ember) 70%, #2a3a32);
}

.yt-mode-btn.is-account .theme-btn__thumb {
  transform: translateX(16px);
  background: var(--ember);
}

html[data-theme="light"] .yt-mode-btn .theme-btn__track {
  background: #d7e0da;
}

html[data-theme="light"] .yt-mode-btn .theme-btn__thumb {
  transform: translateX(0);
  background: #5a6b62;
}

html[data-theme="light"] .yt-mode-btn.is-account .theme-btn__track {
  background: color-mix(in srgb, var(--ember) 55%, #ffffff);
}

html[data-theme="light"] .yt-mode-btn.is-account .theme-btn__thumb {
  transform: translateX(16px);
  background: var(--ember);
}

.playlist-list {
  display: grid;
  gap: 0.25rem;
  overflow: auto;
  flex: 1;
}

.playlist {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 0.55rem;
  padding: 0.65rem 0.7rem;
  cursor: pointer;
  display: grid;
  gap: 0.15rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.playlist:hover,
.playlist.active {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--ember) 40%, transparent);
}

.playlist .title {
  font-family: var(--display);
  font-weight: 650;
  font-size: 0.92rem;
  color: var(--text);
}

.playlist .meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.main {
  padding: 0.9rem clamp(0.8rem, 1.5vw, 1.15rem) 1.15rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.main-head,
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.main-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  overflow: hidden;
  background: var(--surface-2);
}

.view-btn {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 650;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

.view-btn.active {
  background: var(--ember);
  color: #101512;
}

.view-card.grid,
.courses-box.view-card .course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  gap: 0.75rem;
}

.view-list.grid,
.courses-box.view-list .course-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.view-list .card,
.courses-box.view-list .card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: stretch;
}

.view-list .card img,
.courses-box.view-list .card img {
  width: 120px;
  height: 100%;
  min-height: 68px;
  aspect-ratio: auto;
  object-fit: cover;
}

.view-list .card .body,
.courses-box.view-list .card .body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.course-block { margin-bottom: 1.25rem; }
.course-block h2 {
  font-family: var(--display);
  font-size: 1.05rem;
  margin: 0 0 0.65rem;
  color: var(--text);
}

.courses-box { width: 100%; }

.badge {
  font-family: var(--display);
  font-size: 0.72rem;
  color: #101512;
  background: var(--ember);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(68dvh, 820px);
  background: #000;
  border-radius: 0.7rem;
  overflow: hidden;
  margin-bottom: 0.9rem;
  border: 1px solid var(--line);
}

.player-wrap iframe,
.player-mount {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-mount iframe,
.player-mount > div {
  width: 100% !important;
  height: 100% !important;
}

.player-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: var(--display);
  padding: 1rem;
  text-align: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  gap: 0.75rem;
  width: 100%;
}

.card {
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  overflow: hidden;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  animation: rise 0.45s ease both;
}

.card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--ember) 45%, transparent);
}

.card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #1a2420;
}

.card .body { padding: 0.6rem 0.65rem 0.75rem; }
.card .body strong {
  display: block;
  font-family: var(--display);
  font-size: 0.86rem;
  line-height: 1.25;
  margin-bottom: 0.2rem;
  color: var(--text);
}
.card .body span {
  color: var(--muted);
  font-size: 0.75rem;
}

.page {
  display: none;
  width: 100%;
  max-width: 100%;
  min-height: calc(100dvh - 58px);
  padding: 1.25rem clamp(0.75rem, 3vw, 2rem) 2rem;
  margin: 0;
}

.page.active { display: block; }
.home-page.active { display: grid; }

.page--center.active {
  display: grid;
  place-items: center;
  justify-items: center;
  align-content: center;
  min-height: calc(100dvh - 58px);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.page[data-page="register"].page--center.active {
  align-content: start;
  place-items: start center;
}

.page--center .auth-card {
  width: min(100%, 480px);
  margin-inline: auto;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 1.1rem 1.15rem 1.2rem;
  box-shadow: var(--shadow);
}

.page--center .auth-card--wide {
  width: min(100%, 760px);
}

.contact-shell {
  width: min(100%, 1180px);
  display: grid;
  grid-template-columns: minmax(200px, 0.9fr) minmax(260px, 1.05fr) minmax(220px, 1fr);
  gap: 0.9rem;
  align-items: stretch;
}

.contact-info,
.contact-form-card,
.contact-about {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 1.1rem 1.1rem 1.2rem;
  box-shadow: var(--shadow);
  min-width: 0;
}

.contact-info h1,
.contact-form-card h1,
.contact-about h1 {
  margin: 0 0 0.35rem;
}

.contact-about p {
  margin: 0.45rem 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.contact-links {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.contact-links a,
.contact-meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0.65rem;
  padding: 0.65rem 0.75rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.contact-links a:hover {
  border-color: color-mix(in srgb, var(--ember) 50%, var(--line));
  transform: translateY(-1px);
}

.contact-links strong {
  display: block;
  font-family: var(--display);
  font-size: 0.92rem;
}

.contact-links small {
  color: var(--muted);
  font-size: 0.75rem;
}

.contact-ico {
  width: 34px;
  height: 34px;
  border-radius: 0.45rem;
  flex-shrink: 0;
  background: center / 62% no-repeat;
}

.contact-ico--ig {
  background-color: #1a1a1a;
  background-image: radial-gradient(circle at 30% 30%, #feda75, #d62976 45%, #4f5bd5 80%);
}

.contact-ico--tg {
  background-color: #229ED9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M21.9 4.2 2.8 11.6c-1.3.5-1.3 1.2-.2 1.5l4.9 1.5 1.9 5.8c.2.7.4.9 1 .9.6 0 .8-.3 1.1-.6l2.7-2.6 5.6 4.1c1 .6 1.8.3 2-.9l3.5-16.5c.4-1.5-.5-2.2-1.6-1.7z'/%3E%3C/svg%3E");
  background-size: 58%;
}

.contact-ico--yt {
  background-color: #FF0000;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 6v12l10-6z'/%3E%3C/svg%3E");
  background-size: 50%;
}

.contact-ico--globe {
  background-color: #2a4a3d;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eef3f0' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c2.5 2.8 3.8 6 3.8 9s-1.3 6.2-3.8 9c-2.5-2.8-3.8-6-3.8-9s1.3-6.2 3.8-9z'/%3E%3C/svg%3E");
  background-size: 60%;
}

.contact-note {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
}

.about-card .about-tagline {
  color: var(--text);
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.05rem;
  margin: 0.4rem 0 0.65rem;
}

.about-card .about-line {
  margin: 0.2rem 0;
  color: var(--text);
}

.about-card p {
  margin: 0.55rem 0;
}

@media (max-width: 980px) {
  .contact-shell {
    grid-template-columns: 1fr 1fr;
  }
  .contact-about {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .contact-shell {
    grid-template-columns: 1fr;
  }
  .contact-about {
    grid-column: auto;
  }
}

.page--center .auth-card h1 {
  margin-bottom: 0.25rem;
}

.page--center .auth-card > p {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
}

.form--two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 0.85rem;
  margin-top: 0.55rem;
}

.form--two .span-2 {
  grid-column: 1 / -1;
}

.form--two label {
  gap: 0.2rem;
  font-size: 0.8rem;
}

.form--two input,
.form--two select,
.form--two textarea {
  padding: 0.55rem 0.65rem;
}

@media (max-width: 640px) {
  .form--two {
    grid-template-columns: 1fr;
  }
  .form--two .span-2 {
    grid-column: auto;
  }
}

.page h1 {
  font-family: var(--display);
  letter-spacing: -0.03em;
  margin: 0 0 0.55rem;
  color: var(--text);
}

.page p { color: var(--muted); line-height: 1.5; }

.form {
  display: grid;
  gap: 0.7rem;
  width: 100%;
  margin-top: 0.85rem;
}

.form label {
  display: grid;
  gap: 0.28rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.form input,
.form textarea,
.form select {
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  border-radius: 0.4rem;
  padding: 0.7rem 0.75rem;
  width: 100%;
}

.form input::placeholder,
.form textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 80%, transparent);
}

.btn {
  border: 0;
  cursor: pointer;
  font-family: var(--display);
  font-weight: 700;
  border-radius: 0.4rem;
  padding: 0.8rem 1rem;
  background: linear-gradient(180deg, var(--ember), var(--ember-deep));
  color: #101512;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.muted { color: var(--muted); }
.error { color: var(--danger); }
.req { color: var(--danger); font-weight: 700; margin-left: 0.15rem; }

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

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .sidebar {
    position: relative;
    top: 0;
    max-height: none;
  }
  .playlist-list {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    max-height: 220px;
  }
  .player-wrap { max-height: none; }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand theme"
      "nav nav";
  }
  .brand { grid-area: brand; }
  .theme-btn { grid-area: theme; }
  .nav {
    grid-area: nav;
    justify-content: center;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .brand span { font-size: 0.92rem; }
  .main-head { flex-direction: column; }
}

/* === press-feedback === */
button,
.btn,
.view-btn,
.theme-btn,
.playlist,
.nav a,
.brand,
a.card,
.course-card button,
.chip {
  transition:
    transform 0.12s ease,
    filter 0.12s ease,
    box-shadow 0.12s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    opacity 0.12s ease,
    color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button:active,
.btn:active,
.view-btn:active,
.theme-btn:active,
.playlist:active,
.nav a:active,
.brand:active,
a.card:active,
.course-card button:active,
.chip:active {
  transform: translateY(1px) scale(0.96);
  filter: brightness(0.92);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.25);
}
button:focus-visible,
.btn:focus-visible,
.view-btn:focus-visible,
.nav a:focus-visible {
  outline: 2px solid var(--ember, #d4a04a);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  button, .btn, .view-btn, .theme-btn, .playlist, .nav a, .brand, a.card, .chip {
    transition: none !important;
  }
  button:active, .btn:active, .view-btn:active, .theme-btn:active, .playlist:active,
  .nav a:active, .brand:active, a.card:active, .chip:active {
    transform: none;
  }
}
