/* ═══════════════════════════════════════════════
   RESET & TOKENS
═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Backgrounds */
  --white:   #ffffff;
  --off:     #f5f5f7;   /* Apple off-white */
  --light:   #f0f0f2;
  --subtle:  #e8e8ec;

  /* Text */
  --ink:     #1d1d1f;   /* Apple near-black */
  --ink-2:   #424245;
  --ink-3:   #6e6e73;
  --ink-4:   #aeaeb2;
  --ink-5:   #d1d1d6;

  /* Accent */
  --red:     #b91c1c;
  --red-s:   rgba(185,28,28,0.1);
  --red-b:   rgba(185,28,28,0.2);

  /* Borders */
  --border:  #e0e0e5;
  --border-h: #c8c8ce;

  /* Fonts */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --nav-h: 56px;
  --ease: cubic-bezier(0.25, 0, 0, 1);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--red-s); color: var(--red); }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 4px; }


/* ═══════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════ */
.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 40px;
}

.container.narrow {
  max-width: 760px;
}

/* Alternating section backgrounds */
.section-white  { background: var(--white); }
.section-light  { background: var(--off); }
.section-narrative { background: var(--white); }

section {
  padding: 120px 0;
}

.chapter-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
}

.section-header {
  margin-bottom: 72px;
}

.section-header-mt {
  margin-top: 48px;
}

.section-h2 {
  font-size: clamp(36px, 4.5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1.1;
}

.section-sub {
  margin-top: 14px;
  font-size: 17px;
  color: var(--ink-3);
  line-height: 1.7;
}


/* ═══════════════════════════════════════════════
   NAV
═══════════════════════════════════════════════ */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

#nav.scrolled {
  background: rgba(255,255,255,0.88);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-links a {
  font-size: 14px;
  color: var(--ink-3);
  padding: 5px 12px;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--ink);
  background: var(--light);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.lang-btn:hover { border-color: var(--red); color: var(--red); }

.burger-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.burger-btn span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--ink-3);
  border-radius: 1px;
  transition: all 0.2s;
}

.nav-drawer {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 40px 20px;
  flex-direction: column;
  gap: 2px;
  z-index: 99;
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}

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

.nav-drawer a {
  font-size: 16px;
  color: var(--ink-3);
  padding: 10px 12px;
  border-radius: 8px;
  transition: all 0.15s;
}

.nav-drawer a:hover { color: var(--ink); background: var(--off); }


/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 999px;
  transition: background 0.15s, transform 0.15s;
}

.btn-primary:hover { background: var(--ink-2); transform: translateY(-1px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: all 0.15s;
}

.btn-ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
  transform: translateY(-1px);
}

.arrow { font-size: 14px; }


/* ═══════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════ */
#hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--nav-h);
  background: var(--white);
  position: relative;
}

.hero-wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 40px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 80px;
}

.hero-text { flex: 1; }

.hero-greeting {
  font-size: 18px;
  color: var(--ink-3);
  margin-bottom: 16px;
  font-weight: 400;
}

.hero-name {
  font-size: clamp(72px, 10vw, 120px);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.92;
  color: var(--ink);
  margin-bottom: 28px;
}

.dot { color: var(--red); }

.hero-role {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--ink-2);
  font-weight: 400;
  margin-bottom: 8px;
  line-height: 1.4;
}

.hero-sub {
  font-size: 15px;
  color: var(--ink-4);
  margin-bottom: 40px;
  font-family: var(--mono);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* photo */
.hero-photo { flex-shrink: 0; }

.photo-frame {
  position: relative;
  width: 300px;
  height: 300px;
}

.photo-frame::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--red) 0%, transparent 35%, transparent 65%, var(--red) 100%);
  opacity: 0.18;
  animation: spin 12s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.photo-frame img {
  position: relative;
  z-index: 1;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 3px solid var(--border);
  box-shadow: 0 24px 64px rgba(0,0,0,0.10);
}

/* scroll hint */
.scroll-indicator {
  display: none;
}

.scroll-track {
  width: 1px;
  height: 56px;
  background: var(--ink-5);
  border-radius: 1px;
  overflow: hidden;
}

.scroll-thumb {
  width: 1px;
  height: 20px;
  background: var(--ink-3);
  border-radius: 1px;
  animation: scrollDown 2s ease-in-out infinite;
}

@keyframes scrollDown {
  0%   { transform: translateY(-20px); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translateY(56px); opacity: 0; }
}


/* ═══════════════════════════════════════════════
   ABOUT (narrative)
═══════════════════════════════════════════════ */
#about {
  border-top: 1px solid var(--border);
}

.narrative-block {
  padding: 0 0 48px;
}

.narrative-block:last-child { padding-bottom: 0; }

.narrative-lead {
  font-size: clamp(26px, 3.5vw, 38px);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.narrative-body {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--ink-2);
  line-height: 1.75;
}

.narrative-body strong {
  color: var(--ink);
  font-weight: 600;
}

/* stats */
.stat-row {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 40px 0 0;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 48px 0 0;
}

.stat-item:first-child { padding-left: 0; }

.stat-n {
  font-size: clamp(40px, 5vw, 56px);
  font-weight: 800;
  color: var(--red);
  letter-spacing: -0.04em;
  line-height: 1;
  font-family: var(--mono);
}

.stat-l {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.4;
  max-width: 120px;
}

.stat-divider {
  width: 1px;
  height: 60px;
  background: var(--border);
  margin: 0 48px 0 0;
  flex-shrink: 0;
}


/* ═══════════════════════════════════════════════
   EXPERTISE
═══════════════════════════════════════════════ */
#expertise {
  border-top: 1px solid var(--border);
}

.expertise-list {
  display: flex;
  flex-direction: column;
}

