:root {
  --ink: #17211d;
  --muted: #56635d;
  --paper: #fffefa;
  --surface: #f4f7f4;
  --surface-strong: #e8f0ec;
  --line: #d6ded8;
  --green: #214e3a;
  --green-dark: #163528;
  --blue: #315b78;
  --gold: #b87826;
  --gold-ink: #845115;
  --coral: #a54e3f;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(18, 31, 25, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "Noto Sans", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

body.zh {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

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

a {
  color: inherit;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(214, 222, 216, 0.75);
  background: rgba(255, 254, 250, 0.94);
  backdrop-filter: blur(16px);
}

.nav {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: var(--white);
  background: var(--green);
  font-size: 14px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(15, 32, 50, 0.12);
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 15px;
}

.nav-links a {
  text-decoration: none;
  color: #28352f;
}

.nav-links a:hover,
.text-link:hover {
  color: var(--green);
}

.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  color: var(--white);
  background-color: var(--green-dark);
  background-image: url("../images/js-insights-hero.jpg");
  background-image: image-set(
    url("../images/js-insights-hero.webp") type("image/webp"),
    url("../images/js-insights-hero.jpg") type("image/jpeg")
  );
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 28, 23, 0.62);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 86px 0 78px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold-ink);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f0c26f;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: 64px;
}

h2 {
  font-size: 38px;
}

h3 {
  font-size: 23px;
}

p {
  margin: 0;
}

.hero-copy {
  max-width: 720px;
  margin-top: 22px;
  font-size: 21px;
  color: rgba(255, 255, 255, 0.9);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 720;
}

.button-primary {
  color: var(--white);
  background: var(--green);
}

.button-primary:hover {
  background: var(--green-dark);
}

.button-secondary {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.64);
  background: rgba(255, 255, 255, 0.08);
}

.button-light {
  color: var(--green);
  border-color: var(--line);
  background: var(--white);
}

.section {
  padding: 74px 0;
}

.section-tint {
  background: var(--surface);
}

.section-intro {
  padding: 46px 0;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.intro-grid,
.split,
.callout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 48px;
  align-items: center;
}

.intro-grid p:last-child,
.split p,
.callout p,
.page-lead {
  color: var(--muted);
  font-size: 18px;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 30px;
}

.section-heading h2 {
  margin-bottom: 16px;
}

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

.service-card,
.info-card,
.programme-card,
.contact-panel,
.chapter-link,
.lifeuk-question,
.lifeuk-result,
.lifeuk-error {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 10px 30px rgba(18, 31, 25, 0.06);
}

.service-card,
.info-card,
.programme-card,
.contact-panel {
  padding: 26px;
}

.service-card h3,
.info-card h3,
.programme-card h3 {
  margin: 12px 0 12px;
}

.service-card p,
.info-card p,
.programme-card p,
.contact-panel p {
  color: var(--muted);
}

.service-label {
  display: inline-flex;
  color: var(--blue);
  font-size: 13px;
  font-weight: 760;
}

.text-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--blue);
  font-weight: 760;
  text-decoration: none;
}

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

.stat-panel div {
  min-height: 136px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
  border-left: 4px solid var(--gold);
  background: var(--white);
  box-shadow: var(--shadow);
}

.stat-panel strong {
  font-size: 40px;
  line-height: 1;
}

.stat-panel span {
  margin-top: 8px;
  color: var(--muted);
}

