/* ---------- Theme variables ---------- */
:root {
  --bg: #0f1115;
  --bg2: #141824;
  --text: #e6e6e6;
  --muted: #b5b5b5;
  --card: rgba(255, 255, 255, 0.03);
  --accent: #7aa2ff;
  --hover: color-mix(in srgb, var(--accent) 12%, transparent);
  --border: color-mix(in srgb, var(--text) 14%, transparent);
  scroll-padding-top: 110px;
}

html[data-theme="light"] {
  --bg: #f6f7fb;
  --bg2: #ffffff;
  --text: #141824;
  --muted: #4b5563;
  --card: rgba(0, 0, 0, 0.03);
  --accent: #2f6fff;
  --hover: color-mix(in srgb, var(--accent) 12%, transparent);
  --border: color-mix(in srgb, var(--text) 14%, transparent);
}

/* Document: body is the scroll container */
html {
  height: auto;
  margin: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
  background: var(--bg);
  background-color: var(--bg);
  /* Remove smooth scroll from html — handled per-element to avoid mobile jank */
}

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg);
  background-color: var(--bg);
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 180ms;
  animation-timing-function: ease;
}

/* Transitions only on interactive elements (global * caused scroll lag) */

/* ============================================================
   SCROLL PERFORMANCE — GPU layer hints
   Fixed elements get their own compositor layer so they never
   block or interrupt the main scroll thread.
   ============================================================ */

.topbar,
#backToTop,
.nav-backdrop,
dialog.modal {
  will-change: transform;
  transform: translateZ(0);
}

/* Smooth scroll only on anchor/hash navigation, not the whole document */
html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text);
}
.skip-link:focus {
  left: 12px;
  z-index: 9999;
}

/* Keyboard focus: visible ring for interactive elements (no outline on mouse click) */
:focus {
  outline: none;
}
.btn:focus-visible,
.theme-btn:focus-visible,
.nav a:focus-visible,
.nav-link:focus-visible,
.update-item:focus-visible,
.modal-close:focus-visible,
.tab:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Touch: reduce default tap highlight for cleaner feel */
@media (hover: none) {
  .btn, .theme-btn, .nav a, .nav-link, .update-item, .tab {
    -webkit-tap-highlight-color: transparent;
  }
}

/* Universal box-sizing — padding/border never add to element width */
*, *::before, *::after {
  box-sizing: border-box;
}

