/* ==========================================================================
   EL DE'OT Private Course — Base Design System, Tokens & Core Primitives
   Academic Bento Theme: [data-mode="light" | "dark"]
   ========================================================================== */

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

:root {
  interpolate-size: allow-keywords;
  color-scheme: light dark;
  --color-scrollbar-track: #e8edf5;
  --color-scrollbar-thumb: #9aa6be;
  scrollbar-color: var(--color-scrollbar-thumb) var(--color-scrollbar-track);
  --font-sans: "Plus Jakarta Sans", "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;

  --brand: #fda000;
  --brand-hover: #e28d00;
  --brand-text: #a85400;
  --brand-soft: rgba(253, 160, 0, 0.14);
  --brand-ink: #141926;

  --accent: #1d4ed8;
  --accent-soft: rgba(29, 78, 216, 0.1);
  --success: #15803d;
  --success-soft: rgba(21, 128, 61, 0.12);
  --danger: #b91c1c;

  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-alt: #f2ece1;
  --surface-glass: rgba(255, 255, 255, 0.88);
  --ink: #141926;
  --muted: #525b70;
  --border: rgba(20, 25, 38, 0.1);
  --border-strong: rgba(20, 25, 38, 0.2);

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 26px;
  --card-border-w: 1px;

  --shadow-sm: 0 2px 10px rgba(20, 25, 38, 0.05);
  --shadow: 0 12px 32px rgba(20, 25, 38, 0.08);
  --shadow-lg: 0 24px 54px rgba(20, 25, 38, 0.12);
  --hero-bg: radial-gradient(circle at 8% 12%, rgba(253, 160, 0, 0.14), transparent 44%),
    radial-gradient(circle at 92% 20%, rgba(29, 78, 216, 0.08), transparent 42%),
    #faf7f2;

  --header-h: 72px;
  --container: 1200px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

/* ---------- ACADEMIC BENTO (Dark & OS Sync) ---------- */
:root:has(> head > meta[name="color-scheme"][content="light"]),
html[data-mode="light"] {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) {
    color-scheme: dark;
    --color-scrollbar-track: #111723;
    --color-scrollbar-thumb: #46536e;
    --bg: #0e131d;
    --surface: #161d2b;
    --surface-alt: #1e2738;
    --surface-glass: rgba(22, 29, 43, 0.88);
    --ink: #f3f6fc;
    --muted: #aab3c6;
    --brand-text: #ffb838;
    --accent: #60a5fa;
    --accent-soft: rgba(96, 165, 250, 0.16);
    --brand-soft: rgba(253, 160, 0, 0.18);
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.22);
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.32);
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.44);
    --shadow-lg: 0 26px 60px rgba(0, 0, 0, 0.56);
    --hero-bg: radial-gradient(circle at 12% 18%, rgba(253, 160, 0, 0.15), transparent 44%),
      radial-gradient(circle at 88% 24%, rgba(96, 165, 250, 0.12), transparent 42%),
      #111723;
  }
}

:root:has(> head > meta[name="color-scheme"][content="dark"]),
html[data-mode="dark"],
html[data-style="academic-bento"][data-mode="dark"] {
  color-scheme: dark;
  --color-scrollbar-track: #111723;
  --color-scrollbar-thumb: #46536e;
  --bg: #0e131d;
  --surface: #161d2b;
  --surface-alt: #1e2738;
  --surface-glass: rgba(22, 29, 43, 0.88);
  --ink: #f3f6fc;
  --muted: #aab3c6;
  --brand-text: #ffb838;
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.16);
  --brand-soft: rgba(253, 160, 0, 0.18);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.22);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.32);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.44);
  --shadow-lg: 0 26px 60px rgba(0, 0, 0, 0.56);
  --hero-bg: radial-gradient(circle at 12% 18%, rgba(253, 160, 0, 0.15), transparent 44%),
    radial-gradient(circle at 88% 24%, rgba(96, 165, 250, 0.12), transparent 42%),
    #111723;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 220ms var(--ease-out), color 220ms var(--ease-out);
}

img,
canvas,
iframe {
  max-width: 100%;
  display: block;
}

.ui-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -0.15em;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 9999;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
  transition: top 180ms var(--ease-out);
}
.skip-link:focus {
  top: 16px;
}

/* ---------- Ambient Backdrop Layer ---------- */
#style-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 8% 14%, rgba(253, 160, 0, 0.08), transparent 36%),
    radial-gradient(circle at 90% 80%, rgba(29, 78, 216, 0.06), transparent 36%);
}

