/* Storefront styles. No web fonts, no external requests: the page has to load
   from anywhere, including networks where foreign font hosts are unreachable.
   The brand colour comes from /assets/theme.css (content/site.ts → accent). */

:root {
  color-scheme: light dark;
  --accent: #1f5fbf;
  --link: var(--accent);
  --bg: #faf9f6;
  --surface: #ffffff;
  --ink: #1b1a17;
  --muted: #66635b;
  --line: #e3e0d7;
  --ok: #17754a;
  --ok-soft: #e6f4ec;
  --warn: #8a5208;
  --warn-soft: #fbf0d9;
  --radius: 12px;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --link: #8fb8ff;
    --bg: #141412;
    --surface: #1d1d1a;
    --ink: #edebe5;
    --muted: #a5a298;
    --line: #34332e;
    --ok: #74d3a0;
    --ok-soft: #16301f;
    --warn: #ecba66;
    --warn-soft: #372a0f;
  }
}

@supports (color: color-mix(in srgb, red, blue)) {
  @media (prefers-color-scheme: dark) {
    :root {
      --link: color-mix(in srgb, var(--accent) 45%, #ffffff);
    }
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* System serif faces for Chinese vary too much between platforms; headings stay sans. */
:lang(zh-Hans) h1,
:lang(zh-Hans) h2,
:lang(zh-Hans) h3,
:lang(zh-Hans) .brand,
:lang(zh-Hans) .amount {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3rem);
  margin: 0 0 0.5em;
}

h2 {
  font-size: 1.5rem;
  margin: 0 0 0.75em;
}

h3 {
  font-size: 1.15rem;
  margin: 0 0 0.4em;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

.narrow {
  max-width: 720px;
}

.section {
  padding-top: 56px;
  padding-bottom: 16px;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow a {
  color: inherit;
}

.lede {
  max-width: 44em;
  color: var(--muted);
  font-size: 1.15rem;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 10;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--surface);
}

.skip:focus {
  left: 8px;
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 22px;
  font-size: 0.95rem;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
}

.nav a:hover {
  color: var(--link);
}

.nav .lang {
  padding: 1px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

/* ---------- buttons, tags, notices ---------- */

.button {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: #ffffff;
  font: 600 1rem/1.3 var(--sans);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  filter: brightness(1.1);
}

.button[disabled] {
  border-color: var(--line);
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
  filter: none;
}

.button-quiet {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
  font-weight: 500;
}

.button-quiet:hover {
  border-color: var(--muted);
  filter: none;
}

.tag {
  display: inline-block;
  padding: 1px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.tag-accent {
  border-color: var(--link);
  color: var(--link);
}

.notice {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: 8px;
  background: var(--surface);
}

.notice-ok {
  border-left-color: var(--ok);
  background: var(--ok-soft);
}

.notice-warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

/* ---------- home ---------- */

.hero {
  padding: 72px 0 44px;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  max-width: 17em;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.card p {
  margin: 0 0 10px;
}

.card h3 a {
  color: inherit;
  text-decoration: none;
}

.card h3 a:hover {
  color: var(--link);
}

.card-text {
  flex: 1;
  color: var(--muted);
}

.card .card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 8px 0 0;
}

.card-price {
  font-weight: 600;
}

.more {
  font-size: 0.92rem;
  white-space: nowrap;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  padding-top: 12px;
  border-top: 2px solid var(--ink);
  counter-increment: step;
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font: 600 0.85rem var(--mono);
}

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

.faq {
  max-width: 720px;
}

.faq details {
  border-top: 1px solid var(--line);
}

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

.faq summary {
  padding: 14px 0;
  font-weight: 600;
  cursor: pointer;
}

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

/* ---------- product and pricing ---------- */

.product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 48px;
  padding-top: 48px;
  padding-bottom: 16px;
}

.highlights {
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.highlights li,
.assurances li {
  position: relative;
  margin-bottom: 6px;
  padding-left: 26px;
}

.highlights li::before,
.assurances li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--ok);
  font-weight: 700;
}

.included {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.buy-box {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 12px;
}

.buy-box .notice {
  margin: 0;
}

.offer {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.offer-featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.offer p {
  margin: 0;
}

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

.amount {
  font: 600 1.9rem/1.15 var(--serif);
}

.per,
.approx,
.terms {
  color: var(--muted);
  font-size: 0.9rem;
}

.offer .button {
  width: 100%;
  margin-top: 8px;
}

.assurances {
  margin: 8px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.9rem;
  list-style: none;
}

.pricing-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.pricing-about h2 a {
  color: inherit;
  text-decoration: none;
}

.pricing-about p {
  color: var(--muted);
}

.pricing-offers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  align-items: start;
  gap: 12px;
}

/* ---------- long-form text ---------- */

.prose {
  overflow-wrap: break-word;
}

.prose h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.prose h2 {
  margin-top: 1.8em;
  font-size: 1.3rem;
}

.prose h3 {
  margin-top: 1.5em;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose li {
  margin-bottom: 0.35em;
}

.prose img,
.prose video,
.prose iframe {
  max-width: 100%;
  border-radius: 8px;
}

.prose code {
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  font: 0.9em var(--mono);
  overflow-wrap: anywhere;
}

.prose pre {
  overflow-x: auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.prose pre code {
  padding: 0;
  border: 0;
  background: none;
}

.prose blockquote {
  margin: 1em 0;
  padding: 2px 16px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

/* ---------- forms and tables ---------- */

.stack {
  display: grid;
  gap: 10px;
  max-width: 420px;
}

label {
  font-weight: 600;
}

input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- account ---------- */

.account section {
  margin-top: 36px;
}

.account-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
}

.account-head h1 {
  margin-bottom: 0.2em;
}

.library {
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  align-items: start;
}

.actions,
.licenses {
  display: grid;
  gap: 10px;
  margin: 8px 0;
  padding: 0;
  list-style: none;
}

.license {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.license-label {
  width: 100%;
  color: var(--muted);
  font-size: 0.85rem;
}

.license code {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  font: 600 0.95rem var(--mono);
  overflow-wrap: anywhere;
}

.library-card .button {
  padding: 7px 14px;
  font-size: 0.95rem;
}

.account form {
  margin-top: 24px;
}

.account-head form {
  margin-top: 6px;
}

.account form .muted {
  margin-top: 8px;
  font-size: 0.9rem;
}

.help {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

/* ---------- course ---------- */

.lessons {
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  counter-reset: lesson;
}

.lessons li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  counter-increment: lesson;
}

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

.lessons li::before {
  content: counter(lesson, decimal-leading-zero);
  color: var(--muted);
  font: 600 0.85rem var(--mono);
}

.lessons li > :first-child {
  flex: 1;
  min-width: 12em;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* ---------- support, messages ---------- */

.support section {
  margin-top: 28px;
}

.support h2 {
  margin-bottom: 0.4em;
  font-size: 1.2rem;
}

.message {
  padding-top: 88px;
  padding-bottom: 48px;
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: 80px;
  padding: 40px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0 0 6px;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li {
  margin-bottom: 6px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 24px;
}

.footer-brand {
  color: var(--ink);
  font-weight: 700;
}

.footer-title {
  color: var(--ink);
  font-weight: 600;
}

.footer-note {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

@media (max-width: 860px) {
  .product {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding-top: 32px;
  }

  .buy-box {
    position: static;
  }

  .pricing-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero {
    padding: 48px 0 32px;
  }

  .section {
    padding-top: 40px;
  }
}
