:root {
  --bg: #f8efe2;
  --bg-soft: rgba(255, 255, 255, 0.62);
  --panel: rgba(255, 252, 247, 0.78);
  --panel-strong: rgba(255, 252, 247, 0.92);
  --text: #132238;
  --muted: #5b6472;
  --line: rgba(19, 34, 56, 0.12);
  --coral: #f26a4b;
  --gold: #f0b24a;
  --mint: #77c8ad;
  --ink: #27446a;
  --shadow: 0 24px 80px rgba(21, 32, 46, 0.12);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(242, 106, 75, 0.24), transparent 30%),
    radial-gradient(circle at top right, rgba(119, 200, 173, 0.28), transparent 24%),
    linear-gradient(140deg, #f6efe5 0%, #fdf7ef 52%, #f3eadf 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: -1;
  border-radius: 50%;
  filter: blur(10px);
}

body::before {
  width: 260px;
  height: 260px;
  top: 80px;
  right: 8vw;
  background: rgba(242, 106, 75, 0.12);
}

body::after {
  width: 320px;
  height: 320px;
  bottom: 10vh;
  left: -80px;
  background: rgba(39, 68, 106, 0.08);
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr);
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow,
.panel-kicker,
.hero-card-label {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--ink);
}

h1,
h2,
h3 {
  margin: 0;
}

h1,
h2 {
  font-family: "Fraunces", Georgia, serif;
  line-height: 0.95;
}

h1 {
  font-size: clamp(3.2rem, 8vw, 5.8rem);
  letter-spacing: -0.06em;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.05em;
}

.hero-copy,
.hero-card-copy,
.panel-header p,
.task-notes,
.tag-panel p,
.empty-state p {
  color: var(--muted);
}

.hero-copy {
  max-width: 42rem;
  margin-top: 14px;
  font-size: 1.08rem;
  line-height: 1.6;
}

.hero-card,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: var(--panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 24px;
  border-radius: var(--radius-xl);
}

.hero-card::after,
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.34), transparent 34%);
  pointer-events: none;
}

.hero-card-metric {
  display: flex;
  align-items: end;
  gap: 10px;
  margin: 18px 0;
}

.hero-card-metric span {
  font-family: "Fraunces", Georgia, serif;
  font-size: 3rem;
  letter-spacing: -0.06em;
}

.hero-card-metric small {
  margin-bottom: 10px;
  color: var(--muted);
}

.progress-bar {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(39, 68, 106, 0.08);
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--gold));
  transition: width 220ms ease;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.25fr) minmax(240px, 0.8fr);
  gap: 24px;
}

.panel {
  padding: 24px;
  border-radius: var(--radius-xl);
}

.panel-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 22px;
}

.panel-header p,
.tag-panel p {
  margin: 8px 0 0;
  line-height: 1.5;
}

.task-form,
.controls,
.task-list,
.tag-cloud {
  position: relative;
  z-index: 1;
}

.task-form {
  display: grid;
  gap: 16px;
}

label,
.search-wrap {
  display: grid;
  gap: 8px;
}

label span {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
}

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

input,
textarea,
select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  color: var(--text);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(242, 106, 75, 0.42);
  box-shadow: 0 0 0 4px rgba(242, 106, 75, 0.12);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

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

.primary-button,
.ghost-button,
.filter-chip,
.delete-button,
.tag-chip {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}

.primary-button:hover,
.ghost-button:hover,
.filter-chip:hover,
.delete-button:hover,
.tag-chip:hover {
  transform: translateY(-1px);
}

.primary-button {
  justify-self: start;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--coral), #f48e55);
  color: white;
  font-weight: 700;
  box-shadow: 0 18px 30px rgba(242, 106, 75, 0.25);
}

.ghost-button {
  padding: 11px 16px;
  background: rgba(39, 68, 106, 0.08);
  color: var(--ink);
  font-weight: 700;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip,
.tag-chip {
  padding: 10px 14px;
  background: rgba(39, 68, 106, 0.08);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
}

.filter-chip.active,
.tag-chip.active {
  background: var(--ink);
  color: white;
  box-shadow: 0 10px 20px rgba(39, 68, 106, 0.18);
}

.search-wrap {
  min-width: min(280px, 100%);
}

.search-wrap input {
  padding-left: 18px;
}

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

.task-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(39, 68, 106, 0.08);
  border-radius: 22px;
  animation: rise-in 260ms ease both;
}

.task-toggle-wrap {
  gap: 0;
  align-self: stretch;
}

.task-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.task-toggle-ui {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(39, 68, 106, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.8);
}

.task-toggle:checked + .task-toggle-ui {
  background: var(--mint);
  border-color: var(--mint);
}

.task-toggle:checked + .task-toggle-ui::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translateY(-1px);
}

.task-content {
  display: grid;
  gap: 12px;
}

.task-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.task-title {
  font-size: 1.08rem;
  margin-bottom: 6px;
}

.task-notes {
  margin: 0;
  line-height: 1.5;
}

.task-item.is-done .task-title,
.task-item.is-done .task-notes {
  opacity: 0.55;
}

.task-item.is-done .task-title {
  text-decoration: line-through;
}

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

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(39, 68, 106, 0.08);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
}

.meta-pill.priority-high {
  background: rgba(242, 106, 75, 0.14);
  color: #a33b24;
}

.meta-pill.priority-medium {
  background: rgba(240, 178, 74, 0.16);
  color: #8f6110;
}

.meta-pill.priority-low {
  background: rgba(119, 200, 173, 0.18);
  color: #216a55;
}

.delete-button {
  padding: 10px 12px;
  background: rgba(242, 106, 75, 0.1);
  color: #ac3e27;
  font-weight: 700;
}

.insights-panel {
  display: grid;
  align-content: start;
  gap: 18px;
}

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

.stat-card {
  position: relative;
  z-index: 1;
  padding: 18px;
  border-radius: var(--radius-lg);
  color: var(--text);
  display: grid;
  gap: 8px;
}

.stat-card span {
  font-size: 0.88rem;
  font-weight: 700;
}

.stat-card strong {
  font-family: "Fraunces", Georgia, serif;
  font-size: 2rem;
  letter-spacing: -0.05em;
}

.accent-coral {
  background: linear-gradient(135deg, rgba(242, 106, 75, 0.22), rgba(255, 255, 255, 0.5));
}

.accent-gold {
  background: linear-gradient(135deg, rgba(240, 178, 74, 0.24), rgba(255, 255, 255, 0.5));
}

.accent-mint {
  background: linear-gradient(135deg, rgba(119, 200, 173, 0.28), rgba(255, 255, 255, 0.5));
}

.accent-ink {
  background: linear-gradient(135deg, rgba(39, 68, 106, 0.18), rgba(255, 255, 255, 0.5));
}

.tag-panel {
  position: relative;
  z-index: 1;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.58);
}

.tag-panel-head {
  margin-bottom: 12px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.empty-state {
  padding: 24px;
  border: 1px dashed rgba(39, 68, 106, 0.2);
  border-radius: var(--radius-lg);
  text-align: center;
  background: rgba(255, 255, 255, 0.45);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .hero-card {
    max-width: 420px;
  }

  .insights-panel {
    order: -1;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding: 24px 0 40px;
  }

  .panel,
  .hero-card {
    padding: 18px;
    border-radius: 24px;
  }

  .form-row,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .controls,
  .task-topline,
  .list-header {
    flex-direction: column;
    align-items: stretch;
  }

  .search-wrap {
    min-width: 0;
  }

  h1 {
    font-size: clamp(2.8rem, 16vw, 4.2rem);
  }
}
