/* SDE → SDE-2 roadmap tracker — neo-brutalist theme (shared with gitreset.dev) */
/* Shares the design language of gitreset.dev's visual portfolio */

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

:root,
html[data-theme='dark'] {
    --bg: #000000;
    --surface: #111111;
    --surface-alt: #1a1a1a;
    --text: #E5E7EB;
    --text-muted: #9CA3AF;
    --border-color: rgba(229,231,235,0.7);
    --shadow-color: rgba(0,0,0,0.8);

    --primary: #A855F7;     /* violet */
    --secondary: #22D3EE;   /* cyan */
    --highlight: #A3E635;   /* lime */
    --accent: #FB7185;      /* pink */

    --font-main: 'Space Grotesk', system-ui, sans-serif;
    --border-thick: 3px solid var(--border-color);
    --border-thin: 2px solid var(--border-color);
    --dot: #1c1c1c;
    --priority: #e8c547;    /* gold — high-signal prep items */
}

html[data-theme='light'] {
    --bg: #f3f1eb;
    --surface: #ffffff;
    --surface-alt: #efeae0;
    --text: #111111;
    --text-muted: #5c5c5c;
    --border-color: rgba(17,17,17,0.85);
    --shadow-color: rgba(17,17,17,0.25);
    --primary: #7c3aed;
    --secondary: #0891b2;
    --highlight: #65a30d;
    --accent: #e11d48;
    --dot: #d4d0c6;
    --priority: #b8860b;
}

html { color-scheme: dark; scroll-behavior: smooth; }
html[data-theme='light'] { color-scheme: light; }

body {
    font-family: var(--font-main);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    background-image: radial-gradient(circle, var(--dot) 1px, transparent 1px);
    background-size: 20px 20px;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    background: var(--surface);
    border-bottom: var(--border-thick);
    z-index: 1000;
}

.nav-logo {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: var(--border-thick);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #000;
    transform: rotate(-3deg);
    text-decoration: none;
}

.nav-title {
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 15px;
    color: var(--text);
    flex: 1;
    text-align: center;
}

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

.reset-btn,
.theme-btn {
    background: var(--surface-alt);
    color: var(--text);
    border: var(--border-thin);
    padding: 8px 16px;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-btn:hover {
    background: var(--accent);
    color: #000;
    transform: translate(-2px, -2px);
    box-shadow: 3px 3px 0 var(--shadow-color);
}

.theme-btn:hover {
    background: var(--secondary);
    color: #000;
    transform: translate(-2px, -2px);
    box-shadow: 3px 3px 0 var(--shadow-color);
}

/* Hero */
.hero {
    padding: 56px 24px 40px;
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    padding: 6px 18px;
    background: var(--highlight);
    color: #000;
    border: var(--border-thick);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 2px;
    transform: rotate(-2deg);
    margin-bottom: 20px;
}

.hero-title {
    font-size: 52px;
    font-weight: 700;
    line-height: 1.05;
    margin-bottom: 12px;
}

.wave { display: inline-block; }

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 620px;
    margin: 0 auto 40px;
    font-style: italic;
}

