/* Easy Income Tracker site. Tokens mirror the app (src/lib/theme.ts). */
:root {
  color-scheme: light dark;
  --bg: light-dark(#fff8f1, #15111f);
  --card: light-dark(#ffffff, #211b30);
  --ink: light-dark(#1d1530, #f6f1ff);
  --soft: light-dark(#6b6280, #b7add0);
  --line: light-dark(#efe6dc, #342a49);
  --off: light-dark(#ece6f2, #2e2740);
  --band: #2b1d4a;
  --band-soft: #d9cdfa;
  --violet: #7b5cff;
  --coral: #ff5a5f;
  --tangerine: #ffa41b;
  --sunshine: #ffd23f;
  --teal: #00a8a8;
  --leaf: #3bb273;
  --sky: #1e9bff;
  --pink: #ff4fa3;
  --display: Fredoka, Nunito, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 Nunito, system-ui, sans-serif; }
a { color: inherit; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }

/* Header band, shared by every page */
.band { background: var(--band); color: #fff; }
.top { display: flex; align-items: center; gap: 16px; padding-top: 18px; padding-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 20px; text-decoration: none; margin-right: auto; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.top nav { display: flex; gap: 18px; font-weight: 700; }
.top nav a { text-decoration: none; color: var(--band-soft); }
.top nav a:hover { color: #fff; }
@media (max-width: 560px) { .top nav a:not(:last-child) { display: none; } }

/* The app's colour dots, used on the plain pages */
.dots { display: flex; gap: 8px; margin-bottom: 16px; }
.dots i { width: 22px; height: 22px; border-radius: 7px; display: block; }
.dots i:nth-child(1) { background: var(--coral); }
.dots i:nth-child(2) { background: var(--tangerine); }
.dots i:nth-child(3) { background: var(--teal); }
.dots i:nth-child(4) { background: var(--violet); }
.dots i:nth-child(5) { background: var(--pink); }

/* Plain pages: privacy, support, 404 */
.page-head { padding-top: 22px; padding-bottom: 32px; }
.page-head h1 { font-size: clamp(30px, 6vw, 42px); }
.page-head p { color: var(--band-soft); margin: 8px 0 0; }
.page { padding-top: 24px; padding-bottom: 60px; }
.page h2 { font-size: 24px; margin: 32px 0 10px; }
.page li { margin-bottom: 6px; }
.page table { width: 100%; border-collapse: collapse; font-size: 15px; }
.page th, .page td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.small { color: var(--soft); font-size: 15px; }
.contact { background: var(--card); border-radius: 22px; padding: 20px; margin-bottom: 26px; border: 3px solid var(--violet); }
.contact p { margin: 0 0 6px; }
.contact a { font-weight: 800; font-size: 20px; }
details { background: var(--card); border-radius: 18px; padding: 4px 18px; margin-bottom: 10px; border: 2px solid var(--line); }
summary { font-weight: 800; padding: 14px 0; cursor: pointer; }
.after { margin-top: 30px; }

/* Landing: hero */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding-top: 36px; padding-bottom: 72px; }
.hero h1 { font-size: clamp(42px, 6.4vw, 72px); font-weight: 700; letter-spacing: -0.01em; }
.lede { color: var(--band-soft); font-size: 20px; max-width: 34ch; margin: 18px 0 28px; }
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store { display: inline-flex; align-items: center; gap: 12px; background: #000; color: #fff; border: 2px solid #5b4a7e; border-radius: 14px; padding: 8px 18px 8px 14px; line-height: 1.2; }
.store > span { display: flex; flex-direction: column; }
.store svg { width: 26px; height: 26px; flex: none; fill: currentColor; }
.store small { font-size: 12px; color: #cfc6e6; }
.store strong { font-family: var(--display); font-size: 20px; font-weight: 600; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; gap: 36px; } }

/* Landing: the month card, a small copy of the app's month screen */
.month { background: #3a2a62; border-radius: 28px; padding: 22px; box-shadow: 0 24px 60px rgba(10, 4, 30, 0.45); max-width: 460px; justify-self: center; width: 100%; }
.month-name { font-family: var(--display); font-size: 24px; text-align: center; }
.month-lab { text-align: center; color: var(--band-soft); font-weight: 700; font-size: 14px; margin-top: 10px; }
.total { font-family: var(--display); font-weight: 700; font-size: 56px; line-height: 1.1; text-align: center; }
.rain { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: 12px 0 18px; background: rgba(255, 255, 255, 0.12); }
.rain i { display: block; }
.rain i:nth-child(1) { flex: 3; background: var(--coral); }
.rain i:nth-child(2) { flex: 5; background: var(--teal); }
.rain i:nth-child(3) { flex: 2; background: var(--sunshine); }
.client { background: var(--bg); color: var(--ink); border-radius: 18px; overflow: hidden; }
.client + .client { margin-top: 12px; }
.client-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; color: #fff; font-weight: 800; font-size: 14px; }
.client-head b { font-family: var(--display); font-weight: 600; font-size: 20px; display: block; }
.client-head span:last-child { font-family: var(--display); font-size: 19px; }
.c-coral { background: var(--coral); }
.c-teal { background: var(--teal); }
.stickers { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px; }
.st { width: 48px; height: 54px; border-radius: 13px; border: 3px solid; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; font-size: 10px; text-transform: uppercase; line-height: 1.1; position: relative; }
.st b { font-family: var(--display); font-weight: 600; font-size: 19px; text-transform: none; }
.st em { font-style: normal; font-size: 9px; text-transform: none; height: 0; overflow: hidden; }
.st.coral { border-color: var(--coral); }
.st.teal { border-color: var(--teal); }
.st.done.coral { background: var(--coral); color: #fff; }
.st.done.teal { background: var(--teal); color: #fff; }

/* The one animation: a session is cancelled and the forecast follows. CSS only. */
@property --rest { syntax: '<integer>'; inherits: false; initial-value: 534; }
.total-n { --rest: 534; counter-reset: rest var(--rest); }
.total-n::after { content: counter(rest); }
.flip b { text-decoration-color: var(--coral); }
@media (prefers-reduced-motion: no-preference) {
  .total-n { animation: count 0.9s 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
  .flip { animation: cancel 0.35s 1.4s ease-out forwards; }
  .flip b { animation: strike 0.35s 1.4s forwards; }
  .flip em { animation: tag 0.35s 1.4s forwards; }
}
@media (prefers-reduced-motion: reduce) {
  .total-n { --rest: 424; }
  .flip { background: var(--off); border-color: var(--off); color: var(--soft); }
  .flip b { text-decoration-line: line-through; }
  .flip em { height: auto; }
}
@keyframes count { to { --rest: 424; } }
@keyframes cancel { to { background: var(--off); border-color: var(--off); color: var(--soft); } }
@keyframes strike { to { text-decoration-line: line-through; } }
@keyframes tag { to { height: 12px; } }

/* Landing: sections */
.section { padding-top: 72px; padding-bottom: 72px; }
.section > h2, .section > .wrap > h2 { font-size: clamp(30px, 4.4vw, 44px); margin-bottom: 12px; }
.section-lede { color: var(--soft); font-size: 19px; max-width: 56ch; margin: 0 0 36px; }

.glance { background: var(--band); color: #fff; }
.glance .section-lede { color: var(--band-soft); }
.figures { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px 48px; margin: 0; }
.figures div { border-left: 6px solid; padding-left: 16px; }
.figures div:nth-child(1) { border-color: var(--violet); }
.figures div:nth-child(2) { border-color: var(--leaf); }
.figures div:nth-child(3) { border-color: var(--sky); }
.figures div:nth-child(4) { border-color: var(--coral); }
.figures div:nth-child(5) { border-color: var(--sunshine); }
.figures div:nth-child(6) { border-color: var(--pink); }
.figures dt { font-family: var(--display); font-size: 22px; }
.figures dd { margin: 2px 0 0; color: var(--band-soft); }
@media (max-width: 760px) { .figures { grid-template-columns: 1fr; } }

.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 300px)); gap: 20px; }
.plan { background: var(--card); border: 3px solid var(--line); border-radius: 24px; padding: 24px; }
.plan.best { border-color: var(--violet); }
.plan h3 { font-size: 22px; }
.plan .price { color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1.1; margin: 6px 0 2px; }
.plan p { margin: 0; color: var(--soft); }
.fine { color: var(--soft); font-size: 15px; margin-top: 20px; max-width: 60ch; }
@media (max-width: 640px) { .plans { grid-template-columns: 1fr; } }

.faq details, .faq .section-lede { max-width: 760px; }
.faq details ul { margin: 0 0 12px; padding-left: 20px; }
.faq details li { margin-bottom: 6px; }

/* Landing: how it works, told as one month. Numbered stickers, text and a phone that swap sides each step. */
.story { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.story li { counter-increment: step; display: grid; grid-template-columns: minmax(0, 440px) 260px; justify-content: center; gap: 28px 80px; align-items: center; padding: 28px 0; }
.story li:nth-child(even) { grid-template-columns: 260px minmax(0, 440px); }
.story li:nth-child(even) .story-shot { order: -1; }
.story li:nth-child(even) .phone { transform: rotate(1.5deg); }
.story-shot { margin: 0; }
.story-text { max-width: 46ch; }
.story-text::before { content: counter(step); display: flex; align-items: center; justify-content: center; width: 52px; height: 58px; border-radius: 15px; font-family: var(--display); font-size: 26px; color: #fff; margin-bottom: 16px; transform: rotate(-4deg); background: var(--c, var(--coral)); }
.story li:nth-child(7n+1) { --c: var(--coral); }
.story li:nth-child(7n+2) { --c: var(--teal); }
.story li:nth-child(7n+3) { --c: var(--violet); }
.story li:nth-child(7n+4) { --c: var(--pink); }
.story li:nth-child(7n+5) { --c: var(--sky); }
.story li:nth-child(7n+6) { --c: var(--leaf); }
.story li:nth-child(7n+7) { --c: var(--band); }
.story li:nth-child(even) .story-text::before { transform: rotate(3deg); }
.story h3 { font-size: clamp(26px, 3vw, 32px); margin-bottom: 8px; }
.story-text p { margin: 0; color: var(--soft); font-size: 18px; }
.story .when { margin-top: 22px; color: var(--ink); font-size: 15px; line-height: 1.5; text-align: center; }
.story .when b { display: inline-block; background: var(--off); border-radius: 8px; padding: 1px 8px; margin-right: 6px; font-weight: 800; }
.phone { background: var(--band); border-radius: 34px; padding: 8px; box-shadow: 0 18px 40px rgba(20, 8, 50, 0.22); transform: rotate(-1.5deg); }
.phone img { display: block; width: 100%; height: auto; border-radius: 27px; background: var(--off); }
@media (max-width: 760px) {
  .story li, .story li:nth-child(even) { grid-template-columns: 1fr; padding: 20px 0 36px; }
  .story li:nth-child(even) .story-shot { order: 0; }
  .story-shot { width: min(260px, 72vw); justify-self: center; }
}
/* Hover: the phone straightens and lifts, as if picked up. Only where hovering exists, and never with reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .phone { transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.28s ease; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .story li .phone:hover { transform: translateY(-10px) rotate(0deg); box-shadow: 0 30px 56px rgba(20, 8, 50, 0.3); }
}

/* Footer */
.foot { background: var(--band); color: var(--band-soft); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; padding-top: 28px; padding-bottom: 28px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-left: auto; }
.foot a { color: #fff; }
.foot .legal { flex-basis: 100%; margin: 0; font-size: 0.85rem; } /* UK company trading disclosure */
