/* ==========================================================================
   HALL VIII · IIT KANPUR  -  styles.css

   Table of contents
   01. DESIGN TOKENS
   02. BASE / RESET
   03. SITE HEADER & NAVIGATION
   04. LAYOUT PRIMITIVES & TYPOGRAPHY
   05. HERO & BUTTONS
   06. STATUS DOT
   07. PANELS
   08. NOTICE TICKER
   09. ABOUT & STATS
   10. NOTICES & EVENTS
   11. FACILITIES TABLE
   12. PEOPLE CARDS & FILTERS
   13. LEAD CARD
   14. PORTAL LINKS
   15. FOOTER
   16. BASE RESPONSIVE & REDUCED MOTION
   17. ENHANCEMENT LAYER  ·  AMBIENT BACKGROUND, PROGRESS BAR, HERO CANVAS
   18. HERO EXTRAS
   19. BLUEPRINT ILLUSTRATION
   20. GRADIENT ACCENTS
   21. SCROLL REVEAL
   22. SECTION DECORATIONS
   23. FOOTER ACCENT
   24. CURSOR SPOTLIGHT GRID
   25. HERO HEADLINE ANIMATION
   26. BUTTON POSITIONING
   27. TABLE ROW ENTRANCE
   28. HOVER POLISH
   29. REDUCED MOTION (REVEALS)
   30. GALLERY SLIDESHOW
   31. DISCIPLINE ROTATOR
   32. SCHOLAR JOURNEY TIMELINE
   33. PILLAR CARDS
   34. UTILITIES  ·  ACCESSIBILITY & CONTROLS
   35. TYPOGRAPHY REFINEMENTS
   36. NOTICE BAR, NOTICE POPUP & COMING-SOON POPUP
   37. WHITE THEME OVERRIDES
   38. FACILITIES (common-room highlight and service tiles)

   Conventions
   - Colours/fonts come only from the tokens in section 01 (var(--acc) etc.).
   - Theme: light by default; dark via [data-theme="dark"]; plain white via [data-theme="white"] (header toggle).
   - Class names: .panel = card surface, .rv/.in = scroll reveal, .on = active state.
   - Sections 01-15 are the base design; 16+ are enhancement layers that override it.
   ========================================================================== */

/* ==========================================================================
   01. DESIGN TOKENS
   Colours, fonts and shadow as CSS custom properties. Light is the default; dark values are applied by the manual toggle (html[data-theme="dark"]). To restyle the site, edit these values first.
   ========================================================================== */

:root {
  --v: #6d3fe0;
  --pk: #c9246a;
  --on: #fff;
  --ao: 0.1;
  --bg: #f6f8fc;
  --panel: #fff;
  --ink: #0f1b33;
  --mute: #516079;
  --line: #d3dcea;
  --grid: #e7edf6;
  --acc: #0b5fd1;
  --hot: #b45309;
  --ok: #0b8a4f;
  --d: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --b: "Inter", "Segoe UI", system-ui, sans-serif;
  --m: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --sh:
    0 1px 2px rgba(15, 27, 51, 0.05), 0 8px 22px -12px rgba(15, 27, 51, 0.18);
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

:root[data-theme="dark"] {
  --v: #a78bfa;
  --pk: #ff5fa2;
  --on: #04122a;
  --ao: 0.38;
  --bg: #071a33;
  --panel: #0b2447;
  --ink: #e6f1ff;
  --mute: #8fb0d6;
  --line: #1f4274;
  --grid: #0f2c52;
  --acc: #5ec8f2;
  --hot: #ffb000;
  --ok: #4be39a;
  color-scheme: dark;
}

/* White theme: plain white page, dark-grey text and one blue accent (--hot is a grey here). --v and --pk equal --acc
   so every gradient in the design collapses to a single flat colour. Decorative layers are
   switched off in section 37. */
:root[data-theme="white"] {
  --v: #1f4fd8;
  --pk: #1f4fd8;
  --on: #fff;
  --ao: 0;
  --bg: #fff;
  --panel: #fff;
  --ink: #111827;
  --mute: #4b5563;
  --line: #d9dde3;
  --grid: #f3f4f6;
  --acc: #1f4fd8;
  --hot: #374151;
  --ok: #15803d;
  --sh: none;
  color-scheme: light;
}

/* ==========================================================================
   02. BASE / RESET
   Smooth scrolling (offset for the sticky header), box-sizing reset, page background grid, links and focus ring.
   ========================================================================== */

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(64px + env(safe-area-inset-top, 0px));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--b);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--hot);
  outline-offset: 3px;
}

/* Paints the notch / status-bar strip in the page colour on phones */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  background: var(--bg);
  z-index: 60;
}

/* ==========================================================================
   03. SITE HEADER & NAVIGATION
   Sticky translucent header, brand, horizontally scrollable nav (the active link gets .on from JS).
   ========================================================================== */

header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.bar {
  max-width: 1180px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  height: 64px;
}

.brand {
  font: 700 20px var(--d);
  white-space: nowrap;
}

.brand b {
  color: var(--acc);
}