.callout {
  padding: 34px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.site-footer {
  padding: 48px 0 30px;
  color: rgba(255, 255, 255, 0.82);
  background: var(--green-dark);
}

.page-hero {
  padding: 74px 0 52px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.page-hero .container {
  max-width: 960px;
}

.page-hero h1 {
  color: var(--ink);
  font-size: 48px;
}

.page-hero .page-lead {
  margin-top: 20px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

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

.list-clean {
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.list-clean li + li {
  margin-top: 8px;
}

.chapter-grid {
  display: grid;
  gap: 12px;
}

.chapter-link {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  text-decoration: none;
}

.chapter-link:hover {
  border-color: rgba(33, 78, 58, 0.45);
}

.chapter-number {
  color: var(--blue);
  font-weight: 760;
}

.chapter-link small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.chapter-count {
  color: var(--coral);
  font-weight: 760;
  white-space: nowrap;
}

.download-list {
  display: grid;
  gap: 12px;
}

.download-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  background: var(--white);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.note {
  color: var(--muted);
  font-size: 15px;
}

.lifeuk-shell {
  padding: 52px 0 76px;
  background: var(--surface);
}

.lifeuk-quiz__top {
  max-width: 920px;
  margin: 0 auto 24px;
}

.lifeuk-kicker {
  margin-bottom: 8px;
  color: var(--blue);
  font-weight: 760;
}

.lifeuk-quiz__top h1 {
  font-size: 44px;
}

.lifeuk-quiz__top p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 17px;
}

.lifeuk-disclaimer,
.lifeuk-note {
  padding: 12px 14px;
  border-left: 4px solid var(--gold);
  background: rgba(184, 120, 38, 0.1);
}

.lifeuk-form {
  display: grid;
  max-width: 920px;
  margin: 0 auto;
  gap: 16px;
}

.lifeuk-question {
  padding: 24px;
}

.lifeuk-question__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 760;
}

.lifeuk-question h2 {
  font-size: 24px;
}

.lifeuk-question__zh {
  margin-top: 8px;
  color: var(--muted);
}

.lifeuk-options {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.lifeuk-option {
  display: grid;
  grid-template-columns: auto 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.lifeuk-option input {
  margin-top: 4px;
}

.lifeuk-option__key {
  color: var(--green);
  font-weight: 760;
}

.lifeuk-option__text small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.lifeuk-feedback {
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface);
}

.lifeuk-feedback__status {
  font-weight: 760;
}

.lifeuk-feedback__line {
  margin-top: 8px;
}

.lifeuk-explanation p {
  margin-top: 8px;
}

.lifeuk-question.is-correct {
  border-color: rgba(33, 78, 58, 0.52);
}

.lifeuk-question.is-wrong {
  border-color: rgba(165, 78, 63, 0.58);
}

.lifeuk-result,
.lifeuk-error {
  max-width: 920px;
  margin: 0 auto 18px;
  padding: 22px;
}

.lifeuk-result h2,
.lifeuk-error h2 {
  font-size: 30px;
}

.lifeuk-score {
  margin-top: 10px;
  font-size: 34px;
  font-weight: 780;
}

.lifeuk-score span {
  color: var(--blue);
  font-size: 22px;
}

.lifeuk-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: center;
  gap: 12px;
  max-width: 920px;
  margin: 22px auto 0;
  padding: 16px 0;
  background: rgba(244, 247, 244, 0.92);
  backdrop-filter: blur(12px);
}

.lifeuk-button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  background: var(--white);
  font-weight: 760;
  cursor: pointer;
}

.lifeuk-button--primary {
  color: var(--white);
  border-color: var(--green);
  background: var(--green);
}

.lifeuk-loading {
  max-width: 920px;
  margin: 0 auto;
  color: var(--muted);
}

@media (max-width: 860px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .nav-links {
    justify-content: flex-start;
    gap: 12px;
  }

  .hero {
    min-height: auto;
  }

  .hero-content {
    padding: 72px 0 58px;
  }

  h1 {
    font-size: 46px;
  }

  h2 {
    font-size: 32px;
  }

  .hero-copy {
    font-size: 18px;
  }

  .intro-grid,
  .split,
  .callout,
  .footer-top,
  .story-grid,
  .content-grid,
  .wide-grid,
  .service-grid {
    grid-template-columns: 1fr;
  }

  .stat-panel {
    grid-template-columns: 1fr;
  }

  .chapter-link,
  .download-row {
    grid-template-columns: 1fr;
  }

  .chapter-count,
  .download-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 540px) {
  .container {
    width: min(100% - 28px, 1120px);
  }

  h1,
  .page-hero h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 28px;
  }

  .section {
    padding: 54px 0;
  }

  .button,
  .button-row {
    width: 100%;
  }

  .lifeuk-question {
    padding: 18px;
  }

  .lifeuk-question__meta {
    flex-direction: column;
  }

  .lifeuk-option {
    grid-template-columns: auto 26px minmax(0, 1fr);
  }

  .lifeuk-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* ====================================================================
   Redesign additions: bilingual helpers, tags, breadcrumb, story,
   noscript, prose, accessibility, and the unified footer.
   ==================================================================== */

/* Accessibility: skip link + active nav */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 50;
  padding: 10px 14px;
  border-radius: 0 0 8px 0;
  color: var(--white);
  background: var(--green);
  font-weight: 760;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

.nav-links a[aria-current="page"] {
  color: var(--green);
  font-weight: 760;
}

a:focus-visible,
button:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Bilingual text */
.hero-zh {
  max-width: 740px;
  margin-top: 16px;
  font-size: 23px;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.92);
}
.heading-zh {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.35;
}
.page-hero .heading-zh { font-size: 24px; }
.zh-text {
  margin-top: 10px;
  color: var(--muted);
}
.eyebrow .eyebrow-zh {
  margin-left: 8px;
  color: inherit;
  opacity: 0.8;
  font-weight: 700;
}

