/* ==========================================================================
   Machining Research Laboratory — site design system
   Precision-engineering aesthetic: deep navy, machined orange, blueprint grid.
   ========================================================================== */

/* ---------- Fonts (self-hosted; Ontario Tech brand: Ubuntu display,
   Libre Franklin as the open web substitute for ITC Franklin Gothic, Arial fallback) ---------- */
@font-face {
  font-family: "Ubuntu";
  src: url("../fonts/ubuntu-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Ubuntu";
  src: url("../fonts/ubuntu-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Ubuntu";
  src: url("../fonts/ubuntu-700.woff2") format("woff2");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Franklin";
  src: url("../fonts/libre-franklin-vf.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Ubuntu Mono";
  src: url("../fonts/ubuntu-mono-400.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Ontario Tech brand palette (brand.ontariotechu.ca) */
  --paper: #f5f7f9;
  --surface: #ffffff;
  --ink: #1c2226;
  --ink-2: #5b6770;      /* brand Dark Grey (PMS 431) */
  --ink-3: #7d868d;
  --line: #dee2e6;
  --line-2: #c6ccd2;

  --navy: #003c71;       /* Future Blue */
  --navy-2: #005793;     /* web Medium Blue */
  --navy-deep: #00283c;  /* Spirit Navy */
  --navy-line: #1a5a94;
  --on-navy: #e8eef5;
  --on-navy-2: #9fb8d0;

  --blue: #0077ca;       /* Simcoe Blue */
  --blue-text: #005793;  /* accessible small-text blue */
  --heading: #003c71;

  --accent: #e75d2a;     /* Tech Tangerine — strategic pops only */
  --accent-deep: #c74e20;
  --accent-soft: #e8f0f8; /* pale blue chip background */

  --display: "Ubuntu", "Segoe UI", system-ui, sans-serif;
  --body: "Libre Franklin", Arial, "Segoe UI", system-ui, sans-serif;
  --mono: "Ubuntu Mono", ui-monospace, Consolas, "Courier New", monospace;

  --container: 1200px;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --radius: 8px;
  --shadow: 0 10px 30px rgba(0, 60, 113, 0.08);
  --shadow-lg: 0 18px 50px rgba(0, 60, 113, 0.16);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--display);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  font-weight: 600;
  color: var(--heading);
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 5.5vw, 3.9rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--blue-text); text-decoration: none; }
a:hover { color: var(--blue); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: #fff; }

.wrap { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.wrap.narrow { max-width: 880px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--navy); color: #fff; padding: 0.6rem 1rem; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Machinist's ruler divider ---------- */
.ruler {
  height: 16px;
  background:
    repeating-linear-gradient(90deg, var(--line-2) 0 1px, transparent 1px 10px) left bottom / 100% 8px no-repeat,
    repeating-linear-gradient(90deg, var(--ink-3) 0 1px, transparent 1px 50px) left bottom / 100% 16px no-repeat;
}
.ruler.on-navy {
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.22) 0 1px, transparent 1px 10px) left bottom / 100% 8px no-repeat,
    repeating-linear-gradient(90deg, rgba(255,255,255,0.45) 0 1px, transparent 1px 50px) left bottom / 100% 16px no-repeat;
}

/* ---------- Eyebrow / section heads ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-text);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.9rem;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--accent); }
.on-dark .eyebrow, .eyebrow.on-dark { color: #dce8f4; }
.eyebrow.sub { margin-top: -0.6rem; }

.section { padding: clamp(3.2rem, 7vw, 5.5rem) 0; }
.section.tight { padding: clamp(2.2rem, 5vw, 3.5rem) 0; }
.section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: clamp(1.8rem, 4vw, 3rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head .lede { color: var(--ink-2); font-size: 1.1rem; margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--display); font-weight: 600; font-size: 0.98rem;
  padding: 0.72rem 1.4rem; border-radius: 6px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-deep); box-shadow: 0 8px 20px rgba(233, 95, 22, 0.35); color: #fff; }
.btn.navy { background: var(--navy); color: #fff; }
.btn.navy:hover { background: var(--navy-2); box-shadow: 0 8px 20px rgba(12, 35, 64, 0.3); color: #fff; }
.btn.ghost { border-color: var(--line-2); color: var(--ink); background: transparent; }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent-deep); }
.btn.ghost-light { border-color: rgba(255,255,255,0.35); color: #fff; background: transparent; }
.btn.ghost-light:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,0.08); }
.btn .arr { transition: transform 0.15s ease; }
.btn:hover .arr { transform: translateX(3px); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.2s ease;
}
.site-header.scrolled { box-shadow: 0 6px 24px rgba(0, 60, 113, 0.09); }
.site-header .wrap { max-width: 1520px; }
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 0.8rem; margin-right: auto; color: var(--ink); flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.brand-logo { width: 58px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--display); font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.brand-text span { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }

.site-nav { display: flex; align-items: center; gap: clamp(0.2rem, 1.2vw, 0.9rem); }
.site-nav a {
  font-family: var(--display); font-weight: 500; font-size: 0.95rem;
  color: var(--ink-2); padding: 0.45rem 0.55rem; border-radius: 4px;
  position: relative; white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0.55rem; right: 0.55rem; bottom: 0;
  height: 2px; background: var(--accent);
}
.site-nav a.nav-cta {
  border: 1px solid var(--navy); color: var(--navy);
  padding: 0.45rem 1rem; border-radius: 6px; margin-left: 0.4rem;
}
.site-nav a.nav-cta:hover, .site-nav a.nav-cta[aria-current="page"] { background: var(--navy); color: #fff; }
.site-nav a.nav-cta[aria-current="page"]::after { display: none; }

.ot-mark { display: none; margin-left: 0.6rem; flex-shrink: 0; }
.ot-mark img { height: 44px; width: auto; display: block; }
@media (min-width: 86em) { .ot-mark { display: block; } }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 10px;
  background: transparent; border: 1px solid var(--line-2); border-radius: 6px; cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink); transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* em-based breakpoints track the user's font size / zoom, unlike px */
@media (max-width: 100em) {
  .brand-text strong { font-size: 0.92rem; }
  .site-nav { gap: 0.3rem; }
  .site-nav a { font-size: 0.88rem; padding-inline: 0.45rem; }
  .site-nav a.nav-cta { padding: 0.45rem 0.85rem; }
}
@media (max-width: 78em) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 40px rgba(12, 35, 64, 0.12);
    display: none; padding: 0.5rem 0 1rem;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.85rem var(--gutter); font-size: 1.05rem; border-radius: 0; }
  .site-nav a[aria-current="page"]::after { left: var(--gutter); right: auto; width: 26px; bottom: 8px; }
  .site-nav a.nav-cta { margin: 0.6rem var(--gutter) 0; text-align: center; justify-content: center; display: flex; }
}