/* Logos: IIT Kanpur seal + Hall VIII emblem sit before the wordmark (header), in the hero and in the footer. */
.brand,
.brand-iitk {
  display: inline-flex;
  align-items: center;
}

.brand {
  gap: 10px;
}

.brand-iitk {
  flex: none;
  padding-right: 14px;
  margin-right: -6px;
  border-right: 1px solid var(--line);
}

.brand-iitk img,
.brand-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: 48px;
  object-fit: contain;
}

.hero-logo {
  display: block;
  height: clamp(72px, 9vw, 120px);
  width: auto;
  object-fit: contain;
  margin-bottom: 18px;
  filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--acc) 28%, transparent));
}

.f-logos {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.f-logos img {
  display: block;
  height: 56px;
  width: auto;
  object-fit: contain;
}

:root[data-theme="dark"] .brand-iitk img,
:root[data-theme="dark"] .f-logos img:first-child {
  background: #fff;
  border-radius: 50%;
  padding: 2px;
}

nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-left: auto;
}

nav a {
  padding: 8px 12px;
  font: 500 14px var(--m);
  color: var(--mute);
  border-radius: 4px;
  white-space: nowrap;
  transition: 0.2s;
}

nav a:hover,
nav a.on {
  color: var(--ink);
  background: var(--grid);
}

main,

/* ==========================================================================
   04. LAYOUT PRIMITIVES & TYPOGRAPHY
   .wrap / main share the 1180px content column. Section spacing, headings (h2), sub-headings (.sub) and the mono "// tag" labels.
   ========================================================================== */

.wrap {
  max-width: 1180px;
  margin: auto;
  padding: 0 20px;
}

section {
  padding: 88px 0 8px;
}

h2 {
  font: 700 clamp(28px, 4vw, 42px)/1.1 var(--d);
  margin: 0 0 8px;
}

.sub {
  color: var(--mute);
  max-width: 62ch;
  margin: 0 0 32px;
}

.tag {
  font: 500 13px var(--m);
  color: var(--hot);
}

/* hero */

/* ==========================================================================
   05. HERO & BUTTONS
   Two-column hero: copy on the left, animated blueprint SVG on the right, with a crosshair readout (.xh) and the stat line. Also the shared .btn component.
   ========================================================================== */

.hero {
  position: relative;
  min-height: min(calc(100vh - 64px), 780px);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 32px;
  align-items: center;
  padding: 40px 0;
  overflow: hidden;
  cursor: crosshair;
}

.hero h1 {
  font: 700 clamp(40px, 6.4vw, 84px)/0.98 var(--d);
  margin: 12px 0 20px;
}

.hero h1 span {
  color: var(--acc);
}

.hero p {
  max-width: 50ch;
  color: var(--mute);
  font-size: 18px;
}

.btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.btn {
  padding: 12px 20px;
  border: 1px solid var(--acc);
  font: 500 14px var(--m);
  border-radius: 3px;
  transition: 0.2s;
}

.btn.p {
  background: var(--acc);
  color: var(--bg);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 var(--hot);
}

.draw {
  width: 100%;
  height: auto;
  color: var(--acc);
}

/* Paths use pathLength="1", so dasharray/offset 1 draws any path regardless of its real length */
.draw .d {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: dr 2.4s cubic-bezier(0.6, 0, 0.2, 1) forwards;
  animation-delay: calc(var(--i, 0) * 0.12s);
}

.draw .h {
  stroke: var(--hot);
  stroke-width: 1;
}

.draw text {
  fill: var(--hot);
  font: 12px var(--m);
  opacity: 0;
  animation: fi 0.6s 2.2s forwards;
}

.draw .w {
  fill: var(--acc);
  opacity: 0;
  animation: fi 0.5s forwards;
  animation-delay: calc(1.6s + var(--i) * 0.05s);
}

@keyframes dr {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes fi {
  to {
    opacity: 0.9;
  }
}

.xh {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.xh i {
  position: absolute;
  background: var(--acc);
  opacity: 0.35;
}

.xh .v {
  width: 1px;
  top: 0;
  bottom: 0;
  left: 0;
}

.xh .hz {
  height: 1px;
  left: 0;
  right: 0;
  top: 0;
}

.xy {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font: 500 12px var(--m);
  color: var(--mute);
}

.stat-line {
  display: flex;
  gap: 18px;
  margin-top: 30px;
  font: 400 13px var(--m);
  color: var(--mute);
  flex-wrap: wrap;
}

/* ==========================================================================
   06. STATUS DOT
   Pulsing green dot used in the hero tag and the facilities table.
   ========================================================================== */

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 6px;
  animation: pl 1.8s infinite;
}

@keyframes pl {
  50% {
    box-shadow: 0 0 0 6px transparent;
    opacity: 0.5;
  }
  0% {
    box-shadow: 0 0 0 0 var(--ok);
  }
}

/* panels */

/* ==========================================================================
   07. PANELS
   The shared bordered surface (with blueprint corner marks) used by almost every card on the page.
   ========================================================================== */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  position: relative;
}