/* Status tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.02em;
}
.tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.tag--now { color: var(--green); background: rgba(33, 78, 58, 0.1); }
.tag--dev { color: var(--blue); background: rgba(49, 91, 120, 0.1); }

.card-title-zh {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

/* Breadcrumb */
.breadcrumb-bar {
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.breadcrumb {
  padding: 13px 0;
  font-size: 14px;
  color: var(--muted);
}
.breadcrumb a { color: var(--blue); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 8px; color: var(--line); }

/* Story: two-column EN / ZH */
.story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.story-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 10px 30px rgba(18, 31, 25, 0.06);
}
.story-card .eyebrow { margin-bottom: 10px; }
.story-card h3 { margin-bottom: 8px; }
.story-card p { margin-top: 12px; color: var(--muted); }

/* Note / register card */
.note-card {
  display: grid;
  gap: 8px;
  max-width: 920px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: rgba(184, 120, 38, 0.06);
}
.note-card h3 { margin-bottom: 4px; }
.note-card p { color: var(--muted); }
.note-card .text-link { margin-top: 10px; }

/* noscript fallback */
.noscript-note {
  margin: 24px auto;
  max-width: 920px;
  padding: 16px 18px;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: rgba(184, 120, 38, 0.1);
}
.noscript-note p { color: var(--ink); }
.noscript-note p + p { margin-top: 8px; color: var(--muted); }

/* Prose: privacy / legal */
.prose { max-width: 760px; }
.prose h2 { font-size: 23px; margin-top: 34px; margin-bottom: 10px; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin-top: 8px; color: var(--muted); }
.prose a { color: var(--blue); font-weight: 600; }

/* Unified footer */
.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 32px;
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 760;
  text-decoration: none;
}
.footer-logo img { width: 40px; height: 40px; border-radius: 8px; }
.footer-tagline {
  margin-top: 14px;
  max-width: 44ch;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.78);
}
.footer-tagline[lang="zh"] { margin-top: 6px; color: rgba(255, 255, 255, 0.6); }
.footer-col-title {
  display: block;
  margin-bottom: 10px;
  color: var(--white);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.footer-links { display: flex; flex-direction: column; gap: 9px; font-size: 14px; }
.footer-links a { color: rgba(255, 255, 255, 0.8); text-decoration: none; }
.footer-links a:hover { color: var(--white); text-decoration: underline; }
.footer-legal {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.72);
}
.footer-bottom { padding-top: 22px; }
.footer-disclaimer {
  max-width: 104ch;
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
}
.footer-disclaimer[lang="zh"] { margin-top: 6px; }
.footer-copyright { margin-top: 16px; font-size: 12.5px; color: rgba(255, 255, 255, 0.5); }

@media (max-width: 860px) {
  .footer-top { grid-template-columns: 1fr; gap: 26px; }
  .story-grid { grid-template-columns: 1fr; }
}

/* ====================================================================
   Founder credibility: credentials strip + director/founder profiles
   ==================================================================== */

.cred-strip {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
}
.cred-strip li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.cred-strip li::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

.profile {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
.profile + .profile {
  margin-top: 36px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}
.profile-avatar {
  width: 128px;
  height: 128px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--green-dark);
  color: #cfe0d7;
  font-weight: 760;
  font-size: 40px;
  letter-spacing: 2px;
  box-shadow: var(--shadow);
}
.profile h3 { font-size: 26px; }
.profile-role { margin-top: 4px; color: var(--blue); font-weight: 760; }
.profile-role-zh { color: var(--muted); font-weight: 600; }
.profile-body p { color: var(--muted); }
.profile-body p + p { margin-top: 10px; }
.profile-body .text-link { margin-top: 14px; }

@media (max-width: 860px) {
  .profile { grid-template-columns: 1fr; gap: 16px; }
  .profile-avatar { width: 84px; height: 84px; font-size: 26px; border-radius: 10px; }
}
