/* ---------- Home page (/), the group page. Every class starts with hm-; build.py PAGE_CSS links this file
   on pages that use them, between base.css and top.css. Reuses site classes (sec, card, disc, more, logos).
   Motion: transform and opacity only, runs only with html.motion while on screen (src/js/home.js adds
   .is-run), and is still with reduced motion. */

/* Client logos sit right under the video hero. */
.sec.hm-clients { padding-top: clamp(48px, 7vw, 88px); }

/* ---------- Three disciplines: every focus chip is a link; "Explore" links line up at the bottom. */
.hm-discs .disc { grid-template-rows: auto auto auto 1fr auto; align-content: stretch; }
.hm-discs .disc__focus { align-content: flex-start; }
.hm-discs .disc__focus li:has(a) { padding: 0; transition: background-color 0.15s, box-shadow 0.15s; }
.hm-discs .disc__focus a { display: block; padding: 8px 12px; border-radius: inherit; }
.hm-discs .disc__focus li:has(a):hover { background: var(--sun); box-shadow: inset 0 0 0 1.5px var(--sun-deep); }
.hm-discs .disc__focus li:has(a):hover a { color: var(--on-sun); }
.hm-discs .disc__focus a:focus-visible { outline: 2px solid var(--gold-line); outline-offset: 2px; }
@media (pointer: coarse) { .hm-discs .disc__focus a { display: flex; align-items: center; min-height: 40px; padding: 8px 14px; } }

/* ---------- One system behind every discipline */
.hm-key { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin: 0; }
.hm-key span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: var(--radius-pill); background: var(--panel); font: 600 13.5px/1 var(--font-body); color: var(--ink-2); }
:root[data-theme="light"] .hm-key span { box-shadow: 0 0 0 1px var(--line); }
/* Discipline marks: the medal colours from the cards above, with the initial, so colour is never the only cue. */
.hm-dot { display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 50%; font: 700 9.5px/1 var(--font-body); font-style: normal; letter-spacing: 0; box-shadow: inset 0 0 0 1px rgba(22, 24, 29, 0.14); }
.hm-dot--p { background: linear-gradient(135deg, var(--sun), var(--sun-deep)); color: var(--on-sun); }
.hm-dot--e { background: linear-gradient(135deg, var(--gold-1), var(--gold-2)); color: var(--gold-ink); }
.hm-dot--c { background: linear-gradient(135deg, var(--chrome-1), var(--chrome-2)); color: var(--chrome-ink); }
.hm-dot--p::before { content: "P"; }
.hm-dot--e::before { content: "E"; }
.hm-dot--c::before { content: "C"; }

/* The track: four numbered nodes on a hairline, a gold pulse travelling along it, a loop at the end. */
.hm-track { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2vw, 24px); align-items: center; height: 44px; margin-bottom: 18px; padding-right: 44px; overflow: hidden; }
.hm-track::before { content: ""; position: absolute; left: 22px; right: 22px; top: 50%; height: 2px; margin-top: -1px; border-radius: 2px; background: var(--line-2); }
.hm-track__pulse { position: absolute; left: 0; top: 50%; width: 22%; height: 2px; margin-top: -1px; border-radius: 2px; opacity: 0;
  background: linear-gradient(90deg, transparent, var(--gold-2) 40%, var(--sun) 70%, transparent); }
