/* TPC waitlist site (pre-launch). Tokens follow brand-taste.md: teal for the TPC lockup and headings,
   the Academy colours (navy, sky, coral, gold) for game and product accents. */
:root {
  color-scheme: light;
  --teal: #2B6278;
  --teal-dark: #1D4654;
  --navy: #0B3558;
  --deep: #0E5B88;
  --sky: #50B9E5;
  --sky-pale: #EAF5FB;
  --coral: #FE6B52;
  --gold: #FECA61;
  --cream: #FFF6DC;
  --ink: #1F2A30;
  --muted: #55656C;
  --rule: #D6E1E5;
  --white: #FFFFFF;
  --err: #C8371D;

  --zh: "Noto Sans HK", "PingFang HK", "Heiti TC", sans-serif;
  --ui: "Rubik", "Noto Sans HK", system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1160px;
  --radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--white); color: var(--ink); font: 400 17px/1.7 var(--zh); overflow-x: hidden; }
img, video, svg { display: block; max-width: 100%; }
a { color: var(--deep); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; color: var(--teal); text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.kicker { font: 600 13px/1 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--coral); margin-bottom: 14px; }
.shead { display: grid; gap: 12px; max-width: 46rem; margin-bottom: clamp(28px, 4vw, 44px); }
.shead h2 { font: 900 clamp(28px, 4vw, 40px)/1.25 var(--zh); }
.shead p { color: var(--muted); }
section { padding-block: clamp(56px, 8vw, 104px); }
.band-pale { background: var(--sky-pale); }
.band-cream { background: var(--cream); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 26px; border-radius: 999px;
  font: 700 17px/1 var(--zh); text-decoration: none; border: 0; cursor: pointer; transition: transform .15s ease, background-color .15s ease; }
.btn.gold { background: var(--gold); color: var(--navy); }
.btn.gold:hover { background: #FFD982; }
.btn.line { background: transparent; color: var(--teal); box-shadow: inset 0 0 0 2px var(--teal); }
.btn.line:hover { background: rgba(43, 98, 120, .06); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.top.scrolled { border-bottom-color: var(--rule); }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.top .logo img { height: 40px; width: auto; }
.top nav { margin-left: auto; display: flex; gap: 22px; }
.top nav a { color: var(--ink); text-decoration: none; font: 500 15px/1 var(--zh); }
.top nav a:hover { color: var(--teal); }
.top .btn { min-height: 44px; padding: 0 20px; font-size: 15px; }
@media (max-width: 900px) { .top nav { display: none; } .top .btn { margin-left: auto; } }
@media (max-width: 420px) { .top .logo img { height: 32px; } .top .btn { padding: 0 14px; font-size: 14px; } }

/* ---------- hero ---------- */
.hero { padding-block: clamp(32px, 6vw, 72px) clamp(48px, 7vw, 88px); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: clamp(24px, 4vw, 56px); }
.hero h1 { font: 900 clamp(38px, 5.2vw, 66px)/1.15 var(--zh); letter-spacing: .01em; }
.hero h1 span { display: block; white-space: nowrap; }
.hero .lead { margin-top: 20px; font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); max-width: 30em; }
.hero .badge { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 8px 14px; border-radius: 999px;
  background: var(--cream); color: var(--navy); font: 700 14px/1 var(--zh); }
.hero .badge i { width: 9px; height: 9px; border-radius: 50%; background: var(--coral); }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero .art { aspect-ratio: 16 / 10; }
.hero .art img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero .art { order: -1; margin-inline: calc(var(--gutter) * -0.5); }
}

