/* High Performers 2026 — portrait totem
   Reference canvas 1080x1920. All internal values are the design's
   literal pixel values; the .scaler wraps the 1080x1920 stage and JS
   applies uniform transform:scale() based on the actual viewport. */

:root {
  --hp-navy: #12126E;
  --hp-electric: #3312E0;
  --hp-coral: #F46670;
  --hp-pink: #F2A2B0;
  --hp-powder: #D2EBFF;
  --hp-lavender: #9272F0;
  --hp-grey-label: #5A5E8C;
  --hp-placeholder: #8A8FB8;
  --hp-white: #FFFFFF;
  --hp-black: #000000;

  --hp-font-display: 'Alegreya Sans', 'Helvetica Neue', Arial, sans-serif;
  --hp-font-body:    'Alegreya', 'Times New Roman', Georgia, serif;
  --hp-font-label:   'Fira Sans Condensed', 'Helvetica Neue', Arial, sans-serif;

  --hp-shadow-card:  18px 18px 0 #3312E0;
  --hp-shadow-field: 14px 14px 0 #3312E0;
  --hp-ease-rise: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #000;
  color: var(--hp-white);
  font-family: var(--hp-font-display);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
}

/* Chromium 55 compat: place-items ships in Chrome 59. Use flex centring. */
body { display: flex; justify-content: center; align-items: center; }

.scaler {
  position: absolute;
  top: 0; left: 0;
  width: 1080px;
  height: 1920px;
  transform-origin: 0 0;
}

.stage {
  position: relative;
  width: 1080px;
  height: 1920px;
  background: var(--hp-navy);
  overflow: hidden;
}

/* Every screen fills the stage; visibility is driven by body[data-state].
   We use display:none for the inactive screens so the enter animations on
   each screen (hpFade etc.) don't hold opacity at 1 while the screen is
   supposed to be hidden. */
.scr {
  /* Chromium 55 compat: `inset` shorthand ships in Chrome 87. */
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  display: none;
}
body[data-state="attract"]     .attract     { display: block; }
body[data-state="search"]      .search      { display: flex; flex-direction: column; }
body[data-state="recognition"] .recognition { display: flex; flex-direction: column; }

/* Motion keyframes (also declared in tokens.css but the app doesn't import it). */
@keyframes hpDrift { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@keyframes hpRise  { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes hpFade  { from { opacity: 0; } to { opacity: 1; } }
@keyframes hpNudge { 0%,70%,100% { transform: translateX(0); } 80% { transform: translateX(14px); } 90% { transform: translateX(0); } }
@keyframes hpFeatureIn { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: none; } }

/* ============================================================
   ATTRACT
============================================================ */

.attract { animation: hpFade 500ms ease-out both; }

.meerkats {
  position: absolute;
  left: 0; top: 0;
  width: 1080px;
  height: 784px;
  background: url('./assets/hp-meerkats.png') center top / cover no-repeat;
}

.drift {
  /* Chromium 55 compat: CSS Grid ships unprefixed in Chrome 57; flex-gap
     in Chrome 84. Use a flex row with margin-based column spacing. */
  position: absolute;
  left: 0; right: 0;
  top: 860px;
  bottom: 120px;
  display: flex;
  flex-direction: row;
  padding: 0 48px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%);
  transition: opacity 300ms ease-out;
}

.drift-col {
  /* Chromium 55 compat: flex-gap ships in Chrome 84; use per-child margin. */
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  will-change: transform;
  animation: hpDrift linear infinite;
}
.drift-col + .drift-col { margin-left: 40px; }
.drift-col > div + div { margin-top: 44px; }
.drift-col--a { animation-duration:  90s; color: var(--hp-powder);   opacity: .34; }
.drift-col--b { animation-duration: 120s; color: var(--hp-pink);     opacity: .40; padding-top: 140px; }
.drift-col--c { animation-duration: 100s; color: var(--hp-lavender); opacity: .55; padding-top: 60px; }

.drift-col > div {
  font-family: var(--hp-font-display);
  font-size: 42px;
  font-weight: 700;
  line-height: 1.05;
}

/* Settle: dim + pause drift when leaving attract. */
body[data-settling="true"] .drift        { opacity: .25; }
body[data-settling="true"] .drift-col    { animation-play-state: paused; }