/* Dashboard */
.dashboard {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.ring-wrap {
    position: relative;
    width: 180px;
    height: 180px;
}

.ring { width: 180px; height: 180px; transform: rotate(-90deg); }

.ring-bg {
    fill: none;
    stroke: var(--surface-alt);
    stroke-width: 12;
}

.ring-fg {
    fill: none;
    stroke: var(--highlight);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 326.7;
    stroke-dashoffset: 326.7;
    transition: stroke-dashoffset 0.8s ease;
}

.ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ring-pct { font-size: 40px; font-weight: 700; color: var(--text); }
.ring-sub { font-size: 13px; color: var(--text-muted); letter-spacing: 1px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-card {
    background: var(--surface);
    border: var(--border-thick);
    border-top: 4px solid var(--secondary);
    padding: 18px 26px;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.stat-num { font-size: 34px; font-weight: 700; color: var(--text); }
.stat-num .fire { font-size: 22px; }
.stat-label { font-size: 12px; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; }

.checkin {
    background: var(--surface);
    border: var(--border-thin);
    border-left: 5px solid var(--primary);
    padding: 16px 22px;
    max-width: 640px;
    margin: 0 auto;
    font-size: 15px;
    color: var(--text);
}

.checkin.done { border-left-color: var(--highlight); }

/* Tracks */
.tracks {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 24px 60px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.track {
    background: var(--surface);
    border: var(--border-thick);
}

.track-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    cursor: pointer;
    user-select: none;
}

.track-badge {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    border: var(--border-thin);
    background: var(--bg);
    flex-shrink: 0;
}

.track-titles { flex: 1; min-width: 0; }
.track-title { font-size: 20px; font-weight: 700; }
.track-desc { font-size: 13px; color: var(--text-muted); }

.track-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    min-width: 130px;
}

.track-count { font-size: 13px; font-weight: 600; color: var(--text-muted); }

.progress-bar {
    width: 130px;
    height: 10px;
    background: var(--surface-alt);
    border: var(--border-thin);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--highlight);
    transition: width 0.5s ease;
}

.chevron {
    font-family: monospace;
    font-size: 18px;
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

.track.open .chevron { transform: rotate(180deg); }

.track-body {
    display: none;
    padding: 0 24px 22px;
    border-top: var(--border-thin);
}

.track.open .track-body { display: block; }

/* Resource links */
.resources {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px 0 4px;
}

.res-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--surface-alt);
    border: var(--border-thin);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.res-link:hover {
    background: var(--secondary);
    color: #000;
    transform: translate(-2px, -2px);
    box-shadow: 3px 3px 0 var(--shadow-color);
}

/* Groups (for LeetCode topics) */
.group { margin-top: 16px; }

.group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: var(--surface-alt);
    border: var(--border-thin);
    cursor: pointer;
    user-select: none;
}

.group-title { font-weight: 600; font-size: 15px; }
.group-count { font-size: 12px; color: var(--text-muted); font-weight: 600; }

.group-body { display: none; padding: 8px 0 4px; }
.group.open .group-body { display: block; }

/* Task item */
.task {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 8px;
    border-bottom: 1px solid rgba(229,231,235,0.12);
    position: relative;
}

.task:last-child { border-bottom: none; }

.task.is-priority {
    padding-left: 10px;
    background:
      linear-gradient(90deg, rgba(232, 197, 71, 0.16), rgba(232, 197, 71, 0.03) 42%, transparent 70%),
      var(--surface);
    box-shadow: inset 3px 0 0 var(--priority);
}

html[data-theme='light'] .task.is-priority {
    background:
      linear-gradient(90deg, rgba(184, 134, 11, 0.14), rgba(184, 134, 11, 0.03) 42%, transparent 70%),
      var(--surface);
}

.task.is-priority::after {
    content: '';
    pointer-events: none;
    position: absolute;
    inset: 0;
    background: linear-gradient(
      110deg,
      transparent 0%,
      transparent 40%,
      rgba(255, 244, 184, 0.22) 50%,
      transparent 60%,
      transparent 100%
    );
    background-size: 220% 100%;
    animation: priority-sheen 6.5s ease-in-out infinite;
}

.task input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: var(--border-thin);
    background: var(--bg);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: background 0.15s ease;
}

.task input[type="checkbox"]:checked {
    background: var(--highlight);
    border-color: var(--highlight);
}

.task input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: 700;
    font-size: 14px;
}

