/* ============================================================
   MIRROR — Homepage layout
   Uses tokens + components from mirror.css
   ============================================================ */
.home { background: var(--surface); min-height: 100vh; }
.home-wrap { max-width: 1240px; margin: 0 auto; padding: 0 40px; }

/* ---------- sticky header ---------- */
.home-hd {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background .25s ease, box-shadow .25s ease, border-color .25s ease;
  border-bottom: 1px solid transparent;
}
.home-hd__inner { max-width: 1240px; margin: 0 auto; padding: 0 40px; height: 72px; display: flex; align-items: center; gap: 26px; }
.home-hd:not(.is-solid) { background: transparent; }
.home-hd:not(.is-solid) .hh-link, .home-hd:not(.is-solid) .mr-logo { color: #fff; }
.home-hd:not(.is-solid) .mr-logo__mark { background: #fff; }
.home-hd:not(.is-solid) .mr-logo__mark::after { background: var(--accent); }
.home-hd:not(.is-solid) .mr-langtoggle { border-color: rgba(255,255,255,.4); }
.home-hd:not(.is-solid) .mr-langtoggle button, .home-hd:not(.is-solid) .mr-langtoggle a { color: rgba(255,255,255,.85); }
.home-hd:not(.is-solid) .mr-langtoggle button[aria-pressed="true"], .home-hd:not(.is-solid) .mr-langtoggle a[aria-pressed="true"] { background: #fff; color: var(--ink); }
.home-hd.is-solid { background: var(--card); border-bottom-color: var(--line); box-shadow: var(--shadow-1); }

.hh-nav { display: flex; align-items: center; gap: 2px; }
.hh-link { font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: var(--r-sm); cursor: pointer; transition: background .15s, color .15s; white-space: nowrap; }
.home-hd.is-solid .hh-link:hover { background: var(--surface-2); color: var(--ink); }
.home-hd:not(.is-solid) .hh-link:hover { background: rgba(255,255,255,.14); }
.hh-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.hh-cond { display: flex; align-items: center; gap: 9px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 8px 16px; width: 300px; cursor: text; opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s; pointer-events: none; }
.home-hd.is-solid .hh-cond { opacity: 1; transform: none; pointer-events: auto; }
.hh-cond input { border: none; background: none; outline: none; flex: 1; font-family: var(--font-ui); font-size: 14px; color: var(--ink); }
.hh-burger { display: none; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 660px; display: flex; align-items: flex-end; padding: 120px 0 0; overflow: hidden; }
.hero__photo {
  position: absolute; inset: 0; z-index: 0;
  background-color: #2a2620;
  background-image:
    linear-gradient(180deg, rgba(20,16,12,.30) 0%, rgba(20,16,12,.18) 38%, rgba(20,16,12,.72) 100%),
    repeating-linear-gradient(125deg, rgba(255,255,255,.035) 0 16px, rgba(255,255,255,0) 16px 34px);
}
.hero__tag { position: absolute; top: 92px; right: 28px; z-index: 1; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.5); }
.hero__inner { position: relative; z-index: 2; max-width: 1240px; margin: 0 auto; padding: 0 40px 0; width: 100%; }
.hero__eyebrow { font-family: var(--font-ui); font-weight: 600; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.75); margin-bottom: 16px; }
.hero__title { font-family: var(--font-display); font-weight: 500; font-size: clamp(40px, 5.4vw, 68px); line-height: 1.04; letter-spacing: -0.015em; color: #fff; max-width: 16ch; text-wrap: balance; }
.hero__sub { font-family: var(--font-ui); font-size: 18px; line-height: 1.55; color: rgba(255,255,255,.85); max-width: 46ch; margin-top: 18px; }

/* ---------- search card ---------- */
.searchcard { position: relative; z-index: 3; max-width: 1240px; margin: 36px auto -44px; padding: 0 40px; }
.searchcard__box { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-2); border: 1px solid var(--line-2); padding: 18px; }
.searchcard__row { display: grid; grid-template-columns: 2.2fr 1.2fr 1.2fr auto; gap: 12px; align-items: end; margin-top: 16px; }
.sc-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sc-field > label { font-size: 12px; font-weight: 600; color: var(--ink-3); padding-left: 2px; }
.sc-control { display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; transition: border-color .15s, box-shadow .15s; }
.sc-control:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.sc-control input, .sc-control select { border: none; background: none; outline: none; flex: 1; font-family: var(--font-ui); font-size: 15px; color: var(--ink); min-width: 0; cursor: pointer; }
.sc-control input { cursor: text; }
.sc-control input::placeholder { color: var(--ink-3); }
.searchcard .mr-btn { height: 49px; }

/* autocomplete */
.sc-ac { position: relative; }
.sc-acmenu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop); padding: 6px; z-index: 20; }
.sc-acitem { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer; font-size: 14px; color: var(--ink); }
.sc-acitem:hover, .sc-acitem--active { background: var(--surface-2); }
.sc-acitem .sub { color: var(--ink-3); font-size: 12px; margin-left: auto; }