.exp-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 32px;
  align-items: start;
  padding: 36px 0;
}

.exp-divider {
  height: 1px;
  background: var(--border);
}

.exp-row-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-4);
  padding-top: 4px;
}

.exp-row-content h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.exp-row-content p {
  font-size: 15px;
  color: var(--ink-3);
  line-height: 1.7;
  max-width: 520px;
}

.exp-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  padding-top: 4px;
  max-width: 200px;
}

.exp-row-tags span {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--subtle);
  color: var(--ink-3);
}


/* ═══════════════════════════════════════════════
   EXPERIENCE TIMELINE
═══════════════════════════════════════════════ */
#experience {
  border-top: 1px solid var(--border);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 1px solid var(--border);
  margin-left: 8px;
}

.tl-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  padding: 0 0 56px 48px;
  position: relative;
}

.tl-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--border);
  transition: border-color 0.2s;
}

.tl-item:hover::before,
.tl-featured::before {
  border-color: var(--red);
  background: #fff;
}

.tl-item:last-child { padding-bottom: 0; }

.tl-meta {
  padding-top: 3px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.tl-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-4);
  line-height: 1.4;
}

.tl-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  width: fit-content;
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

.tl-tag         { background: var(--subtle); color: var(--ink-3); }
.tl-tag.current { background: var(--red-s); color: var(--red); }
.tl-tag.research{ background: var(--red-s); color: var(--red); }

.tl-body h3 {
  font-size: 21px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1.3;
  margin-bottom: 4px;
}

.tl-company {
  font-size: 14px;
  color: var(--red);
  font-weight: 500;
  margin-bottom: 16px;
}

.tl-body ul {
  margin-bottom: 16px;
}

.tl-body ul li {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.7;
  padding-left: 16px;
  position: relative;
  margin-bottom: 6px;
}

.tl-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink-4);
}

.pub-ref {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--red);
  font-style: normal;
}

.tl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tl-chips span {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 5px;
  background: var(--off);
  color: var(--ink-3);
  border: 1px solid var(--border);
}

/* Education grid */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.edu-card {
  background: var(--off);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.edu-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.07);
  transform: translateY(-2px);
}

.edu-card-main {
  background: var(--white);
  border-color: var(--red-b);
}

.edu-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.edu-tag.current  { background: var(--red-s); color: var(--red); }
.edu-tag.done     { background: var(--red-s); color: var(--red); }
.edu-tag.exchange { background: var(--red-s); color: var(--red); }

.edu-card h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 6px;
}

.edu-school {
  font-size: 13px;
  color: var(--red);
  font-weight: 500;
  margin-bottom: 4px;
}

.edu-period {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  margin-bottom: 12px;
}

.edu-card p {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.65;
}

.edu-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.edu-highlights span {
  font-size: 12px;
  color: var(--ink-2);
  background: var(--light);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}


/* ═══════════════════════════════════════════════
   PUBLICATIONS
═══════════════════════════════════════════════ */
#publications {
  border-top: 1px solid var(--border);
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pub-item {
  display: block;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  cursor: pointer;
  border-radius: 0;
}



.pub-item:hover { background: var(--off); margin: 0 -24px; padding-left: 24px; padding-right: 24px; border-radius: 12px; border-color: transparent; }

.pub-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pub-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pub-venue {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 5px;
}

.pub-venue.ieee    { background: var(--red-s); color: var(--red); }
.pub-venue.springer{ background: var(--red-s); color: var(--red); }
.pub-venue.erad    { background: var(--red-s); color: var(--red); }
.pub-venue.carla   { background: var(--red-s); color: var(--red); }
.pub-venue.pdp     { background: var(--red-s); color: var(--red); }

.pub-year {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
}

.pub-award-badge {
  font-size: 11px;
  font-weight: 500;
  color: #b8860b;
  background: rgba(218,165,32,0.1);
  padding: 3px 9px;
  border-radius: 5px;
}

.pub-arrow {
  color: var(--ink-4);
  transition: color 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.pub-item:hover .pub-arrow {
  color: var(--red);
  transform: translate(2px, -2px);
}

.pub-item h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin-bottom: 8px;
  transition: color 0.15s;
}

.pub-item:hover h3 { color: var(--red); }

.pub-item p {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.65;
  margin-bottom: 12px;
  max-width: 720px;
}

.pub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.pub-chips span {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--subtle);
  color: var(--ink-3);
}

.pub-authors {
  font-size: 12px;
  color: var(--ink-4);
  font-style: italic;
}

.pub-meta-note {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
}


/* ═══════════════════════════════════════════════
   SKILLS
═══════════════════════════════════════════════ */
#skills {
  border-top: 1px solid var(--border);
}

.skills-table {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
}

.sk-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 28px;
  align-items: center;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  transition: background 0.15s;
}

.sk-row:last-child { border-bottom: none; }
.sk-row:hover { background: var(--off); }

.sk-cat {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

.sk-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sk-p {
  font-size: 13px;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--off);
  color: var(--ink-2);
  border: 1px solid var(--border);
  transition: all 0.15s;
}

.sk-p:hover { border-color: var(--ink); color: var(--ink); }



/* ═══════════════════════════════════════════════
   CONTACT
═══════════════════════════════════════════════ */
#contact {
  border-top: 1px solid var(--border);
}

.contact-wrap { }

.contact-h2 {
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 16px;
}

.contact-sub {
  font-size: 17px;
  color: var(--ink-3);
  line-height: 1.7;
  margin-bottom: 0;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--white);
  transition: all 0.2s;
  color: var(--ink);
}

.contact-link:hover {
  background: var(--off);
  border-color: var(--border-h);
  transform: translateX(4px);
}

