/* Chore Bits website. Colours follow the app's Cerulean tokens (frontend/src/theme.ts in chorebits-app). */

/* Readex Pro, self-hosted (SIL OFL, see /assets/fonts/OFL-readex-pro.txt). Split by script so each page only downloads what it uses. */
@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/readex-pro-regular-latin.woff2") format("woff2");
  unicode-range: U+0000-024F, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212;
}
@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/readex-pro-semibold-latin.woff2") format("woff2");
  unicode-range: U+0000-024F, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212;
}
@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/readex-pro-regular-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200F, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/readex-pro-semibold-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200F, U+FB50-FDFF, U+FE70-FEFF;
}

/* Noto Sans JP, self-hosted (SIL OFL, see /assets/fonts/OFL-noto-sans-jp.txt). Subset to the characters
   on the Japanese pages: re-run tools/subset-japanese-font.py whenever that text changes. */
@font-face {
  font-family: "Noto Sans JP";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/noto-sans-jp-regular-subset.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Sans JP";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/noto-sans-jp-bold-subset.woff2") format("woff2");
}


/* Colours follow the app's Cerulean tokens (frontend/src/theme.ts in chorebits-app). */
:root {
  color-scheme: light dark;
  --navy: #0b2545;
  --cerulean: #1dacd6;
  --coral: #ff8559;
  --coral-edge: #d9603a;
  --yellow: #f7d43b;
  --hero: linear-gradient(135deg, #6adcea, #1dacd6 55%, #1a9bd0);
  --on-hero: #0b2545;
  --on-hero-secondary: #0f2c4d;

  --page: #eef9fd;
  --card: #ffffff;
  --card-edge: #0b2545;
  --sheet: #ffffff;
  --tile: #eef9fd;
  --text: #1d2030;
  --heading: #0b2545;
  --text-secondary: #555b6e;
  /* The app's accent (#0e7fa6) deepened slightly so links pass 4.5:1 on every light background used here. */
  --accent: #0a6d91;
  --accent-fill: #e2f0f4;
  --border: #e4e7ef;
  --border-strong: #8a90a2;
  --focus: #0b2545;
  --notice-bg: #fff4e5;
  --notice-border: #d9603a;
  --pay-bg: #0b2545;
  --pixel-navy: #0b2545;

  --font: "Readex Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-ja: "Readex Pro", "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --radius: 22px;
  --radius-lg: 28px;
  --radius-sm: 12px;
  --measure: 42rem;
  --wide: 68rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0b2545;
    --card: #10305a;
    --card-edge: #051528;
    --sheet: #10305a;
    --tile: #0b2545;
    --text: #f2f7fb;
    --heading: #f2f7fb;
    --text-secondary: #c3d0e0;
    --accent: #6adcea;
    --accent-fill: #173d6b;
    --border: #24497a;
    --border-strong: #8fa6c4;
    --focus: #f7d43b;
    --notice-bg: #3a2a24;
    --notice-border: #ff8559;
    --pay-bg: #051528;
    --pixel-navy: #a8e8f2;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* Only Japanese pages use Noto Sans JP. Latin text there stays in Readex Pro. */
html:lang(ja) body {
  font-family: var(--font-ja);
  line-height: 1.8;
}

/* Noto Sans JP ships Regular and Bold only, so Japanese headings and labels use 700. */
html:lang(ja) :is(h1, h2, h3, strong, b, .ui-label, kbd, .store-badge-placeholder__store, .contact-email, .legal-meta dt, [aria-current="page"], .step__num) {
  font-weight: 700;
}

html:lang(ar) body {
  line-height: 1.8;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

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

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

main:focus {
  outline: none;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -10rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--card);
  color: var(--text);
  border: 2px solid var(--focus);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

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

.wrap {
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: 1rem;
}

h1,
h2,
h3 {
  line-height: 1.2;
  font-weight: 600;
  color: var(--heading);
  margin-block: 0 0.75rem;
}

h1 {
  font-size: 1.875rem;
}

h2 {
  font-size: 1.375rem;
  margin-block-start: 2rem;
}

h3 {
  font-size: 1.125rem;
  margin-block-start: 1.5rem;
}

p,
ul,
ol {
  margin-block: 0 1rem;
}

li + li {
  margin-block-start: 0.375rem;
}

/* ---------- Header (inner pages) ---------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: 1rem;
  display: flex;
  align-items: center;
  min-height: 4.5rem;
}

.site-header__logo {
  display: inline-block;
  padding-block: 0.5rem;
}

.site-header__logo img {
  width: 200px;
}

/* ---------- Main ---------- */
main {
  flex: 1;
  width: 100%;
}

/* Inner pages: a strip of the hero gradient with a few pixel "bits", and the content card on top of it. */
.page-inner main {
  position: relative;
  padding: 2rem 1rem 3.5rem;
  background: var(--hero) top / 100% 9rem no-repeat;
}

.page-inner main::before,
.page-inner main::after {
  content: "";
  position: absolute;
  border-radius: 4px;
}

.page-inner main::before {
  top: 1.25rem;
  inset-inline-start: 5%;
  width: 28px;
  height: 28px;
  background: rgb(255 255 255 / 0.4);
}

.page-inner main::after {
  top: 3.5rem;
  inset-inline-end: 6%;
  width: 18px;
  height: 18px;
  background: var(--coral);
}

.card {
  position: relative;
  z-index: 1;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 8px 0 var(--card-edge);
}

.prose {
  max-width: var(--measure);
  margin-inline: auto;
}

.lead {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

/* ---------- Home ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--hero);
  color: var(--on-hero);
  padding: 3rem 0 5.5rem;
}

.hero__decor i {
  position: absolute;
  display: block;
  border-radius: 4px;
}

.hero__decor i:nth-child(1) { top: 1.75rem; inset-inline-start: 5%; width: 26px; height: 26px; background: rgb(255 255 255 / 0.35); }
.hero__decor i:nth-child(2) { top: 5.5rem; inset-inline-start: 46%; width: 18px; height: 18px; background: var(--coral); }
.hero__decor i:nth-child(3) { bottom: 4.5rem; inset-inline-start: 2.5%; width: 42px; height: 42px; background: rgb(255 255 255 / 0.25); }
.hero__decor i:nth-child(4) { bottom: 6.5rem; inset-inline-end: 5%; width: 22px; height: 22px; background: var(--yellow); }
.hero__decor i:nth-child(5) { top: 2.5rem; inset-inline-end: 12%; width: 34px; height: 34px; background: rgb(255 255 255 / 0.3); }
.hero__decor i:nth-child(6) { top: 9rem; inset-inline-end: 2.5%; width: 16px; height: 16px; background: var(--navy); }

/* On narrow screens the text runs edge to edge, so only the squares beside the logo tile stay. */
@media (max-width: 51.99rem) {
  .hero__decor i:not(:nth-child(3), :nth-child(4)) {
    display: none;
  }
}

.hero__grid {
  position: relative;
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.hero h1 {
  color: var(--on-hero);
  font-size: clamp(2.1rem, 7vw, 3.3rem);
  line-height: 1.1;
  margin: 0 0 1rem;
}

.hero h1 span {
  display: block;
}

.hero__lead {
  font-size: 1.1875rem;
  color: var(--on-hero-secondary);
  max-width: 34rem;
  margin-block-end: 1.75rem;
}

.hero__logo {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.75rem 1.5rem;
  box-shadow: 0 10px 0 var(--navy);
  width: 100%;
  max-width: 30rem;
  margin-inline: auto;
}

.hero__logo img {
  width: 100%;
}

.store-badges {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.store-badges li + li {
  margin: 0;
}

/* Placeholder slot for an official store badge. Replace each <li> with the badge link once the app is live. */
.store-badge-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 10rem;
  min-height: 3.5rem;
  padding: 0.5rem 1.25rem;
  background: var(--coral);
  color: var(--navy);
  border-radius: 16px;
  box-shadow: 0 5px 0 var(--coral-edge);
  line-height: 1.25;
}

.store-badge-placeholder__store {
  font-weight: 600;
  font-size: 1.125rem;
}

.store-badge-placeholder__status {
  font-size: 0.875rem;
}

.band {
  padding: 3.5rem 0;
}

.band--sheet {
  position: relative;
  margin-top: -2.5rem;
  background: var(--sheet);
  border-radius: 32px 32px 0 0;
}

.band h2 {
  font-size: clamp(1.625rem, 4vw, 2rem);
  text-align: center;
  margin: 0 0 0.5rem;
}

.section-sub {
  text-align: center;
  color: var(--text-secondary);
  max-width: 36rem;
  margin: 0 auto 2.5rem;
}

.how-steps,
.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}

.how-steps li + li,
.features li + li {
  margin: 0;
}

.step {
  background: var(--tile);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.step__num {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 1.3rem;
  margin-block-end: 0.9rem;
  box-shadow: 0 4px 0 rgb(11 37 69 / 0.25);
}

.step__num--c { background: var(--cerulean); color: var(--navy); }
.step__num--n { background: var(--navy); color: #ffffff; }
.step__num--o { background: var(--coral); color: var(--navy); }

.step h3,
.feature h3 {
  margin: 0 0 0.35rem;
  font-size: 1.1875rem;
}

.step p,
.feature p {
  margin: 0;
  color: var(--text-secondary);
}

.feature {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.pixel-icon {
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, 10px);
  gap: 3px;
  margin-block-start: 0.3rem;
}

.pixel-icon i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.px-c { background: var(--cerulean); }
.px-n { background: var(--pixel-navy); }
.px-o { background: var(--coral); }
.px-y { background: var(--yellow); }

.pay {
  display: grid;
  gap: 1rem;
  align-items: center;
  margin-block-start: 3rem;
  padding: 2rem 1.75rem;
  border-radius: var(--radius-lg);
  background: var(--pay-bg);
  color: #ffffff;
}

.pay h2 {
  color: #ffffff;
  text-align: start;
  margin: 0 0 0.25rem;
}

.pay p {
  margin: 0;
  color: #c3d0e0;
}

.pay__coin {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f2b92b;
  box-shadow: inset 0 -6px 0 #c98a0e;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 1.5rem;
  color: #5c3b00;
}

/* ---------- Delete account / support ---------- */
.steps-list {
  padding-inline-start: 1.5rem;
}

.ui-label {
  font-weight: 600;
}

kbd {
  font-family: inherit;
  font-weight: 600;
  padding: 0.05em 0.4em;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--accent-fill);
}

.contact-email {
  font-size: 1.25rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ---------- Legal pages ---------- */
.legal-meta {
  display: grid;
  grid-template-columns: fit-content(50%) 1fr;
  gap: 0.25rem 1rem;
  margin: 0 0 1rem;
}

.legal-meta dt {
  font-weight: 600;
}

.legal-meta dd {
  margin: 0;
}

.governing-note {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.placeholder-notice {
  margin-block: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--notice-bg);
  border-inline-start: 6px solid var(--notice-border);
  border-radius: var(--radius-sm);
}

.placeholder-notice p:last-child {
  margin: 0;
}

/* ---------- Language suggestion (home pages only, shown by lang-suggest.js) ---------- */
.lang-suggest {
  background: var(--accent-fill);
  border-bottom: 1px solid var(--border);
}

.lang-suggest[hidden] {
  display: none;
}

.lang-suggest__inner {
  max-width: var(--wide);
  margin-inline: auto;
  padding: 0.625rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.lang-suggest p {
  margin: 0;
}

.lang-suggest button {
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.25rem 0.875rem;
  min-height: 2.75rem;
  cursor: pointer;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  font-size: 0.9375rem;
}

.site-footer__inner {
  max-width: var(--wide);
  margin-inline: auto;
  padding: 1.5rem 1rem 2rem;
  display: grid;
  gap: 1.25rem;
}

.site-footer h2 {
  font-size: 0.9375rem;
  margin: 0 0 0.5rem;
}

.footer-links,
.lang-switcher ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.footer-links li + li,
.lang-switcher li + li {
  margin: 0;
}

.footer-links a,
.lang-switcher a {
  display: inline-block;
  padding-block: 0.625rem;
}

.lang-switcher [aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.copyright {
  margin: 0;
  color: var(--text-secondary);
}

/* ---------- Error page ---------- */
.error-code {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-block-end: 0.25rem;
}

/* ---------- Wider screens ---------- */
@media (min-width: 40rem) {
  .card {
    padding: 2.5rem;
  }

  h1 {
    font-size: 2.25rem;
  }

  .site-header__logo img {
    width: 240px;
  }

  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .copyright {
    grid-column: 1 / -1;
  }
}

@media (min-width: 52rem) {
  .hero {
    padding-block: 4rem 6rem;
  }

  .hero__grid {
    grid-template-columns: 1.05fr 0.95fr;
  }

  .how-steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .features {
    grid-template-columns: repeat(2, 1fr);
  }

  .pay {
    grid-template-columns: auto 1fr;
    padding: 2.25rem 2.5rem;
  }
}

@media (prefers-color-scheme: dark) {
  /* The navy step tile would vanish on the dark page, so it turns light. */
  .step__num--n {
    background: #a8e8f2;
    color: var(--navy);
  }
}
