:root {
  color-scheme: light dark;
  --page: #fbfcfd;
  --surface: #ffffff;
  --surface-muted: #eef2f5;
  --text: #18212f;
  --muted: #5a6575;
  --line: #d9e0e8;
  --teal: #0f9f96;
  --teal-dark: #08756f;
  --button-primary-bg: #0f766e;
  --button-primary-border: #0f766e;
  --button-primary-text: #ffffff;
  --amber: #b76b00;
  --rose: #b4234a;
  --ink: #111827;
  --shadow: 0 18px 44px rgba(20, 28, 40, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #101419;
    --surface: #171d24;
    --surface-muted: #222a33;
    --text: #f1f5f9;
    --muted: #bac4d0;
    --line: #354250;
    --teal: #38d6c8;
    --teal-dark: #86fff3;
    --button-primary-bg: #0f766e;
    --button-primary-border: #2dd4bf;
    --button-primary-text: #f8fafc;
    --amber: #ffc56e;
    --rose: #ff8ba7;
    --ink: #f8fafc;
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--teal-dark);
}

.site-header,
.site-footer,
main > section,
.not-found {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
}

.brand,
.top-nav,
.hero-actions,
.card-actions,
.site-footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  font-size: 0.92rem;
}

.top-nav {
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-nav a {
  color: var(--muted);
  font-weight: 650;
  text-decoration: none;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  color: var(--teal-dark);
}

.hero {
  min-height: 520px;
  display: grid;
  align-items: center;
  margin-top: 12px;
  padding: 72px 40px;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(251, 252, 253, 0.96) 0%, rgba(251, 252, 253, 0.90) 48%, rgba(251, 252, 253, 0.44) 100%),
    url("mibudget-icon.png") right 7% center / min(44vw, 420px) auto no-repeat,
    linear-gradient(135deg, #e9fbf8 0%, #f8f0df 52%, #fce8ee 100%);
  border-radius: 8px;
  overflow: hidden;
}

@media (prefers-color-scheme: dark) {
  .hero {
    background:
      linear-gradient(90deg, rgba(16, 20, 25, 0.97) 0%, rgba(16, 20, 25, 0.88) 52%, rgba(16, 20, 25, 0.40) 100%),
      url("mibudget-icon.png") right 7% center / min(44vw, 420px) auto no-repeat,
      linear-gradient(135deg, #0d3b3a 0%, #3b2a13 52%, #451728 100%);
  }
}

.hero-content {
  max-width: 660px;
  min-width: 0;
}

.eyebrow,
.status {
  margin: 0 0 12px;
  color: var(--teal-dark);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: 4rem;
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1.18;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.22;
  letter-spacing: 0;
}

.lead {
  max-width: 62ch;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.18rem;
}

.hero-actions,
.card-actions {
  gap: 10px;
  flex-wrap: wrap;
}

.hero-actions {
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.button.primary {
  border-color: var(--button-primary-border);
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
}

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

.apps-section,
.feature-grid,
.details-list,
.support-band {
  padding: 72px 0 0;
}

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

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

.app-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 20px;
  min-height: 320px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.app-card-muted {
  box-shadow: none;
  background: var(--surface-muted);
}

.app-icon,
.placeholder-icon,
.app-hero-icon {
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(20, 28, 40, 0.16);
}

.placeholder-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  background: var(--surface);
  border: 1px dashed var(--line);
  color: var(--amber);
  font-size: 2.2rem;
  font-weight: 500;
}

.app-copy p {
  color: var(--muted);
}

.app-copy {
  min-width: 0;
}

.app-meta {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.app-meta div {
  display: grid;
  gap: 2px;
}

.app-meta dt {
  color: var(--rose);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-meta dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.app-hero {
  display: grid;
  grid-template-columns: 136px 1fr;
  gap: 28px;
  align-items: center;
  margin-top: 28px;
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.feature-grid .section-heading {
  grid-column: 1 / -1;
}

.feature-grid article,
.details-list,
.support-band {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.feature-grid article {
  padding: 24px;
}

.feature-grid p {
  margin-bottom: 0;
  color: var(--muted);
}

.details-list {
  padding: 28px;
}

.app-meta.expanded {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.support-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 72px;
  padding: 28px;
}

.support-band h2 {
  font-size: 1.7rem;
}

.site-footer {
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 40px 0;
  color: var(--muted);
}

.site-footer a {
  font-weight: 700;
}

.not-found {
  min-height: 100vh;
  display: grid;
  align-content: center;
  justify-items: start;
}

@media (max-width: 840px) {
  .hero {
    min-height: auto;
    padding: 56px 28px 280px;
    background:
      linear-gradient(180deg, rgba(251, 252, 253, 0.98) 0%, rgba(251, 252, 253, 0.92) 56%, rgba(251, 252, 253, 0.62) 100%),
      url("mibudget-icon.png") center bottom 28px / 220px auto no-repeat,
      linear-gradient(135deg, #e9fbf8 0%, #f8f0df 52%, #fce8ee 100%);
  }

  h1 {
    font-size: 3rem;
  }

  .apps-grid,
  .feature-grid,
  .app-meta.expanded {
    grid-template-columns: 1fr;
  }

  .app-card,
  .app-hero {
    grid-template-columns: 1fr;
  }

  .app-hero {
    padding: 30px;
  }

  .support-band {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 840px) and (prefers-color-scheme: dark) {
  .hero {
    background:
      linear-gradient(180deg, rgba(16, 20, 25, 0.98) 0%, rgba(16, 20, 25, 0.92) 56%, rgba(16, 20, 25, 0.60) 100%),
      url("mibudget-icon.png") center bottom 28px / 220px auto no-repeat,
      linear-gradient(135deg, #0d3b3a 0%, #3b2a13 52%, #451728 100%);
  }
}

@media (max-width: 520px) {
  .site-header,
  .site-footer,
  main > section,
  .not-found {
    width: calc(100% - 32px);
    max-width: calc(100% - 32px);
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 0;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .hero {
    padding: 40px 22px 250px;
  }

  h1 {
    font-size: 2.35rem;
  }

  h2 {
    font-size: 1.55rem;
  }

  .lead {
    font-size: 1rem;
  }

  .button {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  .card-actions,
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
}