.contact-link-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  font-family: var(--mono);
  width: 72px;
  flex-shrink: 0;
}

.contact-link-val {
  font-size: 15px;
  color: var(--ink-2);
  flex: 1;
}

.contact-link svg {
  color: var(--ink-4);
  transition: color 0.15s, transform 0.15s;
}

.contact-link:hover svg {
  color: var(--red);
  transform: translate(2px, -2px);
}


/* ═══════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════ */
footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 20px 0 16px;
}

.footer-main {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 12px;
  min-height: 40px;
}

.footer-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: absolute;
  left: 56px;
}

.footer-logo .pr-logo {
  color: var(--ink);
  transition: color 0.2s var(--ease);
}

.footer-logo:hover .pr-logo {
  color: var(--ink);
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-nav a {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-4);
  font-family: var(--mono);
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: 999px;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}

.footer-nav a:hover {
  color: var(--ink);
  background: var(--light);
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-h);
  color: var(--ink-4);
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.footer-social-link:hover {
  color: var(--ink);
  border-color: var(--ink-3);
  background: var(--light);
}

.footer-bottom {
  padding-top: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 13px;
  color: var(--ink-4);
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

.footer-bottom span {
  display: block;
  text-wrap: balance;
  line-height: 1.55;
}


/* ═══════════════════════════════════════════════
   SCROLL ANIMATIONS
═══════════════════════════════════════════════ */
.s-fade-up {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}

.s-fade-up.in {
  opacity: 1;
  transform: translateY(0);
}


/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 900px) {
  .hero-wrap { flex-direction: column-reverse; align-items: flex-start; gap: 40px; }
  .hero-name { font-size: 80px; }
  .photo-frame, .photo-frame img { width: 220px; height: 220px; }
  .photo-frame { align-self: center; }

  .exp-row { grid-template-columns: 40px 1fr; }
  .exp-row-tags { display: none; }

  .tl-item { grid-template-columns: 1fr; gap: 12px; padding-left: 32px; }
  .tl-meta { flex-direction: row; align-items: center; }

  .edu-grid { grid-template-columns: 1fr; }
  .stat-row { gap: 0; flex-wrap: wrap; }
  .stat-item { padding: 0 32px 24px 0; }
  .stat-divider { display: none; }
}

@media (max-width: 768px) {
  :root { --nav-h: 52px; }
  .container { padding: 0 24px; }
  section { padding: 40px 0; }

  .nav-links { display: none; }
  .burger-btn { display: flex; }

  .hero-name { font-size: 64px; }
  .hero-ctas { flex-direction: column; align-items: flex-start; }

  .two-col-about { grid-template-columns: 1fr; }

  .sk-row { grid-template-columns: 1fr; gap: 12px; }

  .footer-main {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
    text-align: left;
  }

  .footer-logo {
    position: static;
    justify-self: start;
  }

  .footer-nav { justify-content: center; }
  .footer-bottom { justify-content: center; }

  .pub-item:hover { background: #fff; border-color: rgba(185,28,28,0.28); box-shadow: 0 8px 24px rgba(185,28,28,0.1); transform: translateY(-3px); }
}

@media (max-width: 480px) {
  .hero-name { font-size: 52px; }
  .photo-frame, .photo-frame img { width: 180px; height: 180px; }
  .narrative-body { font-size: 17px; }
}


/* ═══════════════════════════════════════════════
   CLEAN STORY REDESIGN
═══════════════════════════════════════════════ */
:root {
  --white: #ffffff;
  --off: #fafafa;
  --light: #f4f4f5;
  --subtle: #eef0f4;
  --ink: #171717;
  --ink-2: #303036;
  --ink-3: #61616a;
  --ink-4: #92929d;
  --ink-5: #d8d8de;
  --red: #b91c1c;
  --red-s: rgba(185, 28, 28, 0.09);
  --red-b: rgba(185, 28, 28, 0.22);
  --rose: #e11d48;
  --mint: #14b8a6;
  --border: #e7e7ec;
  --border-h: #d2d2da;
  --nav-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html { font-size: 18px; }

body {
  background:
    radial-gradient(circle at top right, rgba(185,28,28,0.06), transparent 28rem),
    linear-gradient(180deg, #fff 0%, #fff 42rem, #fafafa 100%);
  color: var(--ink);
}

.container,
.nav-inner,
.hero-wrap {
  max-width: 1160px;
}

.container { padding: 0 44px; }
.container.narrow { max-width: 880px; }

section {
  padding: 32px 0;
  position: relative;
  overflow: clip;
}

.section-white,
.section-light,
.section-narrative {
  background: transparent;
}

.section-light {
  background: linear-gradient(180deg, rgba(250,250,250,0.96), rgba(255,255,255,0.96));
}

#about,
#expertise,
#experience,
#publications,
#skills,
#contact {
  border-top: 1px solid rgba(20,20,24,0.07);
}

#about {
  padding-top: 28px;
}

#about::before,
#expertise::before,
#experience::before,
#publications::before,
#skills::before,
#contact::before {
  content: none;
}

.chapter-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--red);
  font-size: 12px;
  letter-spacing: 0.16em;
  margin-bottom: 18px;
}

.chapter-label::before {
  content: "";
  width: 34px;
  height: 1px;
  background: currentColor;
  opacity: 0.38;
}

.section-header {
  margin-bottom: 42px;
}

.section-h2,
.contact-h2 {
  font-size: clamp(48px, 6.3vw, 82px);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.contact-h2 {
  white-space: nowrap;
}

.section-sub {
  max-width: 720px;
  font-size: 20px;
  line-height: 1.7;
}

/* Navigation */
#nav {
  height: var(--nav-h);
}

