:root{
  --bg: #0b0c10;
  --panel: #11131a;
  --card: #141827;
  --text: #e7e9ee;
  --muted: #aab1c2;
  --border: rgba(255,255,255,.08);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 18px;
  --maxw: 1040px;
}

:root[data-theme="light"]{
  --bg: #f7f8fb;
  --panel: #ffffff;
  --card: #ffffff;
  --text: #121521;
  --muted: #5a647a;
  --border: rgba(15, 20, 35, .10);
  --shadow: 0 10px 30px rgba(15, 20, 35, .08);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font: 16px/1.55 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; }

.container{
  width: min(var(--maxw), calc(100% - 32px));
  margin: 0 auto;
}

.skip{
  position:absolute;
  left:-9999px;
  top: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 12px;
}
.skip:focus{ left: 16px; z-index: 1000; }

.topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
:root[data-theme="light"] .topbar{
  background: rgba(255,255,255,.75);
}

.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 0;
  gap: 16px;
}

.brand{ display:flex; align-items:center; gap: 12px; min-width: 220px; }
.avatar{
  width: 40px; height: 40px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  display:grid; place-items:center;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.name{ font-weight: 700; }
.subtitle{ color: var(--muted); font-size: 13px; }

.nav{ display:flex; align-items:center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.nav a{
  padding: 8px 10px;
  border-radius: 12px;
}
.nav a[aria-current="page"]{
  background: var(--card);
  border: 1px solid var(--border);
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  cursor:pointer;
  user-select:none;
}
.btn.ghost{
  background: transparent;
  box-shadow:none;
}
.btn:hover{ filter: brightness(1.05); text-decoration:none; }

main{ padding: 22px 0 40px; }

.hero{
  display:grid;
  grid-template-columns: 1.4fr .9fr;
  gap: 18px;
  align-items: start;
  margin-top: 10px;
}
.hero h1{ margin: 0 0 8px; font-size: 36px; line-height: 1.15; }
.lead{ margin: 0 0 14px; color: var(--muted); font-size: 16px; }
.actions{ display:flex; gap: 10px; flex-wrap: wrap; }

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.bullets{ margin: 10px 0 0; padding-left: 18px; color: var(--muted); }
.muted{ color: var(--muted); }

.kv{ margin: 10px 0 0; }
.kv > div{
  display:flex;
  justify-content:space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.kv > div:first-child{ border-top: none; padding-top: 0; }
.kv dt{ color: var(--muted); }
.kv dd{ margin: 0; text-align: right; max-width: 60%; overflow-wrap: anywhere; }

.stats{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}

@media (max-width: 980px){
  .stats{ grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px){
  .stats{ grid-template-columns: 1fr; }
}

.stat{
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,.03);
}
:root[data-theme="light"] .stat{
  background: rgba(15, 20, 35, .04);
}
.stat-k{ font-size: 22px; font-weight: 800; }
.stat-l{ color: var(--muted); font-size: 13px; margin-top: 2px; }

.pagehead{ margin: 10px 0 14px; }
.pagehead h1{ margin: 0 0 6px; }

.skeleton{
  color: var(--muted);
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed var(--border);
}

.footer{
  border-top: 1px solid var(--border);
  padding: 18px 0;
}
.footer-inner{
  display:flex;
  justify-content:space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Responsive layout tuning */
@media (max-width: 980px){
  .hero{ grid-template-columns: 1fr; }
  .grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px){
  .grid{ grid-template-columns: 1fr; }
  .stats{ grid-template-columns: 1fr; }
}

/* --- Students extras --- */
.search{
  width: 100%;
  max-width: 520px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  outline: none;
}

.students-toolbar{
  display: grid;
  gap: 12px;
  margin-bottom: 10px;
}

.year-title{
  margin: 14px 0 10px;
  font-size: 18px;
}

.year-items{
  display: grid;
  gap: 10px;
}

.thesis-title{
  font-weight: 700;
  margin-bottom: 4px;
}

.thesis-meta{
  font-size: 14px;
}

/* --- Students UI extras --- */
.pills{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill{
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  cursor: pointer;
  user-select: none;
}
:root[data-theme="light"] .pill{
  background: rgba(15, 20, 35, .04);
}
.pill[aria-pressed="true"]{
  background: var(--card);
  box-shadow: var(--shadow);
}

.thesis{
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.badge{
  flex: 0 0 auto;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--muted);
}

.year-title{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.year-title button{
  all: unset;
  cursor: pointer;
  font-weight: 700;
  font-size: 18px;
}

.year-items{
  margin-top: 10px;
}

details.year-group{
  margin-top: 12px;
}

details.year-group > summary{
  list-style: none;
  cursor: pointer;
}
details.year-group > summary::-webkit-details-marker{ display:none; }

/* --- Year toggle arrow --- */
.year-title{
  position: relative;
}

.year-title .muted{
  display: none; /* eltüntetjük a "toggle" szöveget */
}

.year-title::after{
  content: "▾";           /* lefelé nyíl */
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  transition: transform .2s ease, color .2s ease;
}

/* amikor a details nyitva van */
details[open] > summary .year-title::after{
  transform: rotate(180deg);  /* felfelé mutat */
  color: var(--text);
}

summary{
  cursor: pointer;
}

/* --- Publications UI --- */
.pub-toolbar{
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.pub-toolbar .search{
  max-width: 720px;
}

.pub-meta{
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
}

.pub-title{
  font-weight: 800;
  margin: 0 0 8px;
  line-height: 1.25;
}

.chips{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.chip{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--muted);
}
:root[data-theme="light"] .chip{
  background: rgba(15, 20, 35, .04);
}

.pub-card{
  display: grid;
  gap: 10px;
}

.pub-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.pub-actions .btn{
  padding: 8px 10px;
  border-radius: 12px;
  box-shadow: none;
}

details.inline{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 10px;
  background: rgba(255,255,255,.02);
}
:root[data-theme="light"] details.inline{
  background: rgba(15, 20, 35, .02);
}
details.inline > summary{
  cursor: pointer;
  list-style: none;
}
details.inline > summary::-webkit-details-marker{ display:none; }

pre.bib{
  margin: 10px 0 0;
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  overflow: auto;
  max-height: 320px;
  white-space: pre;
  background: rgba(0,0,0,.25);
}
:root[data-theme="light"] pre.bib{
  background: rgba(15, 20, 35, .04);
}

.pub-year-title{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.year-arrow{
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  transition: transform .2s ease, color .2s ease;
}

/* nyitott állapot */
details[open] > summary .year-arrow{
  transform: rotate(180deg);
  color: var(--text);
}

.pub-year-title .right{
  display:flex;
  align-items:center;
  gap:10px;
}

details.pub-year{
  margin-top: 12px;
}
details.pub-year > summary{
  cursor: pointer;
  list-style: none;
  padding: 6px 0;
}
details.pub-year > summary::-webkit-details-marker{ display:none; }


details[open] > summary .pub-year-title::after{
  transform: rotate(180deg);
  color: var(--text);
}

/* publications stats: 4 columns */
.stats{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}
@media (max-width: 980px){
  .stats{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px){
  .stats{ grid-template-columns: 1fr; }
}

/* --- Featured publications on index --- */
.featured-list{
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.featured-item{
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}
:root[data-theme="light"] .featured-item{
  background: rgba(15, 20, 35, .02);
}

.featured-item h3{
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.featured-meta{
  color: var(--muted);
  font-size: 14px;
}

.featured-actions{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  margin-top: 4px;
}

.featured-actions .btn{
  padding: 8px 10px;
  border-radius: 12px;
  box-shadow: none;
}

/* --- Contact card with right-aligned photo --- */
.contact-card{
  display: grid;
  grid-template-columns: 1fr 140px;
  column-gap: 16px;
}

/* cím felül, teljes szélesség */
.contact-card h2{
  grid-column: 1 / -1;
}

/* adatok bal oldalon */
.contact-card .kv{
  grid-column: 1;
}

/* kép JOBBRA: a konténer megy a 2. oszlopba */
.contact-photo{
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  align-self: start;
}

@media (max-width: 680px){
  .contact-photo{
    grid-column: 1;
    grid-row: auto;
    justify-self: center;
  }
}

/* --- Contact photo: fixed size, right column --- */
.contact-photo{
  grid-column: 2;
  grid-row: 2;
  width: 140px;          /* <<< fix konténer szélesség */
  justify-self: end;
  align-self: start;
}

.contact-photo img{
  display: block;        /* <<< ne legyen inline */
  width: 140px;          /* <<< fix */
  height: 140px;         /* <<< fix (nem nőhet meg) */
  max-width: 140px;
  object-fit: cover;
}

/* --- Matrix canvas background --- */
#matrixBg{
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .30;            /* <<< MOST EZ FONTOS */
}

/* light módban halványabb */
:root[data-theme="light"] #matrixBg{
  opacity: .18;
}

/* a kártyák fölötte legyenek */
.topbar, main, footer{
  position: relative;
  z-index: 1;
}

body{
  background-color: #0b0f14; /* dark theme alap */
}

/* Light theme: világos, enyhén szürkés háttér */
:root[data-theme="light"] body{
  background-color: #f4f6f8;  /* NEM fehér, szemkímélő */
}

#matrixBg{ opacity: .40; }
:root[data-theme="light"] #matrixBg{ opacity: .14; }

/* --- Make theme toggle visible in dark mode --- */
#themeToggle.btn.ghost{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
}

#themeToggle.btn.ghost:hover{
  background: rgba(255,255,255,.10);
}



/* Light módban maradjon finomabb */
:root[data-theme="light"] #themeToggle.btn.ghost{
  background: rgba(15,20,35,.06);
}

:root[data-theme="light"] #themeToggle.btn.ghost:hover{
  background: rgba(15,20,35,.10);
}

/* --- Make lang toggle visible in dark mode --- */
#langToggle.btn.ghost{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
}

#langToggle.btn.ghost:hover{
  background: rgba(255,255,255,.10);
}

/* Light módban maradjon finomabb */
:root[data-theme="light"] #langToggle.btn.ghost{
  background: rgba(15,20,35,.06);
}

:root[data-theme="light"] #langToggle.btn.ghost:hover{
  background: rgba(15,20,35,.10);
}

.icon-btn{
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.icon-btn .icon{
  font-size: 18px;
  line-height: 1;
  transform: translateY(-0.5px); /* optikai igazítás */
}

/* csak a bibtex blokk legyen zsugorítható */
.bibtex,
.bibtex *{
  min-width: 0;
}

.pub-actions, .pub-actions * { min-width: 0; }

.pub-actions pre{
  overflow-x: auto !important;
}
.avatar{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.pub-authors{
  margin-top: 6px;
}

.pub-meta{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.pub-chip{
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  font-size: 12px;
  line-height: 1;
}

:root[data-theme="light"] .pub-chip{
  background: rgba(15,20,35,.04);
}

.link-list{
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 8px;
}

.link-list a{
  text-decoration: none;
}

.bio-role{
  font-weight: 600;
}

.bio-focus{
  padding-left: 12px;
  border-left: 2px solid var(--border);
  display: grid;
  gap: 6px;
}