/* ---------- Dark hero / page hero ---------- */
.on-dark { color: var(--on-navy); }
.on-dark h1, .on-dark h2, .on-dark h3 { color: #fff; }
.on-dark p { color: var(--on-navy-2); }

.blueprint {
  background-color: var(--navy);
  background-image:
    radial-gradient(ellipse 80% 60% at 75% -10%, rgba(0, 119, 202, 0.22), transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: auto, 34px 34px, 34px 34px;
}

.hero-home { padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(3rem, 7vw, 5.5rem); }
.hero-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(2rem, 5vw, 4rem); align-items: stretch; }
.hero-grid > div:first-child { align-self: center; }
.hero-grid .framed { display: flex; min-height: 100%; }
.hero-grid .framed img { width: 100%; height: 100%; object-fit: cover; }
.hero-home .lede { font-size: clamp(1.05rem, 1.8vw, 1.2rem); max-width: 34rem; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

.page-hero { padding: clamp(2.8rem, 6vw, 4.5rem) 0; }
.page-hero h1 { margin-bottom: 0.3em; }
.page-hero .lede { font-size: 1.12rem; max-width: 46rem; margin: 0; }

/* Framed image with technical-drawing corner marks */
.framed { position: relative; }
.framed img {
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-lg);
}
.framed::before, .framed::after {
  content: ""; position: absolute; width: 22px; height: 22px; pointer-events: none;
}
.framed::before { top: -9px; left: -9px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.framed::after { bottom: -9px; right: -9px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.framed.on-light img { border-color: var(--line); box-shadow: var(--shadow); }
.framed.fit { width: fit-content; margin-inline: auto; }

/* ---------- Stats strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.stat { background: var(--surface); padding: 1.6rem 1.2rem; text-align: center; }
.stat b { display: block; font-family: var(--display); font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 700; color: var(--navy); letter-spacing: -0.02em; }
.stat b em { font-style: normal; color: var(--accent); }
.stat span { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
@media (max-width: 900px) { .card-grid { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-2); }
.card .card-media { aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid var(--line); }
.card .card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card:hover .card-media img { transform: scale(1.035); }
.card .card-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.card .card-body h3 { margin-bottom: 0.5rem; }
.card .card-body p { color: var(--ink-2); font-size: 0.97rem; flex: 1; }
.card .card-index { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; color: var(--blue-text); margin-bottom: 0.5rem; }
.card .more { font-family: var(--display); font-weight: 600; font-size: 0.94rem; }

/* ---------- Split (media + text) rows ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.split .split-media img { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); width: 100%; object-fit: cover; }
.split.flip .split-media { order: 2; }
@media (max-width: 860px) {
  .split, .split.flip { grid-template-columns: 1fr; }
  .split.flip .split-media { order: 0; }
}

/* ---------- Research area list (home) ---------- */
.area-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.area-list li { padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.area-list li:first-child { border-top: 1px solid var(--line); }
.area-list b { font-family: var(--display); font-size: 1.06rem; font-weight: 600; display: flex; align-items: baseline; gap: 0.6rem; }
.area-list b::before { content: "→"; color: var(--accent); font-weight: 700; }
.area-list span { color: var(--ink-2); font-size: 0.93rem; margin-left: 1.45rem; display: block; }

/* ---------- People ---------- */
.director-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; }
@media (max-width: 900px) { .director-grid { grid-template-columns: 1fr; } }
.director-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.director-card .photo { aspect-ratio: 4 / 3.4; overflow: hidden; border-bottom: 1px solid var(--line); }
.director-card .photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.director-card .body { padding: 1.6rem 1.7rem 1.8rem; }
.director-card .name-row { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.director-card h3 { font-size: 1.45rem; margin: 0; }
.director-card h3 a { color: var(--heading); }
.director-card h3 a:hover { color: var(--accent-deep); }
.role { font-family: var(--display); font-weight: 600; color: var(--blue-text); margin: 0.35rem 0 0.1rem; }
.creds { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; color: var(--ink-3); margin-bottom: 0.9rem; }
.bio { color: var(--ink-2); font-size: 0.97rem; }
details.bio-more { margin-top: 0.4rem; }
details.bio-more summary {
  cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 0.92rem;
  color: var(--blue-text); list-style: none; display: inline-flex; align-items: center; gap: 0.4rem;
}
details.bio-more summary::-webkit-details-marker { display: none; }
details.bio-more summary::after { content: "+"; font-weight: 700; }
details.bio-more[open] summary::after { content: "−"; }
details.bio-more > *:not(summary) { margin-top: 0.7rem; }

.scholar-link { display: inline-flex; align-items: center; }
.scholar-link svg { width: 22px; height: 22px; fill: var(--ink-3); transition: fill 0.15s ease; }
.scholar-link:hover svg { fill: var(--accent); }

.person-row {
  display: grid; grid-template-columns: 210px 1fr; gap: 1.7rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; margin-bottom: 1.3rem; align-items: start;
}
.person-row .photo img { border-radius: 6px; border: 1px solid var(--line); aspect-ratio: 1 / 1.08; object-fit: cover; object-position: top; width: 100%; }
.person-row h3 { font-size: 1.3rem; margin-bottom: 0.15rem; }
.person-row h3 a { color: var(--heading); }
.person-row h3 a:hover { color: var(--accent-deep); }
.person-row .role { margin-top: 0; }
.person-row .supervisor { font-size: 0.9rem; color: var(--ink-3); font-family: var(--mono); margin-bottom: 0.7rem; }
.person-row .bio { margin-bottom: 0; }
@media (max-width: 680px) {
  .person-row { grid-template-columns: 1fr; }
  .person-row .photo { max-width: 240px; }
}

/* Alumni: one full-width row per person — name/details left, thesis right */
.person-card-grid { display: grid; grid-template-columns: 1fr; gap: 0.85rem; }
.person-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.person-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.person-card .photo { aspect-ratio: 1 / 1.05; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--paper); }
.person-card .photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.person-card .body {
  padding: 1.05rem 1.5rem;
  display: grid; grid-template-columns: minmax(230px, 320px) 1fr;
  column-gap: 2rem; row-gap: 0.1rem; align-items: center;
}
.person-card h3 { font-size: 1.05rem; margin-bottom: 0.1rem; grid-column: 1; grid-row: 1; }
.person-card h3 a { color: var(--heading); }
.person-card h3 a:hover { color: var(--accent-deep); }
.person-card .meta { font-size: 0.85rem; color: var(--ink-2); line-height: 1.5; }
.person-card .meta:nth-of-type(1) { grid-column: 1; grid-row: 2; }
.person-card .meta:nth-of-type(2) {
  grid-column: 2; grid-row: 1 / span 2; align-self: center;
  border-left: 1px solid var(--line); padding-left: 2rem; font-size: 0.9rem;
}
@media (max-width: 680px) {
  .person-card .body { grid-template-columns: 1fr; }
  .person-card .meta:nth-of-type(2) {
    grid-column: 1; grid-row: auto;
    border-left: 0; padding-left: 0;
    border-top: 1px solid var(--line); padding-top: 0.55rem; margin-top: 0.55rem;
  }
}

.group-heading { display: flex; align-items: baseline; gap: 1rem; margin: clamp(2.4rem, 5vw, 3.6rem) 0 1.4rem; }
.group-heading h2 { margin: 0; white-space: nowrap; }
.group-heading::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }

/* ---------- Publications ---------- */
.pub-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center;
  position: sticky; top: 72px; z-index: 50;
  background: var(--paper); padding: 0.9rem 0; border-bottom: 1px solid var(--line);
  margin-bottom: 1.8rem;
}
.pub-search {
  flex: 1 1 240px; max-width: 380px;
  font: inherit; font-size: 0.95rem; color: var(--ink);
  padding: 0.55rem 0.9rem; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface);
}
.pub-search:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 119, 202, 0.18); }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
  font-family: var(--display); font-weight: 500; font-size: 0.86rem;
  padding: 0.38rem 0.85rem; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-2);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent-deep); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.filter-count { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3); margin-left: auto; }
