/* ---------------------------------------------------------------------------
   Omar Alterkait, personal site
   Dark navy theme, tuned for a particle physics background visualization.
   --------------------------------------------------------------------------- */

:root {
  --bg: #0f1419;
  --bg-panel: rgba(22, 28, 36, 0.72);
  --bg-card: rgba(23, 29, 38, 0.88);
  --text: #e8eaed;
  --text-dim: #98a2b3;
  --accent: #6ea8dc;
  --accent-warm: #c9a45c;
  --border: rgba(255, 255, 255, 0.08);
  --maxw: 860px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Background canvas sits behind everything */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Nav ------------------------------------------------------------------ */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  background: rgba(15, 20, 25, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.8rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-name {
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}
.nav-name:hover { text-decoration: none; color: var(--accent); }

.nav-links { display: flex; gap: 1.4rem; }
.nav-links a { color: var(--text-dim); font-size: 0.95rem; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.4rem;
  cursor: pointer;
}
.nav-toggle svg { width: 24px; height: 24px; fill: var(--text-dim); display: block; }
.nav-toggle:hover svg { fill: var(--accent); }

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

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(15, 20, 25, 0.97);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 0.4rem 1.25rem 0.8rem;
  }

  .nav.open .nav-links { display: flex; }

  .nav-links a {
    padding: 0.8rem 0;
    font-size: 1rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
  }
  .nav-links a:last-child { border-bottom: none; }
}

/* --- Hero ----------------------------------------------------------------- */

.hero {
  min-height: 88vh;
  display: flex;
  align-items: center;
  padding: 7rem 1.25rem 3rem;
}

.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  background: rgba(15, 20, 25, 0.78);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 2.6rem 2.4rem;
}

.headshot {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.hero-text h1 {
  font-size: 2.6rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}

.hero-role { font-size: 1.15rem; color: var(--text); }
.hero-role-sub { font-size: 1rem; color: var(--text-dim); margin-bottom: 1rem; }

.hero-tagline {
  max-width: 34rem;
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 1.4rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
  max-width: 34rem;
}

.chip {
  font-size: 0.82rem;
  color: var(--text-dim);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.28rem 0.85rem;
  white-space: nowrap;
}

.icon-row { display: flex; gap: 1rem; }

.icon-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  transition: border-color 0.2s, transform 0.2s;
}

.icon-row a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.icon-row svg {
  width: 20px;
  height: 20px;
  fill: var(--text-dim);
  transition: fill 0.2s;
}

.icon-row a:hover svg { fill: var(--accent); }

.icon-cv {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  transition: color 0.2s;
}

.icon-row a:hover .icon-cv { color: var(--accent); }

/* --- Sections ------------------------------------------------------------- */

main { padding: 0 1.25rem; }

