/* =================================================================
   CityUHK AI 醫院 — public landing page
   Editorial Civic aesthetic: cream + CityU red, Fraunces + Noto Serif HK
   ================================================================= */

:root {
  /* Surface */
  --cream:           #f5f0e8;
  --cream-soft:      #faf5ed;
  --card:            #ffffff;

  /* Ink */
  --ink:             #1a1a1a;
  --ink-soft:        #2a2a2a;
  --muted:           #4a4a4a;
  --muted-2:         rgba(26, 26, 26, 0.55);
  --muted-3:         rgba(26, 26, 26, 0.35);

  /* Lines */
  --hairline:        rgba(26, 26, 26, 0.12);
  --hairline-strong: rgba(26, 26, 26, 0.32);

  /* Brand */
  --red:             #c8102e;
  --red-deep:        #a30c25;
  --orange:          #f15a29;
  --whatsapp:        #25D366;

  /* Type — one unified sans family, Inter + Noto Sans HK pairing.
     Inter handles Latin; Noto Sans HK (then PingFang HK on Apple) handles CJK.
     Same stack drives both display and body — hierarchy comes from weight + size. */
  --font-display:    "Inter", "Noto Sans HK", "Noto Sans TC", "PingFang HK", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-body:       "Inter", "Noto Sans HK", "Noto Sans TC", "PingFang HK", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono-nums:  "Inter", ui-monospace, sans-serif;

  /* Rhythm — 8px base */
  --s-1:  8px;
  --s-2:  16px;
  --s-3:  24px;
  --s-4:  32px;
  --s-5:  48px;
  --s-6:  64px;
  --s-7:  80px;
  --s-8:  96px;
  --s-9:  128px;

  /* Container widths */
  --page-max:        1120px;
  --read-max:        720px;
  --pad-x:           24px;

  /* Motion */
  --ease:            cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (min-width: 720px)  { :root { --pad-x: 48px; } }
@media (min-width: 1120px) { :root { --pad-x: 80px; } }

/* =================================================================
   Reset
   ================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ol, ul, li, figure, blockquote {
  margin: 0;
  padding: 0;
}
ol, ul { list-style: none; }
img { max-width: 100%; display: block; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }

/* =================================================================
   Body shell
   ================================================================= */
body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern", "liga", "calt";

  /* Two soft radial accents — borrowed from the poster, dialed down */
  background-image:
    radial-gradient(circle at 92% 4%,  rgba(241, 90, 41, 0.10) 0,  transparent 38%),
    radial-gradient(circle at 6%  98%, rgba(200, 16, 46, 0.08) 0,  transparent 36%);
  background-attachment: fixed;
  min-height: 100vh;
}

html[lang^="en"] body { letter-spacing: 0.005em; }

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--cream);
  padding: 8px 12px;
  z-index: 100;
}
.skip-link:focus { left: 16px; top: 16px; }

/* =================================================================
   Header
   ================================================================= */
.site-header {
  border-bottom: 1px solid var(--hairline);
  background: rgba(245, 240, 232, 0.85);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 16px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  transition: opacity 200ms var(--ease);
}
.brand:hover { opacity: 0.7; }

.brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.brand-wordmark {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.005em;
}

/* Language toggle — typographer's three-state switch */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--muted);
  user-select: none;
}

.lang-btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 4px 2px;
  border-bottom: 1.5px solid transparent;
  transition: color 180ms var(--ease), border-color 180ms var(--ease);
  line-height: 1.2;
}
.lang-btn:hover { color: var(--ink); }
.lang-btn[aria-current="true"] {
  color: var(--red);
  border-bottom-color: var(--red);
  font-weight: 500;
}

.lang-sep {
  color: var(--muted-3);
  font-size: 13px;
}

/* =================================================================
   Main + section scaffolding
   ================================================================= */