.hm-node { position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--gold-grad); color: var(--gold-ink); font: 700 14px/1 var(--font-body); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.hm-node::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; box-shadow: 0 0 0 2px var(--gold-line), 0 0 18px 2px rgba(212, 166, 72, 0.45); opacity: 0; }
.hm-track__end { position: absolute; right: 0; top: 50%; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%; background: var(--panel); box-shadow: inset 0 0 0 1.5px var(--gold-line); color: var(--accent-text); }
.hm-track__end svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.hm-stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2vw, 24px); }
.card.hm-stage { position: relative; gap: 10px; padding: clamp(22px, 2.2vw, 28px); }
.hm-stage::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 2px var(--gold-line); opacity: 0; }
.hm-stage__n { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--gold-soft); color: var(--accent-text); font-size: 21px; }
.hm-stage__k { display: none; }
.hm-stage__h { font: 700 22px/1.2 var(--font-body); letter-spacing: -0.02em; color: var(--ink); margin-top: 4px; }
.hm-stage__p { font: 400 15px/1.5 var(--font-body); color: var(--ink-2); }
.hm-svcs { list-style: none; margin: 6px 0 0; padding: 0; display: grid; border-top: 1px solid var(--line); }
.hm-svcs li { border-bottom: 1px solid var(--line); }
.hm-svcs a { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 9px 2px; color: var(--ink); text-decoration: none; font: 600 15px/1.3 var(--font-body); letter-spacing: -0.01em; }
.hm-svc__t { flex: 1; min-width: 0; transition: color 0.15s; }
.hm-dots { display: inline-flex; gap: 2px; flex: none; }
.hm-svc__go { flex: none; font-size: 16px; color: var(--muted); transform: rotate(-90deg); transition: transform 0.15s, color 0.15s; }
.hm-svcs a:hover .hm-svc__t, .hm-svcs a:hover .hm-svc__go { color: var(--accent-text); }
.hm-svcs a:hover .hm-svc__go { transform: translateX(3px) rotate(-90deg); }
.hm-svcs a:focus-visible { outline: 2px solid var(--gold-line); outline-offset: 2px; border-radius: 6px; }
.hm-stage__loop { display: flex; align-items: flex-start; gap: 8px; margin-top: auto; padding-top: 10px; font: 500 13.5px/1.45 var(--font-body); color: var(--ink-2); }
.hm-stage__loop svg { flex: none; width: 18px; height: 18px; margin-top: 1px; fill: none; stroke: var(--accent-text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.hm-sys__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: clamp(16px, 2vw, 24px); padding: 16px 22px; border-radius: var(--radius-card); background: var(--gold-soft); box-shadow: inset 3px 0 0 var(--gold-line); }
.hm-sys__foot .psg-disk { width: 42px; height: 42px; font-size: 20px; }
.hm-sys__foot p { flex: 1 1 280px; margin: 0; font: 400 16px/1.5 var(--font-body); color: var(--ink-2); }
.hm-sys__foot p b { color: var(--ink); font-weight: 700; }

/* Pulse and lit stages: one 8s cycle; node n lights as the pulse passes it, and its card holds the glow a little longer. */
html.motion .hm-track__pulse { animation: hm-pulse 8s linear infinite; animation-play-state: paused; }
html.motion .hm-node::after { animation: hm-node 8s calc(var(--n) * 2s) ease-out infinite; animation-play-state: paused; }
html.motion .hm-stage::after { animation: hm-lit 8s calc(var(--n) * 2s) ease-in-out infinite; animation-play-state: paused; }
html.motion .hm-sys.is-run .hm-track__pulse, html.motion .hm-sys.is-run .hm-node::after, html.motion .hm-sys.is-run .hm-stage::after { animation-play-state: running; }
@keyframes hm-pulse { 0% { opacity: 0; transform: translateX(-50%); } 4% { opacity: 1; } 92% { opacity: 1; } 100% { opacity: 0; transform: translateX(440%); } }
@keyframes hm-node { 0%, 14%, 100% { opacity: 0; } 3% { opacity: 1; } }
@keyframes hm-lit { 0%, 26%, 100% { opacity: 0; } 4%, 18% { opacity: 1; } }

@media (max-width: 1020px) {
  .hm-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-track { display: none; }
  .hm-stage__k { display: block; position: absolute; top: clamp(22px, 2.2vw, 28px); right: clamp(22px, 2.2vw, 28px); font: 700 13px/1 var(--font-body); letter-spacing: 0.04em; color: var(--accent-text); }
}
.hm-swipe { display: none; }
/* Phones: the four stages become a swipe row (the next card peeks in), so the section stays one screen tall. */
@media (max-width: 640px) {
  .hm-key { justify-content: flex-start; }
  .hm-stages { display: flex; gap: 12px; margin: 0 calc(-1 * var(--gutter-r)) 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter-r) 6px var(--gutter);
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
  .hm-stages::-webkit-scrollbar { display: none; }
  .card.hm-stage { flex: 0 0 86%; scroll-snap-align: start; }
  .hm-swipe { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font: 500 13px/1.3 var(--font-body); color: var(--muted); }
  .hm-swipe svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .hm-sys__foot { padding: 16px 18px; }
}

/* ---------- Built and run by ProjectSG */
.hm-built__label { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: clamp(32px, 4vw, 48px) 0 18px; font: 600 17px/1.35 var(--font-body); letter-spacing: -0.01em; color: var(--ink); }
.hm-prods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 24px); }
.card.hm-prod { padding: 0; gap: 0; overflow: hidden; }
.hm-prod__media { position: relative; aspect-ratio: 16 / 10.5; margin: 10px 10px 0; border-radius: 13px; overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 120% at 100% 0%, rgba(212, 166, 72, 0.22), transparent 58%), var(--chip); }
.hm-prod__body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; flex: 1; padding: clamp(20px, 2.2vw, 26px); }
.hm-prod__k { font: 600 12px/1 var(--font-body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); }
.hm-prod__h { font: 700 22px/1.2 var(--font-body); letter-spacing: -0.02em; color: var(--ink); }
.hm-prod__p { font: 400 15.5px/1.55 var(--font-body); color: var(--ink-2); }
.hm-prod__meta { font: 500 13.5px/1.45 var(--font-body); color: var(--muted); }
.hm-prod__body > .more, .hm-prod__links { margin-top: auto; padding-top: 4px; }
.hm-prod__links { display: flex; flex-wrap: wrap; gap: 10px 20px; }