/* ---------- Layout & Containers ---------- */
.container {
  width: min(var(--container), calc(100% - 40px));
  margin-inline: auto;
}

.section {
  padding: 64px 0;
}

.section-tight {
  padding: 40px 0;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--brand-text);
  background: var(--brand-soft);
  padding: 6px 13px;
  border-radius: 999px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.section-head h2 {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.5vw, 2.15rem);
  line-height: 1.16;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.section-sub {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 62ch;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

/* ---------- Cards & Surfaces ---------- */
.ed-card {
  background: var(--surface);
  border: var(--card-border-w) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out), border-color 200ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .ed-card-hover:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--brand);
  }
}

.ed-card-alt {
  background: var(--surface-alt);
}

/* ---------- Buttons & Pills ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: var(--card-border-w) solid transparent;
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.btn-primary {
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 6px 18px rgba(253, 160, 0, 0.24);
}
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    background: var(--brand-hover);
    transform: translateY(-1px);
  }
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}
@media (hover: hover) and (pointer: fine) {
  .btn-outline:hover {
    border-color: var(--brand);
    background: var(--brand-soft);
    transform: translateY(-1px);
  }
}

.btn-wa {
  background: #15803d;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(21, 128, 61, 0.24);
}
@media (hover: hover) and (pointer: fine) {
  .btn-wa:hover {
    background: #166534;
    transform: translateY(-1px);
  }
}

.btn-sm {
  min-height: 38px;
  padding: 8px 15px;
  font-size: 0.86rem;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: var(--card-border-w) solid var(--border);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out), border-color 180ms var(--ease-out);
}

.filter-pill:hover,
.filter-pill.is-active {
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
}

/* ---------- Header & Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--header-h);
  background: var(--surface-glass);
  backdrop-filter: blur(18px);
  border-bottom: var(--card-border-w) solid var(--border);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  min-height: 44px;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  background: light-dark(#ffffff, var(--surface-alt));
  border: 1px solid light-dark(rgba(20, 25, 38, 0.08), var(--border-strong));
}

.brand-logo-wrap img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand-meta strong {
  font-size: 0.96rem;
  letter-spacing: -0.01em;
}
.brand-meta span {
  font-size: 0.74rem;
  color: var(--muted);
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 13px;
  border-radius: var(--radius-xs);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--ink);
  background: var(--brand-soft);
}

.nav-link.is-active {
  box-shadow: inset 0 -2px 0 var(--brand);
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  border: var(--card-border-w) solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 160ms var(--ease-out), border-color 160ms var(--ease-out), background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}

.theme-toggle-btn:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  color: var(--brand-text);
  background: var(--brand-soft);
}

.theme-toggle-btn .ui-icon {
  width: 18px;
  height: 18px;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-xs);
  background: var(--surface);
  border: var(--card-border-w) solid var(--border-strong);
}

.mobile-drawer {
  background: var(--surface);
  border-bottom: var(--card-border-w) solid var(--border);
  padding: 16px;
}

.mobile-drawer-links {
  display: grid;
  gap: 6px;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 32px;
  background: var(--surface);
  border-top: var(--card-border-w) solid var(--border);
  padding: 28px 0 36px;
  content-visibility: auto;
  contain-intrinsic-size: auto 96px;
}

.footer-minimal-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
}

.footer-brand-minimal {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-logo-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(20, 25, 38, 0.08);
}

.footer-logo-chip img {
  height: 28px;
  width: auto;
  object-fit: contain;
  display: block;
}

.footer-brand-text {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0;
}

.footer-minimal-actions,
.footer-socials-minimal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.footer-mail-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
  transition: transform 160ms var(--ease-out), border-color 160ms var(--ease-out), color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.footer-mail-pill svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.footer-mail-pill:hover {
  border-color: var(--brand);
  color: var(--brand-text);
  background: var(--brand-soft);
  transform: translateY(-1px);
}

.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: transform 160ms var(--ease-out), border-color 160ms var(--ease-out), color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.social-icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.social-icon-btn:hover {
  border-color: var(--brand);
  color: var(--brand-text);
  background: var(--brand-soft);
  transform: translateY(-2px);
}

/* ---------- Floating Translation Widget (Bottom-Left) ---------- */
.lang-widget {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 125;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 6px;
  border-radius: 999px;
  background: var(--surface);
  border: var(--card-border-w) solid var(--border-strong);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.lang-globe {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--muted);
}

