/* =========================================================
   HCM Lab — "Lab notebook" theme (v2)
   Minimal, scientific: graph-paper grid, hairlines, mono figure labels,
   restrained motion. Loaded after styles.css / accounts.css.
   ========================================================= */
:root {
  --paper: #f7f9fa;
  --line: #e3eaee;
  --line-strong: #cfdbe1;
  --grid: rgba(15, 92, 122, .045);
  --r-md: 12px;
  --r-lg: 16px;
  --shadow-md: 0 10px 30px -12px rgba(11, 31, 46, .18);
  --shadow-lg: 0 30px 60px -20px rgba(11, 31, 46, .28);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

body {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
}

h1, h2 { font-weight: 500; letter-spacing: -0.035em; }
h1 { font-size: clamp(2.5rem, 5.4vw, 4.6rem); line-height: 1.02; }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.7rem); }
h3 { font-weight: 600; letter-spacing: -0.015em; }
::selection { background: var(--cyan-300); color: var(--navy-900); }

/* ---------- Eyebrows become figure labels ---------- */
.eyebrow { color: var(--ink-3); letter-spacing: .16em; font-size: .7rem; }
.eyebrow::before { width: 6px; height: 6px; box-shadow: 0 0 0 3px rgba(43,179,200,.18); animation: pulse 2.4s ease-in-out infinite; }
.eyebrow[data-n]::after { content: attr(data-n); order: -1; color: var(--teal-500); margin-right: .2em; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(43,179,200,0); } }

/* ---------- Header: light, frosted, hairline ---------- */
.site-header, .site-header.is-dark {
  background: rgba(247, 249, 250, .78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.6) blur(14px);
}
.site-header.scrolled { box-shadow: 0 6px 24px -18px rgba(11,31,46,.35); }
.site-header .brand, .site-header .brand-text { color: var(--ink) !important; }
.site-header .brand-text small { color: var(--ink-3) !important; }
.site-header .nav-links a { color: var(--ink-2) !important; background: transparent !important; position: relative; }
.site-header .nav-links a:hover { color: var(--ink) !important; }
.site-header .nav-links a[aria-current="page"] { color: var(--ink) !important; }
.site-header .nav-links a::after {
  content: ""; position: absolute; left: .9em; right: .9em; bottom: 2px; height: 1.5px; background: var(--cyan-400);
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.site-header .nav-links a:hover::after, .site-header .nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.site-header .nav-toggle { color: var(--ink) !important; }
.site-header .nav-auth .btn-ghost { color: var(--ink) !important; border-color: var(--line-strong) !important; }
.brand-mark { box-shadow: none; border: 1px solid var(--line); }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 500; letter-spacing: -.005em; }
.btn-primary { background: var(--navy-800); color: #fff; }
.btn-primary:hover { background: var(--teal-600); color: #fff; box-shadow: 0 10px 24px -10px rgba(15,92,122,.6); }
.btn .arr { display: inline-block; transition: transform .3s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn-ghost { background: rgba(255,255,255,.6); }

/* ---------- Page heroes: light, blueprint ---------- */
.page-hero {
  margin-top: 0; padding: 88px 0 56px; color: var(--ink);
  background: linear-gradient(180deg, rgba(255,255,255,.0), rgba(255,255,255,.7));
  border-bottom: 1px solid var(--line);
}
.page-hero .lead { color: var(--ink-2); }
.page-hero h1 { color: var(--ink); }
.page-hero .marker-field { opacity: .9; top: 10px; }
.page-hero .marker-field g[stroke] { stroke: var(--cyan-400); opacity: .55; }
.page-hero .marker-field circle { fill: var(--teal-500); animation: marker 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.page-hero .marker-field circle:nth-child(2n) { animation-delay: .4s; }
.page-hero .marker-field circle:nth-child(3n) { animation-delay: .9s; }
@keyframes marker { 0%,100% { transform: scale(1); opacity: .85 } 50% { transform: scale(1.5); opacity: 1 } }
.page-hero-sm { padding: 64px 0 40px; }

/* ---------- Home hero: split figure ---------- */
.hero2 { padding: 72px 0 40px; position: relative; }
.hero2-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero2 h1 em { font-style: normal; }
.hero2 .lead { margin-top: 18px; }
.hero2-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.shine {
  background: linear-gradient(100deg, var(--teal-600) 20%, var(--cyan-400) 40%, var(--teal-600) 60%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: -250% 0; } }

.figure {
  position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--navy-900);
  aspect-ratio: 4 / 3.3; box-shadow: var(--shadow-lg); isolation: isolate;
}
.figure img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); animation: drift 18s ease-in-out infinite alternate; }
@keyframes drift { to { transform: scale(1.1) translate(-2%, -1%); } }
.figure::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7,23,35,0) 45%, rgba(7,23,35,.75)); z-index: 1; }
.fig-label { position: absolute; z-index: 2; font: 500 .68rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.85); }
.fig-tl { top: 16px; left: 16px; }
.fig-tr { top: 16px; right: 16px; display: flex; align-items: center; gap: 8px; }
.rec { width: 8px; height: 8px; border-radius: 50%; background: #ff5a5a; box-shadow: 0 0 0 0 rgba(255,90,90,.6); animation: rec 1.6s infinite; }
@keyframes rec { 70% { box-shadow: 0 0 0 8px rgba(255,90,90,0); } 100% { box-shadow: 0 0 0 0 rgba(255,90,90,0); } }
.fig-trace { position: absolute; left: 0; right: 0; bottom: 42px; height: 70px; z-index: 2; }
.fig-trace path { fill: none; stroke: var(--cyan-300); stroke-width: 1.6; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: trace 4.5s linear infinite; filter: drop-shadow(0 0 6px rgba(111,211,224,.7)); }
.fig-trace path.ghost { stroke: rgba(255,255,255,.12); animation: none; stroke-dashoffset: 0; filter: none; }
@keyframes trace { to { stroke-dashoffset: 0; } }
.fig-cap { position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 2; display: flex; justify-content: space-between; font: 400 .7rem/1 var(--font-mono); color: rgba(255,255,255,.7); }
/* crop marks */
.crop { position: absolute; inset: -10px; pointer-events: none; }
.crop i { position: absolute; width: 14px; height: 14px; border-color: var(--teal-500); border-style: solid; opacity: .7; }
.crop i:nth-child(1) { top: 0; left: 0; border-width: 1px 0 0 1px; }
.crop i:nth-child(2) { top: 0; right: 0; border-width: 1px 1px 0 0; }
.crop i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 1px 1px; }
.crop i:nth-child(4) { bottom: 0; right: 0; border-width: 0 1px 1px 0; }
.fig-wrap { position: relative; }