#nav.scrolled {
  background: rgba(255,255,255,0.82);
  box-shadow: 0 1px 0 rgba(23,23,23,0.08);
}

.nav-inner {
  width: 100%;
  padding: 0 44px;
}

.nav-right {
  flex-shrink: 0;
}

.nav-logo {
  display: flex;
  align-items: center;
}\n\n.pr-logo {\n  color: var(--ink);\n  transition: color 0.2s var(--ease), transform 0.2s var(--ease);\n}\n\n.nav-logo:hover .pr-logo {\n  color: var(--red);\n  transform: scale(1.06);\n}\n\n.nav-logo-text {\n  font-size: 17px;\n  letter-spacing: -0.03em;\n}

.nav-links {
  gap: 4px;
}

.nav-links a {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-3);
  font-family: var(--mono);
  letter-spacing: 0.03em;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.15s var(--ease);
}

.nav-links a:hover {
  color: var(--ink);
  background: var(--white);
  border-color: var(--border-h);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(23,23,23,0.07);
}

.nav-links a.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 76px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--border-h);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(23,23,23,0.05);
}

.lang-option {
  flex: 1;
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  padding: 7px 8px;
  border-radius: 999px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.lang-btn.is-pt .lang-pt,
.lang-btn.is-en .lang-en {
  color: #fff;
  background: var(--ink);
}

/* Buttons */
.btn-primary,
.btn-ghost,
.btn-hero {
  min-height: 48px;
  padding: 13px 24px;
  border-radius: 12px;
  font-size: 16px;
}

.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 10px 30px rgba(185,28,28,0.2);
}

.btn-primary:hover {
  background: #991b1b;
}

.btn-ghost {
  background: #fff;
  border-color: var(--border);
  color: var(--ink-2);
}

.btn-ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
  transform: translateY(-1px);
}

/* Hero buttons: white bg by default, indigo on hover */
.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 500;
  border: 1.5px solid var(--border-h);
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.15s var(--ease), box-shadow 0.18s var(--ease);
}

.btn-hero:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(185,28,28,0.22);
}

/* Hero */
#hero {
  min-height: auto;
  padding-top: calc(var(--nav-h) + 34px);
  padding-bottom: 20px;
  background: transparent;
  justify-content: flex-start;
}

.hero-wrap {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  text-align: center;
}

/* Intro block (greeting + name) */
.hero-intro {
  width: 100%;
  max-width: 980px;
  will-change: transform;
}

/* Bottom block (role + ctas) */
.hero-bottom {
  width: 100%;
  max-width: 760px;
}

/* Keep hero-text targeting for parallax JS */
.hero-text {
  flex: none;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  will-change: transform;
}

.hero-greeting {
  color: var(--ink-3);
  font-size: clamp(22px, 2.4vw, 30px);
  margin-bottom: 4px;
}

.hero-name {
  font-size: clamp(72px, 10vw, 128px);
  font-weight: 800;
  letter-spacing: -0.065em;
  line-height: 0.9;
  margin-bottom: 4px;
  white-space: nowrap;
}

.dot {
  color: var(--rose);
}

.hero-role {
  max-width: 780px;
  margin: 0 auto 20px;
  color: var(--ink-2);
  font-size: clamp(22px, 2.7vw, 34px);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-align: center;
}

.hero-sub {
  margin-bottom: 34px;
  color: var(--ink-3);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.hero-ctas {
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-photo {
  position: relative;
  flex-shrink: 0;
}

.photo-frame {
  width: min(76vw, 340px);
  height: min(80vw, 370px);
  will-change: transform;
}

.photo-frame::before {
  inset: auto;
  left: 50%;
  bottom: 18px;
  width: 292px;
  max-width: 86vw;
  height: 292px;
  border-radius: 34px;
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 58%, #e11d48 100%);
  opacity: 0.22;
  transform: translateX(-50%) rotate(-7deg);
  animation: none;
}

.photo-frame::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 40px;
  width: 248px;
  max-width: 72vw;
  height: 248px;
  border-radius: 32px;
  background: #f2f2f5;
  transform: translateX(-50%) rotate(5deg);
  z-index: 0;
}

/* photo hover */
.photo-frame img {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(72vw, 304px);
  height: min(76vw, 350px);
  transform: translateX(-50%);
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 28px 70px rgba(23,23,23,0.14);
  z-index: 1;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), filter 0.4s var(--ease);
  filter: brightness(1) saturate(1);
}

.photo-frame:hover img {
  transform: translateX(-50%) scale(1.04);
  box-shadow: 0 36px 90px rgba(185,28,28,0.22), 0 0 0 3px var(--red);
  filter: brightness(1.04) saturate(1.1);
}

.photo-frame::before {
  inset: auto;
  left: 50%;
  bottom: 18px;
  width: 292px;
  max-width: 86vw;
  height: 292px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 58%, #e11d48 100%);
  opacity: 0.22;
  transform: translateX(-50%);
  animation: none;
  transition: opacity 0.4s var(--ease);
}

.photo-frame:hover::before {
  opacity: 0.36;
}

.photo-frame::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 40px;
  width: 248px;
  max-width: 72vw;
  height: 248px;
  border-radius: 50%;
  background: #f2f2f5;
  transform: translateX(-50%);
  z-index: 0;
}

/* Hero social icons below photo */
.hero-social {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink-4);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}

.social-icon:hover {
  color: var(--red);
  border-color: var(--red);
  background: var(--red-s);
  transform: translateY(-2px);
}

.next-chapter {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(34px);
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}

.next-chapter:hover {
  color: var(--red);
  transform: translateX(38px);
}

/* Narrative */
.narrative-block {
  padding-bottom: 28px;
}

.narrative-lead {
  font-size: clamp(42px, 6vw, 70px);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 1;
}