.section {
  max-width: var(--maxw);
  margin: 0 auto 2.75rem;
  padding: 2.6rem 2.2rem;
  background: rgba(15, 20, 25, 0.88);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.section h2 {
  font-size: 1.7rem;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.section h2::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  margin-top: 0.5rem;
  background: var(--accent);
  border-radius: 2px;
}

.section p + p { margin-top: 1rem; }
.section p { color: var(--text-dim); }
.section p strong { color: var(--text); }

/* --- Research cards -------------------------------------------------------- */

.cards { display: grid; gap: 1.25rem; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 1.6rem;
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: rgba(110, 168, 220, 0.4);
  transform: translateY(-2px);
}

.card h3 { font-size: 1.12rem; color: var(--text); margin-bottom: 0.2rem; }

.card-collab {
  font-size: 0.88rem;
  color: var(--accent-warm);
  margin-bottom: 0.7rem;
}

.card p { color: var(--text-dim); font-size: 0.97rem; }

.card-links { margin-top: 0.8rem; }
.card-links a {
  font-size: 0.9rem;
  margin-right: 1.2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
  display: inline-block;
}
.card-links a:hover {
  border-color: var(--accent);
  text-decoration: none;
}

/* --- Publications ----------------------------------------------------------- */

.pub-list { list-style: none; }

.pub-list li {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}
.pub-list li:last-child { border-bottom: none; }

.pub-title { font-weight: 600; color: var(--text); }
.pub-authors { color: var(--text-dim); font-size: 0.94rem; }
.pub-venue { color: var(--text-dim); font-size: 0.94rem; font-style: italic; }
.pub-venue strong { color: var(--accent-warm); font-style: normal; }

.pub-link {
  font-size: 0.85rem;
  margin-left: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.7rem;
}
.pub-link:hover { border-color: var(--accent); text-decoration: none; }

.section-note {
  margin-top: 1.3rem;
  font-size: 0.92rem;
}

/* --- News ------------------------------------------------------------------- */

.news-list { list-style: none; }

.news-list li {
  display: flex;
  gap: 1.2rem;
  padding: 0.35rem 0;
  color: var(--text-dim);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}
.news-list li:last-child { border-bottom: none; }

.news-list strong { color: var(--accent-warm); }
.news-list em { color: var(--text); font-style: italic; }

.news-date {
  flex-shrink: 0;
  width: 5.2rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.news-text { flex: 1; }

/* Anthropic-branded link: their terracotta accent (~5.9:1 on this bg) */
.link-anthropic { color: #d97757; }
.link-anthropic:hover { color: #e59078; }

/* --- Talks & Presentations ------------------------------------------------- */

.talk-list { list-style: none; }

.talk-list li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.35rem 0;
  color: var(--text-dim);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}
.talk-list li:last-child { border-bottom: none; }

.tag {
  flex-shrink: 0;
  width: 4.6rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.12rem 0;
}

.tag-talk { color: var(--accent); border-color: rgba(110, 168, 220, 0.35); }
.tag-seminar { color: #9db4a8; border-color: rgba(157, 180, 168, 0.35); }
.tag-poster { color: #b9a0d8; border-color: rgba(185, 160, 216, 0.35); }

.award {
  color: var(--accent-warm);
  font-weight: 600;
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

.loc {
  color: var(--text-dim);
  opacity: 0.75;
  font-size: 0.9em;
}

/* --- Contact page -------------------------------------------------------------- */

.contact-main { padding-top: 5rem; min-height: 72vh; }

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

.contact-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1.5rem;
}

.contact-block h3 {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.6rem;
  letter-spacing: 0.02em;
}

.contact-block p { font-size: 0.95rem; line-height: 1.9; }

/* --- Background viewing windows ------------------------------------------------ */
/* Deliberate open stretches between panels where the canvas shows through:
   click/tap here to fire an interaction and watch it form and drift.
   clamp() keeps them meaningful on short phone viewports without becoming
   a void on tall monitors. */

.bg-window {
  height: clamp(220px, 32vh, 520px);
  display: flex;
  /* Hint near the top of the window: with the hero at 88vh a centered hint
     would sit at ~104vh, below the fold on every desktop viewport. */
  align-items: flex-start;
  justify-content: center;
  padding-top: 3.2rem;
}

/* Approach window before the sensor plane, shorter than the mid-page ones */
.bg-window-low { height: clamp(140px, 20vh, 380px); }

.bg-hint {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-align: center;
  text-wrap: balance;
  color: var(--text-dim);
  padding: 0 1rem;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0;                              /* shown only if clicking works */
  transition: opacity 1.2s ease 0.4s;
}

html.bg-live .bg-hint { opacity: 0.75; }   /* bg-drift.js: clicks are armed */

/* First visible burst: the intro hint has served its purpose. Exit fast and
   without the entrance delay so the caption never lingers over the forming
   cloud. The plane label (.bg-hint-keep) stays: it names the wireframe. */
html.bg-used .bg-hint:not(.bg-hint-keep) {
  opacity: 0;
  transition: opacity 0.35s ease;
}

/* --- Detector sensor plane space ---------------------------------------------- */

.detector-space {
  height: 46vh;
  min-height: 300px;
  pointer-events: none;   /* clicks pass through; plane is drawn on the canvas */
}

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

.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.25rem 2.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.92rem;
  background: rgba(15, 20, 25, 0.88);
}

/* --- Small screens ------------------------------------------------------------ */

@media (max-width: 640px) {
  .hero { padding-top: 6rem; min-height: auto; }
  .hero-inner { flex-direction: column; text-align: center; padding: 1.8rem 1.2rem; }
  .section { padding: 1.6rem 1.1rem; margin-bottom: 1.8rem; }
  /* Blur over an animating canvas is a per-frame recomposite on mobile
     GPUs; go more opaque instead. */
  .hero-inner, .section {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(15, 20, 25, 0.94);
  }
  .hero-text h1 { font-size: 2rem; }
  .icon-row { justify-content: center; }
  .hero-tagline { margin-left: auto; margin-right: auto; }
  .news-list li { flex-direction: column; gap: 0.1rem; }
  /* Talk rows: date + tags on their own line, text on the next. The desktop
     single-row flex left ~56px for the text beside the fixed-width date and
     chips, ballooning every row and overflowing on long words. */
  .talk-list li { flex-wrap: wrap; gap: 0.25rem 0.6rem; }
  .talk-list .news-text { flex-basis: 100%; }
  .tag { width: auto; padding: 0.12rem 0.7rem; }
  .chip-row { justify-content: center; margin-left: auto; margin-right: auto; }
  /* Panels are full-width on phones, so these gaps are the only place the
     animation shows through; keep them real but economize thumb-scrolling.
     svh fallback: size against the visible viewport while the URL bar shows. */
  .bg-window { height: clamp(160px, 24vh, 280px); height: clamp(160px, 24svh, 280px); }
  .bg-window-low { height: clamp(100px, 14vh, 220px); height: clamp(100px, 14svh, 220px); }
}

/* Short landscape viewports (phones rotated): the portrait floors above only
   apply under 640px width, so rotated phones would get the desktop 220px
   floor, over half the screen of empty scroll per gap. */
@media (max-height: 500px) {
  .bg-window { height: clamp(120px, 30vh, 180px); padding-top: 2rem; }
  .bg-window-low { height: clamp(80px, 16vh, 140px); }
}
