/* =====================================================================
   Nico Schramma — personal site
   Custom stylesheet (plain CSS, no Sass — avoids remote-theme/Sass unit
   issues on GitHub Pages). Palette is drawn from the researcher's own
   imagery: deep lab-dark navy, a bioluminescent teal glow, and a
   vascular rose accent. Typography keeps the Menlo/monospace,
   code-editor aesthetic of the original site.
   ===================================================================== */

:root {
  --ink:        #0c1720;   /* near-black navy, hero / nav */
  --ink-soft:   #16232f;
  --paper:      #f3f5f4;   /* cool off-white page background */
  --paper-card: #ffffff;
  --text:       #1c2732;
  --text-muted: #5b6a76;
  --teal:       #49c9c0;   /* bioluminescence glow */
  --teal-dim:   #2f8f88;
  --rose:       #e0637f;   /* vascular accent */
  --line:       rgba(12, 23, 32, 0.1);
  --line-dark:  rgba(255, 255, 255, 0.14);

  --font-display: Menlo, Monaco, Consolas, "Courier New", monospace;
  --font-body: Menlo, Monaco, Consolas, "Courier New", monospace;

  --nav-h: 4rem;
  --container: 1000px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; -webkit-user-drag: none; user-select: none; }

a { color: var(--teal-dim); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--rose); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

h2 { font-size: clamp(1.35rem, 1.05rem + 1.1vw, 1.85rem); }
h3 { font-size: clamp(1.02rem, 0.95rem + 0.35vw, 1.15rem); }

p { margin: 0 0 1.1em; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--teal);
  color: var(--ink);
  padding: 0.6rem 1rem;
  z-index: 999;
  font-weight: 700;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------------------------------------------------------------------
   Navigation — slim, fixed near the very top, floats over hero/banner
   and solidifies once the page is scrolled.
   --------------------------------------------------------------------- */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
  background: linear-gradient(to bottom, rgba(12,23,32,0.55), rgba(12,23,32,0));
  transition: background-color 0.35s ease, box-shadow 0.35s ease, backdrop-filter 0.35s ease;
}

.site-nav.is-scrolled {
  background: rgba(12, 23, 32, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line-dark);
}

.site-nav .brand {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0;
  white-space: nowrap;
}
.site-nav .brand span { color: var(--teal); }
.site-nav .brand:hover { color: #fff; opacity: 0.85; }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.6rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0;
  padding: 0.4rem 0.1rem;
  position: relative;
  text-decoration: none;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--teal);
  transition: right 0.25s ease;
}

.nav-links a:hover,
.nav-links a.is-active { color: #fff; }
.nav-links a:hover::after,
.nav-links a.is-active::after { right: 0; }

.nav-toggle {
  display: none;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
  z-index: 110;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0.35rem; right: 0.35rem;
  height: 2px;
  background: #fff;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle span { top: 50%; transform: translateY(-50%); }
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }

#nav-check { display: none; }

#nav-check:checked ~ .nav-toggle span { background: transparent; }
#nav-check:checked ~ .nav-toggle span::before { top: 0; transform: rotate(45deg); }
#nav-check:checked ~ .nav-toggle span::after { top: 0; transform: rotate(-45deg); }

/* ---------------------------------------------------------------------
   Home hero — full-bleed image, fades & drifts on scroll (progressive
   enhancement via JS transform; looks static & fine without JS/motion).
   --------------------------------------------------------------------- */

.hero {
  position: relative;
  height: 100svh;
  min-height: 420px;
  overflow: hidden;
  background: var(--ink);
  display: flex;
  align-items: flex-end;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  will-change: transform, opacity;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12,23,32,0.15) 0%, rgba(12,23,32,0.35) 55%, rgba(12,23,32,0.94) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 clamp(1.25rem, 5vw, 4rem) clamp(3.5rem, 9vh, 6rem);
  color: #fff;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 700;
  margin-bottom: 0.9rem;
}

.hero-content h1 {
  color: #fff;
  font-size: clamp(2rem, 1.5rem + 3vw, 3.6rem);
  margin-bottom: 0.35em;
  max-width: 18ch;
}

.hero-content .hero-tagline {
  font-size: clamp(0.95rem, 0.85rem + 0.4vw, 1.1rem);
  color: rgba(255,255,255,0.82);
  max-width: 46ch;
  margin-bottom: 0;
}

.scroll-cue {
  position: absolute;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(255,255,255,0.75);
  font-size: 1.5rem;
  animation: bob 2.2s ease-in-out infinite;
  text-decoration: none;
}
.scroll-cue:hover { color: var(--teal); }

@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ---------------------------------------------------------------------
   Interior page banner (About / Research / Gallery / posts)
   --------------------------------------------------------------------- */

.page-banner {
  position: relative;
  height: 42vh;
  min-height: 260px;
  max-height: 420px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--ink);
}

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

.page-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12,23,32,0.35) 0%, rgba(12,23,32,0.55) 60%, rgba(12,23,32,0.92) 100%);
}

.page-banner-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 2rem) 2.2rem;
  color: #fff;
}

.page-banner-content .hero-eyebrow { margin-bottom: 0.5rem; }

.page-banner-content h1 {
  color: #fff;
  font-size: clamp(1.7rem, 1.4rem + 1.6vw, 2.5rem);
  margin: 0;
}

/* ---------------------------------------------------------------------
   Content layout
   --------------------------------------------------------------------- */