.narrative-body {
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.45;
  letter-spacing: -0.025em;
  text-align: justify;
}

.stat-row {
  width: 100%;
  justify-content: space-between;
  gap: 18px;
  padding-top: 24px;
}

.stat-item {
  min-height: 156px;
  flex: 1;
  justify-content: center;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.86);
}

.stat-n {
  color: var(--red);
  font-size: clamp(48px, 6vw, 72px);
}

.stat-l {
  max-width: 180px;
  font-size: 15px;
}

.stat-divider {
  display: none;
}

/* Expertise 2xN card grid */
.expertise-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.exp-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
  position: relative;
  overflow: hidden;
}

.exp-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red), transparent);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.exp-card:hover {
  border-color: var(--red);
  border-left-color: var(--red);
  box-shadow: 0 16px 48px rgba(185,28,28,0.1);
  transform: translateY(-4px);
  background: linear-gradient(135deg, rgba(185,28,28,0.025), #fff);
}

.exp-card:hover::after { opacity: 1; }

.exp-card-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--red);
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
}

.exp-card h3 {
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.035em;
  margin-bottom: 10px;
  line-height: 1.1;
}

.exp-card p {
  font-size: 15px;
  color: var(--ink-3);
  line-height: 1.68;
  margin-bottom: 16px;
}

.exp-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.exp-card-tags span {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--light);
  border: 1px solid var(--border);
  color: var(--ink-3);
}

.exp-row-num {
  font-size: 13px;
  color: var(--red);
}

.exp-row-content h3 {
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 720;
  letter-spacing: -0.045em;
  line-height: 1.05;
  margin-bottom: 12px;
}

.exp-row-content p {
  max-width: 690px;
  font-size: 18px;
  line-height: 1.65;
}

.exp-row-tags {
  max-width: 260px;
  gap: 8px;
}

.exp-row-tags span,
.tl-chips span,
.pub-chips span {
  border-radius: 999px;
  font-size: 12px;
  padding: 5px 10px;
  background: var(--light);
}

/* Timeline period bar */
.tl-period-bar {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--off);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.tl-period-from,
.tl-period-to {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 600;
}

.tl-period-track {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: 2px 0;
}

.tl-period-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red), var(--rose));
  width: calc(var(--dur, 6) * 8%);
  max-width: 100%;
  transition: width 0.8s var(--ease);
}

.tl-period-ongoing {
  background: linear-gradient(90deg, var(--red), var(--red));
  animation: pulse-bar 2s ease-in-out infinite;
}

@keyframes pulse-bar {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.tl-period-dur {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
}

/* Timeline and cards */
.story-timeline {
  --timeline-progress: 0%;
  position: relative;
}

/* Timeline vertical bar: thicker, solid indigo */
.story-timeline::before,
.story-timeline .timeline-progress {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 8px;
  left: -10px;
  width: 3px;
  border-radius: 999px;
  z-index: 0;
}

.story-timeline::before {
  background: var(--border);
}

.story-timeline .timeline-progress {
  bottom: auto;
  height: var(--timeline-progress);
  background: var(--red);
  box-shadow: none;
  transition: height 0.08s linear;
}

.timeline {
  border-left: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 860px;
  margin-left: 200px;
}

.tl-item {
  display: block;
  position: relative;
  margin-left: 54px;
  margin-bottom: 0;
  border-radius: 18px;
  padding: 32px 28px;
  background: #fff;
  border: 1.5px solid var(--border-h);
  transition: box-shadow 0.22s var(--ease), transform 0.22s var(--ease), border-color 0.22s var(--ease);
  z-index: 1;
}

.tl-item:last-child {
  margin-bottom: 0;
  padding-bottom: 32px;
}

.tl-item::before {
  top: 38%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  left: -70px;
  background: #fff;
  border: 2.5px solid var(--border-h);
  z-index: 2;
}

.tl-item:hover {
  box-shadow: 0 12px 40px rgba(23,23,23,0.09);
  transform: translateY(-3px);
  border-color: var(--red);
}

.tl-meta {
  position: absolute;
  left: -244px;
  width: 160px;
  top: 38%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
  text-align: right;
  pointer-events: none;
  z-index: 1;
}

/* duration label under date */
.tl-duration {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.01em;
  margin-top: 0;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
}

.tl-date {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
  line-height: 1.25;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
}

.tl-tag,
.edu-tag {
  font-size: 12px;
  padding: 5px 12px;
}

.tl-body h3 {
  font-size: clamp(26px, 2.7vw, 36px);
  font-weight: 720;
  letter-spacing: -0.04em;
}

.tl-company,
.edu-school {
  color: var(--red);
  font-size: 16px;
}

.tl-body ul li {
  font-size: 17px;
  line-height: 1.68;
}

.edu-timeline {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 860px;
  margin-left: 200px;
}

.edu-bar-label {
  position: absolute;
  top: -36px;
  left: -10px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--ink-2);
  text-align: center;
  line-height: 1.3;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

/* Education: all cards same visible border and circle */
.edu-card {
  position: relative;
  margin-left: 54px;
  border-radius: 18px;
  padding: 32px 28px;
  background: #fff;
  border: 1.5px solid var(--border-h);
  transition: box-shadow 0.22s var(--ease), transform 0.22s var(--ease), border-color 0.22s var(--ease);
  z-index: 1;
}

.edu-card:hover {
  box-shadow: 0 12px 40px rgba(23,23,23,0.09);
  transform: translateY(-3px);
  border-color: var(--red);
}

.edu-year-label {
  position: absolute;
  left: -168px;
  width: 84px;
  top: 38%;
  transform: translateY(-50%);
  text-align: right;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--mono);
  color: var(--ink-2);
  letter-spacing: 0.02em;
  line-height: 1.4;
  pointer-events: none;
  z-index: 1;
  text-transform: uppercase;
}