/* Property Ecosystem: the directory in a browser frame. */
.hm-prod__media--win { display: flex; flex-direction: column; background: var(--chip); }
.hm-win__bar { display: flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; flex: none; background: var(--panel); border-bottom: 1px solid var(--line); }
.hm-win__bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.hm-win__bar span { margin: 0 auto; transform: translateX(-12px); padding: 3px 12px; border-radius: 9999px; background: var(--chip); font: 600 11px/1.2 var(--font-body); color: var(--muted); }
.hm-prod__media--win img { flex: 1; min-height: 0; width: 100%; object-fit: cover; object-position: 50% 35%; transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.hm-prod:hover .hm-prod__media--win img { transform: scale(1.03); }
.hm-prod__badge { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: baseline; gap: 5px; padding: 7px 11px; border-radius: 10px; background: var(--panel); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); font: 500 12.5px/1.2 var(--font-body); color: var(--ink-2); }
.hm-prod__badge b { font: 700 16px/1 var(--font-body); color: var(--ink); letter-spacing: -0.01em; }

/* ProjectSG Suite: scan-to-download. The QR keeps its white tile in both themes so phones can read it. */
.hm-prod__media--app { display: flex; align-items: center; justify-content: center; gap: clamp(14px, 2vw, 22px); padding: 18px; }
.hm-qr { flex: none; display: grid; place-items: center; width: clamp(108px, 9vw, 132px); aspect-ratio: 1; padding: 8px; border-radius: 14px; background: #fff; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16); }
.hm-qr img { width: 100%; height: auto; }
.hm-app { display: grid; gap: 6px; min-width: 0; }
.hm-app b { font: 700 17px/1.2 var(--font-body); letter-spacing: -0.015em; color: var(--ink); }
.hm-app > span { font: 500 13px/1.4 var(--font-body); color: var(--ink-2); }
.hm-app__stores { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.hm-app__stores i { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 9999px; background: var(--panel); font: 600 12px/1 var(--font-body); font-style: normal; color: var(--ink); }
.hm-app__stores .psg-ic { font-size: 13px; color: var(--trust); }

/* CPC Intelligence Suite: the Lentor Gardens chart from the dashboard, cents masked. */
.hm-prod__media--cpc { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 6px; padding: 14px 16px 12px; }
.hm-cpc__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.hm-cpc__head > span { display: grid; gap: 3px; }
.hm-cpc__head > span b { font: 700 13.5px/1.2 var(--font-body); color: var(--ink); }
.hm-cpc__head > span span { font: 500 12px/1.2 var(--font-body); color: var(--ink-2); }
.hm-cpc__now { font: 700 28px/1 var(--font-body); letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.hm-cpc__plot { position: relative; min-height: 0; margin: 4px 2px 0; }
.hm-cpc__plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hm-cpc__grid line { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
.hm-cpc__area { fill: rgba(212, 166, 72, 0.22); }
.hm-cpc__line { fill: none; stroke: var(--accent-text); stroke-width: 2.6; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.hm-cpc__dot { position: absolute; z-index: 1; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: var(--panel); box-shadow: inset 0 0 0 2.6px var(--accent-text); }
.hm-cpc__dot--lo { left: 1.43%; top: 77.57%; }
.hm-cpc__dot--hi { left: 98.57%; top: 23.54%; }
.hm-cpc__ann { position: absolute; z-index: 2; padding: 4px 8px; border-radius: 7px; background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); font: 600 11.5px/1.2 var(--font-body); white-space: nowrap; }
.hm-cpc__ann--lo { left: 2%; top: 44%; }
.hm-cpc__ann--hi { right: 6%; top: 2%; }

@media (max-width: 960px) {
  .hm-prods { grid-template-columns: minmax(0, 1fr); }
  .hm-prod { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr); align-items: stretch; }
  .hm-prod__media { margin: 10px 0 10px 10px; aspect-ratio: auto; min-height: 230px; }
}
@media (max-width: 640px) {
  .hm-prod { display: flex; }
  .hm-prod__media { margin: 10px 10px 0; aspect-ratio: 16 / 10.5; min-height: 0; }
}

/* ---------- Why ProjectSG: proof, people, partners */
.hm-proof { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 24px); }
.card.hm-proof__c { gap: 6px; text-decoration: none; color: inherit; }
.hm-proof__c .medal { width: 46px; height: 46px; font-size: 21px; margin-bottom: 10px; }
.hm-proof__big { font: 700 clamp(36px, 3.6vw, 46px)/1 var(--font-body); letter-spacing: -0.035em; color: var(--ink); }
.hm-proof__t { font: 600 17px/1.3 var(--font-body); letter-spacing: -0.01em; color: var(--ink); }
.hm-proof__s { font: 400 14.5px/1.5 var(--font-body); color: var(--ink-2); }
.hm-proof__c .more { margin-top: auto; padding-top: 10px; }

.hm-people { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: clamp(16px, 2vw, 24px); margin-top: clamp(16px, 2vw, 24px); }
.card.hm-team { padding: 0; gap: 0; overflow: hidden; }
/* Studio panel: the leadership photos' own flat grey, the same in both themes, like the photos. */
.hm-studio { position: relative; display: flex; justify-content: center; align-items: flex-start; aspect-ratio: 16 / 11; overflow: hidden;
  background: linear-gradient(90deg, #abb4ba 0%, #abb4ba 38%, #acb7bd 62%, #acb7bd 100%); }
.hm-studio__p { position: relative; flex: none; margin: 0; height: 128%; aspect-ratio: 2 / 3; }
.hm-studio__p + .hm-studio__p { margin-left: -17%; }
.hm-studio__p img { width: 100%; height: 100%; object-fit: cover; object-position: top center;
  -webkit-mask-image: linear-gradient(90deg, transparent 4%, #000 16%, #000 84%, transparent 96%); mask-image: linear-gradient(90deg, transparent 4%, #000 16%, #000 84%, transparent 96%); }
/* Name tags sit on the panel's lower third (the figure runs past the panel's bottom edge). */
.hm-studio__p figcaption { position: absolute; left: 50%; bottom: calc(21.9% + 18px); z-index: 1; transform: translateX(-50%); display: grid; gap: 2px; min-width: max-content; padding: 8px 12px; border-radius: 12px; text-align: center;
  background: rgba(255, 255, 255, 0.94); color: #16181d; box-shadow: 0 6px 18px rgba(22, 24, 29, 0.16); }
.hm-studio__p figcaption b { font: 700 14px/1.2 var(--font-body); letter-spacing: -0.01em; }
.hm-studio__p figcaption span { font: 500 12px/1.3 var(--font-body); color: #4b505a; }
.hm-team__body, .hm-photos { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.hm-team__body { flex: 1; padding: clamp(22px, 2.6vw, 32px); }
.hm-team__h { font: 700 clamp(20px, 1.9vw, 24px)/1.2 var(--font-body); letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
.hm-team__p { font: 400 15.5px/1.55 var(--font-body); color: var(--ink-2); max-width: 52ch; }
.hm-office { display: flex; align-items: center; gap: 10px; padding: 9px 14px 9px 10px; border-radius: 9999px; background: var(--gold-soft); font: 500 14.5px/1.3 var(--font-body); color: var(--ink-2); }
.hm-office .psg-ic { font-size: 18px; color: var(--accent-text); }
.hm-office b { color: var(--ink); font-weight: 700; }
.hm-team__body .row { margin-top: auto; padding-top: 4px; gap: 10px 22px; flex-wrap: wrap; }

.hm-photos__head { display: grid; gap: 8px; }
.hm-photos__grid { list-style: none; margin: 4px 0 0; padding: 0; width: 100%; flex: 1; display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: repeat(2, minmax(120px, 1fr)); gap: 8px; }
.hm-photos__grid li { position: relative; min-height: 0; border-radius: 12px; overflow: hidden; background: var(--chip); }
.hm-photos__grid .hm-photos__tall { grid-row: span 2; }
.hm-photos__grid img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.hm-photos:hover .hm-photos__grid img { transform: scale(1.04); }
/* The whole card opens the track record; the link stays the single tab stop. */
.hm-photos { position: relative; }
.hm-photos__go::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-card); }
.hm-photos__go:focus-visible { outline: none; }
.hm-photos__go:focus-visible::after { box-shadow: inset 0 0 0 3px var(--gold-line); }
.hm-photos:hover { box-shadow: inset 0 0 0 2px var(--gold-line); }
:root[data-theme="light"] .hm-photos:hover { box-shadow: 0 0 0 2px var(--gold-line), 0 10px 30px rgba(140, 100, 30, 0.1); }
.hm-partners { margin-top: clamp(40px, 5vw, 64px); }

@media (max-width: 960px) {
  .hm-proof { grid-template-columns: minmax(0, 1fr); }
  .hm-proof__c { display: grid; grid-template-columns: 46px minmax(0, 1fr); column-gap: 16px; row-gap: 4px; }
  .hm-proof__c .medal { grid-row: span 4; margin: 0; }
  .hm-proof__c .more { padding-top: 6px; }
  .hm-proof__big { font-size: 34px; }
  .hm-people { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .hm-studio { aspect-ratio: 4 / 3.3; }
  .hm-studio__p { height: 118%; }
  .hm-studio__p + .hm-studio__p { margin-left: -24%; }
  /* Narrow panel: the two name tags move to the panel's lower corners so they never meet. */
  .hm-studio__p { position: static; }
  .hm-studio__p figcaption { bottom: 10px; padding: 6px 9px; transform: none; }
  .hm-studio__p--a figcaption { left: 10px; right: auto; text-align: left; }
  .hm-studio__p--b figcaption { left: auto; right: 10px; text-align: right; }
  .hm-studio__p figcaption b { font-size: 13px; }
  .hm-studio__p figcaption span { font-size: 11px; }
  .hm-photos__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: none; grid-auto-rows: 120px; }
  .hm-photos__grid .hm-photos__tall { grid-row: span 2; }
}

@media (prefers-reduced-motion: reduce) {
  .hm-track__pulse, .hm-node::after, .hm-stage::after { animation: none !important; opacity: 0 !important; }
  .hm-svc__go, .hm-prod__media--win img, .hm-photos__grid img, .hm-discs .disc__focus li:has(a) { transition: none; }
  .hm-prod:hover .hm-prod__media--win img, .hm-photos:hover .hm-photos__grid img { transform: none; }
  .hm-svcs a:hover .hm-svc__go { transform: rotate(-90deg); }
}

/* Tablets: the single-column team card keeps a sensible studio height. */
@media (min-width: 521px) and (max-width: 960px) { .hm-studio { aspect-ratio: auto; height: 420px; } }
