:root {
  color-scheme: light;
  --ink: #15171a;
  --muted: #6b7280;
  --paper: #f7f8f5;
  --surface: #ffffff;
  --surface-soft: #edf4ef;
  --line: #dde3da;
  --primary: #176b5b;
  --primary-dark: #0d3f36;
  --accent: #f0a83b;
  --success: #2f9e6d;
  --warning: #d97706;
  --danger: #c2413b;
  --shadow: 0 24px 80px rgba(21, 23, 26, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(247, 248, 245, 0.92), rgba(237, 244, 239, 0.72)),
    radial-gradient(circle at top left, rgba(240, 168, 59, 0.12), transparent 32%),
    var(--paper);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 5vw, 70px);
  border-bottom: 1px solid rgba(221, 227, 218, 0.84);
  background: rgba(247, 248, 245, 0.86);
  backdrop-filter: blur(18px);
}

.brand,
.app-nav,
.hero-actions,
.card-heading,
.progress-meta,
.field-row {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary-dark);
  color: #ffffff;
  letter-spacing: 0;
}

.app-nav {
  gap: clamp(14px, 3vw, 30px);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.app-nav a {
  padding: 10px 0;
}

.app-nav a:hover {
  color: var(--primary);
}

main {
  padding: 0 clamp(18px, 5vw, 70px) 48px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: clamp(28px, 6vw, 88px);
  align-items: center;
  min-height: calc(100vh - 75px);
  padding: clamp(52px, 8vw, 92px) 0 36px;
}

.hero-copy {
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 850px;
  margin-bottom: 24px;
  font-size: clamp(3rem, 7vw, 6.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.65rem, 3.5vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.15rem;
}

.hero-copy p:not(.eyebrow) {
  max-width: 640px;
  margin-bottom: 28px;
  color: #4d5560;
  font-size: 1.12rem;
  line-height: 1.75;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid rgba(21, 23, 26, 0.14);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  transition: transform 170ms ease, box-shadow 170ms ease, background 170ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  color: #ffffff;
  box-shadow: 0 16px 38px rgba(13, 63, 54, 0.24);
}

.button.secondary {
  background: var(--surface);
}

.button.ghost {
  background: transparent;
}

.button.danger {
  border-color: rgba(194, 65, 59, 0.28);
  background: rgba(194, 65, 59, 0.08);
  color: var(--danger);
}

.button.wide {
  width: 100%;
}

.today-card,
.panel,
.stats-strip article,
.template-card,
.challenge-card {
  border: 1px solid rgba(221, 227, 218, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.today-card {
  padding: 26px;
}

.card-heading,
.progress-meta {
  justify-content: space-between;
  gap: 16px;
}

.card-heading {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(47, 158, 109, 0.12);
  color: var(--success);
}

.today-card h2 {
  margin-bottom: 20px;
  font-size: 2rem;
}

.today-card h3 {
  margin-bottom: 8px;
  font-size: 1.4rem;
}

.today-card p {
  margin-bottom: 24px;
  color: var(--muted);
  line-height: 1.6;
}

.progress-shell {
  margin-bottom: 22px;
}

.progress-meta {
  margin-bottom: 10px;
}

.progress-meta strong {
  font-size: 2.2rem;
}

.progress-meta span {
  color: var(--muted);
  font-weight: 800;
}

.progress-track {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: var(--surface-soft);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 240ms ease;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 36px;
}

.stats-strip article {
  padding: 18px;
  box-shadow: none;
}

.stats-strip span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stats-strip strong {
  font-size: clamp(1.45rem, 3vw, 2.2rem);
}

.section {
  padding: 48px 0;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading.compact {
  margin-bottom: 18px;
}

.challenges-section {
  padding-top: 18px;
}

.account-section {
  padding-top: 18px;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
}

.account-card p {
  color: var(--muted);
  line-height: 1.65;
}

.challenge-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.challenge-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  text-align: left;
  box-shadow: none;
}

.challenge-card.active {
  border-color: rgba(23, 107, 91, 0.42);
  background: rgba(237, 244, 239, 0.92);
  outline: 3px solid rgba(23, 107, 91, 0.12);
}

.challenge-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.challenge-card h3 {
  margin-bottom: 0;
}

.challenge-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.challenge-card .status-pill {
  flex: 0 0 auto;
}

.challenge-card-progress {
  display: grid;
  gap: 8px;
}

.challenge-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.challenge-card-actions,
.form-actions {
  display: flex;
  gap: 10px;
}

.challenge-card-actions .button,
.form-actions .button {
  flex: 1;
}

.challenge-card-actions .button {
  min-height: 42px;
  padding: 0 12px;
}

.hidden {
  display: none !important;
}

.tracker-grid {
  display: grid;
  grid-template-columns: repeat(21, minmax(42px, 1fr));
  gap: 8px;
}

.day-cell {
  display: grid;
  min-height: 58px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.day-cell.completed {
  border-color: rgba(47, 158, 109, 0.32);
  background: rgba(47, 158, 109, 0.14);
  color: var(--primary-dark);
}

.day-cell.current {
  outline: 3px solid rgba(240, 168, 59, 0.35);
  color: var(--ink);
}

.day-cell.missed {
  background: rgba(194, 65, 59, 0.08);
  color: var(--danger);
}

.workspace-grid,
.journal-rewards {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.panel {
  padding: 24px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: #3d444d;
  font-size: 0.9rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 600;
}

input,
select {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}

.field-row {
  gap: 12px;
}

.field-row label {
  flex: 1;
}

.form-note {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--primary);
  font-weight: 800;
}

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

.template-card {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 210px;
  padding: 18px;
  box-shadow: none;
}

.template-card span {
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.template-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.template-card button {
  align-self: end;
}

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

.seo-grid article {
  padding: 20px;
  border: 1px solid rgba(221, 227, 218, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.seo-grid p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.journal-list,
.badge-list {
  display: grid;
  gap: 10px;
}

.journal-entry,
.badge-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.journal-entry {
  padding: 14px;
}

.journal-entry strong,
.badge-item strong {
  display: block;
  margin-bottom: 4px;
}

.journal-entry span,
.badge-item span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.badge-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.badge-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: rgba(240, 168, 59, 0.18);
  color: var(--warning);
  font-weight: 900;
}

.certificate {
  margin-top: 16px;
  padding: 18px;
  border: 1px dashed rgba(23, 107, 91, 0.45);
  border-radius: 8px;
  background: var(--surface-soft);
}

.certificate span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.certificate.unlocked {
  border-style: solid;
  background: rgba(47, 158, 109, 0.13);
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(18px, 5vw, 70px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

@media (max-width: 980px) {
  .hero-panel,
  .account-grid,
  .workspace-grid,
  .journal-rewards {
    grid-template-columns: 1fr;
  }

  .stats-strip,
  .challenge-list,
  .template-grid,
  .seo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tracker-grid {
    grid-template-columns: repeat(7, minmax(40px, 1fr));
  }
}

@media (max-width: 700px) {
  .app-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .app-nav {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    overflow-x: auto;
    font-size: 0.84rem;
  }

  main {
    padding-inline: 14px;
  }

  .hero-panel {
    min-height: auto;
    padding-top: 36px;
  }

  .stats-strip,
  .challenge-list,
  .template-grid,
  .seo-grid {
    grid-template-columns: 1fr;
  }

  .field-row {
    display: grid;
  }

  .app-footer {
    flex-direction: column;
  }
}

.article-main {
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(44px, 8vw, 86px) clamp(18px, 5vw, 34px);
}

.article-shell {
  display: grid;
  gap: 24px;
}

.article-shell h1 {
  max-width: 900px;
  margin-bottom: 0;
  font-size: clamp(2.7rem, 6vw, 5.8rem);
}

.article-lede {
  color: #4d5560;
  font-size: 1.18rem;
  line-height: 1.8;
}

.article-shell section {
  padding-top: 8px;
}

.article-shell section p {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.78;
}