.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid var(--acc);
}

.panel::before {
  top: -1px;
  left: -1px;
  border-right: 0;
  border-bottom: 0;
}

.panel::after {
  bottom: -1px;
  right: -1px;
  border-left: 0;
  border-top: 0;
}

/* ==========================================================================
   08. NOTICE TICKER
   Marquee strip under the hero. Its content is generated from the #nl notices list by JS.
   ========================================================================== */

.ticker {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: var(--panel);
  font: 400 14px var(--m);
  color: var(--mute);
}

.ticker div {
  display: flex;
  gap: 56px;
  width: max-content;
  padding: 10px 0;
  animation: tk 32s linear infinite;
}

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

/* ==========================================================================
   09. ABOUT & STATS
   Overview quote, recognition card and the count-up statistic tiles.
   ========================================================================== */

.about {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
}

.about .panel {
  padding: 26px;
}

.about blockquote {
  margin: 0;
  font: 500 18px/1.5 var(--d);
}

.about cite {
  display: block;
  margin-top: 14px;
  font: 400 13px var(--m);
  color: var(--mute);
  font-style: normal;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.stats .panel {
  padding: 18px;
}

.stats b {
  font: 700 40px var(--d);
  color: var(--acc);
  display: block;
}

.stats span {
  font: 400 13px var(--m);
  color: var(--mute);
}

/* notices + events */

/* ==========================================================================
   10. NOTICES & EVENTS
   Two-column notice log (.log) and the expandable event list (<details>).
   ========================================================================== */

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.log {
  list-style: none;
  margin: 0;
  padding: 0;
}

.log li {
  padding: 16px 20px;
  border-bottom: 1px dashed var(--line);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
}

.log li:last-child {
  border: 0;
}

.log time {
  font: 500 13px var(--m);
  color: var(--hot);
  grid-row: span 2;
}

.log strong {
  font-family: var(--d);
}

.log small {
  color: var(--mute);
}

details {
  border-bottom: 1px dashed var(--line);
}

summary {
  cursor: pointer;
  padding: 14px 20px;
  font: 500 15px var(--d);
  list-style: none;
  display: flex;
  justify-content: space-between;
}

summary::after {
  content: "+";
  font: 500 18px var(--m);
  color: var(--acc);
  transition: 0.2s;
}

details[open] summary::after {
  transform: rotate(45deg);
}

details p {
  margin: 0;
  padding: 0 20px 16px;
  color: var(--mute);
  font-size: 14px;
}

/* facilities */

/* ==========================================================================
   11. FACILITIES TABLE
   Spec-sheet table; wrapped in .scroll so it scrolls sideways on narrow screens.
   ========================================================================== */

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font: 500 13px var(--m);
  color: var(--mute);
  background: var(--grid);
}

td:first-child {
  font: 700 17px var(--d);
  white-space: nowrap;
}

td:last-child {
  font: 400 13px var(--m);
  white-space: nowrap;
}

tbody tr {
  transition: background 0.2s;
}

tbody tr:hover {
  background: var(--grid);
}

.scroll {
  overflow-x: auto;
}

/* people */

/* ==========================================================================
   12. PEOPLE CARDS & FILTERS
   Warden / HEC cards (.card, .av hexagon avatar), the lead (President) card, and the filter buttons (.sel).
   ========================================================================== */

.people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.card {
  padding: 20px;
  transition:
    transform 0.25s,
    border-color 0.25s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--acc);
}

.av {
  width: 56px;
  height: 56px;
  border: 1.5px solid var(--acc);
  display: grid;
  place-items: center;
  font: 700 20px var(--d);
  color: var(--acc);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  margin-bottom: 12px;
}

.card h3 {
  font: 700 18px var(--d);
  margin: 0;
}

.card .r {
  font: 500 13px var(--m);
  color: var(--hot);
  margin: 2px 0 10px;
}

.card p {
  margin: 0;
  font-size: 14px;
  color: var(--mute);
  word-break: break-word;
}

/* ==========================================================================
   13. LEAD CARD
   Rotating conic-gradient border for the President card (animated via the registered --ang property).
   ========================================================================== */

.card.lead {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 20px;
  align-items: center;
}

.card.lead .av {
  grid-row: span 3;
  width: 72px;
  height: 72px;
  margin: 0;
}