/* ---------- Base ---------- */
body {
  background: radial-gradient(circle at top left, var(--bg2), var(--bg) 60%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* Keep topbar spacing: top for fixed bar, sides + bottom */
  padding: 100px 16px 50px;
  opacity: 1;
  transition: opacity 0.18s ease;
}

img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

body.fade-out {
  opacity: 0;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  animation: fadeIn 0.6s ease-out;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.muted {
  color: var(--muted);
}

.subtitle {
  color: var(--muted);
  font-size: 1.15rem;
}

/* Remove 300ms tap delay on all interactive elements */
a, button, [role="button"], input, select, textarea, label,
.tile, .guide-card, .update-item, .tab, .module-tab,
.dropdown summary, .module-resource-link {
  touch-action: manipulation;
}

/* Noto Emoji images — size controlled by width/height attrs, no distortion */
.noto-emoji {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  object-fit: contain;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 980px;
  z-index: 1000;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  box-shadow:
    0 2px 16px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 color-mix(in srgb, white 6%, transparent);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 18px;
  padding: 10px 12px;
  transition: none;
  view-transition-name: none;
}

.topbar.at-top,
html.at-top .topbar {
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border: 1px solid transparent;
  box-shadow: none;
}

/* Blur only when NOT scrolling — idle glass effect */
.topbar.blur-ready:not(.scrolling) {
  backdrop-filter: blur(24px) saturate(160%) brightness(1.04);
  -webkit-backdrop-filter: blur(24px) saturate(160%) brightness(1.04);
}

.topbar.at-top.blur-ready:not(.scrolling),
html.at-top .topbar.blur-ready:not(.scrolling) {
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.topbar.scrolling {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.brand,
.hero h1,
.page h1,
.section h2 {
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  letter-spacing: -0.3px;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

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

.nav a {
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.nav a:hover {
  background: var(--hover);
  color: var(--text);
  text-decoration: none;
}

.nav a.active {
  color: var(--text);
  background: var(--hover);
}

.nav-link {
  background: none;
  border: 1px solid transparent;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.nav-link:hover {
  background: var(--hover);
  color: var(--text);
}

.topbar a.active {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.theme-btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
}
.theme-btn:hover {
  background: var(--hover);
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 40px;
}

/* Prevent grid children from overflowing their columns */
.hero > * {
  min-width: 0;
}

.hero-text {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  margin: 0 0 10px;
  letter-spacing: -0.5px;
  line-height: 1.05;
}
.hero h1 span {
  font-size: 0.9em;
}

.buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn, .theme-btn, .nav a, .nav-link, .update-item, .tab {
  transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease;
}

.tile {
  transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease;
}

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

.btn {
  display: inline-block;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}
.btn:hover {
  background: var(--hover);
  text-decoration: none;
}

.btn.primary {
  border-color: rgba(122, 162, 255, 0.35);
  background: rgba(122, 162, 255, 0.15);
}

/* right hero card */
.hero-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  backdrop-filter: blur(12px);
}

.small-title {
  margin: 0 0 10px;
  font-weight: 600;
}

.quick {
  margin: 0;
  padding-left: 18px;
}
.quick li {
  margin: 8px 0;
}

/* ---------- Sections / grid ---------- */
.section {
  scroll-margin-top: 110px;
  position: relative; /* needed for highlight overlay */
}

/* Performance: skip rendering offscreen sections */
section.section {
  content-visibility: auto;
  contain-intrinsic-size: auto 700px;
}

.section + .section {
  margin-top: 2.5rem;
}

/* Smooth section highlight */
.section.flash::after,
.footer.flash::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 20px;
  pointer-events: none;

  background: radial-gradient(
    1200px circle at 20% -10%,
    color-mix(in srgb, var(--accent) 22%, transparent),
    transparent 55%
  );

  opacity: 0;
  transform: translateY(2px);
  animation: flashSoft 900ms cubic-bezier(.2,.8,.2,1);
}

@keyframes flashSoft {
  0% { opacity: 0; transform: translateY(2px); }
  35% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-1px); }
}

.section h2 {
  margin: 0 0 10px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.tile {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  backdrop-filter: blur(12px);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
.tile:active {
  transform: scale(0.96);
  transition: transform 0.1s ease;
}

.thumb {
  height: 120px;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.placeholder {
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg2) 70%, transparent);
}

.placeholder::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--accent) 25%, transparent),
    transparent
  );
  transform: translateX(-70%);
  animation: shimmer 2.2s linear infinite;
  filter: blur(1px);
  opacity: 0.75;
}

html.loading .placeholder::before {
  animation: none !important;
  opacity: 0.35;
}