.page-content {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 4rem) clamp(1.25rem, 5vw, 2rem) clamp(3rem, 6vw, 5rem);
}

.page-content > p:first-child { margin-top: 0; }

.lead {
  font-size: 1.02rem;
  color: var(--text-muted);
}

.float-right {
  float: right;
  margin: 0 0 1.25rem 1.75rem;
  max-width: 300px;
}

.float-right img { border-radius: 0.4rem; }

@media (max-width: 640px) {
  .float-right { float: none; margin: 0 auto 1.5rem; max-width: 220px; text-align: center; }
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

.divider-glow {
  border: 0;
  height: 2px;
  margin: 3rem 0;
  background: linear-gradient(90deg, var(--teal) 0%, transparent 60%);
  opacity: 0.55;
}

/* ---------------------------------------------------------------------
   Image protection helper (kept from previous version)
   --------------------------------------------------------------------- */

.image-protect { position: relative; display: inline-block; }
.image-protect img { display: block; }
.image-protect::after { content: ""; position: absolute; inset: 0; }

/* ---------------------------------------------------------------------
   Social links
   --------------------------------------------------------------------- */

.social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin: 1.6rem 0;
  flex-wrap: wrap;
}

.social-links a {
  color: var(--text-muted);
  font-size: 1.4rem;
  transition: color 0.2s ease, transform 0.2s ease;
}
.social-links a:hover { color: var(--rose); transform: translateY(-2px); }

.site-footer .social-links a { color: rgba(255,255,255,0.65); }
.site-footer .social-links a:hover { color: var(--teal); }

/* ---------------------------------------------------------------------
   Research — card grid ("simple list", just tidier)
   --------------------------------------------------------------------- */

.research-intro {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.2rem;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem 1.5rem;
}

@media (max-width: 900px) {
  .research-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.research-card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.research-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px -18px rgba(12,23,32,0.35);
}

.research-card .thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--ink-soft);
}

.research-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.research-card:hover .thumb img { transform: scale(1.05); }

.research-card .card-body {
  padding: 1.1rem 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.research-card h3 { margin-bottom: 0.1rem; }

.research-card .authors {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.research-card .journal-link {
  margin-top: auto;
  padding-top: 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--teal-dim);
  text-decoration: none;
}

.research-card .journal-link:hover { color: var(--rose); }

/* ---------------------------------------------------------------------
   News / posts list (home page)
   --------------------------------------------------------------------- */

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.news-list li {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
}

.news-list li:last-child { border-bottom: 1px solid var(--line); }

.news-date {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--teal-dim);
  font-weight: 700;
  padding-top: 0.2rem;
}

.news-list h3 { margin-bottom: 0.3rem; font-size: 1.05rem; }
.news-list h3 a { color: var(--ink); text-decoration: none; }
.news-list h3 a:hover { color: var(--rose); }
.news-list p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

@media (max-width: 560px) {
  .news-list li { grid-template-columns: 1fr; gap: 0.3rem; }
}

/* ---------------------------------------------------------------------
   Gallery
   --------------------------------------------------------------------- */

.gallery-entry {
  padding: 2rem 0;
  border-top: 1px solid var(--line);
}
.gallery-entry:first-child { border-top: 0; padding-top: 0; }

.gallery-year {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--teal-dim);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  margin-bottom: 0.6rem;
}

.press-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.2rem;
}

.press-item { text-align: left; }
.press-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 0.3rem;
  margin-bottom: 0.6rem;
}
.press-item img.top {
  object-position: top;
}
.press-item .caption { font-size: 0.78rem; color: var(--text-muted); display: block; margin-bottom: 0.4rem; }
.press-item a { display: block; }

.embed-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 100%;
  border-radius: 0.3rem;
  margin: 1.2rem 0;
}
.embed-container iframe,
.embed-container object,
.embed-container embed {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

.site-video {
  display: block;
  width: 100%;
  border-radius: 0.3rem;
  margin: 1.2rem 0;
  background: var(--ink-soft);
}

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */

.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
  font-size: 0.82rem;
}

.site-footer p { margin: 0.3rem 0; }
.site-footer a { color: rgba(255,255,255,0.8); }
.site-footer a:hover { color: var(--teal); }

/* ---------------------------------------------------------------------
   404 page
   --------------------------------------------------------------------- */

.error-page {
  text-align: center;
  padding: 6rem 1.5rem 8rem;
}
.error-page h1 {
  font-size: clamp(3rem, 2.6rem + 3vw, 5rem);
  color: var(--ink);
}

/* ---------------------------------------------------------------------
   Mobile nav panel
   --------------------------------------------------------------------- */

@media (max-width: 800px) {
  .nav-toggle { display: block; }

  .nav-links {
    position: fixed;
    inset: 0 0 auto 0;
    top: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--ink);
    padding: calc(var(--nav-h) + 1rem) 1.5rem 2rem;
    transform: translateY(-105%);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  }

  .nav-links a {
    width: 100%;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line-dark);
    font-size: 1rem;
  }
  .nav-links a::after { display: none; }

  #nav-check:checked ~ .nav-links {
    transform: translateY(0);
  }
}

/* ---------------------------------------------------------------------
   Reduced motion
   --------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-cue { animation: none; }
  .hero-img { transition: none !important; }
  .research-card, .research-card .thumb img { transition: none; }
}