.sel {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.sel button {
  font: 500 13px var(--m);
  background: none;
  color: var(--mute);
  border: 1px solid var(--line);
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 3px;
}

.sel button.on {
  background: var(--acc);
  color: var(--bg);
  border-color: var(--acc);
}

/* gallery */

/* links + footer */

/* ==========================================================================
   14. PORTAL LINKS
   Quick-access link tiles.
   ========================================================================== */

.links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.links a {
  padding: 18px;
  display: block;
  transition: 0.2s;
}

.links a:hover {
  border-color: var(--hot);
  transform: translateY(-3px);
}

.links b {
  font: 700 17px var(--d);
  display: block;
}

.links span {
  font: 400 13px var(--m);
  color: var(--mute);
}

/* ==========================================================================
   15. FOOTER
   Contact columns and copyright line.
   ========================================================================== */

footer {
  margin-top: 96px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.fg {
  max-width: 1180px;
  margin: auto;
  padding: 40px 20px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
}

.fg h3 {
  font: 700 16px var(--d);
  margin: 0 0 8px;
}

.fg p {
  margin: 0 0 4px;
  color: var(--mute);
  font-size: 14px;
}

.cp {
  text-align: center;
  padding: 14px;
  font: 400 12px var(--m);
  color: var(--mute);
  border-top: 1px solid var(--line);
}

/* ==========================================================================
   16. BASE RESPONSIVE & REDUCED MOTION
   Single-column layouts on tablets/phones, and a global switch-off of animation for users who prefer reduced motion.
   ========================================================================== */

@media (max-width: 860px) {
  .hero,
  .about,
  .two,
  .fg {
    grid-template-columns: 1fr;
  }
  .hero {
    min-height: 0;
  }
  .brand .bt > span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
  .draw .d {
    stroke-dashoffset: 0;
  }
  .draw text,
  .draw .w {
    opacity: 0.9;
  }
}

/* ==========================================================================
   17. ENHANCEMENT LAYER  ·  AMBIENT BACKGROUND, PROGRESS BAR, HERO CANVAS
   NOTE: everything from here down was added on top of the base styles above. Rules are intentionally placed later so they override earlier ones of equal specificity - keep this order when editing.
   ========================================================================== */

.aur {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.aur i {
  position: absolute;
  width: 48vmax;
  height: 48vmax;
  border-radius: 50%;
  filter: blur(100px);
  opacity: var(--ao);
  animation: fl 24s ease-in-out infinite alternate;
}

.aur i:nth-child(1) {
  background: var(--acc);
  top: -18vmax;
  left: -14vmax;
}

.aur i:nth-child(2) {
  background: var(--v);
  top: 20vh;
  right: -20vmax;
  animation-delay: -8s;
}

.aur i:nth-child(3) {
  background: var(--pk);
  bottom: -24vmax;
  left: 20vw;
  animation-delay: -15s;
}

@keyframes fl {
  to {
    transform: translate(8vmax, 6vmax) scale(1.25);
  }
}

#pg {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  height: 3px;
  z-index: 70;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(
    90deg,
    var(--acc),
    var(--v),
    var(--pk),
    var(--hot)
  );
}

#cv {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero > div:not(.xh),

/* ==========================================================================
   18. HERO EXTRAS
   Layering above the canvas and a scan-line sweep across the hero.
   ========================================================================== */

.hero > svg {
  position: relative;
  z-index: 1;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 140px;
  top: -140px;
  background: linear-gradient(
    transparent,
    color-mix(in srgb, var(--acc) 14%, transparent),
    transparent
  );
  animation: sc 7s linear infinite;
  pointer-events: none;
}

@keyframes sc {
  to {
    top: 100%;
  }
}

.hero h1 span {
  background: linear-gradient(
    90deg,
    var(--acc),
    var(--v),
    var(--pk),
    var(--hot),
    var(--acc)
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gs 7s linear infinite;
}

@keyframes gs {
  to {
    background-position: 300% 0;
  }
}

/* ==========================================================================
   19. BLUEPRINT ILLUSTRATION
   Glow, bobbing and gradient strokes for the SVG (the gradient #gr is defined in the HTML and follows the theme colours).
   ========================================================================== */

.draw {
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--acc) 45%, transparent));
  animation: bob 6s ease-in-out infinite alternate;
}

@keyframes bob {
  to {
    transform: translateY(-10px);
  }
}

.draw .d:not(.h) {
  stroke: url(#gr);
}

.draw .w {
  fill: url(#gr);
  animation:
    fi 0.5s forwards,
    tw 3.6s ease-in-out infinite;
  animation-delay: calc(1.6s + var(--i) * 0.05s), calc(2.6s + var(--i) * 0.23s);
}

@keyframes tw {
  50% {
    opacity: 0.3;
  }
}

/* ==========================================================================
   20. GRADIENT ACCENTS
   Gradient treatment for primary buttons, active nav link, brand, stats numbers, avatars and hovered cards.
   ========================================================================== */

.btn.p {
  background: linear-gradient(120deg, var(--acc), var(--v));
  color: var(--on);
  border-color: transparent;
}

.btn:hover {
  box-shadow: 4px 4px 0 var(--pk);
}

nav a.on {
  background: linear-gradient(
    120deg,
    color-mix(in srgb, var(--acc) 24%, transparent),
    color-mix(in srgb, var(--v) 24%, transparent)
  );
}

.brand b {
  background: linear-gradient(90deg, var(--acc), var(--v), var(--pk));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stats b {
  background: linear-gradient(120deg, var(--acc), var(--v), var(--pk));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.av {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--acc) 22%, transparent),
    color-mix(in srgb, var(--v) 28%, transparent)
  );
  color: var(--ink);
}

.card {
  transition:
    transform 0.12s,
    border-color 0.25s;
}

.card:hover,
.links a:hover {
  border-color: transparent;
  background:
    radial-gradient(
        260px circle at var(--mx, 50%) var(--my, 50%),
        color-mix(in srgb, var(--acc) 20%, transparent),
        transparent
      )
      padding-box,
    linear-gradient(var(--panel), var(--panel)) padding-box,
    linear-gradient(120deg, var(--acc), var(--v), var(--pk), var(--hot))
      border-box;
}

.card:hover {
  transform: perspective(700px) translateY(-4px) rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg));
}