.lang-globe svg {
  width: 16px;
  height: 16px;
}

.lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}

.lang-btn:hover {
  color: var(--ink);
}

.lang-btn.is-active {
  background: var(--brand);
  color: #ffffff;
}

/* ---------- Floating WhatsApp Button (Bottom-Right) ---------- */
.wa-float {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 125;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 50%;
  background: #25d366;
  color: #ffffff;
  box-shadow: 0 10px 26px rgba(37, 211, 102, 0.38);
  transition: transform 180ms var(--ease-out), background-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.wa-float svg {
  width: 28px;
  height: 28px;
  display: block;
}

@media (hover: hover) and (pointer: fine) {
  .wa-float:hover {
    background: #1ebe5d;
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 14px 32px rgba(37, 211, 102, 0.48);
  }
}

.wa-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #bbf7d0;
  animation: pulseRing 2.4s infinite;
}

@keyframes pulseRing {
  0% {
    box-shadow: 0 0 0 0 rgba(187, 247, 208, 0.75);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(187, 247, 208, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(187, 247, 208, 0);
  }
}

/* ---------- Native Top-Layer Modal & Toast ---------- */
dialog.ed-modal-dialog-native {
  margin: auto;
  padding: 0;
  border: var(--card-border-w) solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  width: min(740px, calc(100vw - 32px));
  max-width: min(740px, calc(100vw - 32px));
  max-height: min(88dvh, 860px);
  overscroll-behavior: contain;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition-property: opacity, transform, overlay, display;
  transition-duration: 220ms;
  transition-timing-function: var(--ease-out);
  transition-behavior: allow-discrete;
}

dialog.ed-modal-dialog-native:not([open]) {
  display: none;
}

dialog.ed-modal-dialog-native[open]:where(:not([data-closing])) {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@starting-style {
  dialog.ed-modal-dialog-native[open]:where(:not([data-closing])) {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

dialog.ed-modal-dialog-native::backdrop {
  background: rgba(10, 14, 24, 0.72);
  backdrop-filter: blur(6px);
  overscroll-behavior: contain;
  opacity: 0;
  transition-property: opacity, overlay, display;
  transition-duration: 220ms;
  transition-timing-function: var(--ease-out);
  transition-behavior: allow-discrete;
}

dialog.ed-modal-dialog-native[open]:where(:not([data-closing]))::backdrop {
  opacity: 1;
}

@starting-style {
  dialog.ed-modal-dialog-native[open]:where(:not([data-closing]))::backdrop {
    opacity: 0;
  }
}

:root:has(dialog.ed-modal-dialog-native:modal) {
  overflow: hidden;
  scrollbar-gutter: stable;
}

.ed-modal-surface {
  position: relative;
  padding: 28px;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.ed-modal-close {
  position: sticky;
  top: 0;
  float: right;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface-alt);
  font-size: 1.35rem;
  line-height: 1;
  display: grid;
  place-items: center;
}

.ed-toast {
  position: fixed;
  top: 86px;
  right: 20px;
  z-index: 260;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
}

/* ---------- Shared Tags & Check Lists ---------- */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--surface-alt);
  color: var(--ink);
  border: 1px solid var(--border);
}

.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
}

.check-list li .ui-icon {
  color: var(--success);
  margin-top: 3px;
}

/* ---------- Responsive Breakpoints ---------- */
@media (max-width: 1120px) {
  .lang-widget {
    bottom: 16px;
    left: 14px;
  }
  .wa-float {
    bottom: 16px;
    right: 14px;
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 1020px) {
  .nav-desktop {
    display: none;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .container {
    width: min(var(--container), calc(100% - 28px));
  }
  .section {
    padding: 44px 0;
  }
  .site-footer {
    padding: 24px 0 84px;
  }
  .footer-minimal-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  .lang-widget {
    bottom: 14px;
    left: 12px;
    padding: 4px 5px;
  }
  .lang-btn {
    padding: 5px 8px;
    font-size: 0.74rem;
  }
  .wa-float {
    bottom: 14px;
    right: 12px;
    width: 46px;
    height: 46px;
  }
  .wa-float svg {
    width: 24px;
    height: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  dialog.ed-modal-dialog-native,
  dialog.ed-modal-dialog-native::backdrop {
    transition-duration: 0.01ms;
    transform: none;
  }
  .wa-pulse {
    animation: none;
  }
}
