/* ───────────────────────────────────────────
   TOKENS
─────────────────────────────────────────── */
:root {
  --ink:       #0a1628;
  --ink-mid:   #1b3a5f;
  --ink-soft:  #4a5b6e;
  --paper:     #ffffff;
  --paper-alt: #f2f6fb;
  --gold:      #1d4ed8;
  --gold-light:#3b82f6;
  --rule:      #1e3a5f;

  --font-display: 'Poppins', system-ui, sans-serif;
  --font-body:    'Open Sans', system-ui, sans-serif;

  --max-w: 1100px;
  --max-w-narrow: 700px;
}

/* ───────────────────────────────────────────
   RESET
─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover {
  color: #000000;
  background: #ffe600;
  border-radius: 3px;
  border-bottom-color: transparent !important;
  box-shadow: 0 0 0 0.15em #ffe600, 0 0 0 calc(0.15em + 2px) #000000;
}
img { max-width: 100%; display: block; }

/* ───────────────────────────────────────────
   NAV
─────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.nav-inner {
  width: 90%;
  margin: 0 auto;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.nav-name a { color: inherit; }
.nav-name a:hover { color: #000000; }

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.2s;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover { color: #000000; }
.nav-links a.active {
  color: var(--ink);
  border-bottom-color: var(--gold);
}

/* ───────────────────────────────────────────
   PAGE HEADER (used on inner pages)
─────────────────────────────────────────── */
.page-header {
  padding: 120px 2rem 60px;
  background: var(--ink-mid);
  border-bottom: 1px solid var(--gold);
}

.page-header .page-eyebrow { color: #9fc3f5; }
.page-header p a { color: #bcd8f7; border-bottom-color: #bcd8f7; }
.page-header .btn-secondary { color: #ffffff; border-color: #bcd8f7; }
.page-header .btn-secondary:hover { color: #000000; border-color: #000000; }

.page-header-inner {
  width: 90%;
  margin: 0 auto;
}

.page-eyebrow {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.2vw, 3.8rem);
  font-weight: 600;
  line-height: 1.1;
  color: #ffffff;
  margin-bottom: 1rem;
}

.page-header p {
  font-size: 1rem;
  color: #d3e4f7;
  max-width: 580px;
  line-height: 1.8;
}

/* ───────────────────────────────────────────
   SECTIONS
─────────────────────────────────────────── */
.section { padding: 70px 2rem; }
.section-alt { background: var(--paper-alt); }

.container {
  width: 90%;
  margin: 0 auto;
}

.container-narrow {
  max-width: var(--max-w-narrow);
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 2.8vw, 2.4rem);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.section-intro {
  font-size: 1rem;
  color: var(--ink-mid);
  max-width: 600px;
  margin-bottom: 3rem;
  margin-top: 1rem;
}

.section-intro a {
  color: var(--gold);
  border-bottom: 1px solid var(--gold-light);
}

/* ───────────────────────────────────────────
   BUTTONS
─────────────────────────────────────────── */
.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  background: transparent;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--rule);
  transition: border-color 0.2s, color 0.2s;
}
.btn-primary:hover,
.btn-secondary:hover {
  border-color: #000000;
  color: #000000;
}

/* ───────────────────────────────────────────
   RESEARCH GRID (shared: homepage + research page)
─────────────────────────────────────────── */
.research-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.5px;
  background: var(--rule);
  border: 1px solid var(--rule);
  overflow: hidden;
}

.research-card {
  flex: 1 1 0;
  min-width: 0;
  background: var(--paper);
  padding: 2rem;
  transition: background 0.2s;
}
.research-card:hover { background: var(--paper-alt); }

.card-number {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold-light);
  line-height: 1;
  margin-bottom: 0.75rem;
}

.research-thumb {
  width: 100%;
  height: 170px;
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1rem;
  overflow: hidden;
}
.research-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.research-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.research-card p {
  font-size: 0.9rem;
  color: var(--ink-mid);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.card-where {
  font-size: 0.78rem !important;
  color: var(--ink-soft) !important;
  font-style: italic;
  margin-top: 0.75rem !important;
}

/* ───────────────────────────────────────────
   AI/ML PAGE (larger cards)
─────────────────────────────────────────── */
.ai-grid .research-card { padding: 2.75rem; }
.ai-grid .research-thumb { height: 240px; font-size: 0.8rem; }
.ai-grid .research-card h3 { font-size: 1.5rem; margin-bottom: 0.9rem; }
.ai-grid .research-card p { font-size: 1.02rem; line-height: 1.8; }

.card-github {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gold);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 2px;
}
.card-github:hover { color: #000000; }
.card-github::after { content: "→"; transition: transform 0.2s; }
.card-github:hover::after { transform: translateX(3px); }

/* ───────────────────────────────────────────
   PUBLICATIONS (shared)
─────────────────────────────────────────── */
.pub-list {
  display: flex;
  flex-direction: column;
}

.pub-item {
  display: grid;
  grid-template-columns: 130px 1fr 130px;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.pub-item:first-child { border-top: 1px solid var(--rule); }

.pub-thumb {
  width: 130px;
  height: 130px;
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  overflow: hidden;
}
.pub-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pub-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.35rem;
  line-height: 1.4;
}
.pub-title a {
  color: var(--gold);
  border-bottom: 1px solid var(--gold-light);
  transition: color 0.2s, border-color 0.2s;
}
.pub-title a:hover {
  color: #000000;
}

.pub-authors {
  font-size: 0.95rem;
  color: var(--ink-mid);
  margin-bottom: 0.2rem;
  line-height: 1.5;
}
.pub-authors .me {
  font-weight: 700;
  color: var(--gold);
}

.pub-journal {
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.pub-journal .pub-year {
  font-weight: 600;
  color: var(--ink-mid);
  font-style: normal;
}

/* ───────────────────────────────────────────
   CV ITEMS (shared)
─────────────────────────────────────────── */
.cv-group-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 1.5rem;
  margin-top: 3rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}
.cv-group-title:first-child { margin-top: 0; }

.pres-subgroup {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1.5rem 0 1rem;
}

/* ───────────────────────────────────────────
   NEWS PAGE
─────────────────────────────────────────── */
.news-list {
  display: flex;
  flex-direction: column;
}
.news-post {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.news-post:first-child { padding-top: 0; }
.news-date {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.4rem;
}
.news-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}
.news-body {
  font-size: 0.92rem;
  color: var(--ink-mid);
  line-height: 1.7;
}

/* ───────────────────────────────────────────
   SERVICE PAGE
─────────────────────────────────────────── */
.service-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  align-items: start;
}
.service-column .cv-group-title { margin-top: 0; }