/* ==========================================================================
   21. SCROLL REVEAL
   JS adds .rv to each section child and .in when it scrolls into view.
   ========================================================================== */

.rv {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--dl, 0s);
}

.rv.in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ==========================================================================
   22. SECTION DECORATIONS
   Block-level section tags and the growing gradient underline under each h2.
   ========================================================================== */

section > .tag {
  display: block;
}

h2::after {
  content: "";
  display: block;
  height: 3px;
  width: 0;
  margin-top: 10px;
  background: linear-gradient(90deg, var(--acc), var(--v), var(--pk));
  transition: width 1s 0.35s;
}

h2.in::after {
  width: 84px;
}

/* ==========================================================================
   23. FOOTER ACCENT
   Animated gradient rule along the top of the footer.
   ========================================================================== */

footer {
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--acc),
    var(--v),
    var(--pk),
    var(--hot),
    var(--acc)
  );
  background-size: 200% 100%;
  animation: gs2 6s linear infinite;
}

@keyframes gs2 {
  to {
    background-position: 200% 0;
  }
}

/* Registers --ang as a real <angle> so the conic-gradient border can animate smoothly */
@property --ang {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

/* ==========================================================================
   24. CURSOR SPOTLIGHT GRID
   Faint grid revealed around the pointer. --cx / --cy are updated from JS.
   ========================================================================== */

.spot {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
  background-image:
    linear-gradient(var(--acc) 1px, transparent 1px),
    linear-gradient(90deg, var(--acc) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(
    300px circle at var(--cx, 50%) var(--cy, -30%),
    #000,
    transparent 70%
  );
  mask-image: radial-gradient(
    300px circle at var(--cx, 50%) var(--cy, -30%),
    #000,
    transparent 70%
  );
}

/* ==========================================================================
   25. HERO HEADLINE ANIMATION
   JS wraps every letter in .ch (inside .wd words) so letters can animate in one by one.
   ========================================================================== */

.hero h1 {
  perspective: 700px;
}

.hero h1 span {
  background: none;
  color: inherit;
  animation: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
}

.wd {
  display: inline-block;
  white-space: nowrap;
}

.hero h1 .ch {
  display: inline-block;
  transform-origin: 50% 100%;
  animation: ci 1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--c) * 0.04s + 0.25s);
}

.hero h1 > span .ch {
  background: linear-gradient(
    90deg,
    var(--acc),
    var(--v),
    var(--pk),
    var(--hot),
    var(--acc)
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation:
    ci 1s cubic-bezier(0.2, 0.8, 0.2, 1) both,
    gs 7s linear infinite;
  animation-delay: calc(var(--c) * 0.04s + 0.25s), 0s;
}

@keyframes ci {
  from {
    opacity: 0;
    transform: translateY(70%) rotateX(-85deg);
    filter: blur(12px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* ==========================================================================
   26. BUTTON POSITIONING
   Relative positioning for button children.
   ========================================================================== */

.btn {
  position: relative;
  overflow: hidden;
  transform: translate(var(--tx, 0px), var(--ty, 0px));
}

.btn:hover {
  transform: translate(var(--tx, 0px), calc(var(--ty, 0px) - 2px));
}

.card.lead {
  border-color: transparent;
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    conic-gradient(
        from var(--ang),
        var(--acc),
        var(--v),
        var(--pk),
        var(--hot),
        var(--acc)
      )
      border-box;
  animation: rot 6s linear infinite;
}

@keyframes rot {
  to {
    --ang: 360deg;
  }
}

/* ==========================================================================
   27. TABLE ROW ENTRANCE
   Rows slide in with a stagger (--r is set per row from JS).
   ========================================================================== */

.scroll tbody tr {
  opacity: 0;
  transform: translateX(-26px);
  transition:
    opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) calc(var(--r, 0) * 0.09s + 0.3s),
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1)
      calc(var(--r, 0) * 0.09s + 0.3s),
    background 0.2s;
}

.scroll.in tbody tr {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   28. HOVER POLISH
   Notice rows and stat tiles react on hover.
   ========================================================================== */

.log li {
  transition:
    padding-left 0.3s,
    background 0.3s;
}

.log li:hover {
  padding-left: 30px;
  background: color-mix(in srgb, var(--acc) 8%, transparent);
}

.stats .panel {
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}

.stats .panel:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px -12px var(--v);
}

/* ==========================================================================
   29. REDUCED MOTION (REVEALS)
   Makes revealed content visible immediately when animation is disabled.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .scroll tbody tr {
    opacity: 1;
    transform: none;
  }
  .rv {
    opacity: 1;
    transform: none;
    filter: none;
  }
  .spot {
    opacity: 0.2;
  }
}

/* ==========================================================================
   30. GALLERY SLIDESHOW
   Auto-advancing slideshow: slides (.sl), caption bar, arrows, progress bar (.pb) and dot pager.
   ========================================================================== */

.show {
  position: relative;
  aspect-ratio: 16/8;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
}

/* Placeholder stripes + caption (data-c) show if a photo is missing: JS removes broken <img> tags */
.sl {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transform: scale(1.04);
  transition:
    opacity 1s,
    transform 1s;
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(
    45deg,
    var(--grid) 0 10px,
    transparent 10px 20px
  );
  font: 700 clamp(22px, 4vw, 40px) var(--d);
  color: var(--mute);
  text-align: center;
}

.sl::after {
  content: attr(data-c);
}

.sl img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sl.on {
  opacity: 1;
  transform: none;
  z-index: 1;
}

.sl.on img {
  animation: kb 8s ease-out forwards;
}

@keyframes kb {
  from {
    transform: scale(1.12);
  }
  to {
    transform: scale(1);
  }
}

.cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 44px 22px 18px;
  display: flex;
  gap: 14px;
  align-items: baseline;
  font: 500 16px var(--d);
  color: #fff;
  background: linear-gradient(transparent, rgba(4, 18, 42, 0.88));
}

.cap b {
  font: 500 13px var(--m);
  color: #ffb000;
}

.ar {
  position: absolute;
  top: 50%;
  z-index: 3;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 1px solid var(--acc);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  color: var(--ink);
  font: 24px var(--m);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: 0.2s;
}

.ar:hover {
  background: var(--acc);
  color: var(--on);
}

.pv {
  left: 14px;
}

.nx {
  right: 14px;
}

.pb {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 3;
}

.pb i {
  display: block;
  height: 100%;
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--acc), var(--v), var(--pk));
  animation: pbf 5s linear forwards;
}

