/* =========================================================
   Dan-Mircea Mirea — personal site
   ========================================================= */

:root{
  --bg: #FAF7F1;
  --bg-alt: #F1ECE2;
  --surface: #FFFFFF;
  --text: #1E1B26;
  --text-soft: #5D5A68;
  --text-faint: #8B8794;
  --border: #E6DFD1;
  --accent: #8438C7;
  --accent-strong: #6B2AA3;
  --accent-soft: #F3E8FC;
  --accent-2: #D9633A;
  --accent-2-soft: #FBE7DC;
  --display: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --shadow: 0 20px 50px -25px rgba(30, 27, 38, 0.35);
  --radius: 18px;
  color-scheme: light;
}

:root:not([data-theme="light"]){
  @media (prefers-color-scheme: dark){
    --bg: #17151F;
    --bg-alt: #1E1B29;
    --surface: #221F2E;
    --text: #F3F1EC;
    --text-soft: #B9B5C4;
    --text-faint: #837E90;
    --border: #322D40;
    --accent: #C79AF2;
    --accent-strong: #D9B8F7;
    --accent-soft: #33254A;
    --accent-2: #F0916A;
    --accent-2-soft: #3A2A24;
    --shadow: 0 20px 60px -20px rgba(0,0,0,0.55);
    color-scheme: dark;
  }
}

:root[data-theme="dark"]{
  --bg: #17151F;
  --bg-alt: #1E1B29;
  --surface: #221F2E;
  --text: #F3F1EC;
  --text-soft: #B9B5C4;
  --text-faint: #837E90;
  --border: #322D40;
  --accent: #C79AF2;
  --accent-strong: #D9B8F7;
  --accent-soft: #33254A;
  --accent-2: #F0916A;
  --accent-2-soft: #3A2A24;
  --shadow: 0 20px 60px -20px rgba(0,0,0,0.55);
  color-scheme: dark;
}

*, *::before, *::after{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
  overflow-x: hidden;
}

img{ max-width: 100%; display: block; }

a{ color: inherit; text-decoration: none; }