.edu-card::before {
  content: "";
  position: absolute;
  top: 38%;
  transform: translateY(-50%);
  left: -70px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--border-h);
  z-index: 2;
}

.edu-card:hover::before {
  border-color: var(--red);
  background: #fff;
}

.edu-card-main::before {
  border-color: var(--red);
  background: #fff;
}

.edu-card-main {
  border-color: var(--red-b);
  box-shadow: 0 18px 54px rgba(185,28,28,0.08);
  position: relative;
  overflow: visible;
}

/* BSc hover-expand area: laurea panel opens below the main card */
.edu-bsc-hover-area {
  margin-left: 54px;
  display: block;
}

.edu-bsc-hover-area .edu-card {
  margin-left: 0;
}

/* Mini badge in card top-right corner */
.laurea-mini-badge {
  position: absolute;
  top: 6px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(218,165,32,0.35);
  background: rgba(218,165,32,0.08);
  color: #b8860b;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  transition: background 0.18s var(--ease);
}

.edu-bsc-hover-area:hover .laurea-mini-badge {
  background: rgba(218,165,32,0.18);
}

.edu-bsc-desc {
  margin-top: 12px;
}

/* Expand panel (below the degree card) */
.laurea-expand-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  border-radius: 18px;
  transition: max-height 0.55s var(--ease), opacity 0.3s var(--ease);
}

.edu-bsc-hover-area:hover .laurea-expand-panel {
  max-height: 720px;
  opacity: 1;
}

.lep-inner {
  padding: 28px 24px;
  margin-top: 16px;
  background: #fff;
  border-radius: 18px;
  border: 1.5px solid rgba(218,165,32,0.30);
  box-shadow: 0 18px 54px rgba(218,165,32,0.10);
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 28px;
  align-items: stretch;
  width: 100%;
  min-height: 320px;
}

.lep-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 260px;
}

.lep-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
}

.lep-pdf {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border-radius: 10px;
  width: 100%;
  display: block;
  background: #fff;
  border: 1px solid rgba(218,165,32,0.22);
}

.lep-star {
  color: #b8860b;
  margin-bottom: 10px;
  line-height: 1;
}

.lep-inner h4 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  line-height: 1.25;
}

.lep-gpa-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.lep-label {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.lep-gpa {
  font-size: clamp(24px, 3.2vw, 32px);
  font-weight: 800;
  color: #b8860b;
  letter-spacing: -0.04em;
  font-family: var(--mono);
  line-height: 1;
}

.lep-left > p {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.6;
  margin-bottom: 16px;
}

.lep-pdf img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #fff;
}

.laurea-pdf-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--mono);
  color: var(--red);
  border: 1px solid var(--red-b);
  padding: 5px 12px;
  border-radius: 999px;
  transition: background 0.15s;
}

.laurea-pdf-link:hover {
  background: var(--red-s);
}

/* Contact section icons + WPP button */
.contact-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.ci-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 80px;
  padding: 18px 12px;
  border-radius: 16px;
  border: 1.5px solid var(--border-h);
  background: #fff;
  color: var(--ink-3);
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: center;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}

.ci-link:hover {
  color: var(--ink);
  border-color: var(--red-b);
  box-shadow: 0 8px 24px rgba(185,28,28,0.10);
  transform: translateY(-3px);
}

.wpp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  background: #25D366;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--sans);
  letter-spacing: -0.01em;
  transition: background 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
  box-shadow: 0 8px 28px rgba(37,211,102,0.30);
  max-width: 280px;
  margin: 0 auto;
  text-align: center;
}

.wpp-btn:hover {
  background: #1dbb59;
  box-shadow: 0 12px 36px rgba(37,211,102,0.40);
  transform: translateY(-2px);
}

.edu-card h3 {
  font-size: 22px;
  line-height: 1.15;
}

.edu-card p {
  font-size: 16px;
}

/* Publications */
.pub-item {
  position: relative;
  padding: 24px;
  border-radius: 18px;
  border: 1.5px solid var(--border);
  margin-bottom: 8px;
  transition:
    background 0.22s var(--ease),
    border-color 0.22s var(--ease),
    box-shadow 0.22s var(--ease),
    transform 0.22s var(--ease);
}

.pub-best {
  padding-top: 56px;
}

.pub-item:hover {
  background: #fff;
  border-color: rgba(185,28,28,0.28);
  box-shadow: 0 16px 48px rgba(185,28,28,0.13);
  transform: translateY(-5px);
}

.pub-item h3 {
  max-width: 900px;
  font-size: clamp(23px, 2.45vw, 32px);
  font-weight: 720;
  letter-spacing: -0.04em;
}

.pub-item p {
  max-width: 820px;
  font-size: 17px;
  line-height: 1.62;
}