main {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

section + section { margin-top: clamp(72px, 10vw, 128px); }
main > section:first-child { padding-top: clamp(56px, 8vw, 96px); }

/* Section header (eyebrow + title) — sits in left rail */
.section-head {
  display: grid;
  gap: 12px;
  margin-bottom: clamp(32px, 5vw, 56px);
  max-width: var(--read-max);
}

.section-rule {
  display: block;
  width: 40px;
  height: 1px;
  background: var(--ink);
}

.section-eyebrow {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

html[lang^="zh"] .section-eyebrow {
  text-transform: none;
  letter-spacing: 0.12em;
  font-size: 13px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.22;
  letter-spacing: -0.018em;
  color: var(--ink);
}

html[lang^="zh"] .section-title {
  font-weight: 600;
  letter-spacing: -0.005em;
}

/* =================================================================
   Hero
   ================================================================= */
.hero {
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 5vw, 40px);
}

@media (min-width: 920px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
    grid-template-rows: auto auto;
    column-gap: clamp(48px, 6vw, 88px);
    row-gap: 36px;
    align-items: start;
  }
  .hero-top    { grid-column: 1; grid-row: 1; }
  .hero-bottom { grid-column: 1; grid-row: 2; }
  .qr-card     { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
  position: relative;
  padding-left: 56px;
}
.hero-eyebrow::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 40px;
  height: 1px;
  background: var(--ink);
}
html[lang^="zh"] .hero-eyebrow {
  text-transform: none;
  letter-spacing: 0.12em;
  font-size: 13px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 5.4vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.028em;
  color: var(--ink);
}

html[lang^="zh"] .hero-title {
  font-weight: 700;
  font-size: clamp(32px, 4.8vw, 56px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.hero-bottom { display: grid; gap: 22px; max-width: 580px; }

.hero-intro {
  font-family: var(--font-body);
  font-size: clamp(15px, 1.7vw, 17px);
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: 520px;
}

/* =================================================================
   QR card
   ================================================================= */
.qr-card {
  background: var(--card);
  border: 1px solid var(--hairline-strong);
  border-radius: 4px;
  padding: clamp(24px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 360px;
  margin: 0 auto;
  width: 100%;
  position: relative;
}

/* Tiny corner ticks — newsprint frame detail */
.qr-card::before,
.qr-card::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--ink);
}
.qr-card::before {
  top: -1px;
  left: -1px;
  border-right: 0;
  border-bottom: 0;
}
.qr-card::after {
  bottom: -1px;
  right: -1px;
  border-left: 0;
  border-top: 0;
}

.qr-label {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
html[lang^="zh"] .qr-label {
  text-transform: none;
  letter-spacing: 0.1em;
  font-size: 13px;
}

.qr-frame {
  padding: 12px;
  background: white;
  border: 1px solid var(--hairline);
  border-radius: 2px;
}

.qr-image {
  width: 200px;
  height: 200px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.qr-phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.qr-phone-icon { width: 18px; height: 18px; }

.qr-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: var(--whatsapp);
  color: white;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: background 180ms var(--ease), transform 180ms var(--ease);
  margin-top: 4px;
}
.qr-cta:hover {
  background: #1ebd5b;
  transform: translateY(-1px);
}

/* =================================================================
   Pillars
   ================================================================= */
.pillar-list {
  display: grid;
  gap: 0;
  max-width: var(--read-max);
}

.pillar {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 24px;
  row-gap: 6px;
  padding: 28px 0;
  border-bottom: 1px solid var(--hairline);
  align-items: baseline;
}
.pillar:first-child { border-top: 1px solid var(--hairline); }

.pillar-num {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--red);
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

.pillar-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(19px, 2vw, 22px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
  grid-column: 2;
}

.pillar-body {
  grid-column: 2;
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 540px;
}

/* =================================================================
   About
   ================================================================= */
.about-body {
  font-family: var(--font-body);
  font-size: clamp(16px, 1.8vw, 18px);
  line-height: 1.78;
  color: var(--ink-soft);
  max-width: var(--read-max);
}

.about-logos {
  margin-top: clamp(36px, 5vw, 56px);
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 40px);
  flex-wrap: wrap;
}

.partner-logo {
  width: auto;
  object-fit: contain;
  filter: saturate(0.92);
}

/* Visually balance the two partner marks: CityU is a square emblem, Mycoach
   is a landscape wordmark. Match their visual mass (area + horizontal weight)
   rather than just matching height. */
.partner-cityu   { height: 72px; }
.partner-mycoach { height: 28px; }

@media (min-width: 720px) {
  .partner-cityu   { height: 88px; }
  .partner-mycoach { height: 32px; }
}

.logo-sep {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 300;
  color: var(--muted-3);
}

/* =================================================================
   Trust
   ================================================================= */
.trust-list {
  display: grid;
  gap: 0;
  max-width: var(--read-max);
}

.trust-item {
  padding: 24px 0;
  border-bottom: 1px solid var(--hairline);
  position: relative;
  padding-left: 32px;
}
.trust-item:first-child { border-top: 1px solid var(--hairline); }

.trust-item::before {
  content: "—";
  position: absolute;
  left: 0;
  top: 24px;
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--red);
}