.show:hover .pb i,
.show:focus-within .pb i {
  animation-play-state: paused;
}

@keyframes pbf {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.srow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.dots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dots button {
  width: 22px;
  height: 5px;
  border: 0;
  padding: 0;
  background: var(--line);
  cursor: pointer;
  transition: 0.3s;
}

.dots button.on {
  width: 44px;
  background: var(--acc);
}

/* ==========================================================================
   31. DISCIPLINE ROTATOR
   "Home to research in ..." text that swaps between disciplines.
   ========================================================================== */

.rot {
  margin-top: 14px;
  font: 400 14px var(--m);
  color: var(--mute);
}

.rot b {
  color: var(--acc);
  display: inline-block;
  transition:
    opacity 0.35s,
    transform 0.35s;
}

.rot b.sw {
  opacity: 0;
  transform: translateY(8px);
}

/* ==========================================================================
   32. SCHOLAR JOURNEY TIMELINE
   Six-stage PhD timeline; JS marks steps .done / .on.
   ========================================================================== */

.path {
  padding: 30px 22px;
  overflow-x: auto;
}

.pi {
  position: relative;
  min-width: 820px;
}

.pl {
  position: absolute;
  left: 7px;
  right: 0;
  top: 6px;
  height: 3px;
  background: var(--line);
}

.pl i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--acc), var(--v), var(--pk));
  transition: width 1s cubic-bezier(0.6, 0, 0.2, 1);
}

.path ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  position: relative;
}

/* States: default = upcoming (dim), .done = passed, .on = current */
.path li {
  position: relative;
  padding-top: 26px;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.4s;
}

.path li.on,
.path li.done {
  opacity: 1;
}

.path li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--line);
  transition: 0.4s;
}

.path li.done::before {
  background: var(--acc);
  border-color: var(--acc);
}

.path li.on::before {
  background: var(--hot);
  border-color: var(--hot);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--hot) 25%, transparent);
  animation: pl 1.8s infinite;
}

.path b {
  font: 700 17px var(--d);
  display: block;
}

.path li span {
  font-size: 13px;
  color: var(--mute);
  display: block;
  margin-top: 4px;
  line-height: 1.45;
}

/* ==========================================================================
   33. PILLAR CARDS
   Four feature cards under the timeline.
   ========================================================================== */

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.pillars .panel {
  padding: 22px;
  transition: transform 0.3s;
}

.pillars .panel:hover {
  transform: translateY(-5px);
}

.pillars h3 {
  font: 700 18px var(--d);
  margin: 0 0 6px;
}

.pillars p {
  margin: 0;
  color: var(--mute);
  font-size: 14px;
}

/* ==========================================================================
   34. UTILITIES  ·  ACCESSIBILITY & CONTROLS
   Skip-to-content link, dark-mode toggle (.tt), back-to-top button (.top), HEC search box (.srch), link styling in cards/footer, ticker pause, paused slideshow, print stylesheet.
   ========================================================================== */

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--acc);
  color: var(--on);
  font: 500 14px var(--m);
  border-radius: 3px;
  transition: top 0.2s;
}

