html.irec-zh:not(.irec-zh-ready) body { visibility: hidden; }
html.irec-zh .fi-tick { letter-spacing: .04em; text-transform: none; }

/* Phone and tablet layout for the static IREC pages.
   Inline styles stay in charge on desktop. These rules only take over
   once the viewport is too narrow for the desktop header and heroes. */

.irec-menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  flex: none;
  font-style: normal;
}
.irec-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
}
.irec-menu-btn:focus-visible,
.irec-menu-close:focus-visible {
  outline: 2px solid #2ed1f1;
  outline-offset: 3px;
}

.irec-menu {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #0b0b0d;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: max(18px, env(safe-area-inset-top)) 22px max(28px, env(safe-area-inset-bottom));
  overflow: auto;
  font-family: Quantico, sans-serif;
  font-style: normal;
  box-sizing: border-box;
}
.irec-menu[hidden] {
  display: none !important;
}
.irec-menu::before {
  content: "";
  display: block;
  height: 10px;
  margin: 0 -22px 18px;
  background: repeating-linear-gradient(-45deg, #0200dd 0 22px, #0b0b0d 22px 44px);
}
.irec-menu-close {
  align-self: flex-end;
  min-height: 44px;
  padding: 0 16px;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
.irec-menu-nav {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
}
.irec-menu-nav a {
  font-family: "Race Sport", Impact, sans-serif;
  font-style: normal;
  font-size: 28px;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: #fff;
  padding: 14px 0;
  border-bottom: 1px solid #2a2a30;
  min-height: 48px;
  box-sizing: border-box;
}
.irec-menu-nav a[href*="/zh"] {
  font-family: Quantico, sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #aaa9a9;
}

html.irec-menu-open,
html.irec-menu-open body {
  overflow: hidden;
}

/* Language switch and Book Now stay on the right edge of the header. */
header {
  flex-wrap: nowrap !important;
}
header > a:first-child {
  flex: none;
}
header > nav {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
}
header > nav a {
  white-space: nowrap;
}
/* Let the bar use the full window so the links can sit further apart. */
header {
  max-width: none !important;
  width: 100%;
  box-sizing: border-box;
}
header > nav {
  gap: 18px !important;
  letter-spacing: .05em !important;
}
@media (min-width: 1400px) {
  header > nav {
    flex-wrap: nowrap !important;
    gap: 18px !important;
    letter-spacing: .05em !important;
    font-size: 13px !important;
  }
}
/* Chinese menu labels are shorter, so they can sit larger than the English caps. */
html.irec-zh header > nav {
  font-size: 20px !important;
}
.irec-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #2ED1F1;
  color: #2ED1F1;
  text-decoration: none;
  font-family: "Race Sport", Impact, sans-serif;
  font-style: normal;
  font-size: 13px;
  letter-spacing: .06em;
  white-space: nowrap;
  box-sizing: border-box;
}
.irec-login:hover { color: #fff; border-color: #fff; }
.irec-menu-nav a.irec-login {
  display: flex;
  justify-content: flex-start;
  border: 0;
  padding: 14px 0;
  min-height: 48px;
  color: #2ED1F1;
  font-size: 28px;
  letter-spacing: .06em;
}
@media (max-width: 759px) {
  header .irec-login {
    width: 44px;
    padding: 0;
  }
  header .irec-login-label {
    font-size: 12px;
    letter-spacing: 0;
  }
}
header > .irec-header-actions {
  margin-left: auto;
  flex: none;
}
.irec-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Quantico", sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .12em;
  white-space: nowrap;
  color: #2ED1F1;
}
.irec-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3DDC97;
  box-shadow: 0 0 0 3px rgba(61, 220, 151, .22);
  flex: none;
}
.irec-status[data-irec-status="book"] { color: #F5C16C; }
.irec-status[data-irec-status="book"] .irec-status-dot {
  background: #F5C16C;
  box-shadow: 0 0 0 3px rgba(245, 193, 108, .22);
}
.irec-status[data-irec-status="closed"],
.irec-status[data-irec-status="hold"] { color: #ED1C24; }
.irec-status[data-irec-status="closed"] .irec-status-dot,
.irec-status[data-irec-status="hold"] .irec-status-dot {
  background: #ED1C24;
  box-shadow: 0 0 0 3px rgba(237, 28, 36, .28);
}
@media (max-width: 759px) {
  header > .irec-header-actions > a[href="zh.html"],
  header > .irec-header-actions > a[href="index.html"] {
    display: none !important;
  }
  header > .irec-header-actions {
    flex-wrap: wrap !important;
    justify-content: flex-end;
    row-gap: 4px;
  }
  .irec-menu-btn { order: 0; }
  header > .irec-header-actions > a { order: 1; }
  .irec-status {
    order: 3;
    flex: 1 0 100%;
    width: 0;
    min-width: 0;
    justify-content: flex-end;
    margin-left: 0;
  }
}
@media (max-width: 420px) {
  .irec-status { font-size: 9px; letter-spacing: .04em; gap: 6px; }
}

/* Below this width the nine links no longer fit beside the status light. */
@media (max-width: 1399px) {
  html.irec-js header nav {
    display: none !important;
  }
  html.irec-js .irec-menu-btn {
    display: inline-flex;
  }
  html.irec-js header {
    gap: 12px !important;
  }
}
html.irec-nav-collapse header > nav {
  display: none !important;
}
html.irec-nav-collapse .irec-menu-btn {
  display: inline-flex;
}

/* Tablet: stack the heroes once the desktop composition no longer fits. */
@media (max-width: 1180px) {
  html.irec-js header > a:first-child,
  html.irec-js header a[style*="border-radius:999px"] {
    flex: none;
  }
  header a[style*="border-radius:999px"] {
    white-space: nowrap;
  }
  [style*=" 40px"] {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
  section[style*="padding:120px"],
  section[style*="padding:110px"],
  section[style*="padding:100px"],
  section[style*="padding:90px"] {
    padding-top: 72px !important;
    padding-bottom: 64px !important;
  }
  [style*="font-size:360px"],
  [style*="font-size:320px"] {
    font-size: 160px !important;
  }
  [style*="font-size:220px"] {
    font-size: 140px !important;
  }
  /* Stack the clipped hero through tablet landscape so the gauge
     and the diagonal photo cannot cover the headline. */
  header + section {
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  header + section > svg {
    display: none !important;
  }
  header + section > div[style*="polygon(18% 0,21%"],
  header + section > div[style*="polygon(23%"] {
    display: none !important;
  }
  header + section > div[style*="polygon(18% 0,100%"] {
    position: relative !important;
    inset: auto !important;
    clip-path: none !important;
    width: 100% !important;
    height: 280px !important;
    flex: none !important;
    order: -1;
  }
  header + section > div[style*="position:relative"] {
    padding-top: 32px !important;
    padding-bottom: 40px !important;
  }
  header + section > .fi-throttle-dock {
    position: relative !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: min(320px, calc(100% - 48px)) !important;
    margin: 4px 24px 28px !important;
    display: flex !important;
    order: 1;
    z-index: 2;
  }
  [style*="inset:0 0 0 38%"],
  [style*="inset:0 0 0 46%"] {
    inset: auto !important;
  }
}

@media (max-width: 760px) {
  [style*=" 40px"] {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  section[style*="padding:120px"],
  section[style*="padding:110px"],
  section[style*="padding:100px"],
  section[style*="padding:90px"] {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
  }
  [style*="padding:100px 40px"],
  [style*="padding:96px 40px"],
  [style*="padding:80px 40px"],
  [style*="padding:70px 40px"],
  [style*="padding:64px 40px"] {
    padding-top: 40px !important;
    padding-bottom: 36px !important;
  }
  header img[alt="IREC crest"] {
    width: 40px !important;
  }
  header img[alt="IREC Hong Kong"] {
    width: 96px !important;
  }
  header + section h1 {
    font-size: clamp(34px, 10vw, 58px) !important;
    max-width: 100% !important;
  }
  img[style*="height:520px"],
  img[style*="height:460px"],
  video[style*="height:460px"] {
    height: 240px !important;
  }
  [style*="min-height:480px"],
  [style*="min-height:460px"],
  [style*="min-height:440px"] {
    min-height: 240px !important;
  }
  [style*="min-height:400px"] {
    min-height: 260px !important;
  }
  header + section {
    min-height: 0 !important;
  }
  [style*="font-size:360px"],
  [style*="font-size:320px"] {
    display: none !important;
  }
  [style*="font-size:220px"],
  [style*="font-size:180px"] {
    font-size: 88px !important;
  }
  section > svg[style*="width:420px"] {
    width: 160px !important;
    height: 72px !important;
  }
  article > div[style*="padding:22px 24px"] {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  article > div[style*="padding:22px 24px"] > div[style*="gap:20px"] {
    width: 100%;
    justify-content: space-between;
  }
  [style*="left:24px;top:22px"] {
    left: 10px !important;
    top: 10px !important;
    max-width: calc(100% - 20px);
    flex-wrap: wrap;
  }
  [style*="right:24px;top:22px"] {
    top: 46px !important;
    right: auto !important;
    left: 10px !important;
    max-width: calc(100% - 20px);
  }
  [style*="left:24px;bottom:20px"] {
    left: 10px !important;
    bottom: 8px !important;
  }
  [style*="grid-template-columns:110px"],
  [style*="grid-template-columns:96px"] {
    grid-template-columns: 88px 1fr !important;
  }
  a[href^="mailto:"] {
    overflow-wrap: anywhere;
  }
}

.fi-gauge {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.fi-touch-label {
  display: none;
  justify-content: center;
  align-items: center;
  min-height: 36px;
  padding: 8px 2px 0;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-family: Quantico, sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .06em;
  line-height: 1.2;
  text-align: center;
}
.fi-upshift {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0 10px;
  box-sizing: border-box;
  border: 1px solid #2ED1F1;
  color: #fff;
  font-family: "Race Sport", Impact, sans-serif;
  font-style: normal;
  font-size: 16px;
  letter-spacing: .1em;
  cursor: pointer;
  touch-action: none;
}
.fi-upshift:focus-visible {
  outline: 2px solid #2ED1F1;
  outline-offset: 3px;
}

/* Phone hero stays side by side, the way the desktop hero is:
   headline on the left, tach on the right over the video. */
@media (max-width: 760px), (max-width: 932px) and (max-height: 500px) {
  header + section {
    display: block !important;
    min-height: 0 !important;
    overflow: hidden;
  }
  header + section > svg,
  header + section > div[style*="polygon(18% 0,21%"],
  header + section > div[style*="polygon(23%"] {
    display: none !important;
  }
  header + section > div[style*="polygon(18% 0,100%"] {
    position: absolute !important;
    inset: 0 0 0 28% !important;
    clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 100%) !important;
    width: auto !important;
    height: auto !important;
    order: 0 !important;
  }
  header + section > div[style*="position:relative"] {
    position: relative !important;
    z-index: 1;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 22px 16px 18px !important;
    box-sizing: border-box !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    gap: 16px !important;
  }
  header + section h1 {
    font-size: clamp(24px, 8.4vw, 48px) !important;
    max-width: 100% !important;
  }
  header + section > div[style*="position:relative"] > p,
  header + section > div[style*="position:relative"] > div:last-child {
    max-width: calc(100% - 176px) !important;
  }
  header + section > div[style*="position:relative"] > div:last-child {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  header + section > div[style*="position:relative"] > div:last-child > a {
    box-sizing: border-box !important;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    padding-left: 12px !important;
    padding-right: 12px !important;
    min-height: 46px !important;
    font-size: 14px !important;
  }
  header + section > .fi-throttle-dock {
    position: absolute !important;
    top: auto !important;
    right: 8px !important;
    bottom: 12px !important;
    left: auto !important;
    width: 168px !important;
    margin: 0 !important;
    z-index: 3;
    display: flex !important;
    order: 0 !important;
    gap: 6px !important;
  }
  .fi-throttle-dock .fi-throttle {
    padding: 8px 8px 4px !important;
    gap: 4px !important;
  }
  .fi-tach-kicker { display: none !important; }
  .fi-tach-meta { justify-content: flex-end !important; }
  .fi-leds { gap: 3px !important; }
  .fi-leds > span {
    width: 11px !important;
    height: 5px !important;
  }
  .fi-gauge { gap: 6px !important; }
  .fi-gauge [style*="font-size:32px"] { font-size: 20px !important; }
  .fi-gauge [style*="font-size:20px"] { font-size: 12px !important; }
  .fi-throttle-hint { display: none !important; }
  .fi-touch-label {
    display: flex !important;
    min-height: 28px;
    padding: 6px 0 1px;
    font-size: 11px;
    letter-spacing: .04em;
    white-space: nowrap;
  }
  .fi-upshift {
    display: flex !important;
    min-height: 44px;
    font-size: 15px;
  }
}

/* A short landscape phone still shows the tach in the first screen. */
@media (max-width: 932px) and (max-height: 500px) {
  header + section h1 {
    font-size: clamp(22px, 4.6vw, 40px) !important;
    max-width: calc(100% - 188px) !important;
  }
  header + section > div[style*="position:relative"] > div:first-child,
  header + section > div[style*="position:relative"] > div:last-child {
    max-width: calc(100% - 188px) !important;
  }
  header + section > div[style*="position:relative"] > p {
    max-width: min(470px, calc(100% - 250px)) !important;
  }
  header + section > div[style*="position:relative"] > div:last-child {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    width: auto !important;
  }
  header + section > div[style*="position:relative"] > div:last-child > a {
    width: auto !important;
  }
  header + section > .fi-throttle-dock {
    top: 8px !important;
    bottom: auto !important;
    width: 156px !important;
  }
  .fi-throttle-dock .fi-throttle {
    padding: 6px 6px 2px !important;
  }
  .fi-touch-label {
    min-height: 22px;
    padding-top: 4px;
    font-size: 10px;
  }
  .fi-upshift { min-height: 40px; }
}

@media (max-width: 380px) {
  header + section > div[style*="position:relative"] {
    gap: 12px !important;
    padding: 16px 12px 12px !important;
  }
  header + section h1 {
    font-size: clamp(22px, 7.5vw, 30px) !important;
  }
  header + section > div[style*="position:relative"] > p {
    font-size: 15px !important;
    line-height: 1.4 !important;
  }
  header + section > div[style*="position:relative"] > p,
  header + section > div[style*="position:relative"] > div:last-child {
    max-width: calc(100% - 140px) !important;
  }
  header + section > div[style*="position:relative"] > div:last-child > a {
    min-height: 42px !important;
    width: auto !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    font-size: 13px !important;
    gap: 6px !important;
    white-space: nowrap !important;
  }
  header + section > .fi-throttle-dock {
    width: 132px !important;
    bottom: 8px !important;
  }
  .fi-leds > span {
    width: 8px !important;
    height: 4px !important;
  }
  .fi-touch-label {
    font-size: 10px;
    letter-spacing: .02em;
  }
  .fi-upshift {
    min-height: 40px;
    font-size: 13px;
  }
}

.fi-rate {
  display: flex;
  align-items: stretch;
  gap: 12px;
  font-style: normal;
}
.fi-rate-rule {
  width: 1px;
  align-self: stretch;
  background: #3a3a42;
  flex: none;
}
.fi-rate--stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.fi-rate--stack .fi-rate-rule {
  width: 28px;
  height: 1px;
  align-self: auto;
}
@media (max-width: 520px) {
  .fi-rate { flex-direction: column; align-items: flex-start; gap: 8px; }
  .fi-rate-rule { width: 28px; height: 1px; align-self: auto; }
  .fi-rate-row { flex-wrap: wrap; align-items: flex-start; }
  .fi-rate-row .fi-rate { flex: 1 0 100%; }
}

/* Framed rig photos. The cyan edge is the glow; the picture itself is the real photo. */
.fi-rig-frame {
  position: relative;
  display: block;
  padding: 3px;
  background: linear-gradient(145deg, #2ed1f1 0%, #5e5cff 48%, #0200dd 100%);
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  filter:
    drop-shadow(0 0 6px rgba(46, 209, 241, 0.9))
    drop-shadow(0 0 14px rgba(94, 92, 255, 0.65))
    drop-shadow(0 0 26px rgba(2, 0, 221, 0.55));
}
.fi-rig-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  background: #050507;
  clip-path: polygon(13px 0, 100% 0, 100% calc(100% - 13px), calc(100% - 13px) 100%, 0 100%, 0 13px);
}
.fi-rig-frame--card {
  position: absolute;
  right: 16px;
  bottom: 36px;
  width: 34%;
  max-width: 228px;
  aspect-ratio: 4 / 3;
  z-index: 2;
  pointer-events: none;
}
.fi-rig-frame--hero {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  aspect-ratio: 4 / 5;
}
.fi-rig-frame--seat {
  width: min(100%, 420px);
  aspect-ratio: 4 / 5;
  margin: 0 auto;
}

@media (max-width: 760px) {
  .fi-rig-frame--card {
    width: 46%;
    max-width: none;
    right: 10px;
    bottom: 28px;
  }
  .fi-rig-frame--hero,
  .fi-rig-frame--seat {
    width: min(100%, 420px);
  }
}

@media (max-width: 420px) {
  header img[alt="IREC crest"] {
    width: 34px !important;
  }
  header img[alt="IREC Hong Kong"] {
    width: 72px !important;
  }
  header a[style*="border-radius:999px"] {
    padding-left: 12px !important;
    padding-right: 12px !important;
    gap: 0 !important;
  }
  header a[style*="border-radius:999px"] span {
    display: none !important;
  }
  .irec-menu-nav a {
    font-size: 24px;
  }
}

/* 240p player (426×240). Scale is applied from the center so the
   picture covers the card without asking YouTube for a larger file. */
iframe.fi-feed {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 426px !important;
  height: 240px !important;
  max-width: none !important;
  margin: 0;
  border: 0;
  transform-origin: center center;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
