/* ==========================================================================
   Signed-in life: cursor light, live dashboard hero, Finals Prep
   ========================================================================== */

/* soft light that follows the cursor behind the content */
.cursor-light {
  position: fixed; left: 0; top: 0; z-index: 0; width: 640px; height: 640px; margin: -320px 0 0 -320px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%);
  opacity: 0; transition: opacity 0.6s var(--ease); will-change: transform;
}
.cursor-light.on { opacity: 1; }
:root[data-theme="dark"] .cursor-light { background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cursor-light { background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%); } }
.logged-out .cursor-light { display: none; }
.app { position: relative; z-index: 1; }
.main, .view { background: transparent; }

/* entrance */
.rising { animation: riseIn 0.9s var(--ease) both; }
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } }

/* temporary owner button */

/* tilt + spotlight cards */
.subject-card[data-open], .today-card, .fw-next { transition: transform 0.5s var(--ease), box-shadow 0.4s var(--ease), border-color 0.3s; transform-style: preserve-3d; will-change: transform; }
.subject-card[data-open]::after, .fw-next::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--sc, var(--accent)) 12%, transparent), transparent 55%);
}
.subject-card[data-open]:hover::after, .fw-next:hover::after { opacity: 1; }
.today-card { position: relative; }
.today-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%); }
.today-card:hover::after { opacity: 1; }

/* live greeting hero */
.greet-hero {
  position: relative; min-height: 380px; margin: 0 0 28px; border-radius: 28px; overflow: hidden; isolation: isolate;
  border: 1px solid var(--line); background: radial-gradient(120% 120% at 85% 20%, color-mix(in srgb, var(--accent) 6%, var(--surface)), var(--surface) 60%);
  box-shadow: var(--shadow); display: flex; align-items: center; padding: 40px clamp(22px, 4vw, 48px) 56px;
}
.greet-hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.greet-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(90deg, var(--surface) 30%, color-mix(in srgb, var(--surface) 0%, transparent) 62%); }
.greet-copy { max-width: 560px; position: relative; pointer-events: none; }
.greet-copy > * { pointer-events: auto; }
.greet-copy h1 { font-size: clamp(2.5rem, 5vw, 4.1rem); line-height: 1; letter-spacing: -0.03em; margin: 14px 0 14px; font-weight: 400; }
.greet-copy h1 em { font-style: italic; color: var(--accent-ink); }
.greet-copy .lede { color: var(--ink-2); font-size: 1.02rem; margin: 0 0 22px; }
.greet-copy .daily-quote { margin: 0; }
.greet-copy .daily-quote p { font-size: 1.12rem; color: var(--ink-2); }
.mind-caption { position: absolute; right: 22px; bottom: 16px; margin: 0; display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); pointer-events: none; }
.mind-caption .live { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.mind-caption .live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s infinite; }
.greet { display: none; }

/* 14-day sparkline */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 22px; width: 100%; margin-top: -2px; }
.spark i { flex: 1; height: calc(var(--h) * 100%); min-height: 3px; border-radius: 2px; background: var(--surface-3); transition: height 0.6s var(--ease); }
.spark i.on { background: color-mix(in srgb, var(--accent) 70%, transparent); }
.spark i.now { box-shadow: 0 0 0 1px var(--accent); }

/* subject card mini constellation */
.sc-top { gap: 12px; align-items: center; }
.sc-mini { flex: 1; height: 40px; min-width: 0; opacity: 0.85; }
.sc-mini line { stroke: var(--line-strong); stroke-width: 0.8; }
.subject-card:hover .sc-mini line { stroke: color-mix(in srgb, var(--sc) 55%, var(--line-strong)); }