html.loading .topbar {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

@keyframes shimmer {
  0% { transform: translateX(-70%); }
  100% { transform: translateX(70%); }
}

@media (prefers-reduced-motion: no-preference) {
  .tile,
  .card,
  .updates {
    animation: reveal 0.45s ease both;
    animation-timeline: view();
    animation-range: entry 15% cover 30%;
  }

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

/* ---------- Latest updates + modal ---------- */
.section-head {
  margin-bottom: 12px;
}

.updates {
  padding: 6px;
}

.update-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  padding: 14px 14px;
  border-radius: 16px;
  cursor: pointer;
}

.update-item:hover {
  background: var(--hover);
  border-color: var(--border);
}

.update-item:active,
.tab:active {
  transform: scale(0.98);
}

.update-title {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.update-meta {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
}

.badge {
  font-size: 0.7rem;
  background: rgba(122, 162, 255, 0.25);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 999px;
  margin-left: 6px;
}

/* Modal */
.modal {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0;
  /* Frosted glass — backdrop-filter only on desktop to avoid Android flicker */
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  color: var(--text);
  max-width: 680px;
  width: calc(100% - 24px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4),
              inset 0 1px 0 color-mix(in srgb, white 8%, transparent);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ---- Desktop: fade + slight rise ---- */
dialog.modal {
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition: opacity 220ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 220ms cubic-bezier(0.34, 1.4, 0.64, 1);
}
dialog.modal[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}
dialog.modal.is-closing {
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition: opacity 180ms ease, transform 180ms ease;
}

dialog.modal::backdrop {
  opacity: 0;
  transition: opacity 220ms ease;
}
dialog.modal[open]::backdrop { opacity: 1; }
dialog.modal.is-closing::backdrop { opacity: 0; }

/* ---- Mobile: bottom sheet ---- */
@media (max-width: 768px) {
  dialog.modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    max-height: 92dvh;
    overflow-y: auto;
    border-radius: 24px 24px 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    margin: 0;
    /* Safe area for notch phones */
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateY(100%);
    opacity: 1;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg2);
    transition: transform 320ms cubic-bezier(0.34, 1.2, 0.64, 1);
  }
  dialog.modal[open] {
    transform: translateY(0);
    opacity: 1;
  }
  dialog.modal.is-closing {
    transform: translateY(100%);
    opacity: 1;
    transition: transform 240ms cubic-bezier(0.4, 0, 1, 1);
  }
  /* Drag handle pill */
  dialog.modal .modal-inner::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--text) 20%, transparent);
    margin: 0 auto 16px;
  }
  /* Give modal inner a bit of breathing room on sides */
  .modal-inner {
    padding: 16px 20px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  dialog.modal,
  dialog.modal::backdrop {
    transition: none !important;
  }
}

.modal-inner {
  padding: 18px;
}

.modal-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.modal-date {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.modal-title {
  margin: 4px 0 0;
  font-size: 1.35rem;
}

.modal-body {
  margin: 12px 0 16px;
  color: var(--muted);
  line-height: 1.5;
}

.modal-close {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
}

.modal-close:hover {
  background: var(--hover);
}

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.contact-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Year tabs ---------- */
.tabs {
  display: flex;
  gap: 10px;
  margin: 10px 0 14px;
  flex-wrap: wrap;
}

.tab {
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
}

.tab:hover {
  background: var(--hover);
  color: var(--text);
}

.tab.active {
  color: var(--text);
  background: rgba(122, 162, 255, 0.18);
  border-color: rgba(122, 162, 255, 0.35);
}

.year {
  display: none;
}
.year.active {
  display: block;
}

/* ---------- Modules card + dropdowns ---------- */
.page h1 {
  margin: 0 0 8px;
  font-size: 2.2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  backdrop-filter: blur(12px);
}

.dropdown {
  border-top: 1px solid var(--border);
  padding: 12px 0;
}
.dropdown:first-of-type {
  border-top: none;
}

.dropdown summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 8px;
  border-radius: 12px;
}

.dropdown summary .summary-meta,
.dropdown summary .chips {
  width: 100%;
}
.dropdown summary::-webkit-details-marker {
  display: none;
}
.dropdown summary:hover {
  background: var(--hover);
}

.module-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.tag {
  font-size: 0.9rem;
  color: var(--muted);
}

.content {
  padding: 10px 18px 18px;
}

.note {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
}

.note ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.note li {
  margin: 6px 0;
}

.continue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.continue-card .btn {
  flex-shrink: 0;
}

.summary-meta {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chip {
  display: inline-block;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.week-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.week-checklist label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}

.week-checklist input[type="checkbox"] {
  cursor: pointer;
}

.links {
  margin: 0;
  padding-left: 18px;
}
.links li {
  margin: 8px 0;
}

/* ---------- Searchbar ---------- */
.searchbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 14px 0 18px;
}

.searchbar input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  outline: none;
}