@media (max-width: 720px) { .pub-toolbar { position: static; } }

.pub-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.35rem 1.5rem; margin-bottom: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.pub-item:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.pub-item h3 { font-size: 1.12rem; line-height: 1.35; margin-bottom: 0.45rem; }
.pub-item h3 a { color: var(--heading); }
.pub-item h3 a:hover { color: var(--accent-deep); }
.pub-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; align-items: center; font-size: 0.88rem; color: var(--ink-2); margin-bottom: 0.2rem; }
.pub-meta .year {
  font-family: var(--mono); font-size: 0.75rem; font-weight: 600;
  background: var(--accent-soft); color: var(--navy);
  border: 1px solid rgba(0, 60, 113, 0.25); border-radius: 4px; padding: 0.1rem 0.45rem;
}
.pub-meta .venue { font-style: italic; color: var(--ink-3); }
.pub-venue { font-size: 0.89rem; color: var(--ink-2); margin: 0.15rem 0 0.1rem; font-weight: 500; }
.pub-venue .pub-publisher { color: var(--ink-3); font-weight: 400; }
details.pub-abs { margin-top: 0.55rem; }
details.pub-abs summary {
  cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 0.88rem;
  color: var(--blue-text); list-style: none; display: inline-flex; align-items: center; gap: 0.35rem;
}
details.pub-abs summary::-webkit-details-marker { display: none; }
details.pub-abs summary::before { content: "▸"; font-size: 0.75rem; transition: transform 0.15s ease; }
details.pub-abs[open] summary::before { transform: rotate(90deg); }
details.pub-abs p { margin: 0.6rem 0 0; color: var(--ink-2); font-size: 0.95rem; }

