
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #24212b;
  --muted: #817c89;
  --paper: #f8f6f2;
  --white: #ffffff;
  --purple: #7655e8;
  --purple-dark: #6041cf;
  --lilac: #e9e0ff;
  --peach: #ffe2d5;
  --mint: #d9f1e4;
  --yellow: #fff0bf;
  --line: rgba(36, 33, 43, .09);
  --shadow: 0 20px 60px rgba(43, 34, 70, .08);
  --radius: 24px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Montserrat', sans-serif;
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(118, 85, 232, .25);
  outline-offset: 3px;
}

/* APP LAYOUT */

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  animation: pageEnter .7s ease both;
}

.app-shell[hidden] {
  display: none !important;
}

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

/* SIDEBAR */

.sidebar {
  min-height: 100vh;
  padding: 34px 22px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 5;
}

.logo {
  color: var(--ink);
  text-decoration: none;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -1.2px;
  margin: 0 0 48px 5px;
}

.logo::first-letter {
  color: var(--purple);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border-radius: 17px;
  background: #f8f6fb;
  margin-bottom: 38px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  background: var(--purple);
}

.user-card strong,
.user-card small {
  display: block;
}

.user-card strong {
  font-size: 12px;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-card small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}

.side-label {
  color: #aaa4b1;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.8px;
  margin: 0 0 13px 12px;
}

.sidebar nav {
  display: grid;
  gap: 7px;
  margin-bottom: 34px;
}

.nav-link {
  width: 100%;
  border: 0;
  background: transparent;
  color: #77717f;
  padding: 13px 14px;
  text-align: left;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  transition: .25s ease;
}

.nav-link:hover {
  color: var(--purple);
  background: #f6f2ff;
  transform: translateX(3px);
}

.nav-link.active {
  color: var(--purple);
  background: var(--lilac);
  font-weight: 800;
}

.sidebar-bottom {
  margin-top: auto;
}

/* MAIN CONTENT */

.main-content {
  min-width: 0;
  padding: 42px clamp(24px, 5vw, 76px) 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 38px;
}

.eyebrow {
  display: inline-block;
  color: #938b9b;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2.1px;
}

.topbar h1 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(42px, 5vw, 65px);
  line-height: .98;
  letter-spacing: -1.5px;
  margin-top: 9px;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.top-actions input {
  width: 230px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 30px;
  padding: 13px 18px;
  font-size: 11px;
  outline: none;
  transition: .25s ease;
}

.top-actions input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(118, 85, 232, .09);
}

.icon-button {
  width: 43px;
  height: 43px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  font-size: 18px;
  transition: .3s ease;
}

.icon-button:hover {
  background: var(--ink);
  color: white;
  transform: rotate(-15deg);
}

/* HERO */

.hero-banner {
  min-height: 275px;
  padding: 42px 48px;
  border-radius: 30px;
  background: var(--lilac);
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  animation: riseIn .8s .1s both;
}

.hero-banner::before {
  content: "";
  position: absolute;
  width: 310px;
  height: 310px;
  border-radius: 50%;
  right: 8%;
  top: -160px;
  background: rgba(255,255,255,.35);
  z-index: -1;
}

.hero-banner h2 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(52px, 6vw, 82px);
  line-height: .87;
  letter-spacing: -1.5px;
  margin: 17px 0;
}

.hero-banner h2 em {
  color: var(--purple);
  font-weight: 400;
}

.hero-banner p {
  color: #716b7c;
  font-size: 12px;
  margin-top: 20px;
}

.hero-art {
  font-size: clamp(120px, 17vw, 210px);
  color: var(--purple);
  line-height: 1;
  animation: float 5s ease-in-out infinite;
  filter: drop-shadow(0 16px 18px rgba(118, 85, 232, .14));
  user-select: none;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-17px) rotate(8deg); }
}

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

/* STATS */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin: 24px 0 55px;
}

.stat-card {
  min-height: 150px;
  border-radius: 22px;
  padding: 22px;
  transition: transform .3s ease, box-shadow .3s ease;
  animation: riseIn .7s both;
}

