/*
 * bShop's website (#71): CHECK-MATE's site layout (header, hero, how it works, features, FAQ,
 * footer, A−/A+, theme and language controls) in bShop's own colours, the app's palette
 * (app/src/theme/palettes.ts): the notepad's sky-blue cover, golden spiral and ruled paper, warm
 * cream page, cart-red accent, and the navy ink all three family apps share.
 */
:root {
  --bg: #fbf7f0;
  --surface: #ffffff;
  --border: #ece4d6;
  --text: #0b2251;
  --text-muted: #5f6684;
  --accent: #d2372c;
  --accent-text: #ffffff;
  --gold: #c98a2e;
  --paper: #f4f8fd;
  --ruled: rgba(66, 124, 204, 0.38);
  --spiral: #c9a632;
  --cover: #6fbafa;
  --cover-edge: #3f8fd6;
  --on-cover: #0b2251;
  --radius: 16px;
  --font: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
    "Noto Sans Hebrew", "Noto Sans Arabic", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0a08;
    --surface: #1b1511;
    --border: #382c22;
    --text: #f7f2ea;
    --text-muted: #b4a996;
    --accent: #e8665c;
    --accent-text: #0d0a08;
    --gold: #e3ae55;
    --paper: #0e131b;
    --ruled: rgba(110, 155, 220, 0.22);
    --spiral: #d9b84a;
    --cover: #1e5a8c;
    --cover-edge: #133f66;
    --on-cover: #ffffff;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0d0a08;
  --surface: #1b1511;
  --border: #382c22;
  --text: #f7f2ea;
  --text-muted: #b4a996;
  --accent: #e8665c;
  --accent-text: #0d0a08;
  --gold: #e3ae55;
  --paper: #0e131b;
  --ruled: rgba(110, 155, 220, 0.22);
  --spiral: #d9b84a;
  --cover: #1e5a8c;
  --cover-edge: #133f66;
  --on-cover: #ffffff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.55; }
img { max-width: 100%; }
a { color: var(--accent); }

.skip-link {
  position: absolute; top: -100px; inset-inline-start: 12px; z-index: 100;
  background: var(--accent); color: var(--accent-text); padding: 10px 18px; border-radius: 8px;
  text-decoration: none; font-weight: 600; transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

.container { max-width: 1080px; margin-inline: auto; padding-inline: 24px; }
@media (max-width: 480px) { .container { padding-inline: 16px; } }

/* Header: on the cover, like the app's header */
.site-header { background: var(--cover); color: var(--on-cover); padding-block: 14px; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; color: var(--on-cover); text-decoration: none; }
.brand-icon { border-radius: 8px; transition: transform 0.15s ease; }
.brand:hover .brand-icon { transform: translateY(-2px); }
.header-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.a11y-controls, .a11y-controls > [role="group"] { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

.a11y-button, .lang-dropdown-button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 32px; height: 32px; padding: 0 8px;
  font: inherit; font-size: 0.85rem; font-weight: 700;
  border-radius: 8px; border: 1px solid var(--cover-edge);
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.lang-dropdown-button { font-weight: 500; font-size: 0.9rem; padding: 0 10px; }
.a11y-button:hover, .lang-dropdown-button:hover { transform: translateY(-2px); border-color: var(--accent); }
.a11y-button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }

.lang-dropdown { position: relative; }
.lang-flag, .lang-option img { width: 20px; height: 15px; object-fit: cover; border-radius: 2px; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }
.lang-caret { font-size: 0.7rem; color: var(--text-muted); }
.lang-dropdown-list {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 28px rgba(11, 34, 81, 0.18); z-index: 20;
}
.lang-dropdown-list[hidden] { display: none; }
.lang-option { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 0.9rem; color: var(--text); text-decoration: none; }
.lang-option:hover, .lang-option[aria-current="page"] { background: var(--bg); }

:is(a, button, summary, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Hero: the notepad's cover */
.hero { background: var(--cover); color: var(--on-cover); padding-block: 40px 64px; }
.hero-row { display: flex; align-items: center; gap: 40px 56px; flex-wrap: wrap; }
.hero-copy { flex: 1 1 360px; min-width: 260px; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); line-height: 1.1; margin: 0 0 16px; }
.hero-subhead { font-size: 1.15rem; margin: 0 0 28px; max-width: 46ch; }
.hero-note { margin-top: 14px; font-size: 0.9rem; }
.hero-art { flex: 0 0 auto; margin-inline: auto; }
.hero-art img {
  display: block; width: min(300px, 70vw); height: auto; border-radius: 22%;
  border: 8px solid #ffffff; box-shadow: 0 18px 40px rgba(11, 34, 81, 0.28);
  transition: transform 0.15s ease;
}
.hero-art img:hover { transform: translateY(-4px) rotate(-1deg); }

.cta-button { display: inline-block; transition: transform 0.15s ease; }
.cta-button:hover { transform: translateY(-2px); }
.play-badge { width: 220px; height: auto; display: block; }
.soon-pill {
  display: inline-block; padding: 12px 22px; border-radius: 999px; font-weight: 700;
  background: var(--text); color: var(--bg);
}

/* The spiral binding between the cover and the page */
.spiral { height: 40px; margin-top: -22px; margin-bottom: -18px; position: relative; z-index: 1; }
.spiral::before, .spiral::after {
  content: ""; position: absolute; inset: 0;
  -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x;
  -webkit-mask-position: center top; mask-position: center top;
  -webkit-mask-size: 40px 40px; mask-size: 40px 40px;
}
/* One coil of the app's binding: a golden hook, its end in a punched hole */
.spiral::before {
  background: var(--spiral);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M14 31V11a6 6 0 0 1 12 0v24' fill='none' stroke='%23000' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M14 31V11a6 6 0 0 1 12 0v24' fill='none' stroke='%23000' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E");
}
.spiral::after {
  background: var(--text-muted);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='14' cy='32' r='4.5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='14' cy='32' r='4.5'/%3E%3C/svg%3E");
}

/* The page: ruled paper */
.paper {
  background:
    linear-gradient(transparent calc(100% - 1px), var(--ruled) calc(100% - 1px)) 0 0 / 100% 2.2rem,
    var(--paper);
}

section { padding-block: 56px; }
h2 { text-align: center; font-size: 1.8rem; margin: 0 0 32px; }

.steps { list-style: none; margin: 0 0 40px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.steps li { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; font-weight: 600; }
.step-num { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-text); font-weight: 800; }

.screenshot-strip { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; }
.screenshot-strip img { width: min(270px, 80vw); height: auto; border-radius: 22px; border: 6px solid var(--text); box-shadow: 0 14px 32px rgba(11, 34, 81, 0.22); background: var(--surface); }

.features { background: var(--bg); }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; border-top: 4px solid var(--cover); }
.feature-card h3 { margin: 0 0 6px; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.feature-card p { margin: 0; color: var(--text-muted); }
.feature-icon { font-size: 1.3rem; }

.faq-list { max-width: 760px; margin-inline: auto; display: grid; gap: 12px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px 18px; }
.faq-item summary { cursor: pointer; font-weight: 700; padding-block: 12px; }
.faq-item p { margin: 0 0 14px; color: var(--text-muted); }

.final-cta { text-align: center; background: var(--cover); color: var(--on-cover); }
.final-cta p { font-size: 1.4rem; font-weight: 800; margin: 0 0 18px; }
.final-cta .cta-button, .final-cta .soon-pill { margin-inline: auto; }

.site-footer { border-top: 1px solid var(--border); padding-block: 24px; font-size: 0.9rem; color: var(--text-muted); }
.footer-row { display: flex; gap: 10px 22px; flex-wrap: wrap; align-items: center; justify-content: center; }
.site-footer a { color: var(--text-muted); }

/* Text pages: privacy, accessibility, 404 */
.statement { max-width: 760px; padding-block: 40px 64px; }
.statement h1 { color: var(--accent); margin-top: 0; }
.statement h2 { text-align: start; font-size: 1.2rem; margin: 28px 0 6px; }
.statement section { padding-block: 0; }
.statement section + section { border-top: 1px solid var(--border); margin-top: 40px; padding-top: 24px; }
.muted { color: var(--text-muted); }
.back-link { display: inline-block; margin-top: 24px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
