/* V10: the real elevator. All stage sizes are in render-frame pixels (2560 x 1600);
   js/v10.js scales #stage to the screen and writes the layout.json positions. */

:root {
  --felt-ink: #ebe3cf;
  --felt-dim: #b9ad92;
  --night: #0a0705;
  --brass: #b08a4e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--night);
  color: var(--felt-ink);
  font-family: "Libre Franklin", system-ui, sans-serif;
}

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 50;
  padding: 10px 14px; background: #1b130c; color: var(--felt-ink);
}
.skip-link:focus { top: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

#track { width: 1px; pointer-events: none; }

/* ---- stage */

#stage {
  position: fixed;
  left: 0; top: 0;
  width: 2560px; height: 1600px;
  transform-origin: 0 0;
  overflow: hidden;
  contain: layout paint;
}

#stage img { position: absolute; left: 0; top: 0; display: block; user-select: none; }

#shaft {
  position: absolute; inset: 0;
  background: url("../assets/img/elevator/shaft.webp") 0 0 / 2560px 1600px repeat-y;
}

.door { will-change: transform; }

#strip { position: absolute; left: 0; top: 0; width: 2560px; will-change: transform; }

.floor { position: absolute; left: 0; width: 2560px; height: 1600px; }
.slab { will-change: auto; }

.needle {
  will-change: transform;
}

/* ---- directory board: white felt letters pressed into black ribbed felt */

.board {
  position: absolute;
  display: flex; flex-direction: column; justify-content: center;
  padding: 26px 34px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--felt-ink);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.75), 0 0 1px rgba(235, 227, 207, 0.35);
  opacity: 0.94;
}
/* faint glass sheen over the letters */
.board::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 236, 200, 0.07) 0%, rgba(255, 236, 200, 0) 38%);
}

.board > * { margin: 0; }
.board__label {
  font-size: 19px; font-weight: 500; color: var(--felt-dim);
  margin-bottom: 10px;
}
.board__title {
  font-size: 44px; font-weight: 600; line-height: 1.05;
  letter-spacing: 0.07em;
  margin-bottom: 14px;
}
/* the hero name wraps to two lines (ASHRITH / CHENNURI) and the whole board must fit its box */
.board--hero .board__title { font-size: 66px; letter-spacing: 0.08em; line-height: 1.02; margin-bottom: 12px; }
.board--hero .board__copy { margin-bottom: 8px; }
.board--hero .board__copy--small { font-size: 18px; margin-bottom: 0; }
.board__copy { font-size: 22px; line-height: 1.38; font-weight: 400; margin-bottom: 12px; }
.board__copy--small { font-size: 19px; }
.board__label + .board__copy { margin-top: 0; }
.board__copy + .board__label { margin-top: 6px; }

.board__list {
  list-style: none; padding: 0; margin: 0;
  font-size: 19px; line-height: 1.5;
}
.board__list li::before { content: "· "; color: var(--felt-dim); }

.board__link {
  align-self: flex-start;
  margin-top: 6px;
  padding: 10px 18px;
  font-size: 20px; font-weight: 600; letter-spacing: 0.12em;
  color: var(--felt-ink); text-decoration: none;
  border: 2px solid var(--felt-dim);
}
.board__link:hover, .board__link:focus-visible { background: rgba(235, 227, 207, 0.12); outline: none; }
/* contact email: plain felt letters, kept lowercase so it reads as an address */
.board__email {
  align-self: flex-start;
  margin-top: 4px;
  font-size: 24px; font-weight: 600;
  text-transform: none; letter-spacing: 0.04em;
  color: var(--felt-ink); text-decoration: none;
  border-bottom: 2px solid var(--felt-dim);
}
.board__email:hover, .board__email:focus-visible { color: #fff; border-bottom-color: var(--felt-ink); outline: none; }
.board__foot { margin-top: 18px; margin-bottom: 0; }

/* floors 35 and 25: long copy, so these two boards use smaller type (scoped by .board--tight) */
.board--tight .board__label { font-size: 16px; margin-bottom: 8px; }
.board--tight .board__title { font-size: 38px; margin-bottom: 10px; }
.board--tight .board__copy { font-size: 20px; line-height: 1.3; margin-bottom: 8px; }
.board--tight .board__copy--small { font-size: 16px; }

/* ---- operator panel: a small bronze plate with round buttons */

#panel {
  position: fixed; right: 22px; top: 50%; z-index: 10;
  transform: translateY(-50%);
  display: grid; gap: 6px;
  padding: 14px 10px;
  background: linear-gradient(160deg, #2a1d11, #120c07);
  border: 1px solid #4a3520;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 220, 160, 0.08);
}
#panel button {
  width: 38px; height: 38px; border-radius: 50%;
  font: 600 12px/1 "Libre Franklin", sans-serif; letter-spacing: 0.04em;
  color: #d9c9a4;
  background: radial-gradient(circle at 40% 35%, #3b2a19, #160e07 70%);
  border: 2px solid #6b4f2c;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.7);
  cursor: pointer;
}
#panel button:hover { border-color: var(--brass); }
#panel button:focus-visible { outline: 2px solid var(--felt-ink); outline-offset: 2px; }
#panel button.is-lit {
  color: #2a1606;
  background: radial-gradient(circle at 40% 35%, #ffe2a8, #e0a35a 60%, #a8662a);
  border-color: #c99654;
  box-shadow: 0 0 14px rgba(255, 190, 110, 0.55);
}

#hint {
  position: fixed; left: 50%; bottom: 22px; z-index: 10;
  transform: translateX(-50%);
  margin: 0;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--felt-dim);
  transition: opacity 0.4s;
}
#hint.is-gone { opacity: 0; }