.stats2 { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 56px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats2 > div { padding: 22px 20px; border-right: 1px solid var(--line); }
.stats2 > div:last-child { border-right: 0; }
.stats2 strong { display: block; font: 500 2.2rem/1 var(--font-display); letter-spacing: -.03em; color: var(--ink); }
.stats2 span { font: 500 .68rem/1.4 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
@media (max-width: 900px) { .hero2-grid { grid-template-columns: 1fr; gap: 36px; } .hero2 { padding-top: 40px; } }
@media (max-width: 640px) { .stats2 { grid-template-columns: 1fr 1fr; } .stats2 > div:nth-child(2) { border-right: 0; } .stats2 > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }

/* ---------- Marquee (equipment) ---------- */
.marquee { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.55); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 56px; width: max-content; padding: 18px 0; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font: 500 .8rem/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 12px; }
.marquee-track span::before { content: "+"; color: var(--cyan-400); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: 104px 0; }
.section-white { background: rgba(255,255,255,.72); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { border-bottom: 1px solid var(--line); padding-bottom: 22px; }

/* ---------- Cards: hairline + cursor spotlight ---------- */
.card, .pub, .panel, .stat, .bk-card, .req, .ct-row {
  border-radius: var(--r-md); box-shadow: none;
  transition: border-color .3s var(--ease), transform .35s var(--ease), box-shadow .35s var(--ease);
}
.card, .pub { position: relative; overflow: hidden; }
.card::before, .pub::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(43,179,200,.10), transparent 45%);
}
.card:hover::before, .pub:hover::before { opacity: 1; }
.card:hover, .pub:hover { border-color: rgba(43,179,200,.55); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.skel-card:hover, .skel-card:hover::before { transform: none; box-shadow: none; opacity: 0; }
.area-card .media { transition: transform .8s var(--ease); }
.area-card:hover .media { transform: scale(1.04); }
.area-card { padding: 0; }
.tag { border-radius: 6px; background: rgba(43,179,200,.1); }
.pub-year { color: var(--ink-3); font-weight: 500; }
.pub h3 { font-weight: 500; }

/* Featured: animated gradient hairline */
.feature-pub { background: var(--navy-900); }
.feature-pub::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--ang, 0deg), transparent 0 70%, var(--cyan-300) 80%, transparent 90%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 7s linear infinite;
}
@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spin { to { --ang: 360deg; } }