.stat-card:nth-child(2) { animation-delay: .08s; }
.stat-card:nth-child(3) { animation-delay: .16s; }
.stat-card:nth-child(4) { animation-delay: .24s; }

.stat-card:hover {
  transform: translateY(-7px) rotate(-1deg);
  box-shadow: var(--shadow);
}

.stat-card span,
.stat-card small {
  display: block;
}

.stat-card span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.4px;
}

.stat-card strong {
  display: block;
  font-family: 'Instrument Serif', serif;
  font-size: 57px;
  line-height: 1;
  margin: 14px 0 7px;
}

.stat-card small {
  font-size: 10px;
  color: #716b7c;
}

.lilac { background: var(--lilac); }
.peach { background: var(--peach); }
.mint { background: var(--mint); }
.yellow { background: var(--yellow); }

/* SECTION HEADING */

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 23px;
}

.section-heading h2 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(38px, 4vw, 54px);
  line-height: 1;
  margin-top: 9px;
  letter-spacing: -.8px;
}

.primary-button {
  border: 0;
  color: white;
  background: var(--purple);
  border-radius: 13px;
  padding: 15px 23px;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 9px 22px rgba(118, 85, 232, .2);
  transition: .25s ease;
}

.primary-button:hover {
  background: var(--purple-dark);
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(118, 85, 232, .28);
}

.primary-button:active {
  transform: scale(.97);
}

/* TOOLBAR */

.task-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.task-toolbar select,
.task-toolbar button {
  background: white;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 11px 15px;
  color: #6e6876;
  font-size: 10px;
}

.task-toolbar button {
  font-weight: 700;
  transition: .2s ease;
}

.task-toolbar button:hover {
  color: var(--purple);
  border-color: var(--purple);
}

/* TASK CARDS */

.task-list {
  display: grid;
  gap: 12px;
  min-height: 100px;
}

.task-card {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: white;
  transition: .25s ease;
  animation: riseIn .45s both;
}

.task-card:hover {
  transform: translateY(-3px);
  border-color: rgba(118, 85, 232, .25);
  box-shadow: 0 12px 30px rgba(43, 34, 70, .06);
}

.task-check {
  accent-color: var(--purple);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}

.task-info {
  flex: 1;
  min-width: 0;
}

.task-info h3 {
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.task-info p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-badge {
  padding: 7px 10px;
  border-radius: 30px;
  font-size: 8px;
  font-weight: 800;
  text-transform: capitalize;
  background: #f1eff5;
  color: #77717f;
}

.priority-high { background: #ffe1e1; color: #c34b4b; }
.priority-medium { background: #fff0c9; color: #9a741e; }
.priority-low { background: #dff3e8; color: #3d8960; }

.status-pending { background: #f0edf7; color: #75678f; }
.status-progress { background: #e2eaff; color: #496fc2; }
.status-completed { background: #dff3e8; color: #3d8960; }

.task-actions {
  display: flex;
  gap: 7px;
}

.task-actions button {
  border: 0;
  background: #f5f2fa;
  color: #6c5a9c;
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 9px;
  font-weight: 800;
  transition: .2s ease;
}

.task-actions button:hover {
  background: var(--purple);
  color: white;
}

/* EMPTY STATE */

.empty-state {
  text-align: center;
  padding: 65px 20px;
  border: 1px dashed #d9d2e5;
  border-radius: 23px;
  background: rgba(255,255,255,.55);
}

.empty-state span {
  display: inline-block;
  font-size: 38px;
  color: var(--purple);
  animation: float 4s ease-in-out infinite;
}

.empty-state h3 {
  font-family: 'Instrument Serif', serif;
  font-size: 32px;
  margin: 12px 0 6px;
}

.empty-state p {
  color: var(--muted);
  font-size: 11px;
}

/* CALENDAR */

.calendar-day {
  margin-bottom: 20px;
}

.calendar-day > h3 {
  font-family: 'Instrument Serif', serif;
  font-size: 30px;
  margin: 10px 0;
}

/* BIG FOOTER */

.big-footer {
  margin: 100px calc(clamp(24px, 5vw, 76px) * -1) 0;
  padding: 65px clamp(24px, 5vw, 76px) 25px;
  background: #24212b;
  color: white;
  overflow: hidden;
}

.big-footer > span {
  color: #b7a5ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 3px;
}

.big-footer h2 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(65px, 12vw, 170px);
  line-height: .82;
  letter-spacing: -4px;
  margin: 30px 0 70px;
  white-space: normal;
}

.big-footer h2 em {
  color: #b7a5ff;
  font-weight: 400;
}

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.17);
  display: flex;
  justify-content: space-between;
  gap: 15px;
  color: #aaa4b1;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* TASK MODAL */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: rgba(31, 27, 39, .48);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 1;
  visibility: visible;
  animation: overlayIn .25s ease both;
}

.modal-overlay.hidden,
#task-modal.hidden {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.task-modal {
  width: min(100%, 520px);
  max-height: calc(100vh - 35px);
  overflow-y: auto;
  padding: 35px 30px 30px;
  border-radius: 25px;
  background: white;
  box-shadow: 0 30px 100px rgba(0,0,0,.2);
  animation: modalIn .35s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.modal-heading h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 39px;
  font-weight: 400;
  margin-top: 5px;
}

#close-modal {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 13px;
  background: #f3f0f7;
  font-size: 19px;
  transition: .2s ease;
}

#close-modal:hover {
  background: var(--ink);
  color: white;
  transform: rotate(90deg);
}

.task-modal label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  margin: 14px 0 10px;
}