.title-panel {
  position: absolute;
  left: 90px;
  right: 90px;
  top: 372px;
  background: var(--hp-white);
  border: 16px solid var(--hp-black);
  padding: 44px 40px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--hp-black);
  text-align: center;
}
.title-line { font-family: var(--hp-font-display); }
.title-high        { font-size: 112px; font-weight: 800; letter-spacing: .14em; line-height: .92; margin-right: -.14em; }
.title-performers  { font-size: 112px; font-weight: 800; letter-spacing: .10em; line-height: .92; margin-right: -.10em; }
.title-year        { font-size:  60px; font-weight: 500; letter-spacing: .55em; line-height: 1;   margin-right: -.55em; margin-top: 12px; }
.title-date        { font-family: var(--hp-font-label); font-size: 50px; font-weight: 700; line-height: 1; margin-top: 28px; color: var(--hp-black); }

.feature-slot {
  position: absolute;
  left: 90px;
  right: 90px;
  top: 1010px;
  height: 520px;
  display: flex;
  align-items: center;
}
.feature-card {
  width: 100%;
  background: var(--hp-coral);
  color: var(--hp-navy);
  padding: 56px 60px 60px;
  display: flex;
  flex-direction: column;
  /* Chromium 55 compat: flex-gap ships in Chrome 84. */
  box-shadow: var(--hp-shadow-card);
  transition: opacity 420ms ease, transform 420ms ease;
}
.feature-card > * + * { margin-top: 22px; }
.feature-card[data-out="true"] {
  opacity: 0;
  transform: translateY(-24px);
}
.feature-eyebrow {
  font-family: var(--hp-font-label);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.feature-eyebrow:empty { display: none; }
.feature-name {
  font-family: var(--hp-font-display);
  font-size: 96px;
  font-weight: 800;
  line-height: .98;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.feature-fragment {
  font-family: var(--hp-font-body);
  font-style: italic;
  font-weight: 400;
  font-size: 50px;
  line-height: 1.22;
  text-wrap: pretty;
}

.cta {
  position: absolute;
  left: 90px;
  right: 90px;
  top: 1614px;
  height: 164px;
  background: var(--hp-white);
  border: 12px solid var(--hp-black);
  color: var(--hp-black);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Chromium 55 compat: flex-gap ships in Chrome 84. */
}
.cta > * + * { margin-left: 30px; }
.cta-label {
  font-family: var(--hp-font-display);
  font-size: 54px;
  font-weight: 800;
  letter-spacing: .08em;
}
.cta-arrow {
  font-family: var(--hp-font-label);
  font-size: 64px;
  font-weight: 700;
  animation: hpNudge 3.2s ease-in-out infinite;
  will-change: transform;
}

/* ============================================================
   SEARCH
============================================================ */

body[data-state="search"] .search { animation: hpFade 280ms ease-out both; }

.header-band {
  flex: none;
  height: 180px;
  background: url('./assets/hp-pattern-top.png') left center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
}
.header-band--rec { height: 200px; }

.header-plate {
  background: var(--hp-white);
  border: 8px solid var(--hp-black);
  color: var(--hp-black);
  padding: 14px 26px 12px;
  font-family: var(--hp-font-display);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: .1em;
  line-height: 1;
}

.close-btn {
  width: 120px;
  height: 120px;
  background: var(--hp-white);
  border: 8px solid var(--hp-black);
  position: relative;
  padding: 0;
  cursor: pointer;
  box-sizing: border-box;
}
.close-bar {
  position: absolute;
  left: 22px; right: 22px;
  top: 46px;
  height: 12px;
  background: var(--hp-black);
}
.close-bar--a { transform: rotate( 45deg); }
.close-bar--b { transform: rotate(-45deg); }

.search-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 44px 60px 0;
  animation: hpRise 360ms ease-out both;
}

.find-label {
  font-family: var(--hp-font-label);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--hp-pink);
  margin-bottom: 18px;
}

.search-field {
  display: flex;
  align-items: center;
  height: 148px;
  background: var(--hp-white);
  border: 12px solid var(--hp-black);
  box-shadow: var(--hp-shadow-field);
  padding: 0 20px 0 36px;
  /* Chromium 55 compat: flex-gap ships in Chrome 84. */
}
.search-field > * + * { margin-left: 16px; }
#searchInput {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-family: var(--hp-font-display);
  font-size: 60px;
  font-weight: 700;
  color: var(--hp-navy);
  caret-color: var(--hp-coral);
}
#searchInput::placeholder { color: var(--hp-placeholder); }
.clear-btn {
  flex: none;
  height: 88px;
  padding: 0 26px;
  display: inline-flex;
  align-items: center;
  background: var(--hp-powder);
  color: var(--hp-navy);
  border: 0;
  font-family: var(--hp-font-label);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: .08em;
  cursor: pointer;
}
.clear-btn[hidden] { display: none; }