.book-card {
  display: grid; grid-template-columns: 190px 1fr; gap: 1.8rem; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.8rem; margin-bottom: 1.4rem;
}
.book-card img { border-radius: 4px; border: 1px solid var(--line); box-shadow: var(--shadow); }
@media (max-width: 640px) { .book-card { grid-template-columns: 1fr; } .book-card img { max-width: 190px; } }

.empty-note { display: none; text-align: center; color: var(--ink-3); padding: 2.5rem 1rem; font-family: var(--mono); font-size: 0.9rem; }

/* ---------- Gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 1.1rem; }
.gal-item { margin: 0; }
.gal-item a { display: block; position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: var(--navy); }
.gal-item img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; transition: transform 0.35s ease, opacity 0.35s ease; }
.gal-item a:hover img { transform: scale(1.05); opacity: 0.85; }
.gal-item a::after {
  content: "⊕"; position: absolute; right: 10px; bottom: 8px;
  color: #fff; font-size: 1.1rem; opacity: 0; transition: opacity 0.25s ease;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}
.gal-item a:hover::after { opacity: 1; }
.gal-item figcaption { padding: 0.6rem 0.2rem 0; }
.gal-item figcaption b { font-family: var(--display); font-weight: 600; font-size: 0.95rem; display: block; }
.gal-item figcaption span { font-size: 0.82rem; color: var(--ink-3); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 300; display: none;
  background: rgba(0, 22, 37, 0.95);
  align-items: center; justify-content: center; flex-direction: column;
  padding: 2.5rem 1rem 1.5rem;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: min(92vw, 1400px); max-height: 76vh; width: auto; height: auto;
  border-radius: 6px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.lightbox .lb-caption { color: #e8edf4; text-align: center; margin-top: 1rem; font-size: 0.95rem; max-width: 80ch; }
.lightbox .lb-caption b { font-family: var(--display); }
.lightbox .lb-caption span { color: #9fb0c4; display: block; font-size: 0.85rem; margin-top: 0.15rem; }
.lightbox .lb-counter { position: absolute; top: 1rem; left: 1.3rem; color: #9fb0c4; font-family: var(--mono); font-size: 0.8rem; }
.lb-btn {
  position: absolute; background: rgba(255, 255, 255, 0.08); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; cursor: pointer;
  width: 46px; height: 46px; font-size: 1.25rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.2); }
.lb-close { top: 1rem; right: 1.3rem; }
.lb-prev { left: 1.3rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1.3rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) {
  .lb-prev { left: 0.5rem; } .lb-next { right: 0.5rem; }
  .lightbox img { max-height: 66vh; }
}

/* ---------- News ---------- */
.news-list { max-width: 900px; }
.news-item {
  display: grid; grid-template-columns: 148px 1fr; gap: 1.5rem; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.45rem 1.6rem; margin-bottom: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.news-item.no-photo { grid-template-columns: 1fr; }
.news-item:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.news-date {
  display: inline-block;
  font-family: var(--mono); font-size: 0.74rem; font-weight: 600; line-height: 1.3;
  color: var(--navy); background: var(--accent-soft);
  border: 1px solid rgba(0, 60, 113, 0.25); border-radius: 5px;
  padding: 0.22rem 0.6rem; margin-bottom: 0.55rem;
}
.news-item h3 { font-size: 1.15rem; margin-bottom: 0.35rem; }
.news-item p { color: var(--ink-2); font-size: 0.95rem; margin: 0; }
.news-photo { margin: 0; }
.news-photo img {
  border-radius: 6px; border: 1px solid var(--line);
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
}
.news-photo.doc img { aspect-ratio: auto; object-fit: contain; background: #fff; }
@media (max-width: 560px) {
  .news-item { grid-template-columns: 1fr; gap: 0.9rem; }
  .news-photo { max-width: 200px; }
}

/* ---------- Partners ---------- */
.partner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.partner-tile {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  padding: 1.3rem 1.4rem; min-height: 110px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.partner-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.partner-tile img { max-height: 62px; width: auto; max-width: 100%; object-fit: contain; }
.partner-tile .wordmark { font-family: var(--display); font-weight: 700; font-size: 1.25rem; color: var(--navy); letter-spacing: -0.01em; }

/* ---------- CTA band ---------- */
.cta-band { padding: clamp(2.8rem, 6vw, 4.5rem) 0; }
.cta-band .inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.cta-band h2 { margin: 0 0 0.3rem; }
.cta-band p { margin: 0; max-width: 46rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.7rem 1.8rem;
}
.contact-card h3 { font-size: 1.3rem; margin-bottom: 0.2rem; }
.contact-card.slim { padding: 1.15rem 1.35rem; }
.contact-card.slim h3 { font-size: 1.12rem; }
.contact-card.slim .role { font-size: 0.88rem; margin-top: 0.1rem; }
.contact-mini-grid { display: grid; gap: 0.9rem; margin-top: 1.4rem; }
.contact-card h3 a { color: var(--heading); }
.contact-card h3 a:hover { color: var(--accent-deep); }
.contact-card .email { font-family: var(--mono); font-size: 0.9rem; word-break: break-all; }
.icon-row { display: flex; gap: 0.7rem; margin-top: 0.5rem; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--line-2);
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.icon-btn svg { width: 20px; height: 20px; fill: var(--ink-2); transition: fill 0.15s ease; }
.icon-btn:hover { border-color: var(--blue); background: var(--accent-soft); transform: translateY(-2px); }
.icon-btn:hover svg { fill: var(--navy-2); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: var(--on-navy-2); }
.footer-main { display: grid; grid-template-columns: 1.3fr 0.8fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); padding: clamp(2.8rem, 6vw, 4.2rem) 0; }
@media (max-width: 860px) { .footer-main { grid-template-columns: 1fr; } }
.footer-brand { display: flex; align-items: flex-start; gap: 1rem; }
.footer-logo-tile { background: #fff; border-radius: 8px; padding: 8px; flex-shrink: 0; }
.footer-logo-tile img { width: 74px; }
.footer-brand p { font-size: 0.93rem; margin: 0.4rem 0 0; }
.footer-brand strong { color: #fff; font-family: var(--display); font-size: 1.05rem; }
.site-footer h4 {
  color: #fff; font-family: var(--mono); font-weight: 600; font-size: 0.75rem;
  letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 1rem;
}
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.footer-links a { color: var(--on-navy-2); font-size: 0.95rem; }
.footer-links a:hover { color: #fff; }
.footer-contact { font-size: 0.93rem; font-style: normal; }
.footer-contact a { color: var(--on-navy); }
.footer-contact a:hover { color: #fff; }
.footer-contact .icon-row .icon-btn { border-color: var(--navy-line); }
.footer-contact .icon-row .icon-btn svg { fill: var(--on-navy-2); }
.footer-contact .icon-row .icon-btn:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--on-navy-2); }
.footer-contact .icon-row .icon-btn:hover svg { fill: #fff; }
.footer-bottom { background: var(--navy-deep); border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 1.2rem 0; }
.footer-bottom .wrap { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between; font-size: 0.83rem; }
.footer-bottom a { color: var(--on-navy); }
.footer-bottom a:hover { color: #fff; }

/* ---------- Equipment ---------- */
.equip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.3rem; }
.equip-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem 1.7rem 1.7rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.equip-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-2); }
.equip-icon {
  width: 58px; height: 58px; border-radius: 10px;
  background: var(--accent-soft); border: 1px solid rgba(0, 60, 113, 0.2);
  display: flex; align-items: center; justify-content: center; margin-bottom: 1.1rem;
}
.equip-icon svg { width: 30px; height: 30px; stroke: var(--navy-2); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.equip-photo {
  aspect-ratio: 4 / 3; background: #fff;
  border: 1px solid var(--line); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0.9rem; margin-bottom: 1.1rem; overflow: hidden;
}
.equip-photo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.equip-card .model {
  font-family: var(--mono); font-size: 0.8rem; color: var(--blue-text);
  margin: 0 0 0.55rem;
}
.equip-card .equip-cat {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 0.25rem;
}
.equip-card h3 { font-size: 1.18rem; margin-bottom: 0.45rem; }
.equip-card p { color: var(--ink-2); font-size: 0.95rem; margin: 0; }

/* ---------- Reveal animations ---------- */
html.js .reveal { opacity: 0; transform: translateY(16px); }
html.js .reveal.on { opacity: 1; transform: none; transition: opacity 0.6s ease, transform 0.6s ease; transition-delay: var(--d, 0s); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- Utilities ---------- */
.center { text-align: center; }
.muted { color: var(--ink-3); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
