/* Markets (Figma D05 649:1228 · T05 673:77353 · M05 673:76730) */

/* Figma mobile section titles are 28px (v-m-h1); base .t-h2 is 24px on mobile */
@media (max-width: 767px) { main .t-h2 { font-size: 28px; } }

/* ---------- intro ---------- */
.mk-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 .5H40M.5 0V40' stroke='%23EBEBEB' stroke-dasharray='3 3' fill='none'/%3E%3C/svg%3E"); background-size: 40px 40px; background-position: calc(50% - 20px) 0; }
.mk-hero-in { position: relative; z-index: 1; order: 1; }
.mk-globe { order: 2; position: relative; overflow: hidden; }
.mk-globe img { position: absolute; left: 50%; max-width: none; height: auto; transform: translateX(-50%); }
.mk-lead { max-width: 380px; }
.mk-now-s { display: inline-flex; align-items: center; gap: 10px; }
.mk-dot { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--k500); }
.mk-dot.is-open { background: var(--g700); border-color: var(--g700); }
@media (max-width: 767px) {
  .mk-hero-in { display: contents; }
  .mk-title { order: 1; padding: 32px var(--margin) 0; }
  .mk-title .crumb { margin-bottom: 30px; }
  .mk-title .t-mark { margin-bottom: 10px; }
  .mk-globe { height: 300px; margin-top: 12px; }
  .mk-globe img { width: 893px; top: -62px; }
  .mk-now { order: 3; margin: 0 var(--margin); display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 6px 16px; border-top: 1px solid var(--black); padding: 16px 0 32px; }
  .mk-now .t-monos { grid-column: 1 / -1; }
  .mk-now-s { font-size: 13px; padding-bottom: 6px; }
}
@media (min-width: 768px) {
  .mk-hero-in { padding-top: 48px; }
  .mk-title { max-width: 60%; }
  .mk-title .crumb { margin-bottom: 24px; }
  .mk-title .t-mark { margin-bottom: 32px; }
  .mk-now { position: absolute; top: 48px; right: var(--margin); text-align: right; }
  .mk-now .t-num { margin-top: 14px; }
  .mk-now-s { padding-top: 6px; }
  .mk-now .mk-dot { display: none; }
  .mk-globe { height: 540px; }
  .mk-globe img { width: 1440px; top: -70px; }
}
@media (min-width: 1200px) {
  .mk-hero { height: 620px; }
  .mk-hero-in { padding-top: 72px; }
  .mk-title .crumb { margin-bottom: 31px; }
  .mk-title .t-mark { margin-bottom: 24px; }
  .mk-now { top: 72px; }
  .mk-now .t-num { margin-top: 15px; }
  .mk-now-s { padding-top: 8px; }
  .mk-globe { position: absolute; inset: 0; height: auto; }
  .mk-globe img { top: 0; }
}

/* 1200–1439: keep the globe clear of the title */
@media (min-width: 1200px) and (max-width: 1439px) { .mk-globe img { left: max(50%, 740px); } }

/* ---------- section heads ---------- */
.mk-head { display: grid; gap: 16px; align-content: start; margin-bottom: 32px; }
@media (min-width: 1200px) {
  .mk-head--row { grid-template-columns: 1fr 520px; align-items: end; gap: 24px; margin-bottom: 56px; }
}

/* ---------- exchange hours ---------- */
.hours-table { table-layout: fixed; }
.hours-table th, .fx-table th { color: var(--k500); padding-top: 0; padding-bottom: 12px; }
.hours-table td { padding-block: 14px; line-height: 18px; height: 47px; }
.hours-table th:nth-child(1) { width: 19.7%; } .hours-table th:nth-child(2) { width: 23.7%; } .hours-table th:nth-child(3) { width: 26.3%; }
.hours-table th.arrow, .hours-table td.arrow { width: 24px; }
.hours-table td.arrow a { display: flex; align-items: center; justify-content: flex-end; width: 24px; height: 18px; transition: color .15s, transform .15s; }
.hours-table tr:hover td.arrow a { color: var(--g700); transform: translateX(2px); }
.hours-table tbody tr { transition: background .15s; }
.hours-table tbody tr:hover { background: var(--g50); }
.hours-table .city { font-weight: 400; }
@media (min-width: 1200px) {
  .mk-hours { display: grid; grid-template-columns: minmax(0, 440fr) minmax(0, 760fr); gap: 80px; }
  .mk-hours .mk-head { margin: 0; }
  .hours-table th:nth-child(4) { width: auto; }
}
@media (max-width: 767px) {
  .hours-table th:nth-child(1) { width: auto; }
  .hours-table th:nth-child(3) { width: 120px; }
  .hours-table th:nth-child(4) { width: 92px; }
  .hours-table td { padding-block: 12px; }
  .hours-table .code { display: block; }
  .hours-table .sub { display: block; font-family: var(--serif); font-weight: 400; font-size: 13px; letter-spacing: 0; color: var(--k600); margin-top: 2px; }
  .hours-table td:nth-child(3) { font-size: 12px; }
}