.skip:focus {
  top: calc(8px + env(safe-area-inset-top, 0px));
}

.tt {
  flex: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 4px;
  font: 18px var(--m);
  cursor: pointer;
  transition: 0.2s;
}

.tt:hover {
  border-color: var(--acc);
}

.top {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 55;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--acc);
  color: var(--on);
  border-radius: 50%;
  font: 20px var(--m);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 0.25s;
}

.top.vis {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.srch {
  flex: 1;
  min-width: 180px;
  max-width: 280px;
  margin-left: auto;
  font: 400 13px var(--m);
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 3px;
}

.card p a {
  color: var(--acc);
  border-bottom: 1px solid transparent;
}

.card p a:hover {
  border-color: currentColor;
}

.fg a {
  color: var(--acc);
}

.fg a:hover {
  text-decoration: underline;
}

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

.show.paused .pb i {
  animation-play-state: paused;
}

@media print {
  header,
  .aur,
  .spot,
  .ticker,
  #pg,
  .top,
  #cv,
  .skip,
  .tt {
    display: none !important;
  }
  .rv,
  .scroll tbody tr {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  body {
    background: #fff;
    background-image: none;
  }
  section {
    padding-top: 32px;
  }
}

::selection {
  background: color-mix(in srgb, var(--acc) 22%, transparent);
}

/* ==========================================================================
   35. TYPOGRAPHY REFINEMENTS
   Final typographic tuning (smoothing, letter-spacing, line-height) and light-mode panel shadow. Dark mode removes the shadow.
   ========================================================================== */

body {
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

h2,
h3,
.hero h1,
.brand {
  letter-spacing: -0.02em;
}

.hero h1 {
  letter-spacing: -0.035em;
}

.sub,
.hero p {
  line-height: 1.7;
}

.panel {
  box-shadow: var(--sh);
}

header {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
}

th {
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
}

:root[data-theme="dark"] {
  --sh: none;
}

/* ==========================================================================
   36. NOTICE BAR, NOTICE POPUP & COMING-SOON POPUP
   .tickbar wraps the marquee (.ticker) and the "All notices" button (.tk-btn).
   .nd is the shared native <dialog> look, used by #nd (notice list) and #soon (coming soon).
   html.dlg-open locks page scrolling while a dialog is open (set from js/main.js).
   ========================================================================== */
.tickbar {
  display: flex;
  align-items: stretch;
  border-block: 1px solid var(--line);
  background: var(--panel);
}
.tickbar .ticker {
  flex: 1;
  min-width: 0;
  border: 0;
  cursor: pointer;
}
.tk-btn {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: 500 13px var(--m);
  cursor: pointer;
  transition: 0.2s;
}
.tk-btn:hover {
  color: var(--acc);
  background: color-mix(in srgb, var(--acc) 10%, var(--panel));
}
.tk-n {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--hot);
  color: var(--on);
  font-size: 12px;
  text-align: center;
}
html.dlg-open {
  overflow: hidden;
}
.nd {
  width: min(560px, calc(100vw - 32px));
  max-height: min(80vh, 640px);
  padding: 0;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 60px -20px rgba(4, 16, 31, 0.5);
}
.nd[open] {
  display: flex;
  animation: nd-in 0.25s ease;
}
.nd::backdrop {
  background: rgba(4, 16, 31, 0.55);
  backdrop-filter: blur(3px);
}
@keyframes nd-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}
.nd-box {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}
.nd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.nd-head h3 {
  margin: 0;
  font: 700 20px var(--d);
  letter-spacing: -0.01em;
}
.nd-x {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: none;
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
}
.nd-x:hover {
  border-color: var(--acc);
  color: var(--acc);
}
.nd-list {
  flex: 1;
  margin: 0;
  padding: 0;
  overflow-y: auto; /* the scrollable list */
  overscroll-behavior: contain;
  list-style: none;
}
.nd-list li:last-child {
  border-bottom: 0;
}
.nd-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  font: 400 12px var(--m);
  color: var(--mute);
}
.nd-foot a {
  color: var(--acc);
}
.soon-body {
  padding: 24px 20px 22px;
  text-align: center;
}
.soon-ic {
  font-size: 44px;
}
.soon-body p {
  margin: 8px 0 20px;
  color: var(--mute);
}
.soon-body b {
  color: var(--ink);
}
.soon-act {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
@media (max-width: 600px) {
  .tk-lbl {
    display: none;
  }
}
@media print {
  .tickbar,
  .nd {
    display: none !important;
  }
}


/* ==========================================================================
   37. WHITE THEME OVERRIDES
   The white theme (tokens in section 01) is deliberately plain: no ambient glow, no cursor
   grid, no page grid, no gradient text, no hard offset shadow on hover.
   ========================================================================== */
:root[data-theme="white"] .aur,
:root[data-theme="white"] .spot,
:root[data-theme="white"] #cv,
:root[data-theme="white"] #pg {
  display: none;
}
:root[data-theme="white"] body {
  background-image: none;
}
:root[data-theme="white"] header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
:root[data-theme="white"] .brand b,
:root[data-theme="white"] .stats b {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: var(--acc);
}
:root[data-theme="white"] .btn.p {
  background: var(--acc);
}
:root[data-theme="white"] .btn:hover {
  box-shadow: none;
  border-color: var(--acc);
}
:root[data-theme="white"] nav a.on {
  background: none;
  color: var(--acc);
  text-decoration: underline;
  text-underline-offset: 6px;
}
:root[data-theme="white"] .hero::after {
  display: none; /* scan-line sweep */
}
:root[data-theme="white"] .draw {
  filter: none; /* blueprint glow */
}
/* Headline: one solid colour instead of the animated gradient (the entrance animation stays) */
:root[data-theme="white"] .hero h1 span {
  background: none;
  color: var(--acc);
  animation: none;
}
:root[data-theme="white"] .hero h1 > span .ch {
  background: none;
  color: var(--acc);
  animation: ci 1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--c) * 0.04s + 0.25s);
}
:root[data-theme="white"] .av {
  background: var(--grid);
}
:root[data-theme="white"] .panel::before,
:root[data-theme="white"] .panel::after {
  display: none; /* blueprint corner marks */
}