.container{
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3{
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.section-head{
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 44px;
}
.section-head .num{
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--accent);
}
.section-head h2{
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}
.section-head .rule{
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: 8px;
}

section{
  padding: 96px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
section:last-of-type{ border-bottom: none; }

/* ---------- Header / Nav ---------- */
.site-header{
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header nav{
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo{
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  border: 1.5px solid var(--text);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color .2s, border-color .2s, transform .2s;
}
.logo:hover{ color: var(--accent); border-color: var(--accent); transform: rotate(-8deg); }

.nav-links{
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  flex: 1;
}
.nav-links a{
  font-size: 0.94rem;
  color: var(--text-soft);
  position: relative;
  padding: 4px 0;
}
.nav-links a::after{
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width .25s ease;
}
.nav-links a:hover, .nav-links a.active{ color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after{ width: 100%; }

.nav-actions{ display: flex; align-items: center; gap: 12px; }

.icon-btn{
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-soft);
  transition: color .2s, border-color .2s, transform .2s;
}
.icon-btn:hover{ color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.icon-btn svg{ width: 18px; height: 18px; }
.icon-btn svg.icon-tiktok{ width: 20px; height: 20px; }
.icon-btn .icon-moon{ display: none; }
:root[data-theme="dark"] .icon-btn .icon-sun{ display: none; }
:root[data-theme="dark"] .icon-btn .icon-moon{ display: block; }
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .icon-btn .icon-sun{ display: none; }
  :root:not([data-theme="light"]) .icon-btn .icon-moon{ display: block; }
}

.btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn-primary{ background: var(--accent); color: #fff; }
.btn-primary:hover{ background: var(--accent-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-outline{ border-color: var(--text); color: var(--text); }
.btn-outline:hover{ border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn-sm{ padding: 8px 16px; font-size: 0.82rem; }

.nav-toggle{
  display: none;
  background: none; border: none; cursor: pointer;
  width: 38px; height: 38px; align-items: center; justify-content: center;
  color: var(--text);
}
.nav-toggle svg{ width: 22px; height: 22px; }

/* ---------- About masthead (name/photo/intro) ---------- */
.about-top{
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
  margin-bottom: 40px;
}
.eyebrow{
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 18px;
}
.hero-text h1{
  font-size: clamp(2.2rem, 4.6vw, 3.8rem);
  font-weight: 700;
  line-height: 1.08;
  margin-bottom: 18px;
}
@media (min-width: 900px){
  .hero-text h1{ white-space: nowrap; }
}
.about-text a{
  color: var(--accent);
  font-weight: 600;
  border-bottom: 1px solid transparent;
}
.about-text a:hover{ border-color: var(--accent); }
.hero-actions{ display: flex; gap: 14px; flex-wrap: wrap; margin: 40px 0 24px; }

.social-row{ display: flex; gap: 10px; }

.hero-photo{
  justify-self: center;
  width: 100%;
  max-width: 300px;
}
.hero-photo img{
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- About ---------- */
.about-text{ margin-top: 22px; }
.about-text p{ margin: 0 0 20px; color: var(--text-soft); font-size: 1.05rem; }
.about-text p:last-child{ margin-bottom: 0; }
.about-text strong{ color: var(--text); font-weight: 600; }
.about-text a{ color: var(--accent); font-weight: 600; border-bottom: 1px solid transparent; }
.about-text a:hover{ border-color: var(--accent); }

/* ---------- News ---------- */
.timeline{
  list-style: none;
  margin: 0; padding: 0;
  position: relative;
  border-left: 1.5px solid var(--border);
  max-width: 780px;
}
.timeline li{
  position: relative;
  padding: 0 0 34px 32px;
}
.timeline li:last-child{ padding-bottom: 0; }
.timeline li::before{
  content: '';
  position: absolute;
  left: -6.5px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2.5px solid var(--accent);
}
.timeline time{
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.timeline p{ margin: 0; color: var(--text-soft); font-size: 1rem; }
.timeline strong{ color: var(--text); font-weight: 600; }
.timeline a{ color: var(--accent); font-weight: 600; border-bottom: 1px solid transparent; }
.timeline a:hover{ border-color: var(--accent); }

/* ---------- Publications ---------- */
.pub-filters{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}
.pub-filters button{
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: all .2s ease;
}
.pub-filters button:hover{ border-color: var(--accent); color: var(--accent); }
.pub-filters button.active{ background: var(--text); border-color: var(--text); color: var(--bg); }

.pub-group-label{
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  font-weight: 700;
  margin: 36px 0 16px;
}
.pub-group-label:first-child{ margin-top: 0; }

.pub-list{ list-style: none; margin: 0; padding: 0; }
.pub-item{
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity .25s ease, transform .25s ease;
}
.pub-item:first-child{ padding-top: 0; }
.pub-year{
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--accent);
  min-width: 3.2ch;
}
.pub-title{
  font-size: 1.04rem;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.4;
}
.pub-authors{
  font-size: 0.92rem;
  color: var(--text-soft);
  margin: 0 0 8px;
}
.pub-meta{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}
.pub-venue{ font-style: italic; color: var(--text-faint); }
.pub-badge{
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-2-soft);
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pub-link{
  color: var(--accent);
  font-weight: 600;
  border-bottom: 1px solid transparent;
}
.pub-link:hover{ border-color: var(--accent); }
.pub-item.hidden{ display: none; }

/* ---------- Footer ---------- */
footer{
  padding: 36px 0 48px;
  text-align: center;
}
footer p{
  margin: 0 0 6px;
  font-size: 0.86rem;
  color: var(--text-faint);
}
footer a{ color: var(--text-faint); border-bottom: 1px dotted var(--text-faint); }
footer a:hover{ color: var(--accent); border-color: var(--accent); }

/* ---------- Reveal animation ---------- */
.reveal{
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.in-view{ opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 860px){
  .about-top{ grid-template-columns: 1fr; margin-bottom: 48px; }
  .hero-photo{ order: -1; max-width: 200px; margin-bottom: 8px; }
  section{ padding: 64px 0; }
}

@media (max-width: 700px){
  .nav-links{
    position: fixed;
    top: 70px; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 20px 28px 28px;
    gap: 16px;
    display: none;
  }
  .nav-links.open{ display: flex; }
  .nav-toggle{ display: flex; order: 2; }
  .nav-actions{ order: 3; }
  .site-header nav{ flex-wrap: wrap; }
  .btn-cv-label{ display: none; }
}