.task-label {
    flex: 1;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.task-label.is-priority {
    font-weight: 700;
    letter-spacing: 0.01em;
    background-image: linear-gradient(
      110deg,
      #8b6914 0%,
      #c9a227 18%,
      #fff1a8 38%,
      #e8c547 52%,
      #f0d56a 62%,
      #b8860b 82%,
      #8b6914 100%
    );
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: gold-glitter 5.5s linear infinite;
}

.task-priority-mark {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border: 1.5px solid rgba(232, 197, 71, 0.85);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 1.3;
    color: #1a1400;
    -webkit-text-fill-color: #1a1400;
    background: linear-gradient(135deg, #fff4b8 0%, #e8c547 45%, #c9a227 100%);
    box-shadow:
      0 0 0 1px rgba(255, 244, 184, 0.35) inset,
      0 0 12px rgba(232, 197, 71, 0.35);
    animation: priority-pulse 4.8s ease-in-out infinite;
}

.task-actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
}

.task input:checked + .task-label {
    color: var(--text-muted);
    text-decoration: line-through;
}

.task input:checked + .task-label.is-priority {
    font-weight: 400;
    background: none;
    color: var(--text-muted);
    -webkit-text-fill-color: var(--text-muted);
    animation: none;
    text-decoration: line-through;
}

.task input:checked + .task-label .task-priority-mark {
    opacity: 0.45;
    filter: grayscale(0.8);
    animation: none;
    box-shadow: none;
}

.task.is-priority:has(input:checked) {
    background: transparent;
    box-shadow: none;
}

.task.is-priority:has(input:checked)::after {
    display: none;
}

@keyframes gold-glitter {
    0% { background-position: 0% center; }
    100% { background-position: 220% center; }
}

@keyframes priority-sheen {
    0%, 100% { background-position: 120% 0; opacity: 0.35; }
    50% { background-position: -20% 0; opacity: 0.85; }
}

@keyframes priority-pulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(255, 244, 184, 0.35) inset, 0 0 10px rgba(232, 197, 71, 0.28); }
    50% { box-shadow: 0 0 0 1px rgba(255, 244, 184, 0.55) inset, 0 0 16px rgba(232, 197, 71, 0.55); }
}

@media (prefers-reduced-motion: reduce) {
    .task-label.is-priority,
    .task.is-priority::after,
    .task-priority-mark {
        animation: none;
    }
}

.task-link,
.task-copy {
    color: var(--secondary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border: var(--border-thin);
    flex-shrink: 0;
    background: transparent;
    font-family: var(--font-main);
    cursor: pointer;
}

.task-link:hover { background: var(--secondary); color: #000; }

.task-ai {
    color: var(--primary);
}

.task-ai:hover {
    background: var(--primary);
    color: #000;
}

.task-copy {
    color: var(--text-muted);
}

.task-copy:hover {
    background: var(--highlight);
    color: #000;
}

/* Footer */
.footer {
    border-top: var(--border-thick);
    background: var(--surface);
    padding: 40px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.footer-sub { margin-top: 8px; font-style: italic; opacity: 0.8; }

.footer a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover { text-decoration: underline; }

/* Custom reset modal */
.modal-root[hidden] { display: none !important; }

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  width: min(420px, 100%);
  background: var(--surface);
  color: var(--text);
  border: var(--border-thick);
  box-shadow: 8px 8px 0 var(--shadow-color);
  padding: 28px 24px 22px;
  transform: rotate(-0.4deg);
}

.modal-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.modal-card h2 {
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.modal-body {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 22px;
}

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

.modal-btn {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: var(--border-thin);
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.modal-btn-ghost {
  background: var(--surface-alt);
  color: var(--text);
}

.modal-btn-ghost:hover {
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--shadow-color);
}

.modal-btn-danger {
  background: var(--accent);
  color: #000;
}

.modal-btn-danger:hover {
  background: var(--highlight);
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--shadow-color);
}

body.modal-open {
  overflow: hidden;
}

/* Confetti */
.confetti {
    position: fixed;
    top: -12px;
    width: 10px;
    height: 14px;
    z-index: 2000;
    pointer-events: none;
    will-change: transform, opacity;
}

@keyframes confetti-fall {
    to { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

/* Responsive */
@media (max-width: 700px) {
    .hero-title { font-size: 38px; }
    .nav-title { display: none; }
    .dashboard { gap: 24px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .track-head { flex-wrap: wrap; }
    .track-meta { min-width: 0; align-items: flex-start; }
    .progress-bar { width: 100px; }
}