/* ---------- 24h timeline ---------- */
.tl { width: 100%; }
.tl svg { width: 100%; height: auto; overflow: visible; }
.tl text { font-family: var(--mono); font-weight: 500; letter-spacing: .05em; }
.tl .tl-code { font-size: 12px; fill: var(--black); }
.tl .tl-axis { font-size: 11px; fill: var(--k500); }
.tl .tl-nowlabel { font-size: 11px; fill: var(--black); }
.tl .tl-cap { font-size: 11px; fill: var(--k600); }
.tl .tl-bar { fill: #EDEDED; stroke: var(--k500); stroke-width: 1; }
.tl .tl-row.is-open .tl-bar { fill: var(--g100); stroke: var(--g700); }
.tl-legend { display: flex; gap: 32px; margin-top: 16px; padding-left: 150px; }
.tl-legend li { display: inline-flex; align-items: center; gap: 10px; }
.tl-legend .sw { width: 24px; height: 12px; background: #EDEDED; border: 1px solid var(--k500); }
.tl-legend .sw--open { background: var(--g100); border-color: var(--g700); }
@media (max-width: 1199px) { .tl-legend { padding-left: 96px; } }
@media (max-width: 559px) { .tl .tl-code { font-size: 11px; } .tl-legend { padding-left: 0; gap: 24px; margin-top: 32px; } }

/* ---------- photo ---------- */
.mk-photo { height: 280px; }
.mk-photo figcaption { left: var(--margin); bottom: 24px; }
@media (min-width: 768px) { .mk-photo { height: 440px; } }
@media (min-width: 1200px) { .mk-photo { height: 600px; } .mk-photo figcaption { left: max(var(--margin), calc((100% - 1280px) / 2)); bottom: 24px; } }

/* ---------- currency ---------- */
.mk-fx .mk-head--row [data-fx-time] { justify-self: start; }
@media (min-width: 768px) { .mk-fx .mk-head--row { grid-template-columns: 1fr auto; align-items: end; } }
@media (min-width: 1200px) { .mk-fx .mk-head--row { margin-bottom: 40px; } }
.fx-table { table-layout: fixed; }
.fx-table td { padding-block: 25px; }
.fx-table th:nth-child(1) { width: 18.75%; } .fx-table th:nth-child(2), .fx-table th:nth-child(3), .fx-table th:nth-child(4), .fx-table th:nth-child(5) { width: 15.625%; }
.fx-table td.sp { padding-block: 18px; padding-right: 0; }
.spark { display: block; width: 100%; max-width: 168px; height: 32px; overflow: visible; }
@media (max-width: 767px) {
  .fx-table th, .fx-table td { padding-right: 6px; }
  .fx-table td { padding-block: 18px; }
  .fx-table td.sp { padding-block: 14px; }
  .fx-table th:nth-child(1) { width: 22%; } .fx-table th:nth-child(2), .fx-table th:nth-child(3) { width: 18%; } .fx-table th:nth-child(5) { width: 24%; }
  .fx-table .chg::before { display: none; }
  .spark { height: 24px; max-width: 62px; margin-left: auto; }
}

/* ---------- instruments ---------- */
.mk-ins .ins-head { margin-bottom: 40px; }
.ins { border-top: 1px solid var(--g900); }
.ins-row { display: grid; grid-template-columns: 1fr auto 24px; grid-template-areas: "k n i" "t t t" "m m m"; align-items: center; gap: 0 12px; padding: 16px 0 18px; border-bottom: 1px solid var(--g900); transition: background .2s; }
.ins-row .k { grid-area: k; color: var(--g300); }
.ins-row .t { grid-area: t; margin-top: 8px; max-width: 250px; }
.ins-row .m { grid-area: m; color: #CFE0D7; font-size: 11px; margin-top: 4px; }
.ins-row .n { grid-area: n; }
.ins-row .icon { grid-area: i; transition: transform .2s; }
.ins-row:hover .icon { transform: translateX(3px); }
.ins-row:hover .t { color: var(--g300); }
@media (min-width: 768px) {
  .ins-row { grid-template-columns: 48px 1fr auto 24px; grid-template-areas: "k t n i" "k m n i"; gap: 0; padding: 18px 0; min-height: 91px; }
  .ins-row .n { margin-right: 24px; }
  .ins-row .t { margin: 0; max-width: none; }
  .ins-row .m { margin-top: 2px; }
  .ins-row .k { align-self: center; }
}
@media (min-width: 1200px) {
  .ins-row { grid-template-columns: 80px 440px 1fr auto 24px; grid-template-areas: "k t m n i"; gap: 0; padding: 0; min-height: 71px; }
  .ins-row .m { margin: 0; font-size: 12px; }
  .ins-row .n { margin-right: 24px; }
}
@media (min-width: 1200px) { .mk-title .t-mark { font-size: 71px; } }

/* ---------- phase 3: motion, hover, focus ---------- */
/* hero: globe settles in after the title */
.mk-globe img { animation: mk-globe-in 1.6s var(--ease) .25s both; }
@keyframes mk-globe-in { from { opacity: 0; transform: translateX(-50%) translateY(16px) scale(.985); } }
/* 24h timeline (rendered by markets.js inside .tl.draw) */
.tl.draw .tl-bar { transform: scaleX(0); transform-box: fill-box; transform-origin: left center; transition: transform .9s var(--ease); transition-delay: var(--d, 0s); }
.tl.draw.is-in .tl-bar { transform: none; }
.tl.draw [data-draw] { transition-duration: 1.1s; }
.tl.draw text[data-pop] { transform: translateX(-6px); }
.tl.draw.is-in text[data-pop] { transform: none; }
/* sparklines */
.fx-table.draw [data-draw] { transition-duration: 1.2s; }
.fx-table tbody tr { transition: background .15s; }
.fx-table tbody tr:hover { background: var(--k50); }
/* hours table: whole row opens the brokerage page (desktop/tablet, where the arrow link exists) */
@media (min-width: 768px) {
  .hours-table tbody tr { position: relative; cursor: pointer; }
  .hours-table td.arrow a::after { content: ""; position: absolute; inset: 0; }
  .hours-table td.arrow a:focus-visible { outline: none; }
  /* keep the link untransformed so its ::after stays sized to the row; nudge the icon instead */
  .hours-table tr:hover td.arrow a { transform: none; }
  .hours-table td.arrow .icon { transition: transform .3s var(--ease); }
  .hours-table tr:hover td.arrow .icon, .hours-table tr:has(a:focus-visible) td.arrow .icon { transform: translateX(4px); }
  .hours-table tbody tr:has(a:focus-visible) { outline: 2px solid var(--g700); outline-offset: -2px; background: var(--g50); }
}
/* instruments on dark: visible hover + focus */
.ins-row { transition: background .2s; }
.ins-row .t { transition: color .2s; }
.ins-row:hover, .ins-row:focus-visible { background: rgba(255,255,255,.03); }
.ins-row:focus-visible { outline: 2px solid var(--g300); outline-offset: -2px; }
.ins-row:focus-visible .t { color: var(--g300); }
.ins-row:focus-visible .icon { transform: translateX(3px); }
.mk-hero .crumb a { transition: color .2s; }
.mk-hero .crumb a:hover { color: var(--g700); }
/* full-bleed photo: cap height on very wide screens */
@media (min-width: 1600px) { .mk-photo { height: min(720px, 37.5vw); } }
@media (prefers-reduced-motion: reduce) {
  .mk-globe img { animation: none; }
  .tl.draw .tl-bar, .tl.draw text[data-pop] { transform: none !important; transition: none !important; }
}
/* narrow phones (< 420): tighten mono columns so city names and rates never collide */
@media (max-width: 419px) {
  .hours-table th:nth-child(3) { width: 104px; }
  .hours-table th:nth-child(4) { width: 72px; }
  .hours-table td:nth-child(3) { font-size: 11px; letter-spacing: 0; }
  .hours-table th, .hours-table td { padding-right: 8px; }
  .fx-table th, .fx-table td { font-size: 11px; letter-spacing: 0; padding-right: 4px; }
  .fx-table th:nth-child(1) { width: 25%; } .fx-table th:nth-child(2), .fx-table th:nth-child(3) { width: 18%; } .fx-table th:nth-child(5) { width: 19%; }
  .spark { max-width: 56px; }
}
@media (max-width: 419px) {
  .hours-table th { white-space: normal; }
  .fx-table th { font-size: 10px; }
  .fx-table th:nth-child(1) { width: 24%; } .fx-table th:nth-child(2) { width: 17%; } .fx-table th:nth-child(3) { width: 19%; }
}
@media (max-width: 419px) {
  .hours-table th { font-size: 10px; }
  .hours-table th:nth-child(3) { width: 100px; }
  .hours-table th:nth-child(4) { width: 82px; }
}