.pub-item:hover h3 {
  color: var(--red);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.pub-item:hover .pub-arrow {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.pub-arrow {
  width: 34px;
  height: 34px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 50%;
  transition:
    color 0.2s var(--ease),
    background 0.2s var(--ease),
    border-color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.best-paper-ribbon {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #e11d48);
  border-radius: 999px 999px 999px 6px;
  box-shadow: 0 12px 28px rgba(225,29,72,0.22);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.pub-best:hover .best-paper-ribbon {
  transform: translateY(-2px);
}

.pub-venue,
.pub-year,
.pub-award-badge {
  font-size: 12px;
}

/* Skills 2xN grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.sk-group {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 28px;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}

.sk-group:hover {
  border-color: var(--border-h);
  box-shadow: 0 8px 28px rgba(23,23,23,0.06);
  transform: translateY(-2px);
}

.sk-cat {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
}

.sk-p {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--off);
  color: var(--ink-2);
  border: 1.5px solid var(--border-h);
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.15s var(--ease);
  cursor: default;
}

.sk-p:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  transform: translateY(-2px);
}

/* accent & nvidia use same base, just slightly bolder */
.sk-p.accent {
  font-weight: 600;
}

.sk-p.nvidia {
  font-weight: 500;
}

.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.contact-col-text {
  min-width: 0;
}

.contact-col-actions {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.contact-link {
  padding: 24px 28px;
  border-radius: 16px;
}

.contact-link-label {
  width: 92px;
  font-size: 14px;
}

.contact-link-val {
  font-size: 18px;
}

/* Scroll story motion */
.s-fade-up {
  opacity: 0;
  transform: translateY(58px) scale(0.985);
  filter: blur(10px);
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease),
    filter 0.9s var(--ease);
}

.s-fade-up.in {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

section.in-view .chapter-label {
  color: var(--rose);
}

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

  .s-fade-up {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@media (max-width: 900px) {
  html { font-size: 17px; }
  section { padding: 36px 0; }

  .story-timeline::before,
  .story-timeline .timeline-progress {
    left: -2px;
  }

  #about::before,
  #expertise::before,
  #experience::before,
  #publications::before,
  #skills::before,
  #contact::before {
    content: none;
  }

  .container,
  .nav-inner,
  .hero-wrap {
    padding-left: 26px;
    padding-right: 26px;
  }

  .hero-wrap {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .hero-name {
    font-size: clamp(68px, 16vw, 112px);
  }

  .expertise-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .exp-row {
    grid-template-columns: 44px 1fr;
  }

  .tl-item {
    margin-left: 18px;
    padding: 28px 22px;
    width: auto;
    min-width: 0;
  }

  .tl-item:last-child {
    padding-bottom: 28px;
  }

  .timeline {
    margin-left: 104px;
    max-width: none;
    width: auto;
    min-width: 0;
  }

  .tl-meta {
    position: absolute;
    left: -100px;
    width: 68px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-end;
    text-align: right;
    pointer-events: none;
    z-index: 1;
  }

  .tl-date {
    font-size: clamp(9px, 2.4vw, 12px);
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    text-align: right;
    text-transform: uppercase;
    color: var(--ink-3);
  }

  .tl-duration {
    font-size: clamp(9px, 2.4vw, 12px);
    font-weight: 700;
    color: var(--ink-3);
    white-space: nowrap;
    text-align: right;
    line-height: 1.3;
    margin-top: 1px;
  }

  .tl-item::before {
    left: -26px;
    top: 50%;
    transform: translateY(-50%);
  }

  .tl-body h3,
  .edu-card h3 {
    font-size: clamp(20px, 6vw, 28px);
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .tl-company,
  .edu-school,
  .edu-period,
  .tl-body p,
  .edu-card p,
  .tl-body li {
    overflow-wrap: anywhere;
  }

  .tl-chips {
    max-width: 100%;
  }

  .tl-chips span,
  .edu-tag,
  .laurea-mini-badge {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
    max-width: 100%;
  }

  .edu-timeline {
    margin-left: 104px;
    max-width: none;
    width: auto;
    min-width: 0;
  }

  .edu-year-label {
    display: block;
    position: absolute;
    left: -100px;
    width: 68px;
    top: 50%;
    transform: translateY(-50%);
    text-align: right;
    font-size: clamp(7px, 2.2vw, 10px);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--ink-3);
  }

  .edu-card {
    margin-left: 18px;
    width: auto;
    min-width: 0;
  }

  .edu-card::before {
    left: -26px;
    top: 50%;
    transform: translateY(-50%);
  }

  .edu-bsc-hover-area {
    margin-left: 18px;
    width: auto;
    min-width: 0;
  }

  .edu-bsc-hover-area .edu-card {
    width: 100%;
  }

  .laurea-mini-badge {
    position: static;
    margin: 0 0 14px auto;
    max-width: 100%;
  }

  .laurea-expand-panel {
    display: block;
    max-height: none;
    opacity: 1;
    overflow: visible;
  }

  .lep-inner {
    grid-template-columns: 1fr;
    gap: 22px;
    min-height: 0;
    padding: 24px 20px;
  }

  .lep-left {
    align-items: center;
    max-width: none;
    text-align: center;
  }

  .lep-gpa-row {
    justify-content: center;
  }

  .lep-pdf {
    height: auto;
  }

  .lep-pdf img {
    height: auto;
  }

  .lep-gpa {
    font-size: clamp(20px, 5.5vw, 28px);
  }

  .lep-inner h4 {
    font-size: clamp(12px, 3.2vw, 14px);
  }

  .lep-left > p {
    font-size: clamp(10px, 2.8vw, 12px);
  }

  .lep-label {
    font-size: clamp(9px, 2.4vw, 10px);
  }

  .laurea-pdf-link {
    font-size: clamp(10px, 2.6vw, 12px);
  }

  .edu-bsc-desc {
    max-height: none !important;
    opacity: 1 !important;
    margin-top: 12px !important;
  }

  .stat-row {
    flex-direction: column;
  }

  .stat-item {
    width: 100%;
  }

  .photo-frame {
    width: min(72vw, 280px);
    height: min(80vw, 320px);
  }

  .photo-frame img {
    width: min(68vw, 264px);
    height: min(76vw, 304px);
  }

  .photo-frame::before,
  .photo-frame::after {
    width: min(64vw, 248px);
    height: min(64vw, 248px);
  }
}

@media (max-width: 768px) {
  :root { --nav-h: 60px; }
  .container { padding: 0 24px; }
  section { padding: 30px 0; }

  .nav-inner {
    padding: 0 24px;
  }

  .nav-links {
    display: none;
  }

  .burger-btn {
    display: flex;
  }

  .nav-right {
    position: static;
    transform: none;
    gap: 8px;
  }

  .lang-btn {
    min-width: 68px;
    padding: 3px;
  }

  .lang-option {
    font-size: 10px;
    padding: 6px 7px;
  }

  .nav-drawer {
    padding: 12px 24px 22px;
  }

  .burger-btn.open span:first-child {
    transform: translateY(3px) rotate(45deg);
  }

  .burger-btn.open span:last-child {
    transform: translateY(-3px) rotate(-45deg);
  }

  .hero-ctas {
    align-items: stretch;
    width: 100%;
    max-width: min(260px, 90vw);
    margin: 0 auto;
  }

  .hero-ctas a {
    justify-content: center;
  }

  .hero-name {
    font-size: clamp(44px, 13vw, 82px);
    white-space: nowrap;
    letter-spacing: -0.07em;
  }

  .section-h2,
  .contact-h2 {
    font-size: clamp(40px, 13vw, 62px);
  }

  .narrative-lead {
    font-size: clamp(38px, 11vw, 56px);
  }

  .narrative-body {
    font-size: 22px;
  }

  .hero-role {
    max-width: min(260px, 90vw);
    font-size: clamp(16px, 5vw, 19px);
    line-height: 1.18;
  }

  .hero-sub {
    max-width: min(230px, 90vw);
    margin-left: auto;
    margin-right: auto;
    font-size: clamp(12px, 3.5vw, 14px);
  }

  .contact-wrap {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .contact-col-actions {
    align-items: center;
  }

  .contact-sub {
    margin-bottom: 0;
  }

  .sk-row {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .contact-link {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .contact-link-label {
    width: auto;
  }

  .contact-link-val {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .best-paper-ribbon {
    top: 14px;
    right: 14px;
    font-size: 11px;
  }

  .tl-item {
    padding: 24px 18px;
  }

  .edu-card {
    padding: 26px 18px;
  }

  .tl-body h3,
  .edu-card h3 {
    font-size: clamp(18px, 4.6vw, 23px);
    letter-spacing: -0.03em;
  }

  .tl-company,
  .edu-school,
  .edu-period,
  .tl-body ul li,
  .edu-card p {
    font-size: 14px;
  }

  .tl-chips {
    max-width: 100%;
  }

  .footer-main {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    text-align: left;
  }

  .footer-logo {
    position: static;
    justify-self: start;
  }

  .footer-nav {
    justify-content: center;
    gap: 2px 4px;
  }

  .footer-nav a {
    font-size: 12px;
    padding: 4px 7px;
  }

  .footer-bottom span {
    max-width: 28ch;
  }

  .narrative-body {
    font-size: clamp(17px, 5vw, 22px);
  }

  .stat-n {
    font-size: clamp(36px, 10vw, 56px);
  }

  .wpp-btn {
    max-width: 100%;
    font-size: 14px;
    padding: 12px 20px;
  }

  .ci-link {
    width: 70px;
    font-size: 10px;
    padding: 14px 8px;
  }
}

@media (max-width: 480px) {
  html { font-size: 16px; }

  .story-timeline::before,
  .story-timeline .timeline-progress {
    left: -1px;
  }

  #hero {
    padding-top: calc(var(--nav-h) + 30px);
  }

  .hero-name {
    font-size: clamp(44px, 13vw, 82px);
    white-space: nowrap;
    letter-spacing: -0.07em;
  }

  .hero-role {
    max-width: min(305px, 90vw);
    font-size: clamp(16px, 5vw, 19px);
    line-height: 1.18;
  }

  .hero-sub {
    max-width: min(250px, 90vw);
    margin-left: auto;
    margin-right: auto;
    font-size: clamp(12px, 3.5vw, 14px);
    line-height: 1.55;
  }

  .hero-ctas {
    max-width: min(300px, 90vw);
  }

  .photo-frame {
    width: min(68vw, 240px);
    height: min(76vw, 290px);
  }

  .photo-frame img {
    width: min(64vw, 224px);
    height: min(72vw, 272px);
  }

  .photo-frame::before,
  .photo-frame::after {
    width: min(60vw, 210px);
    height: min(60vw, 210px);
  }

  .lep-gpa {
    font-size: clamp(18px, 5vw, 24px);
  }

  .timeline,
  .edu-timeline {
    margin-left: 96px;
  }

  .tl-item,
  .edu-card,
  .edu-bsc-hover-area {
    margin-left: 14px;
  }

  .tl-meta {
    left: -104px;
    width: 68px;
    top: 50%;
    transform: translateY(-50%);
  }

  .edu-year-label {
    left: -104px;
    width: 68px;
    top: 50%;
    transform: translateY(-50%);
  }

  .tl-item::before,
  .edu-card::before {
    left: -21px;
    top: 50%;
    transform: translateY(-50%);
  }

  .tl-item {
    padding: 24px 18px;
  }

  .edu-card {
    padding: 26px 18px;
  }

  .tl-body h3,
  .edu-card h3 {
    font-size: clamp(18px, 5vw, 22px);
    letter-spacing: -0.03em;
  }

  .tl-company,
  .edu-school,
  .edu-period,
  .tl-body ul li,
  .edu-card p {
    font-size: 14px;
  }

  .lep-inner {
    padding: 22px 14px;
  }

  .tl-chips {
    max-width: 100%;
  }

  .footer-main {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
  }

  .footer-logo .pr-logo {
    width: 34px;
    height: auto;
  }

  .footer-nav a {
    font-size: 11px;
    padding: 4px 5px;
  }

  .footer-bottom span {
    max-width: 28ch;
  }
}