/* ==========================================================================
   38. FACILITIES
   .fac-hero highlights the common rooms: a short intro on the left, a grid of room tiles on
   the right (filled by js/main.js from HALL8.rooms). .fac-tiles lists the other services.
   ========================================================================== */
.fac-hero {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) 2fr;
  margin-bottom: 36px;
}
.fac-intro {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
  background: color-mix(in srgb, var(--acc) 8%, var(--panel));
  border-right: 1px solid var(--line);
}
.fac-intro h3 {
  margin: 0;
  font: 700 clamp(24px, 3vw, 30px) / 1.15 var(--d);
  letter-spacing: -0.02em;
}
.fac-intro p {
  margin: 0;
  color: var(--mute);
}
.fac-intro .btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.fac-rooms {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.fac-rooms li {
  display: flex;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.fac-rooms li:nth-child(3n) {
  border-right: 0;
}
.fac-rooms li:nth-last-child(-n + 3) {
  border-bottom: 0;
}
.fac-room {
  position: relative;
  flex: 1;
  display: grid;
  justify-items: start;
  gap: 4px;
  padding: 20px 18px 18px;
  color: inherit;
  transition: background 0.2s;
}
.fac-room:hover,
.fac-room:focus-visible {
  background: var(--grid);
}
.fac-ic {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 8px;
  font-size: 34px;
  line-height: 1;
}
.fac-ic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.fac-nm {
  font: 700 17px var(--d);
}
.fac-meta {
  font: 400 12px var(--m);
  color: var(--mute);
}
/* "Know more" icon: circled arrow, top-right of every room tile */
.fac-i {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 26px;
  height: 26px;
  color: var(--acc);
  transition: transform 0.2s;
}
.fac-room:hover .fac-i,
.fac-room:focus-visible .fac-i {
  transform: translate(2px, -2px);
}
.fac-sub {
  margin: 0 0 12px;
  font: 700 16px var(--d);
}
.fac-tiles {
  list-style: none;
  margin: 0 0 36px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.fac-tile {
  display: grid;
  justify-items: center;
  gap: 8px;
  height: 100%;
  padding: 16px 10px;
  text-align: center;
  color: inherit;
  font: 500 13px var(--b);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
}
a.fac-tile:hover,
a.fac-tile:focus-visible {
  border-color: var(--acc);
}
.fac-tile img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
@media (max-width: 900px) {
  .fac-hero {
    grid-template-columns: 1fr;
  }
  .fac-intro {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
@media (max-width: 560px) {
  .fac-rooms {
    grid-template-columns: repeat(2, 1fr);
  }
  .fac-rooms li:nth-child(3n) {
    border-right: 1px solid var(--line);
  }
  .fac-rooms li:nth-child(2n) {
    border-right: 0;
  }
  .fac-rooms li:nth-last-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }
  .fac-rooms li:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

/* ==========================================================================
   39. MEMBER PHOTO FRAME
   .ph is the portrait frame on every HEC and warden card (built by HALL8.frame in js/data.js).
   Fixed 4:5 ratio, photo cropped from the top so faces stay in view; the initials sit behind the
   photo and show when the file is missing. On phones the card turns horizontal (see responsive.css).
   ========================================================================== */
.ph {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  margin-bottom: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--acc) 22%, var(--panel)),
    color-mix(in srgb, var(--v) 28%, var(--panel))
  );
  font: 700 clamp(34px, 5vw, 48px) var(--d);
  color: var(--ink);
}
.ph img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
}
.card.lead.has-ph {
  align-content: center; /* text block sits in the middle of the taller portrait */
}
.card.lead .ph {
  grid-row: span 4; /* name, role, e-mail, phone */
  width: clamp(104px, 11vw, 128px); /* about as tall as the four text lines beside it */
  margin: 0;
}
:root[data-theme="white"] .ph {
  background: var(--grid);
}
