/* ==========================================================================
   LOCKWOOD — components.css
   Component recipes: REDBOX, buttons/pills, availability table, ticker,
   stat counters. Page-level composition lives in pages.css.
   ========================================================================== */

/* ---- REDBOX (placeholder media system — see redbox.js) ------------------
   Default (and no-JS) state renders the red prompt box. When redbox.js
   confirms the asset exists it injects the media and adds .is-live.
   The wrapper always carries aspect-ratio, so layout never shifts.       */

.redbox {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9; /* fallback — redbox.js sets the real ratio from data-ar */
  background: var(--ph-red);
  overflow: hidden;
}

.redbox__prompt {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: clamp(16px, 2vw, 24px);
  padding-bottom: 56px; /* clears the meta line */
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: #fff;
  -webkit-user-select: text;
  user-select: text;
}

.redbox__meta {
  position: absolute;
  left: clamp(16px, 2vw, 24px);
  right: clamp(16px, 2vw, 24px);
  bottom: 16px;
  z-index: 2;
  background: var(--ph-red); /* masks prompt text scrolling beneath */
  padding-block: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.redbox__copied {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 14, 17, 0.88);
  color: var(--bone);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s var(--ease-soft);
}

.redbox.is-copied .redbox__copied {
  opacity: 1;
}

.redbox.is-placeholder {
  cursor: copy;
}

/* Live state: media fills the wrapper, prompt apparatus disappears */

.redbox > img,
.redbox > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.redbox.is-live {
  background: var(--ink-2);
  cursor: auto;
}

.redbox.is-live .redbox__prompt,
.redbox.is-live .redbox__meta,
.redbox.is-live .redbox__copied {
  display: none;
}

/* ---- Buttons & pills ------------------------------------------------------
   Pills are the only rounded element on the site.                          */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--bone);
  background: transparent;
  transition:
    border-color 0.2s var(--ease-soft),
    background-color 0.2s var(--ease-soft),
    color 0.2s var(--ease-soft);
}

.btn:hover {
  border-color: var(--brass);
  background: var(--brass);
  color: var(--ink);
}

.btn--ghost:hover {
  background: transparent;
  color: var(--brass);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--bone-dim);
  background: transparent;
  transition:
    border-color 0.2s var(--ease-soft),
    color 0.2s var(--ease-soft);
}

.pill:hover {
  border-color: var(--brass);
  color: var(--bone);
}

.pill.is-active,
.pill[aria-pressed="true"] {
  border-color: var(--brass);
  color: var(--brass);
}

/* Text link with sliding brass underline (cards, "All holdings →") */

.link-line {
  position: relative;
  display: inline-block;
  padding-bottom: 3px;
}

.link-line::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--brass);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-2) var(--ease-out);
}

.link-line:hover::after,
a:hover .link-line::after,
.card:hover .link-line::after {
  transform: scaleX(1);
}

/* ---- Availability table (Derwent/GPE register) --------------------------- */

.tbl-wrap {
  overflow-x: auto;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.03em;
}

.tbl th,
.tbl td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.tbl th {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-mono);
  color: var(--bone-dim);
}

.tbl th[data-sort] {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.tbl th[data-sort]:hover,
.tbl th[aria-sort="ascending"],
.tbl th[aria-sort="descending"] {
  color: var(--brass);
}

.tbl td.is-num {
  font-variant-numeric: tabular-nums;
}

.tbl tbody tr {
  transition: background-color 0.2s var(--ease-soft);
}

.tbl tbody tr:hover {
  background: var(--ink-2);
}

.tbl .tbl__arrow {
  color: transparent;
  transition: color 0.2s var(--ease-soft);
}

.tbl tbody tr:hover .tbl__arrow {
  color: var(--brass);
}

/* ---- Stat counters -------------------------------------------------------- */

.stat {
  display: grid;
  gap: 10px;
}

.stat__value {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat__label {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--bone-dim);
}

/* ---- Ledger ticker ---------------------------------------------------------
   Duplicated track, linear infinite. Pauses on hover/focus; static under
   reduced motion (base.css kills the animation globally).                  */

.ticker {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-block: 18px;
}

/* The track holds two identical halves (second one aria-hidden). Spacing
   lives INSIDE each half (item gap + trailing padding) so the track is
   exactly two half-widths wide and the -50% loop is seamless. */
.ticker__track {
  display: flex;
  width: max-content;
  animation: ticker-scroll 40s linear infinite;
}

.ticker__track > * {
  display: flex;
  align-items: center;
  gap: 64px;
  padding-right: 64px;
  flex: none;
}

.ticker:hover .ticker__track,
.ticker:focus-within .ticker__track {
  animation-play-state: paused;
}

.ticker__item {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--bone-dim);
  white-space: nowrap;
}