.task-modal input:not([type="hidden"]),
.task-modal textarea,
.task-modal select {
  width: 100%;
  border: 1px solid #ece8f0;
  background: #faf9fb;
  border-radius: 12px;
  padding: 13px;
  font-size: 11px;
  color: var(--ink);
  outline: none;
  transition: .2s ease;
}

.task-modal input:focus,
.task-modal textarea:focus,
.task-modal select:focus {
  border-color: var(--purple);
  background: white;
  box-shadow: 0 0 0 4px rgba(118, 85, 232, .08);
}

.task-modal textarea {
  min-height: 90px;
  resize: vertical;
}

.modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.modal-row > div {
  min-width: 0;
}

.modal-submit {
  width: 100%;
  margin-top: 25px;
}

/* TOAST */

.toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 2000;
  padding: 14px 20px;
  border-radius: 13px;
  background: var(--ink);
  color: white;
  font-size: 11px;
  box-shadow: var(--shadow);
}

/* DARK MODE */

body.dark-mode {
  --paper: #17151d;
  --ink: #f5f1fa;
  --white: #24212b;
  --muted: #aaa2b4;
  --line: rgba(255,255,255,.1);
  background: var(--paper);
  color: var(--ink);
}

body.dark-mode .sidebar,
body.dark-mode .task-card,
body.dark-mode .top-actions input,
body.dark-mode .icon-button,
body.dark-mode .task-toolbar select,
body.dark-mode .task-toolbar button {
  background: #24212b;
  color: #f5f1fa;
}

body.dark-mode .user-card,
body.dark-mode .task-actions button {
  background: #302b3a;
  color: #e5dcff;
}

body.dark-mode .hero-banner {
  background: #342b4d;
}

body.dark-mode .hero-banner p,
body.dark-mode .stat-card small {
  color: #d0c7df;
}

body.dark-mode .empty-state {
  background: #24212b;
  border-color: #484052;
}

body.dark-mode .task-info p {
  color: #aaa2b4;
}

body.dark-mode .task-modal {
  background: #24212b;
  color: #f5f1fa;
}

body.dark-mode .task-modal input:not([type="hidden"]),
body.dark-mode .task-modal textarea,
body.dark-mode .task-modal select {
  background: #302b3a;
  color: white;
  border-color: #484052;
}

body.dark-mode #close-modal {
  background: #302b3a;
  color: white;
}

/* REDUCED MOTION ACCESSIBILITY */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