/* ---------- game worlds ---------- */
.worlds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 28px); list-style: none; margin: 0; padding: 0; }
.world { display: grid; grid-template-rows: auto 1fr; background: var(--white); border-radius: var(--radius); overflow: hidden; }
.world .media { position: relative; aspect-ratio: 16 / 9; background: var(--navy); }
.world .media img, .world .media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.world .media video { opacity: 0; transition: opacity .3s; }
.world .media video.on { opacity: 1; }
.world .body { padding: 20px 22px 24px; display: grid; gap: 8px; align-content: start; }
.world h3 { font: 900 21px/1.35 var(--zh); }
.world p { color: var(--muted); font-size: 16px; }
@media (max-width: 900px) { .worlds { grid-template-columns: 1fr; max-width: 560px; } }

/* ---------- how it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; gap: 10px; align-content: start; }
.steps svg { width: 72px; height: 72px; margin-bottom: 6px; }
.steps h3 { font: 900 22px/1.35 var(--zh); }
.steps p { color: var(--muted); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } .steps li { grid-template-columns: 64px 1fr; column-gap: 16px; } .steps svg { width: 56px; height: 56px; grid-row: span 2; } }

/* ---------- beta + waitlist ---------- */
.beta .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.beta .shead { margin-bottom: 0; }
.beta .facts { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; }
.beta .facts li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.beta .facts svg { width: 24px; height: 24px; margin-top: 4px; }
.beta .small { margin-top: 20px; font-size: 15px; color: var(--muted); }
@media (max-width: 860px) { .beta .wrap { grid-template-columns: 1fr; } }

.form-card { background: var(--white); border-radius: 24px; padding: clamp(22px, 3.4vw, 36px); box-shadow: 0 0 0 1px var(--rule); }
.form-card h3 { font: 900 24px/1.3 var(--zh); margin-bottom: 18px; }
.field { display: grid; gap: 8px; margin-bottom: 20px; border: 0; padding: 0; min-width: 0; }
.field > label, .field legend { font: 700 16px/1.4 var(--zh); color: var(--ink); padding: 0; }
.field .req { color: var(--coral); font-weight: 700; margin-left: 2px; }
.field input[type=email], .field input[type=text], .field select {
  width: 100%; min-height: 52px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--rule); background: var(--white);
  font: 400 17px/1.4 var(--zh); color: var(--ink); appearance: none; -webkit-appearance: none; }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%232B6278' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 12px 8px; padding-right: 40px; }
.field input:focus, .field select:focus { border-color: var(--sky); outline: none; box-shadow: 0 0 0 3px rgba(80, 185, 229, .3); }
.field[data-error] input, .field[data-error] select { border-color: var(--err); }
.field .msg { display: none; color: var(--err); font-size: 14px; }
.field[data-error] .msg { display: block; }
.grades { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grades label { position: relative; }
.grades input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.grades span { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 12px; border: 1.5px solid var(--rule);
  font: 700 17px/1 var(--zh); color: var(--ink); transition: background-color .15s, border-color .15s; }
.grades input:checked + span { background: var(--sky-pale); border-color: var(--deep); color: var(--navy); }
.grades input:focus-visible + span { box-shadow: 0 0 0 3px rgba(80, 185, 229, .4); }
.field[data-error] .grades span { border-color: var(--err); }
.consent { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; margin-bottom: 18px; font-size: 16px; cursor: pointer; }
.consent input { width: 22px; height: 22px; margin: 3px 0 0; accent-color: var(--deep); }
.pics { font-size: 13.5px; line-height: 1.7; color: var(--muted); margin-bottom: 20px; }
.form-card .btn { width: 100%; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.status { margin-top: 14px; font-size: 15px; color: var(--err); min-height: 1em; }
.done { display: grid; gap: 12px; justify-items: start; }
.done svg { width: 56px; height: 56px; }
.done h3 { margin: 0; }
.done p { color: var(--muted); }

/* ---------- TPC Live ---------- */
.live .wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: center; }
.live svg { width: clamp(88px, 12vw, 132px); height: auto; }
.live h2 { font: 900 clamp(26px, 3.4vw, 34px)/1.3 var(--zh); margin-bottom: 12px; }
.live p { color: var(--muted); max-width: 40em; }
@media (max-width: 600px) { .live .wrap { grid-template-columns: 1fr; } }

/* ---------- join ---------- */
.join-teaser .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; }
.join-teaser h2 { font: 900 clamp(24px, 3vw, 30px)/1.3 var(--zh); margin-bottom: 8px; }
.join-teaser p { color: var(--muted); max-width: 38em; }

