:root {
  color-scheme: light dark;
  --canvas: #f7f7fb;
  --canvas-deep: #eeeef7;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #fff;
  --ink: #16151d;
  --muted: #625f6f;
  --line: rgba(30, 27, 43, 0.12);
  --violet: #7756e8;
  --violet-deep: #5734cb;
  --cyan: #16a9cf;
  --coral: #ef6f72;
  --magenta: #c94faa;
  --focus: #087f9d;
  --shadow: 0 18px 55px rgba(54, 38, 96, 0.1);
  --radius: 24px;
  --content: 1120px;
  --reading: 760px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 2%, rgba(119, 86, 232, 0.13), transparent 31rem),
    radial-gradient(circle at 94% 12%, rgba(22, 169, 207, 0.12), transparent 27rem),
    linear-gradient(180deg, var(--canvas) 0%, var(--canvas-deep) 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--violet-deep);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:hover {
  text-decoration-thickness: 0.12em;
}

a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-radius: 6px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 10px;
  left: 10px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--surface-solid);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 247, 251, 0.82);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.nav-shell {
  width: min(calc(100% - 32px), var(--content));
  min-height: 70px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  overflow: hidden;
  border: 1px solid rgba(152, 132, 255, 0.26);
  border-radius: 12px;
  background: #07081b url("tally-pro-icon.png") center / cover no-repeat;
  box-shadow: 0 7px 20px rgba(49, 35, 102, 0.28), 0 0 18px rgba(80, 111, 255, 0.12);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}

.site-nav a {
  min-height: 44px;
  padding: 9px 12px;
  display: inline-flex;
  align-items: center;
  border-radius: 13px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--surface);
  color: var(--ink);
}

main {
  width: min(calc(100% - 32px), var(--content));
  margin: 0 auto;
}

.hero {
  position: relative;
  overflow: hidden;
  margin: 54px 0 28px;
  padding: clamp(32px, 6vw, 72px);
  border: 1px solid var(--line);
  border-radius: clamp(26px, 5vw, 40px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(246, 244, 255, 0.72));
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: -100px;
  bottom: -190px;
  border: 50px solid rgba(119, 86, 232, 0.12);
  border-radius: 48% 52% 46% 54%;
  box-shadow: 0 0 0 45px rgba(22, 169, 207, 0.07), 0 0 0 90px rgba(239, 111, 114, 0.05);
  transform: rotate(20deg);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero.home-hero {
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 240px);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  border-color: rgba(141, 126, 255, 0.25);
  background:
    radial-gradient(circle at 80% 24%, rgba(24, 179, 255, 0.22), transparent 24rem),
    radial-gradient(circle at 65% 92%, rgba(236, 47, 172, 0.18), transparent 25rem),
    linear-gradient(135deg, #070817 0%, #0c1233 54%, #210d31 100%);
  box-shadow: 0 28px 80px rgba(19, 12, 56, 0.28);
}

.home-hero h1 {
  color: #fff;
}

.home-hero .eyebrow {
  color: #69dffa;
}

.home-hero .lede {
  color: #cbc7da;
}

.home-hero .button.secondary {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.hero-app-icon {
  position: relative;
  z-index: 1;
  width: min(100%, 240px);
  height: auto;
  justify-self: end;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22%;
  box-shadow: 0 30px 70px rgba(2, 4, 25, 0.5), 0 0 55px rgba(45, 132, 255, 0.2);
  transform: rotate(3deg);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--violet-deep);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  color: var(--ink);
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.13;
}

h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.45rem, 7vw, 5rem);
}

.legal-hero h1 {
  font-size: clamp(2.2rem, 6vw, 4.25rem);
}

.lede {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
}

.meta-row {
  margin-top: 26px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.button-row {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  min-height: 48px;
  padding: 11px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--violet), var(--violet-deep));
  color: #fff;
  font-weight: 750;
  text-decoration: none;
  box-shadow: 0 9px 24px rgba(87, 52, 203, 0.24);
}