.ticker__item strong {
  font-weight: 500;
  color: var(--brass);
}

.ticker__item a:hover {
  color: var(--bone);
}

@keyframes ticker-scroll {
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker .ticker__track {
    animation: none;
    flex-wrap: wrap;
    width: auto;
  }

  /* Halves must be allowed to wrap too, or the static list clips */
  .ticker .ticker__track > * {
    flex: 1 1 100%;
    max-width: 100%;
    flex-wrap: wrap;
    padding-right: 0;
    row-gap: 12px;
  }

  /* Hide the duplicate track when static */
  .ticker .ticker__track > [aria-hidden="true"] {
    display: none;
  }
}

/* ---- Filter bar (Holdings / Space / People / Ledger) -------------------------
   Sticky under the header. Mono pills; active pill = brass border + text.
   Result count rides the right edge.                                       */

.filterbar {
  position: sticky;
  top: 63px; /* header height */
  z-index: calc(var(--z-header) - 1);
  background: var(--ink);
  border-block: 1px solid var(--line);
  padding-block: 14px;
}

.filterbar__inner {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
}

.filterbar__group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filterbar__count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--bone-dim);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .filterbar__count {
    margin-left: 0;
    flex-basis: 100%;
  }
}

/* Pill-shaped <select> */
select.pill {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='6' viewBox='0 0 9 6'%3E%3Cpath d='M1 1l3.5 3.5L8 1' fill='none' stroke='%23A39D8F'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  color: var(--bone);
}

select.pill:hover {
  border-color: var(--brass);
}

select.pill.is-active {
  border-color: var(--brass);
  color: var(--brass);
}

/* Filter re-render: 250ms fade/reflow */
.filterable {
  transition: opacity 0.25s var(--ease-soft);
}

.filterable.is-filtering {
  opacity: 0;
}

/* ---- Spec strip (property template) -------------------------------------------- */

.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--gutter);
  border-block: 1px solid var(--line);
  padding-block: clamp(28px, 4vh, 44px);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
}

.spec {
  display: grid;
  gap: 8px;
  align-content: start;
}

.spec__k {
  color: var(--bone-dim);
}

.spec__v {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ---- Next-building pager band ------------------------------------------------------ */

.pager {
  position: relative;
  display: block;
  min-height: clamp(300px, 42vh, 460px);
  overflow: hidden;
  border-top: 1px solid var(--line);
  color: var(--bone);
}

.pager:hover {
  color: var(--bone);
}

.pager__media,
.pager__media .redbox {
  position: absolute;
  inset: 0;
  height: 100%;
}

.pager__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--scrim);
  pointer-events: none;
}

.pager__media .redbox {
  transition: transform var(--dur-2) var(--ease-out);
}

.pager:hover .pager__media .redbox {
  transform: scale(1.03);
}

.pager__inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  align-content: end;
  min-height: inherit;
  padding-block: clamp(32px, 5vh, 56px);
}

.pager__name {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: 1.05;
}

/* ---- Property card --------------------------------------------------------
   REDBOX 4:5 → mono meta → serif name with sliding brass underline.        */

.card {
  display: block;
  color: var(--bone);
}

.card:hover {
  color: var(--bone); /* the brass lives in the underline, not the text */
}

.card__media {
  overflow: hidden;
}

.card__media .redbox {
  transition: transform var(--dur-2) var(--ease-out);
}

.card:hover .card__media .redbox,
.card:focus-visible .card__media .redbox {
  transform: scale(1.05);
}

.card__meta {
  display: block;
  margin-top: 18px;
}

.card__title {
  margin-top: 10px;
  font-size: var(--fs-h3);
}

/* ---- Market row (mono list next to the map) ------------------------------- */

.market-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--gutter);
  padding-block: 13px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--bone);
}

.market-row:first-child {
  border-top: 1px solid var(--line);
}

.market-row:hover {
  color: var(--brass);
}

/* ---- US map (hand-built SVG, markup from data.js) --------------------------- */

.usmap {
  position: relative;
}

.usmap svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.usmap__outline {
  fill: none;
  stroke: var(--line);
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}

.usmap__dot {
  fill: var(--brass);
  transition: transform 0.2s var(--ease-soft);
  transform-box: fill-box;
  transform-origin: center;
}

.usmap__hit {
  fill: transparent; /* generous pointer target */
}

.usmap__pulse {
  fill: none;
  stroke: var(--brass);
  stroke-width: 0.35;
  transform-box: fill-box;
  transform-origin: center;
  animation: map-pulse 3.2s ease-out infinite;
}