/* ---------- FAQ ---------- */
.faq { max-width: 52rem; display: grid; gap: 12px; }
.faq details { background: var(--white); border-radius: 14px; box-shadow: 0 0 0 1px var(--rule); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 56px 18px 22px; position: relative; font: 700 17px/1.5 var(--zh); color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 22px; top: 50%; width: 12px; height: 12px; margin-top: -8px;
  border-right: 2.5px solid var(--teal); border-bottom: 2.5px solid var(--teal); transform: rotate(45deg); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq details p { padding: 0 22px 20px; color: var(--muted); }

/* ---------- footer ---------- */
.foot { background: var(--teal-dark); color: rgba(255, 255, 255, .86); padding-block: 48px 36px; font-size: 15px; }
.foot .wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 32px; }
.foot img { height: 40px; width: auto; margin-bottom: 14px; }
.foot h4 { margin: 0 0 10px; font: 700 15px/1.4 var(--zh); color: var(--white); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot a { color: rgba(255, 255, 255, .86); text-decoration: none; }
.foot a:hover { color: var(--white); text-decoration: underline; }
.foot .legal { grid-column: 1 / -1; border-top: 1px solid rgba(255, 255, 255, .16); padding-top: 20px; font-size: 13px; color: rgba(255, 255, 255, .6); }
@media (max-width: 700px) { .foot .wrap { grid-template-columns: 1fr 1fr; } .foot .brand { grid-column: 1 / -1; } }

/* ---------- inner pages (join, privacy) ---------- */
.page { padding-block: clamp(40px, 6vw, 80px) clamp(64px, 8vw, 104px); }
.page .wrap { max-width: 780px; }
.page h1 { font: 900 clamp(32px, 5vw, 48px)/1.25 var(--zh); margin-bottom: 20px; }
.page h2 { font: 900 22px/1.4 var(--zh); margin: 36px 0 10px; }
.page p, .page li { color: var(--ink); }
.page ul { padding-left: 1.2em; display: grid; gap: 6px; }
.page .note { margin-top: 36px; padding: 18px 20px; border-radius: 14px; background: var(--sky-pale); }

/* private-preview ribbon (removed at launch) */
.preview-ribbon { background: var(--navy); color: var(--white); text-align: center; font: 500 13px/1.4 var(--zh); padding: 8px var(--gutter); }

/* inner pages follow the homepage chrome (lockup-en, teal nav, gold pill with an arrow) */
.top .logo img { height: 40px; }
.top nav a { color: var(--teal); font: 500 14px/1 var(--ui); }
.top .btn.gold::after, .page .btn::after { content: "→"; font-weight: 500; }
.top .btn { font: 600 15px/1 var(--ui); color: var(--ink); background: #FFD368; }
.foot .wrap { grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); }
.foot p { margin: 0; line-height: 1.7; }
.page .en-title { margin: -8px 0 18px; font: 600 17px/1.4 var(--ui); color: var(--muted); }
.page .meta { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.page .meta li { padding: 6px 12px; border-radius: 999px; background: var(--sky-pale); color: var(--navy); font: 700 14px/1.2 var(--zh); }
.page .muted { color: var(--muted); font-size: 15px; }

/* careers page (Kelvin 10/16: HKU NETjobs needs a recognisable career page; bilingual, employer name as registered) */
.page.careers .wrap { max-width: 1000px; }
.page .h1-en, .page .h2-en, .page .h3-en { margin-left: .45em; font-family: var(--ui); font-weight: 500; color: var(--muted); font-size: .7em; }
.page h3 .h3-en, .page h2 .h2-en { font-size: .8em; }
.page h3 { font: 900 19px/1.4 var(--zh); margin: 30px 0 10px; }
.page .bi { display: grid; grid-template-columns: 1fr; gap: 6px 40px; }
.page .bi > * { margin: 0; }
@media (min-width: 760px) { .page .bi { grid-template-columns: 1fr 1fr; } }
.page .bi { align-items: start; }
.page .bi ul { align-content: start; }
.page .lead p { font-size: 17px; line-height: 1.75; }
.page .job { display: grid; gap: 4px; padding: 20px 22px; border-radius: 16px; background: var(--sky-pale); color: var(--ink); text-decoration: none; }
.page .job:hover { outline: 2px solid var(--teal); }
.page .job-t { font: 900 20px/1.35 var(--zh); color: var(--navy); }
.page .job-en { font: 600 16px/1.4 var(--ui); color: var(--navy); }
.page .job-m { font-size: 14px; color: var(--muted); }
.page .role { margin-top: 56px; padding-top: 40px; border-top: 1px solid rgba(29, 70, 84, .14); }
.page .role-h { font: 900 clamp(26px, 4vw, 34px)/1.3 var(--zh); margin: 0 0 16px; }
.page .facts { display: grid; gap: 10px; margin: 18px 0 0; }
.page .facts div { display: grid; grid-template-columns: 9em 1fr; gap: 12px; }
.page .facts dt { font-weight: 700; color: var(--navy); }
.page .facts dd { margin: 0; }
@media (max-width: 520px) { .page .facts div { grid-template-columns: 1fr; gap: 2px; } }
.page .note.bi { display: grid; }
.page ul.pair { padding-left: 0; list-style: none; gap: 0; }
.page .pair li { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 9px 0 9px 1.2em; position: relative; border-top: 1px solid rgba(29, 70, 84, .08); }
.page .pair li:first-child { border-top: 0; }
.page .pair li::before { content: ""; position: absolute; left: 2px; top: 1.15em; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.page .pair [lang="en"] { color: var(--muted); font-size: 15px; }
@media (min-width: 760px) { .page .pair li { grid-template-columns: 1fr 1fr; gap: 40px; } .page .pair [lang="en"] { color: var(--ink); font-size: inherit; } }
.page .bi.example { margin-top: 18px; padding: 18px 20px; border-radius: 14px; background: #FFF6DE; }
.page .bi.closing { margin-top: 24px; }
.page .pair b { color: var(--navy); }

/* careers motion (Kelvin 10/17): the homepage's entrance, set by app.js only when JS runs; a light drift on the steps */
.cmo { opacity: 0; transform: translateY(22px); transition: opacity .55s ease-out var(--d, 0ms), transform .8s cubic-bezier(.2, .8, .2, 1) var(--d, 0ms); }
.cmo.in { opacity: 1; transform: none; }
.page.careers .wrap { position: relative; }
.c-steps { position: absolute; top: 4px; right: 0; width: 120px; height: 72px; translate: 0 calc(var(--q, 0) * -24px); }
.c-steps circle { translate: 0 calc(var(--q, 0) * -30px); }
@media (max-width: 520px) { .c-steps { width: 76px; height: 46px; } }
@media (prefers-reduced-motion: reduce) { .cmo { opacity: 1 !important; transform: none !important; transition: none !important; } .c-steps, .c-steps circle { translate: none; } }

/* careers v2 (Max 10/17: industry-standard page; the full JD lives in the ad) */
.page .job { gap: 10px; }
.page .job .job-t { margin: 0; } .page .job .job-en { margin: 0; }
.page .job .meta { margin: 4px 0 2px; } .page .job .meta li { background: #fff; }
.page .job .bi p { color: var(--ink); } .page .job .req p { font-size: 15px; color: var(--muted); }
.page article.job:hover { outline: none; }