.button.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
}

.section {
  padding: 34px 0;
}

.section-heading {
  max-width: 680px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 4vw, 2.65rem);
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

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

.card {
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 32px rgba(54, 38, 96, 0.055);
}

.card h2,
.card h3 {
  margin: 0 0 9px;
  font-size: 1.22rem;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.card .text-link {
  margin-top: 18px;
  display: inline-flex;
  font-weight: 750;
}

.accent-card {
  background: linear-gradient(145deg, rgba(119, 86, 232, 0.13), rgba(22, 169, 207, 0.08)), var(--surface);
}

.legal-layout {
  max-width: var(--reading);
  margin: 0 auto;
  padding: 8px 0 62px;
}

.legal-layout section {
  padding-top: 24px;
  scroll-margin-top: 90px;
}

.legal-layout h2 {
  margin: 0 0 10px;
  font-size: clamp(1.38rem, 3vw, 1.75rem);
}

.legal-layout h3 {
  margin: 20px 0 8px;
  font-size: 1.08rem;
}

.legal-layout p,
.legal-layout ul,
.legal-layout ol {
  margin-top: 0;
}

.legal-layout li + li {
  margin-top: 8px;
}

.notice {
  margin: 22px 0;
  padding: 20px 22px;
  border-left: 4px solid var(--violet);
  border-radius: 0 18px 18px 0;
  background: rgba(119, 86, 232, 0.09);
}

.notice strong {
  color: var(--ink);
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 54px;
}

.support-grid .card h2 {
  font-size: 1.3rem;
}

.support-grid ul,
.support-grid ol {
  margin: 12px 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
}

details {
  border-top: 1px solid var(--line);
  padding: 17px 0;
}

details:last-child {
  border-bottom: 1px solid var(--line);
}

summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 750;
}

details p {
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.38);
}

.footer-shell {
  width: min(calc(100% - 32px), var(--content));
  margin: 0 auto;
  padding: 32px 0 40px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.footer-shell p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 8px 18px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

@media (max-width: 820px) {
  .nav-shell {
    padding: 12px 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .site-nav a {
    padding-inline: 9px;
  }

  .hero.home-hero {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .hero-app-icon {
    grid-row: 1;
    width: 118px;
    justify-self: start;
    border-radius: 26px;
    transform: none;
  }

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

  .support-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  main,
  .nav-shell,
  .footer-shell {
    width: min(calc(100% - 24px), var(--content));
  }

  .site-nav a {
    font-size: 0.82rem;
  }

  .hero {
    margin-top: 28px;
    padding: 28px 22px 34px;
  }

  .card {
    padding: 21px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #101016;
    --canvas-deep: #17151f;
    --surface: rgba(35, 32, 44, 0.79);
    --surface-solid: #24212c;
    --ink: #f5f2fb;
    --muted: #bbb5c8;
    --line: rgba(239, 235, 248, 0.14);
    --violet: #a388ff;
    --violet-deep: #b49dff;
    --cyan: #55d4ef;
    --focus: #72d7ef;
    --shadow: 0 18px 65px rgba(0, 0, 0, 0.3);
  }

  body {
    background:
      radial-gradient(circle at 12% 2%, rgba(119, 86, 232, 0.2), transparent 31rem),
      radial-gradient(circle at 94% 12%, rgba(22, 169, 207, 0.14), transparent 27rem),
      linear-gradient(180deg, var(--canvas) 0%, var(--canvas-deep) 100%);
  }

  .site-header {
    background: rgba(16, 16, 22, 0.84);
  }

  .hero {
    background: linear-gradient(135deg, rgba(43, 39, 54, 0.92), rgba(26, 23, 36, 0.82));
  }

  .site-footer {
    background: rgba(16, 16, 22, 0.45);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: currentColor;
  }

  .card,
  .hero,
  .pill,
  .button.secondary {
    border-width: 2px;
  }
}