.searchbar input:focus {
  border-color: rgba(122, 162, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(122, 162, 255, 0.12);
}

.hint {
  color: var(--muted);
  font-size: 0.95rem;
  white-space: nowrap;
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 38px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  position: relative;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 14px;
}

.footer-title {
  margin: 0 0 8px;
  font-weight: 700;
}

.footer.simple {
  margin-top: 26px;
}

.copyright {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 850px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  body {
    padding: 100px 14px 50px;
  }
  .hero h1 {
    font-size: 2.25rem;
  }
  .subtitle {
    font-size: 1.05rem;
  }
  .btn {
    width: 100%;
    text-align: center;
  }
  .searchbar {
    flex-direction: column;
    align-items: stretch;
  }
  .hint {
    text-align: left;
  }
}

/* (mobile nav handled by nav-mobile styles below) */

/* ---------- Reduced motion + performance ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .topbar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .placeholder::before {
    animation: none !important;
  }

  .section.flash::after,
  .footer.flash::after {
    animation: none !important;
    opacity: 0.9;
  }
}

/* ---------- Animation ---------- */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- Command palette ---------- */
.command-palette .modal-inner {
  max-width: 480px;
  width: 100%;
}

.command-palette-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  margin-bottom: 10px;
}

.command-palette-input:focus {
  border-color: rgba(122, 162, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(122, 162, 255, 0.12);
}

.command-palette-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  max-height: 280px;
  overflow-y: auto;
}

.command-palette-item {
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
}

.command-palette-item:hover,
.command-palette-item.selected {
  background: var(--hover);
}

.command-palette-hint {
  margin: 10px 0 0;
  font-size: 0.85rem;
}

/* Custom scrollbar removed: it caused thumb to stay inactive / out of sync with trackpad.
   Browser default scrollbar is used so position tracks correctly. */


/* ============================================================
   GUIDES — guide grid, cards, page layout, content styles
   ============================================================ */

/* Guide grid (home + guides.html) */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.guide-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 18px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.18s ease,
              box-shadow 0.18s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.guide-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.guide-card:active {
  transform: scale(0.96);
  transition: transform 0.1s ease;
}
.guide-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}
.guide-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  flex: 1;
}
.guide-card-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 2px;
}
.guide-card-cta {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 4px;
}

/* Guide page layout */
.guide-page {
  max-width: 720px;
}