.trust-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(17px, 1.9vw, 20px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 8px;
}

.trust-body {
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 580px;
}

/* =================================================================
   Closing
   ================================================================= */
.closing {
  text-align: center;
  padding: clamp(48px, 8vw, 96px) 0;
  border-top: 1px solid var(--hairline);
  margin-top: clamp(72px, 10vw, 128px) !important;
}

.closing-quote {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(22px, 2.8vw, 30px);
  line-height: 1.35;
  color: var(--ink);
  max-width: 720px;
  margin: 0 auto 32px;
  letter-spacing: -0.018em;
}
html[lang^="zh"] .closing-quote {
  letter-spacing: -0.005em;
}

.closing-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: background 200ms var(--ease), transform 200ms var(--ease);
}
.closing-cta:hover {
  background: var(--red);
  transform: translateY(-1px);
}

/* =================================================================
   Footer
   ================================================================= */
.site-footer {
  margin-top: clamp(48px, 6vw, 72px) !important;
  border-top: 1px solid var(--hairline);
  background: rgba(0, 0, 0, 0.015);
}

.footer-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 36px var(--pad-x);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.footer-left { display: grid; gap: 8px; }
.footer-right { display: inline-flex; align-items: center; gap: 20px; }

.footer-copy {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.footer-support {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.footer-support-label {
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 11.5px;
  color: var(--muted-2);
}
html[lang^="zh"] .footer-support-label {
  text-transform: none;
  letter-spacing: 0.05em;
  font-size: 12px;
}

.footer-email {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--hairline-strong);
  transition: color 180ms var(--ease), border-color 180ms var(--ease);
}
.footer-email:hover {
  color: var(--red);
  border-bottom-color: var(--red);
}

.pilot-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: linear-gradient(95deg, var(--orange), var(--red));
  color: white;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.console-link {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  transition: color 180ms var(--ease);
}
.console-link:hover { color: var(--ink); }

/* =================================================================
   Stagger-in motion (load-time only, respects reduce-motion)
   ================================================================= */
.stagger {
  opacity: 0;
  transform: translateY(8px);
  animation: rise 700ms var(--ease) forwards;
}

.stagger[data-stagger="0"] { animation-delay: 40ms; }
.stagger[data-stagger="1"] { animation-delay: 180ms; }
.stagger[data-stagger="2"] { animation-delay: 280ms; }
.stagger[data-stagger="3"] { animation-delay: 360ms; }
.stagger[data-stagger="4"] { animation-delay: 440ms; }
.stagger[data-stagger="5"] { animation-delay: 520ms; }

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Language-toggle cross-fade */
body.lang-switching .stagger {
  animation: none;
  opacity: 1;
  transform: none;
}
[data-i18n], [data-i18n-html] {
  transition: opacity 180ms var(--ease);
}
body.lang-switching [data-i18n],
body.lang-switching [data-i18n-html] {
  opacity: 0.25;
}

@media (prefers-reduced-motion: reduce) {
  .stagger {
    opacity: 1;
    transform: none;
    animation: none;
  }
  [data-i18n], [data-i18n-html] { transition: none; }
  .qr-cta:hover,
  .closing-cta:hover,
  .footer-email:hover { transform: none; }
}

/* =================================================================
   Selection / focus
   ================================================================= */
::selection { background: var(--red); color: var(--cream); }

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

/* Mobile fine-tune */
@media (max-width: 720px) {
  .header-inner { padding: 12px var(--pad-x); }
  .brand-wordmark { font-size: 15px; }
  .hero-eyebrow { padding-left: 0; }
  .hero-eyebrow::before { display: none; }
  .qr-image { width: 220px; height: 220px; }
  .closing-quote br { display: none; }
}