@keyframes map-pulse {
  0%   { transform: scale(0.3); opacity: 0.8; }
  70%  { transform: scale(1.2); opacity: 0; }
  100% { transform: scale(1.2); opacity: 0; }
}

.usmap__node {
  cursor: pointer;
}

.usmap__node:hover .usmap__dot,
.usmap__node:focus-visible .usmap__dot {
  transform: scale(1.6);
}

.usmap__tip {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -130%);
  background: var(--ink-2);
  border: 1px solid var(--line);
  padding: 9px 14px;
  white-space: nowrap;
  pointer-events: none;
  color: var(--bone);
}

/* ---- Page curtain (transitions) ---------------------------------------------
   Authored as the first element of <body>. Covers the page from first paint
   when JS is available (html.js set by the inline head script); motion.js
   wipes it up on load and back down on same-origin navigation.            */

.curtain {
  position: fixed;
  inset: 0;
  z-index: var(--z-curtain);
  background: var(--ink);
  display: none;
  pointer-events: none;
}

html.js .curtain {
  display: block;
}

/* ---- Site header --------------------------------------------------------------
   Fixed; transparent over the hero, gains ink fill + bottom hairline after
   80px of scroll (class toggled in main.js).                              */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  padding-block: 20px;
  background: transparent;
  transition: background-color 0.35s var(--ease-soft);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--line);
  opacity: 0;
  transition: opacity 0.35s var(--ease-soft);
}

.site-header.is-scrolled {
  background: var(--ink);
}

.site-header.is-scrolled::after {
  opacity: 1;
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gutter);
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  line-height: 1;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 44px);
}

.nav-mono {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--bone);
  transition: color 0.2s var(--ease-soft);
}

.nav-mono:hover {
  color: var(--brass);
}

/* ---- Menu overlay ------------------------------------------------------------
   Full-screen ink panel injected by main.js. Left: primary nav in display
   serif. Right (mono): the nine markets, HQ address, socials.             */

.menu {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  background: var(--ink);
  display: none;
  overflow-y: auto;
}

.menu.is-open {
  display: block;
}

.menu__top {
  position: sticky;
  top: 0;
  padding-block: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gutter);
  background: var(--ink);
}

.menu__inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(48px, 6vw, 96px);
  padding-block: clamp(40px, 9vh, 110px) 64px;
}

@media (max-width: 860px) {
  .menu__inner {
    grid-template-columns: 1fr;
  }
}

.menu__nav ol {
  list-style: none;
  display: grid;
  gap: clamp(10px, 2.4vh, 24px);
}

.menu__link {
  display: inline-flex;
  align-items: baseline;
  gap: 20px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.05;
}

.menu__index {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--ls-mono);
  color: var(--bone-dim);
}

.menu__aside {
  display: grid;
  gap: clamp(28px, 4vh, 44px);
  align-content: start;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
}

.menu__label {
  display: block;
  color: var(--brass);
  margin-bottom: 14px;
}

.menu__markets {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px 24px;
}

.menu__markets a {
  color: var(--bone-dim);
}

.menu__markets a:hover {
  color: var(--brass);
}

.menu__address {
  color: var(--bone-dim);
  font-style: normal;
  line-height: 1.8;
}

.menu__social {
  display: flex;
  gap: 28px;
}

.menu__social a {
  color: var(--bone-dim);
}

.menu__social a:hover {
  color: var(--brass);
}

/* ---- Site footer (RIPCO register) --------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(64px, 9vh, 110px) 28px;
}

.site-footer__offices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 44px var(--gutter);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.03em;
}

.office {
  display: grid;
  gap: 8px;
  align-content: start;
}

.office__market {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-mono);
}

.office a,
.office span {
  color: var(--bone-dim);
}

.office a:hover {
  color: var(--brass);
}

.site-footer__signoff {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--fs-h2);
  line-height: 1;
  margin-block: clamp(64px, 9vh, 110px) clamp(40px, 6vh, 72px);
}

.site-footer__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--gutter);
  flex-wrap: wrap;
  padding-bottom: 40px;
}

.mailing {
  display: grid;
  gap: 14px;
  max-width: 440px;
  flex: 1 1 320px;
}

.mailing__label {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--bone-dim);
}

.mailing__row {
  display: flex;
  gap: 12px;
}

.mailing input {
  flex: 1;
  min-width: 0;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  color: var(--bone);
  transition: border-color 0.2s var(--ease-soft);
}

.mailing input::placeholder {
  color: var(--bone-dim);
}

.mailing input:focus-visible {
  outline: none;
  border-bottom-color: var(--brass);
}

.mailing__success {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--brass);
}

.site-footer__fine {
  display: flex;
  justify-content: space-between;
  gap: var(--gutter);
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--bone-dim);
}