/* finals widget on the dashboard */
.finals-widget { display: grid; grid-template-columns: minmax(240px, 0.8fr) 1.6fr; gap: 16px; }
.fw-next {
  position: relative; display: grid; align-content: start; gap: 6px; padding: 22px; border-radius: 20px; text-decoration: none; color: inherit; overflow: hidden;
  background: radial-gradient(140% 120% at 100% 0%, color-mix(in srgb, var(--sc) 14%, var(--surface)), var(--surface) 60%); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.fw-next b { font-size: 4.2rem; line-height: 0.9; font-weight: 400; letter-spacing: -0.04em; color: var(--sc); }
.fw-unit { font-size: 0.85rem; color: var(--ink-3); margin-top: -2px; }
.fw-next strong { font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 450; font-size: 1.35rem; margin-top: 10px; }
.fw-next small:last-child { color: var(--ink-3); font-size: 0.8rem; }
.fw-today { padding: 18px 20px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.fw-today .eyebrow { margin-bottom: 10px; }
.finals-cta-card { display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: 20px; border: 1px solid var(--line); background: radial-gradient(120% 140% at 0% 0%, var(--accent-soft), var(--surface) 55%); box-shadow: var(--shadow); }
.finals-cta-card > .i { color: var(--accent-ink); width: 28px; height: 28px; }
.finals-cta-card strong { font-size: 1.4rem; font-weight: 450; }
.finals-cta-card p { margin: 2px 0 0; font-size: 0.92rem; }
.finals-cta-card .btn { margin-left: auto; }
.mini-bar { display: block; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.mini-bar i { display: block; height: 100%; border-radius: 2px; background: var(--sc, var(--accent)); transition: width 0.6s var(--ease); }

/* tasks (shared by dashboard + finals) */
.tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.task { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--bg); border: 1px solid transparent; transition: border-color 0.2s, background 0.2s; }
.task:hover { border-color: var(--line); background: var(--surface); }
.task-check { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: #fff; transition: all 0.2s var(--ease); }
.task-check:hover { border-color: var(--sc); }
.task.done .task-check { background: var(--sc); border-color: var(--sc); }
.task-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--sc); background: color-mix(in srgb, var(--sc) 12%, transparent); }
.task-body strong { display: block; font-weight: 500; font-size: 0.92rem; }
.task-body small { color: var(--ink-3); font-size: 0.78rem; }
.task.done .task-body strong { text-decoration: line-through; text-decoration-color: var(--ink-3); color: var(--ink-3); }
.task.kind-rest .task-ico { color: var(--m-fading); background: color-mix(in srgb, var(--m-fading) 12%, transparent); }

/* ---------- Finals Prep page ---------- */
.finals-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; padding: 6px 0 30px; flex-wrap: wrap; }
.finals-head h1 { font-size: clamp(2.5rem, 5vw, 4.2rem); line-height: 1; letter-spacing: -0.03em; margin: 14px 0 12px; font-weight: 400; }
.finals-head h1 em { font-style: italic; color: var(--accent-ink); }
.finals-head .lede { max-width: 56ch; margin: 0; color: var(--ink-2); }
.finals-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.next-exam { display: grid; padding: 10px 16px; border-radius: 14px; border-left: 3px solid var(--sc); background: var(--surface); box-shadow: var(--shadow); }
.next-exam small { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.next-exam strong { font-size: 1.1rem; font-weight: 450; }
.next-exam span { font-size: 0.82rem; color: var(--sc); font-weight: 600; }
.finals-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-bottom: 40px; align-items: start; }
.cal-wrap, .day-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.cal { padding: 20px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-head h3 { margin: 0; font-size: 1.5rem; font-weight: 450; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); text-align: center; padding: 4px 0 8px; }
.cal-day {
  position: relative; min-height: 78px; padding: 8px; border-radius: 12px; border: 1px solid transparent; background: var(--bg); cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 4px; transition: border-color 0.2s, background 0.2s, transform 0.25s var(--ease);
}
.cal-day:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.cal-day.out { opacity: 0.4; }
.cal-day.past .cal-n { color: var(--ink-3); }
.cal-n { font-size: 0.82rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.cal-day.today .cal-n { display: inline-grid; place-items: center; width: 24px; height: 24px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--ink); color: var(--bg); }
.cal-day.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.cal-exam { font-size: 0.68rem; font-weight: 600; line-height: 1.2; padding: 3px 6px; border-radius: 6px; color: var(--sc); background: color-mix(in srgb, var(--sc) 16%, transparent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-dots { display: flex; gap: 3px; margin-top: auto; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--sc) 35%, transparent); }
.cal-dots i.on { background: var(--sc); }
.day-panel { padding: 22px; position: sticky; top: 16px; }
.day-title { font-size: 2rem; font-weight: 420; margin: 6px 0 4px; }
.day-meta { font-size: 0.84rem; color: var(--ink-3); margin: 0 0 14px; }
.day-empty { margin: 10px 0 0; }
.exam-banner { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; margin: 10px 0 14px; background: color-mix(in srgb, var(--sc) 12%, transparent); color: var(--ink); }
.exam-banner .i { color: var(--sc); }
.exam-banner small { display: block; color: var(--ink-2); font-size: 0.8rem; }
.exam-list { display: grid; gap: 14px; }
.exam-card { position: relative; padding: 20px 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.exam-card.past { opacity: 0.65; }
.exam-top { display: flex; align-items: center; gap: 16px; }
.exam-id { flex: 1; min-width: 0; }
.exam-id h3 { margin: 0; font-size: 1.6rem; font-weight: 420; line-height: 1.1; }
.exam-id small { color: var(--ink-3); font-size: 0.84rem; }
.exam-count { text-align: right; }
.exam-count b { display: block; font-size: 2.8rem; line-height: 0.9; font-weight: 400; color: var(--sc); letter-spacing: -0.03em; }
.exam-count small { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.exam-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 18px 0 14px; }
.exam-stats span { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.exam-stats small { font-size: 0.8rem; color: var(--ink-2); }
.exam-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.exam-actions .danger-ico { margin-left: auto; color: var(--bad); }
.plan { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); animation: riseIn 0.6s var(--ease) both; }
.plan-headline { font-size: 1.35rem; font-weight: 420; line-height: 1.25; margin: 0 0 10px; }
.plan-strategy { margin: 0 0 18px; padding-left: 1.1em; color: var(--ink-2); font-size: 0.92rem; columns: 2; column-gap: 28px; }
.plan-strategy li { margin: 0 0 4px; break-inside: avoid; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 12px; position: relative; display: grid; gap: 4px; }
.timeline::before { content: ""; position: absolute; left: 33px; top: 8px; bottom: 8px; width: 1px; background: var(--line-strong); }
.timeline li { position: relative; display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: center; padding: 8px 10px 8px 0; border-radius: 12px; cursor: pointer; transition: background 0.2s; }
.timeline li:hover { background: var(--bg); }
.tl-date { position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); line-height: 1; }
.tl-date b { font-family: var(--display); font-variation-settings: "SOFT" 100; font-size: 1.05rem; font-weight: 450; color: var(--ink); letter-spacing: 0; text-transform: none; }
.timeline li.now .tl-date { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.timeline li.past { opacity: 0.55; }
.timeline li.exam-day .tl-date { background: var(--sc); border-color: var(--sc); color: #fff; }
.timeline li.exam-day .tl-date b { color: #fff; }
.tl-body strong { display: block; font-weight: 500; font-size: 0.94rem; }
.tl-body small { display: block; color: var(--ink-3); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-done { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3); }
.finals-empty { display: grid; justify-items: center; gap: 14px; }

/* exam form */
.three-col { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr; gap: 10px; }
input[type="time"] { width: 100%; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; padding: 10px 12px; outline: none; color: var(--ink); }
.segmented.hours { grid-template-columns: repeat(5, 1fr); max-width: none; display: grid; }
.segmented.hours button { padding: 8px 6px; font-size: 0.85rem; }

/* planning overlay */
.planning { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(10px); animation: riseIn 0.4s var(--ease) both; }
.planning-card { text-align: center; padding: 34px 40px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); max-width: 380px; }
.planning-card h3 { font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 420; font-size: 1.7rem; margin: 18px 0 6px; }
.planning-card p { margin: 0 0 16px; }
.planning-rings svg { width: 64px; height: 64px; color: var(--ink); animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1000px) {
  .finals-grid { grid-template-columns: 1fr; }
  .day-panel { position: static; }
  .finals-widget { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .greet-hero { min-height: 0; padding: 28px 20px 52px; }
  .greet-hero::before { background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 70%, transparent), var(--surface) 75%); }
  .mind-caption { left: 20px; right: auto; }
  .cal { padding: 14px 10px; }
  .cal-day { min-height: 54px; padding: 5px; }
  .cal-exam { font-size: 0; padding: 0; height: 5px; border-radius: 3px; background: var(--sc); }
  .three-col { grid-template-columns: 1fr; }
  .plan-strategy { columns: 1; }
  .exam-top { flex-wrap: wrap; }
  .finals-cta-card { flex-direction: column; align-items: flex-start; }
  .finals-cta-card .btn { margin-left: 0; }
  .task { grid-template-columns: auto 1fr auto; }
  .task-ico { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rising, .plan, .planning { animation: none; }
  .planning-rings svg { animation: none; }
}

[hidden] { display: none !important; }
@media (max-width: 860px) {
  .dash { padding-top: 64px; }
}
@media (max-width: 860px) {
  .topbar-home { z-index: 20; }
  .topbar-home .nav-toggle { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); box-shadow: 0 0 0 1px var(--line), var(--shadow); }
}

/* Exam readiness */
.ready { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: center; margin: 18px 0 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--sc, var(--accent)) 4%, var(--surface)); }
.ready-num { display: flex; align-items: baseline; color: var(--ink); }
.ready-num b { font-size: 3rem; line-height: 0.9; font-weight: 400; letter-spacing: -0.04em; }
.ready-num span { font-size: 1.1rem; color: var(--ink-3); margin-left: 2px; }
.ready-body { display: grid; gap: 7px; min-width: 0; }
.ready-body strong { font-size: 0.92rem; }
.ready-body small { color: var(--ink-2); font-size: 0.8rem; }
.ready-body small b { color: var(--ink); }
.ready-early { font-style: normal; font-weight: 400; color: var(--ink-3); font-size: 0.76rem; margin-left: 6px; }
.ready-track { position: relative; display: block; height: 6px; border-radius: 3px; background: var(--surface-3); }
.ready-track .r-now { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--m-solid); transition: width 0.6s var(--ease); }
.ready-track .r-plan, .ready-track .r-stop { position: absolute; top: -4px; width: 2px; height: 14px; border-radius: 1px; transform: translateX(-1px); }
.ready-track .r-plan { background: var(--accent); }
.ready-track .r-plan::after { content: ""; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.ready-track .r-stop { background: var(--ink-3); opacity: 0.6; }
.ready-gaps { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.ready-gaps > span { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-right: 4px; }
.gap-chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 5px 11px; font-size: 0.78rem; cursor: pointer; transition: border-color 0.2s, color 0.2s; }
.gap-chip:hover { border-color: var(--accent); color: var(--ink); }
.gap-chip.st-blind { border-color: color-mix(in srgb, var(--m-blind) 50%, transparent); color: var(--m-blind); }
.exam-plan-bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-bottom: 14px; }
.exam-plan-bar span { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.exam-plan-bar .mini-bar { margin-top: 0; }
.exam-plan-bar small { font-size: 0.8rem; color: var(--ink-2); }
.ready-mini { display: grid; gap: 6px; margin-top: 10px; font-size: 0.8rem; color: var(--ink-2); }
.ready-mini b { color: var(--ink); }
.ready-mini .ready-track { height: 4px; }
@media (max-width: 560px) { .ready-num b { font-size: 2.4rem; } }