.guide-page-header {
  margin-bottom: 32px;
}
.guide-page-header h1 {
  margin: 8px 0 6px;
}
.guide-page-icon {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 6px;
}
.guide-disclaimer {
  font-size: 0.85rem;
  margin-top: 6px;
}
.guide-back-btn {
  display: inline-flex;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

/* Guide content sections */
.guide-content {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.guide-section {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.guide-section:last-child {
  border-bottom: none;
}
.guide-section h2 {
  margin: 0 0 14px;
  font-size: 1.15rem;
  font-weight: 700;
}
.guide-section p {
  margin: 0 0 12px;
  line-height: 1.7;
}
.guide-section p:last-child {
  margin-bottom: 0;
}

/* Lists */
.guide-list {
  margin: 10px 0 14px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.guide-list li {
  line-height: 1.6;
}
.guide-list--bad li::marker  { color: #ff6b6b; }
.guide-list--good li::marker { color: var(--accent); }

.guide-checklist {
  list-style: none;
  padding: 0;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.guide-checklist li {
  line-height: 1.6;
}

/* Module highlight card */
.guide-module-card {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 12px;
}
.guide-module-card:last-child { margin-bottom: 0; }
.guide-module-card h3 {
  margin: 0 0 6px;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--accent);
}
.guide-module-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

/* Callout box */
.guide-callout {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  padding: 14px 18px;
  margin: 16px 0;
}
.guide-callout p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Weekly schedule */
.week-schedule {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 14px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.week-day {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.week-day:last-child { border-bottom: none; }
.week-day--weekend { opacity: 0.85; }
.week-day-label {
  padding: 12px 16px;
  font-weight: 700;
  font-size: 0.88rem;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  color: var(--accent);
}
.week-day-tasks {
  padding: 12px 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
}

/* Mistakes list */
.mistakes-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mistake-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  transition: border-color 0.15s;
}
.mistake-item:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.mistake-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
.mistake-number {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.7;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.mistake-header h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
}
.mistake-item p {
  margin: 0 0 8px;
  font-size: 0.88rem;
  line-height: 1.6;
}
.mistake-fix {
  font-size: 0.88rem;
  color: var(--text) !important;
  opacity: 0.9;
}

/* Bottom nav between guides */
.guide-nav-bottom {
  display: flex;
  gap: 10px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* Show/hide password toggle (shared) */
.input-with-toggle {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.input-with-toggle input {
  flex: 1;
  min-width: 0;
  padding-right: 56px !important;
  box-sizing: border-box;
}
/* Apply consistent box-sizing to all modal inputs */
.modal input[type="text"],
.modal input[type="password"] {
  box-sizing: border-box;
}
.input-toggle-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.15s;
  letter-spacing: 0.02em;
}
.input-toggle-btn:hover { color: var(--text); }

/* Responsive */
@media (max-width: 600px) {
  .guide-grid {
    grid-template-columns: 1fr;
  }
  .week-day {
    grid-template-columns: 90px 1fr;
  }
  .guide-nav-bottom {
    flex-direction: column;
  }
  .guide-nav-bottom .btn {
    width: 100%;
    text-align: center;
  }
}


/* ============================================================
   TIP OF THE DAY — hero card variant
   ============================================================ */

.tip-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 140px;
}

.tip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tip-shuffle-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s, transform 0.15s;
  flex-shrink: 0;
}
.tip-shuffle-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

@keyframes tipSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.tip-spin {
  animation: tipSpin 0.4s ease;
}

.tip-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  flex: 1;
  color: var(--text);
}

.tip-meta {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
  color: var(--accent);
  opacity: 0.8;
}

/* Fade transitions */
.tip-fade-out {
  opacity: 0;
  transition: opacity 0.18s ease;
}
.tip-fade-in {
  opacity: 1;
  transition: opacity 0.25s ease;
}


/* ============================================================
   PAGE TRANSITIONS — View Transitions API
   ============================================================ */

@keyframes vt-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes vt-fade-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-6px); }
}

::view-transition-old(root) {
  animation: vt-fade-out 180ms ease forwards;
}
::view-transition-new(root) {
  animation: vt-fade-in 220ms ease forwards;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}


/* ============================================================
   BACK TO TOP BUTTON
   ============================================================ */

#backToTop {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 1050; /* above mobile nav backdrop */
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--accent) 40%, transparent);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  will-change: opacity, transform;
}
/* Extended touch target on mobile */
#backToTop::before {
  content: "";
  position: absolute;
  inset: -8px;
}
/* JS adds .btt-visible when scrolled down */
#backToTop.btt-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
#backToTop:hover {
  filter: brightness(1.12);
}
#backToTop:active {
  transform: scale(0.93);
}
@media (prefers-reduced-motion: reduce) {
  #backToTop { transition: none; }
}


/* ============================================================
   MODULE TABS (Weeks | Resources)
   ============================================================ */

.module-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 14px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.module-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 6px 12px 8px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.module-tab:hover { color: var(--text); }
.module-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.module-tab-count {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  border-radius: 10px;
  padding: 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.module-panel {
  padding: 4px 0;
}


/* ============================================================
   WEEK META — summary + topics inside each week row
   ============================================================ */

.week-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.week-meta {
  margin: 6px 0 8px 0;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  border-radius: 8px;
  border-left: 2px solid var(--border);
}

.week-summary {
  margin: 0 0 6px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.week-topics {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  list-style: disc;
}
.week-topics li {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}


/* ============================================================
   MODULE RESOURCES GRID
   ============================================================ */

.module-resources-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 4px;
}

.module-resource-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: border-color 0.15s, transform 0.15s;
}
.module-resource-link:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  transform: translateX(3px);
  color: var(--accent);
}
.module-resource-icon {
  font-size: 1rem;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}


/* ============================================================
   ANIMATED STATS BAR
   ============================================================ */

.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 24px;
  margin: 24px 0 0;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 28px;
  flex: 1;
  min-width: 110px;
}

.stat-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .stats-bar {
    gap: 0;
    padding: 12px 8px;
    /* 2x2 grid — no more clashing on narrow screens */
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .stat-item {
    padding: 12px 8px;
    min-width: 0;
    flex: unset;
  }
  .stat-number {
    font-size: 1.6rem;
  }
  /* Hide vertical dividers — use border lines instead */
  .stat-divider {
    display: none;
  }
  /* Inner borders to separate the 4 cells */
  .stat-item:nth-child(1) { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .stat-item:nth-child(3) { border-right: 1px solid var(--border); }
  .stat-item:nth-child(2) { border-bottom: 1px solid var(--border); }
}






/* ============================================================
   MOBILE NAV — hamburger + drawer
   ============================================================ */

/* Hamburger button — hidden on desktop */
.nav-toggle-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 1100;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center;
  will-change: transform;
}