/* ---------- Spec sheet (equipment) ---------- */
.spec { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: rgba(255,255,255,.8); }
.spec > div { padding: 26px 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background .3s; }
.spec > div:nth-child(3n) { border-right: 0; }
.spec > div:nth-last-child(-n+3) { border-bottom: 0; }
.spec > div:hover { background: rgba(43,179,200,.06); }
.spec small { font: 500 .66rem/1 var(--font-mono); letter-spacing: .12em; color: var(--teal-500); text-transform: uppercase; }
.spec strong { display: block; font: 500 1.2rem/1.2 var(--font-display); margin: 10px 0 4px; letter-spacing: -.02em; }
.spec span { color: var(--ink-3); font-size: .88rem; }
@media (max-width: 760px) { .spec { grid-template-columns: 1fr 1fr; } .spec > div { border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line) !important; } }

/* ---------- Shimmer skeletons ---------- */
.skel {
  display: block; height: 12px; margin: 8px 0; border-radius: 6px;
  background: linear-gradient(90deg, #e9eff2 0%, #f6f9fa 40%, #e9eff2 80%);
  background-size: 300% 100%; animation: shimmer 1.4s ease-in-out infinite;
}
.photo.skel { height: auto; margin: 0; aspect-ratio: 5 / 4; }
.skel-card { pointer-events: none; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.shimmer-text { background: linear-gradient(90deg, var(--ink-3), var(--cyan-400), var(--ink-3)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.2s linear infinite; }

/* ---------- Reveal: staggered, softer ---------- */
.reveal { opacity: 0; transform: translateY(18px); filter: blur(4px); transition: opacity .8s var(--ease), transform .8s var(--ease), filter .8s var(--ease); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; filter: none; }

/* ---------- People / misc ---------- */
.person .photo { background: radial-gradient(circle at 30% 20%, rgba(111,211,224,.35), transparent 55%), linear-gradient(160deg, var(--teal-600), var(--navy-800)); font-weight: 500; }
.cta-band { border-radius: var(--r-lg); }
.draft-note { border-radius: 10px; }
.site-footer { background: var(--navy-900); }

/* ---------- Admin content manager ---------- */
.admin-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.admin-tab { background: none; border: 0; padding: 12px 16px; font: 500 .95rem var(--font-body); color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .2s, border-color .2s; }
.admin-tab:hover { color: var(--ink); }
.admin-tab.active { color: var(--ink); border-bottom-color: var(--cyan-400); }
.ct-list { display: flex; flex-direction: column; gap: 8px; }
.ct-row { display: flex; align-items: center; gap: 14px; background: var(--white); border: 1px solid var(--line); padding: 12px 16px; }
.ct-row:hover { border-color: var(--line-strong); }
.ct-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ct-main strong { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-main span { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-when { font-size: .72rem; }
.ct-thumb { width: 40px; height: 40px; border-radius: 8px; flex: none; background: var(--cyan-100) center/cover; display: grid; place-items: center; font: 600 .9rem var(--font-display); color: var(--teal-600); }
.ct-thumb.round { border-radius: 50%; }
.ct-dialog { width: min(760px, 94vw); max-height: 90vh; }
.ct-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; margin: 18px 0 8px; }
.ct-fields .wide { grid-column: 1 / -1; }
.ct-fields > * { min-width: 0; }
.ct-fields input:not([type="checkbox"]), .ct-fields select, .ct-fields textarea { width: 100%; min-width: 0; }
.ct-dialog { overflow-x: hidden; }
.ct-fields small { font-size: .76rem; }
.ct-check { display: flex; gap: 8px; align-items: center; font-size: .9rem; color: var(--ink-2); padding: 6px 0; }
.ct-dialog-actions { display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: -28px; background: #fff; padding: 14px 0 0; }
.upload { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 12px; display: grid; gap: 10px; }
.upload-preview img { max-height: 120px; border-radius: 8px; }
.upload-actions { display: flex; align-items: center; gap: 12px; }
.upload-actions .link-btn { margin: 0; }
.upload-url { font: inherit; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); }
.staff-form { display: flex; gap: 10px; padding: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.staff-form input { flex: 1 1 200px; font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line-strong); }
@media (max-width: 640px) { .ct-fields { grid-template-columns: 1fr; } .ct-row { flex-wrap: wrap; } .ct-when { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
}