.cv-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.cv-item.with-logo {
  grid-template-columns: 56px 1fr 44px;
  align-items: center;
}
.cv-item.with-logo .cv-logo { justify-self: end; order: 3; }
.cv-item.with-logo .cv-detail { order: 2; }

.cv-logo {
  width: 44px;
  height: 44px;
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  overflow: hidden;
}
.cv-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.cv-date {
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 500;
  padding-top: 0.15rem;
  letter-spacing: 0.03em;
}

.cv-detail {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.cv-detail strong {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
}
.cv-detail span {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* ───────────────────────────────────────────
   CONTACT BLOCK (shared)
─────────────────────────────────────────── */
.contact-block {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
}

.contact-item {
  display: grid;
  grid-template-columns: 20px 80px 1fr;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--rule);
  align-items: center;
}
.contact-item:last-child { border-bottom: none; }

.contact-icon {
  width: 18px;
  height: 18px;
  color: var(--ink-soft);
}
.contact-icon svg { width: 100%; height: 100%; }

.contact-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.contact-item a {
  font-size: 0.9rem;
  color: var(--ink);
  border-bottom: 1px solid var(--gold-light);
  transition: color 0.2s, border-color 0.2s;
}
.contact-item a:hover { color: #000000; border-color: #000000; }
.contact-item span { font-size: 0.9rem; color: var(--ink-mid); }

/* ───────────────────────────────────────────
   SKILLS PAGE
─────────────────────────────────────────── */
.skills-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.5px;
  background: var(--rule);
  border: 1px solid var(--rule);
  overflow: hidden;
}

.skill-thumb {
  width: 100%;
  height: 110px;
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1rem;
  overflow: hidden;
}
.skill-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.skill-pill {
  font-size: 0.82rem;
  color: var(--ink-mid);
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  line-height: 1.3;
  transition: border-color 0.2s, color 0.2s;
}
.skill-pill:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ───────────────────────────────────────────
   PHOTO GALLERY (Outside Work)
─────────────────────────────────────────── */
.fun-block { margin-bottom: 3.5rem; }
.fun-block h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.4rem;
}
.fun-block p {
  font-size: 0.95rem;
  color: var(--ink-mid);
  margin-bottom: 1.25rem;
  max-width: 600px;
}

.fun-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem;
  align-items: start;
}
.fun-columns .fun-block { margin-bottom: 0; }
.fun-columns .photo-grid {
  grid-template-columns: 1fr;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.photo-thumb {
  aspect-ratio: 4 / 3;
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.photo-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(10, 22, 40, 0.18);
  border-color: var(--gold);
  z-index: 1;
  position: relative;
}
.photo-thumb:hover img { transform: scale(1.08); }
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

/* ───────────────────────────────────────────
   FOOTER
─────────────────────────────────────────── */
footer {
  padding: 2rem;
  border-top: 1px solid var(--rule);
}
footer p {
  font-size: 0.8rem;
  color: var(--ink-soft);
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ───────────────────────────────────────────
   FADE-IN (JS hook)
─────────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ───────────────────────────────────────────
   RESPONSIVE
─────────────────────────────────────────── */
@media (max-width: 600px) {
  .nav-links { display: none; }
  .section { padding: 50px 1.5rem; }
  .page-header { padding: 100px 1.5rem 50px; }
  .research-grid { flex-wrap: wrap; }
  .research-card { flex: 1 1 100%; }
  .skills-grid { flex-wrap: wrap; }
  .fun-columns { grid-template-columns: 1fr; }
  .service-columns { grid-template-columns: 1fr; }
  .pub-item { grid-template-columns: 1fr; gap: 0.25rem; }
  .pub-year { font-size: 0.82rem; }
  .cv-item { grid-template-columns: 48px 1fr; }
  .cv-item.with-logo { grid-template-columns: 48px 1fr; }
  .cv-item.with-logo .cv-logo { display: none; }
}