/* ---------- generic section ---------- */
.sec { padding: 64px 0; }
.sec--pt { padding-top: 92px; }
.sechead { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.sechead__t { font-family: var(--font-display); font-weight: 500; font-size: 32px; line-height: 1.1; letter-spacing: -0.01em; color: var(--ink); }
.sechead__s { font-size: 15px; color: var(--ink-2); margin-top: 6px; }
.sec-viewall { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; cursor: pointer; }
.sec-viewall:hover { color: var(--accent-press); }

/* quick links */
.quick { display: flex; flex-wrap: wrap; gap: 10px; }

/* featured grid */
.pgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }

/* global markets */
.mgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.mcard { position: relative; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 5/4; cursor: pointer; box-shadow: var(--shadow-1); }
.mcard__photo { position: absolute; inset: 0; background-color: #2c2820; background-image: linear-gradient(180deg, rgba(20,16,12,.15), rgba(20,16,12,.78)), repeating-linear-gradient(130deg, rgba(255,255,255,.05) 0 13px, rgba(255,255,255,0) 13px 27px); transition: transform .35s ease; }
.mcard:hover .mcard__photo { transform: scale(1.05); }
.mcard__body { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 18px; color: #fff; }
.mcard__name { font-family: var(--font-display); font-weight: 500; font-size: 21px; line-height: 1.1; }
.mcard__count { font-size: 13px; color: rgba(255,255,255,.8); margin-top: 3px; }

/* top markets rail */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 280px; gap: 18px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.rail > * { scroll-snap-align: start; }
.citycard { border-radius: var(--r-md); overflow: hidden; background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow-1); cursor: pointer; transition: box-shadow .2s, transform .2s; }
.citycard:hover { box-shadow: var(--shadow-2); transform: translateY(-3px); }
.citycard__photo { position: relative; aspect-ratio: 16/10; background-color: var(--surface-2); background-image: repeating-linear-gradient(135deg, transparent 0 11px, color-mix(in oklab, var(--ink) 5%, transparent) 11px 12px); }
.citycard__body { padding: 14px 16px; }

/* editorial */
.jgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.jcard { display: flex; flex-direction: column; gap: 0; cursor: pointer; }
.jcard__photo { position: relative; aspect-ratio: 16/10; border-radius: var(--r-md); overflow: hidden; background-color: var(--surface-2); background-image: repeating-linear-gradient(135deg, transparent 0 11px, color-mix(in oklab, var(--ink) 5%, transparent) 11px 12px); margin-bottom: 14px; }
.jcard__tag { position: absolute; top: 12px; left: 12px; background: var(--card); color: var(--ink); font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: var(--r-pill); }
.jcard__title { font-family: var(--font-display); font-weight: 500; font-size: 21px; line-height: 1.18; color: var(--ink); }
.jcard:hover .jcard__title { color: var(--accent); }
.jcard__ex { font-size: 14px; line-height: 1.55; color: var(--ink-2); margin-top: 8px; }
.jcard__meta { display: flex; align-items: center; gap: 10px; margin-top: 12px; }

/* mobile drawer overlay */
.home-drawer { position: fixed; inset: 0; z-index: 90; display: none; }
.home-drawer--open { display: block; }
.home-drawer__scrim { position: absolute; inset: 0; background: rgba(20,16,12,.5); backdrop-filter: blur(3px); animation: mr-fade .2s ease; }
.home-drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(86vw, 360px); animation: mr-slide .25s cubic-bezier(.2,.7,.3,1); }
@keyframes mr-fade { from { opacity: 0; } }
@keyframes mr-slide { from { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .home-drawer__scrim, .home-drawer__panel { animation: none; } }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .pgrid { grid-template-columns: repeat(2, 1fr); }
  .mgrid { grid-template-columns: repeat(2, 1fr); }
  .jgrid { grid-template-columns: 1fr; gap: 28px; }
  .hh-nav, .hh-cond { display: none !important; }
  .hh-burger { display: inline-flex; }
  .home-hd__inner { gap: 12px; }
}
@media (max-width: 760px) {
  .home-wrap, .hero__inner, .searchcard, .home-hd__inner { padding-left: 20px; padding-right: 20px; }
  .searchcard__row { grid-template-columns: 1fr; }
  .searchcard .mr-btn { width: 100%; }
  .pgrid { grid-template-columns: 1fr; }
  .mgrid { grid-template-columns: 1fr 1fr; }
  .hero { min-height: 560px; }
  .sechead { flex-direction: column; align-items: flex-start; }
  .sec { padding: 48px 0; }
}

/* a11y (Phase 5) — light focus ring for header links on the dark hero */
.home-hd:not(.is-solid) .hh-link:focus-visible,
.home-hd:not(.is-solid) .mr-langtoggle a:focus-visible {
  box-shadow: 0 0 0 3px rgba(255,255,255,.55);
  outline: none;
}
