:root{
  --bg:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --border:#e5e7eb;
  --card:#ffffff;
  --accent:#111827;
  --max: 980px;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,.06);
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font-family:var(--sans);line-height:1.5}
a{color:inherit;text-decoration:none}
a:hover{text-decoration:underline}
img,video{max-width:100%;height:auto;display:block}

.muted{color:var(--muted)}
.kicker{text-align:center;letter-spacing:.08em;text-transform:uppercase;font-size:1.4rem;color:var(--text);margin-bottom:1rem;font-weight:600}

header{
  border-bottom:1px solid var(--border);
  background:rgba(255,255,255,.92);
  backdrop-filter:saturate(180%) blur(10px);
  position:sticky;top:0;z-index:10
}
.nav{
  max-width:var(--max);
  margin:0 auto;
  display:flex;
  gap:18px;
  align-items:center;
  justify-content:space-between;
  padding:14px 18px
}
.brand{display:flex;align-items:center;gap:12px;min-width:0}
.brand .mark{
  width:56px;height:56px;
  border:1px solid var(--border);
  border-radius:12px;
  overflow:visible;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
}
.brand .mark img{width:100%;height:100%;object-fit:contain;padding:2px}
.brand .txt{display:flex;flex-direction:column;gap:2px;min-width:0}
.brand .name{font-weight:700;line-height:1.1}
.brand .tag{color:var(--muted);font-size:.92rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}


/* Hamburger nav (replaces old .navlinks link styling) */
.navlinks{
  position:relative;
  display:flex;
  justify-content:flex-end; /* right aligned */
  align-items:center;
}

/* Hide checkbox */
#menu-toggle{
  display:none;
}

/* Hamburger icon */
.menu-icon{
  width:28px;
  height:22px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  cursor:pointer;
}

.menu-icon span{
  height:3px;
  background:var(--text);
  border-radius:2px;
  transition:.3s ease;
}

/* Dropdown menu */
.dropdown{
  position:absolute;
  top:44px;
  right:0;
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  box-shadow:var(--shadow);
  display:flex;
  flex-direction:column;
  min-width:140px;
  padding:8px 0;
  opacity:0;
  pointer-events:none;
  transform:translateY(-10px);
  transition:.25s ease;
  z-index: 999;
}

.dropdown a{
  padding:10px 16px;
}

.dropdown a:hover{
  background:#f3f4f6;
  text-decoration:none;
}

/* Toggle open */
#menu-toggle:checked + .menu-icon + .dropdown{
  opacity:1;
  pointer-events:auto;
  transform:translateY(0);
}

/* Optional: animate to X when open */
#menu-toggle:checked + .menu-icon span:nth-child(1){
  transform:rotate(45deg) translate(5px,5px);
}
#menu-toggle:checked + .menu-icon span:nth-child(2){
  opacity:0;
}
#menu-toggle:checked + .menu-icon span:nth-child(3){
  transform:rotate(-45deg) translate(6px,-6px);
}

main{max-width:var(--max);margin:0 auto;padding:22px 18px 56px}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:40px 32px;
  margin-top:40px;
}
.card h1{margin:0 0 8px;font-size:1.8rem;letter-spacing:-0.02em}
.card h2{margin:0 0 10px;font-size:1.2rem}
.card p{margin:10px auto;max-width:78ch;text-align:center;}

.hero{
  display:flex;
  flex-direction:column;
  text-align: center;
  gap:24px;
  align-items:center;
}

.video-wrap{
  border:none;
  border-radius:18px;
  overflow:hidden;
  background:transparent;
}
.video-wrap video{width:100%;height:auto;margin-top:0.5rem;}