/* Bars animate to X when open */
.nav-open .nav-toggle-btn .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-open .nav-toggle-btn .nav-toggle-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-open .nav-toggle-btn .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/*
 * Backdrop — simple dark overlay, NO blur.
 * Backdrop blur here forces the browser to composite the entire page
 * on every scroll frame, which causes the jank you were seeing.
 * The glass effect lives on the nav drawer only (isolated layer).
 */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  /* NO backdrop-filter here */
}
.nav-backdrop--visible {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .nav-toggle-btn {
    display: flex;
  }

  /*
   * Nav drawer — true iOS frosted glass.
   * Isolated on its own GPU layer so blur doesn't affect page scroll.
   */
  .nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 999;
    padding: 6px;
    border-radius: 20px;

    /* Frosted glass — dark mode */
    background: color-mix(in srgb, var(--bg) 75%, transparent);
    backdrop-filter: blur(48px) saturate(180%) brightness(1.1);
    -webkit-backdrop-filter: blur(48px) saturate(180%) brightness(1.1);

    /* Subtle inner highlight + outer border */
    border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
    box-shadow:
      0 0 0 0.5px color-mix(in srgb, var(--text) 6%, transparent),
      0 8px 32px rgba(0, 0, 0, 0.35),
      0 2px 8px rgba(0, 0, 0, 0.2),
      inset 0 1px 0 color-mix(in srgb, white 8%, transparent);

    /* Spring-like open animation */
    will-change: transform, opacity;
    transform: translateY(-8px) scale(0.96);
    transform-origin: top center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .nav-open .nav {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  /* Light mode glass */
  html[data-theme="light"] .nav {
    background: color-mix(in srgb, var(--bg2) 80%, transparent);
    box-shadow:
      0 0 0 0.5px color-mix(in srgb, var(--text) 8%, transparent),
      0 8px 32px rgba(0, 0, 0, 0.12),
      0 2px 8px rgba(0, 0, 0, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.7);
  }

  .nav-backdrop {
    display: block;
    /* Soft backdrop blur only when menu is open — isolated from scroll */
    transition: opacity 0.22s ease, backdrop-filter 0.22s ease;
  }

  .nav-backdrop--visible {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.25);
  }

  /* Nav items — grouped rows */
  .nav a,
  .nav-link {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 50px;
    padding: 13px 16px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    text-align: left;
    box-sizing: border-box;
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
    transition: background 0.12s ease;
    position: relative;
  }

  /* Separator lines between items (not after last, not before theme btn) */
  .nav a + a::before,
  .nav a + button.nav-link::before {
    content: "";
    position: absolute;
    top: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background: color-mix(in srgb, var(--text) 7%, transparent);
  }

  .nav a:active,
  .nav-link:active {
    background: color-mix(in srgb, var(--text) 10%, transparent);
  }

  /* Active nav link */
  .nav a.active {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
  }

  /* Theme toggle — separated at bottom */
  .theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    border-radius: 14px;
    padding: 12px;
    margin-top: 4px;
    background: color-mix(in srgb, var(--text) 5%, transparent);
    border: none;
    position: relative;
  }

  .theme-btn::before {
    content: "";
    position: absolute;
    top: -2px;
    left: 6px;
    right: 6px;
    height: 1px;
    background: color-mix(in srgb, var(--text) 8%, transparent);
  }

  .theme-btn:active {
    background: color-mix(in srgb, var(--text) 12%, transparent);
  }

  /* Topbar single row */
  .topbar {
    flex-wrap: nowrap;
    align-items: center;
    padding: 10px 14px;
  }

  .brand {
    flex: 1;
    font-size: 1rem;
  }
}

@media (max-width: 400px) {
  .topbar {
    width: calc(100% - 20px);
    padding: 9px 12px;
  }
  .brand { font-size: 0.92rem; }
}