#plaque { display: none; }

/* ---- phone: doorway on top, the current board as a plaque below */

@media (max-aspect-ratio: 1/1) {
  #panel {
    top: auto; bottom: 14px; right: 50%;
    transform: translateX(50%);
    /* 15 buttons: eight on the top row, seven centred below */
    display: flex; flex-wrap: wrap; justify-content: center; gap: 4px;
    width: 282px; padding: 8px 6px;
  }
  #panel button { width: 30px; height: 30px; font-size: 11px; }
  #hint { bottom: 104px; }
  /* boards stay in the page for screen readers; the plaque shows the text */
  .board { opacity: 0; pointer-events: none; }
  #plaque {
    display: block;
    position: fixed; left: 0; right: 0; z-index: 5;
    padding: 22px 22px 118px;
    background: linear-gradient(#0d0906, #080504);
    border-top: 3px solid #3a2815;
    text-transform: uppercase; letter-spacing: 0.08em;
    text-shadow: 0 1px 0 #000;
    overflow: auto;
  }
  #plaque > * { margin: 0 0 6px; }
  #plaque .board__label { font-size: 11px; }
  #plaque .board__title { font-size: 24px; }
  #plaque .board__copy { font-size: 13px; line-height: 1.28; }
  #plaque .board__list { font-size: 12px; line-height: 1.35; columns: 1; }
  #plaque .board__link { font-size: 12px; padding: 8px 12px; }
  #plaque .board__email { font-size: 15px; }
  #plaque .board__foot { margin-top: 18px; }
}

/* ---- college photo viewer: the "See all N photos" buttons open it.
   Same felt type, warm near-black, and bronze hairlines as the boards. */

button.board__link {
  background: transparent; font-family: inherit; line-height: inherit;
  text-transform: uppercase; text-shadow: inherit; cursor: pointer;
}
button.board__link:hover { background: rgba(235, 227, 207, 0.12); }
button.board__link:focus-visible {
  background: rgba(235, 227, 207, 0.12); outline: 2px solid var(--felt-ink); outline-offset: 3px;
}

html.gallery-lock, html.gallery-lock body { overflow: hidden; }
#gallery[hidden] { display: none; }
#gallery {
  position: fixed; inset: 0; z-index: 60;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 14px;
  padding: 24px 30px 22px;
  background: radial-gradient(120% 90% at 50% 35%, #1c130b 0%, #0a0705 60%, #050403 100%);
  color: var(--felt-ink);
  text-transform: uppercase; letter-spacing: 0.09em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.75);
}
/* a bronze hairline frame, inset from the edge */
#gallery::before {
  content: ""; position: absolute; inset: 12px;
  border: 1px solid #4a3520; pointer-events: none;
}

.gallery__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
.gallery__title { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: 0.08em; }
.gallery__count {
  margin: 0 0 0 auto; font-size: 18px; font-weight: 500;
  letter-spacing: 0.12em; color: var(--felt-dim);
}
.gallery__bar .gallery__close { margin: 0; }

.gallery__stage { position: relative; display: flex; align-items: stretch; gap: 18px; min-height: 0; }
.gallery__figure { flex: 1; min-width: 0; min-height: 0; margin: 0; display: flex; }
.gallery__img {
  flex: 1; min-width: 0; width: 100%; height: 100%;
  object-fit: contain; display: block;
}
.gallery__nav {
  flex: 0 0 auto; align-self: center; width: 46px; height: 46px; padding: 0;
  display: grid; place-items: center; border-radius: 50%;
  color: #d9c9a4;
  background: radial-gradient(circle at 40% 35%, #3b2a19, #160e07 70%);
  border: 2px solid #6b4f2c;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.7);
  cursor: pointer;
}
.gallery__nav:hover { border-color: var(--brass); }
.gallery__nav svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

.gallery__caption {
  margin: 0 auto; max-width: 980px; min-height: 2.8em;
  font-size: 17px; line-height: 1.4; letter-spacing: 0.06em;
  text-align: center;
}

.gallery__strip {
  position: relative; display: flex; align-items: center; gap: 8px;
  height: 84px; padding: 0 4px; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin; scrollbar-color: #4a3520 transparent;
}
.gallery__thumb {
  flex: 0 0 auto; height: 72px; padding: 0; margin: 0;
  background: #120c07; border: 1px solid #3a2815; cursor: pointer;
  opacity: 0.5;
}
.gallery__thumb img { display: block; height: 70px; width: auto; }
.gallery__thumb:hover { opacity: 0.85; }
.gallery__thumb[aria-current="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--brass); }

.gallery__nav:focus-visible,
.gallery__close:focus-visible,
.gallery__thumb:focus-visible { outline: 2px solid var(--felt-ink); outline-offset: 2px; }

/* phone: the arrows sit on the photo's edges so the photo keeps the full width */
@media (max-aspect-ratio: 1/1) {
  #gallery { padding: 18px 14px 16px; gap: 10px; }
  #gallery::before { inset: 8px; }
  .gallery__title { flex: 0 0 100%; font-size: 17px; letter-spacing: 0.06em; }
  .gallery__count { margin-left: 0; margin-right: auto; font-size: 15px; }
  .gallery__bar .gallery__close { font-size: 15px; padding: 8px 14px; }
  .gallery__figure { padding: 0; }
  .gallery__nav {
    position: absolute; top: 50%; margin-top: -23px; z-index: 1;
    background: rgba(10, 7, 5, 0.8);
  }
  .gallery__nav--prev { left: 4px; }
  .gallery__nav--next { right: 4px; }
  .gallery__caption { font-size: 14px; min-height: 0; }
  .gallery__strip { height: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  #hint { transition: none; }
}