.count-line {
  font-family: var(--hp-font-label);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--hp-powder);
  margin: 40px 0 12px;
  min-height: 30px;
}

.results {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0 0 40px;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}
.result {
  flex: none;
  min-height: 132px;
  display: flex;
  align-items: center;
  /* Chromium 55 compat: flex-gap ships in Chrome 84. */
  padding: 0 28px;
  margin: 0 -28px;
  border-bottom: 3px solid var(--hp-electric);
  color: var(--hp-white);
  cursor: pointer;
  transition: background 120ms;
}
.result > * + * { margin-left: 28px; }
.result[data-pressed="true"] { background: var(--hp-coral); color: var(--hp-navy); }

.result-name {
  font-family: var(--hp-font-display);
  font-size: 58px;
  font-weight: 800;
  line-height: 1.05;
}
.result-name mark {
  background: transparent;
  color: var(--hp-pink);
  text-decoration: underline;
  text-decoration-thickness: 5px;
  text-underline-offset: 8px;
}
.result[data-pressed="true"] .result-name mark {
  color: var(--hp-navy);
}
.result-arrow {
  flex: none;
  font-family: var(--hp-font-label);
  font-size: 56px;
  font-weight: 700;
}
.result-left { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* Chromium 55 compat: flex-gap ships in Chrome 84. */
.result-left > * + * { margin-top: 4px; }

.no-results {
  padding-top: 24px;
  font-family: var(--hp-font-body);
  font-size: 44px;
  line-height: 1.3;
  color: var(--hp-powder);
  margin: 0;
}

/* Reserve keyboard height at the end of the results list so the last
   rows can scroll clear of an OS keyboard covering ~780px. Applied by
   JS when the search input receives focus. */
body[data-keyboard="true"] .results { padding-bottom: 800px; }

/* ============================================================
   RECOGNITION
============================================================ */

body[data-state="recognition"] .recognition { animation: hpFade 300ms ease-out both; }

.rec-main {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  padding: 56px 60px 40px;
}

.rec-card {
  position: relative;
  width: 100%;
  background: var(--hp-white);
  border: 14px solid var(--hp-black);
  box-shadow: var(--hp-shadow-card);
  box-sizing: border-box;
  padding: 88px 64px 64px;
  color: var(--hp-navy);
  display: flex;
  flex-direction: column;
  animation: hpRise 520ms var(--hp-ease-rise) both;
}
.rec-tab {
  position: absolute;
  left: 50px;
  top: -38px;
  background: var(--hp-coral);
  border: 8px solid var(--hp-black);
  padding: 12px 24px 10px;
  color: var(--hp-black);
  font-family: var(--hp-font-label);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1;
}
.rec-name {
  font-family: var(--hp-font-display);
  font-weight: 800;
  line-height: .96;
  letter-spacing: -.015em;
  text-wrap: balance;
}
/* Recognition body sizing is set via inline styles by the app
   (short / standard / long tier by word count). */
.rec-body {
  font-family: var(--hp-font-body);
  font-weight: 400;
  color: var(--hp-navy);
  text-wrap: pretty;
}
.rec-rule { width: 120px; height: 8px; background: var(--hp-coral); margin: 40px 0 36px; }

.rec-buttons {
  /* Chromium 55 compat: CSS Grid unprefixed ships in Chrome 57; use flex. */
  flex: none;
  display: flex;
  flex-direction: row;
  padding: 0 60px 44px;
}
.rec-btn + .rec-btn { margin-left: 32px; }
.rec-btn {
  flex: 1;
  height: 140px;
  border: 10px solid var(--hp-black);
  box-sizing: border-box;
  color: var(--hp-black);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Chromium 55 compat: flex-gap ships in Chrome 84. */
  font-family: var(--hp-font-display);
  font-size: 42px;
  font-weight: 800;
  letter-spacing: .08em;
  cursor: pointer;
  background: var(--hp-white);
}
.rec-btn > * + * { margin-left: 18px; }
.rec-btn--done { background: var(--hp-coral); }
.rec-btn-arrow { font-family: var(--hp-font-label); font-weight: 700; }

.footer-band {
  flex: none;
  height: 110px;
  background: url('./assets/hp-pattern-bottom.png') left center / cover no-repeat;
}

/* ============================================================
   Reduced motion: keep fades, stop the drift and nudge.
============================================================ */
@media (prefers-reduced-motion: reduce) {
  .drift-col, .cta-arrow { animation: none !important; }
}