/* ============================================================
   GENERAL MOBILE LAYOUT IMPROVEMENTS
   ============================================================ */

@media (max-width: 768px) {
  body {
    padding-top: 80px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-bottom: 8px;
  }

  .hero h1 { font-size: 2rem; }

  .buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .buttons .btn {
    width: 100%;
    text-align: center;
  }

  .guide-grid { grid-template-columns: 1fr; }
  .stat-item  { min-width: 80px; }
  .card       { padding: 14px; }
  .grid       { grid-template-columns: 1fr; }
}



/* ============================================================
   LUCIDE SVG ICONS — global styles
   ============================================================ */

.icon-svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  /* Inherits currentColor from parent — works in dark + light mode */
}

/* Icon in hero heading */
.hero-icon {
  color: var(--accent);
  margin-left: 6px;
  vertical-align: -4px;
}

/* Tip card lightbulb */
.tip-icon {
  color: var(--accent);
  vertical-align: -2px;
}

/* Guide card icons — accent coloured, larger */
.guide-card-icon .icon-svg,
.guide-page-icon .icon-svg {
  color: var(--accent);
  display: block;
}

/* Checklist icons in guide lists */
.checklist-icon {
  color: var(--accent);
  vertical-align: -3px;
  margin-right: 4px;
  flex-shrink: 0;
}

/* 404 page icon — inherits wobble animation from .error-emoji */
.error-icon {
  color: var(--accent);
  opacity: 0.7;
  display: block;
}

/* Theme toggle — icon inherits button color */
.theme-btn .icon-svg {
  vertical-align: middle;
  pointer-events: none;
  transition: transform 0.0s; /* default: instant */
}

/* Flip class added by JS during theme switch */
.theme-btn.is-flipping .icon-svg {
  animation: iconFlip 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes iconFlip {
  0%   { transform: rotateY(0deg) scale(1); }
  40%  { transform: rotateY(90deg) scale(0.8); }
  41%  { transform: rotateY(-90deg) scale(0.8); }
  100% { transform: rotateY(0deg) scale(1); }
}

/* Tip shuffle button icon */
.tip-shuffle-btn .icon-svg {
  pointer-events: none;
}

/* Back to top SVG */
#backToTop .icon-svg {
  pointer-events: none;
}


/* ============================================================
   CURSOR GLOW — desktop hover light effect on cards
   ============================================================ */

@media (hover: hover) {
  .guide-card,
  .tile,
  .card,
  .dropdown,
  .note {
    --glow-x: 50%;
    --glow-y: 50%;
    --glow-opacity: 0;
    position: relative;
    isolation: isolate;
  }

  .guide-card::after,
  .tile::after,
  .card::after,
  .dropdown::after,
  .note::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: var(--glow-opacity);
    transition: opacity 0.35s ease;
    background: radial-gradient(
      280px circle at var(--glow-x) var(--glow-y),
      color-mix(in srgb, var(--accent) 9%, transparent),
      transparent 70%
    );
    z-index: 0;
  }

  /* Make sure card content sits above the glow */
  .guide-card > *,
  .tile > *,
  .card > *,
  .dropdown > *,
  .note > * {
    position: relative;
    z-index: 1;
  }
}


/* ============================================================
   ANIMATED MESH BACKGROUND — subtle drifting aurora
   ============================================================ */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, color-mix(in srgb, var(--accent) 5%, transparent), transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%, color-mix(in srgb, var(--accent) 3%, transparent), transparent 70%);
  animation: meshDrift 18s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes meshDrift {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(2%, 1.5%) scale(1.03); }
  66%  { transform: translate(-1.5%, 2%) scale(0.98); }
  100% { transform: translate(1%, -1%) scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}


/* ============================================================
   AUTH MODAL — polished input fields
   ============================================================ */

.auth-field {
  margin: 14px 0;
}

.auth-label {
  display: block;
  margin-bottom: 7px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.auth-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: color-mix(in srgb, var(--card) 80%, transparent);
  color: var(--text);
  font-size: 0.97rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
}

.auth-input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.auth-error {
  margin: 10px 0 4px;
  font-size: 0.875rem;
  color: #ff6b6b;
  font-weight: 500;
}