.btnrow{display:flex;justify-content:center;gap:16px;flex-wrap:wrap;margin-top:1.5rem;margin-bottom:1rem;}
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  border:1px solid var(--border);
  padding:10px 12px;
  border-radius:14px;
  background:#fff;
}
.btn:hover{background:#f9fafb;text-decoration:none}

footer{max-width:var(--max);margin:0 auto;padding:0 18px 36px;color:var(--muted);font-size:.92rem}

.cv-embed{
  width:100%;
  height:min(78vh, 900px);
  border:1px solid var(--border);
  border-radius:14px;
}

.cv-viewer{
  width:100%;
  height:min(78vh, 900px);
  border:1px solid var(--border);
  border-radius:14px;
  background:#f8fafc;
  padding:12px;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}

.cv-status{
  margin:4px auto;
  text-align:center;
  color:var(--muted);
  font-size:.96rem;
}

.cv-page-frame{
  border:1px solid var(--border);
  border-radius:10px;
  overflow:hidden;
  background:#fff;
  margin:0 auto 10px;
  width:max-content;
  box-shadow:0 6px 18px rgba(0,0,0,.08);
}

.cv-page-frame:last-child{
  margin-bottom:0;
}

.cv-page-canvas{
  display:block;
  width:auto;
  height:auto;
}

.cv-viewer-error{
  padding:16px 12px;
}

/* Centering contact card page */
.contact-card{
  display:flex;
  flex-direction:column;
  align-items:center;   /* centers the whole content block */
  justify-content:center;
  text-align:center;    /* centers text within */
  padding: 64px 32px;   /* optional: makes it feel intentional */
}

.contact-card .kicker{
  margin-bottom: 18px;
}

.contact-card p{
  margin: 0;            /* removes default <p> margins that can look off */
  font-size: 1.25rem;   /* optional */
}

/* Research-only scroll snapping (make MAIN the scroller) */
body.research{
  height: 100vh;
  overflow: hidden; /* prevents body from being the scroller */
}

body.research main{
  height: calc(100vh - 72px); /* 72px ~ header height; adjust if needed */
  overflow-y: auto;
  scroll-snap-type: y proximity;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

body.research .snap{
  scroll-snap-align: start;
  scroll-margin-top: 0;
}

@media (max-width: 768px){
  body.research main{
    scroll-snap-type: none;
    scroll-behavior: auto;
  }

  body.research .snap{
    scroll-snap-align: none;
  }
}

body.research main{
  scrollbar-width: thin;              /* Firefox */
}

body.research main::-webkit-scrollbar{
  width: 10px;                        /* Chrome/Safari */
}

body.research main::-webkit-scrollbar-thumb{
  border-radius: 999px;
  background: rgba(0,0,0,.18);
  border: 3px solid transparent;
  background-clip: content-box;
}

/* -------------------------
   Carousel (horizontal) within each research section
-------------------------- */
body.research .carousel{
  margin-top: 14px;
}

/* Horizontal scroll container */
body.research .carousel-track{
  display:flex;
  overflow-x:auto;
  scroll-snap-type: x mandatory;
  scroll-behavior:smooth;
  -webkit-overflow-scrolling: touch;
  border-radius: 18px;
  gap: 0;
}

/* Hide horizontal scrollbar but keep functionality (optional) */
body.research .carousel-track{
  scrollbar-width: none; /* Firefox */
}
body.research .carousel-track::-webkit-scrollbar{
  display:none; /* Chrome/Safari */
}

/* Each slide is one full "page" */
body.research .slide{
  flex: 0 0 100%;
  scroll-snap-align: start;
  padding: 6px 2px 2px;
}

/* Two-column layout inside slide */
body.research .slide-grid{
  display:grid;
  grid-template-columns: var(--text-col, 1.15fr) var(--media-col, 0.85fr);
  gap: 18px;
  align-items:start;
}

/* Mobile handling: keep 2 columns until it gets too tight */
@media (max-width: 520px){
  body.research .slide-grid{
    grid-template-columns: 1fr; /* recommended: stack when cramped */
  }
}

/* If you INSIST on always 2 columns on mobile, delete the media query above. */

body.research .slide-text h2{
  margin: 6px 0 10px;
  font-size: 1.25rem;
}

body.research .slide-text h3{
  margin: 16px 0 8px;
  font-size: 1.05rem;
}

body.research .slide-text p{
  text-align:left;  /* better for reading inside slides */
  margin: 10px 0;
}

body.research .slide-text ul{
  margin: 10px 0 0 18px;
}

body.research .slide-media{
  display:flex;
  align-items:flex-start;
  justify-content:center;
}

body.research .research-figure{
  width:100%;
  border-radius: 14px;
}

/* Carousel nav dots */
body.research .carousel-dots{
  display:flex;
  justify-content:center;
  gap:10px;
  margin-top:14px;
}

body.research .dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background:var(--border);
  transition:.3s ease;
}

body.research .dot.active{
  background:var(--text);
  transform:scale(1.2);
}

body.research .slide-text ul{
  padding-left: 0;      /* remove browser default indent */
  margin-left: 0;
  list-style-position: inside; /* keeps bullet aligned with text */
}

/* Bullet point styling */
ul { padding-left: 1.5em; }
li { text-indent: -1.5em; padding-left: 1.5em; }

/* CV/Contact header logo override */
body.cv-page .brand .mark,
body.contact-page .brand .mark {
  width: 56px;
  height: 56px;
  overflow: visible;
}

body.cv-page .brand .mark img,
body.contact-page .brand .mark img {
  object-fit: contain;
  padding: 2px;
}

/* Force consistent logo sizing/cropping across pages */
.brand .mark {
  width: 56px !important;
  height: 56px !important;
  overflow: visible !important;
}

.brand .mark img {
  object-fit: contain !important;
  padding: 2px !important;
}
