:root {
  --bg: #f6f5f2;
  --ink: #202124;
  --muted: #68645f;
  --line: #e3dfd8;
  --teal: #5d6764;
  --teal-dark: #2f3432;
  --amber: #9b8a6f;
  --white: #ffffff;
  --shadow: 0 18px 48px rgba(32, 33, 36, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
}

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(155, 138, 111, 0.16), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(32, 33, 36, 0.08), transparent 28%),
    var(--bg);
  transition: opacity 420ms ease;
}

body.page-leaving {
  opacity: 0;
}

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

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--amber), var(--ink));
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 14px clamp(14px, 3vw, 34px) 0;
  padding: 14px clamp(16px, 3.5vw, 38px);
  border: 1px solid rgba(227, 223, 216, 0.78);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 42px rgba(32, 33, 36, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  color: var(--white);
  background: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 10px 24px rgba(32, 33, 36, 0.18);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.4vw, 18px);
}

.site-nav a {
  position: relative;
  padding: 0;
  border-radius: 0;
  color: var(--muted);
  font-weight: 700;
  transition: color 180ms ease;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}

.site-nav a:hover::after,
.site-nav a.is-current::after {
  transform: scaleX(1);
}

.site-nav a.is-current {
  color: var(--ink);
}

.language-toggle {
  min-width: 44px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.language-toggle:hover {
  transform: translateY(-2px);
  border-color: rgba(155, 138, 111, 0.48);
  background: var(--white);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--ink);
}

.hero {
  position: relative;
  min-height: calc(100vh - 82px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  gap: clamp(22px, 4vw, 34px);
  padding: clamp(44px, 7vw, 92px) clamp(20px, 5vw, 72px);
  overflow: hidden;
  text-align: center;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(246, 245, 242, 0.98) 0%, rgba(246, 245, 242, 0.9) 46%, rgba(246, 245, 242, 0.44) 100%),
    linear-gradient(180deg, transparent 0%, rgba(246, 245, 242, 0.82) 100%);
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-content {
  max-width: 900px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 22px;
  max-width: 780px;
  font-size: clamp(2.8rem, 8vw, 6.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero h1 {
  font-family: "Outfit", "Inter", Arial, sans-serif;
  margin-left: auto;
  margin-right: auto;
  max-width: 960px;
  font-size: clamp(2.45rem, 7vw, 5.6rem);
  font-style: italic;
  font-weight: 700;
  line-height: 1.02;
}

h1 span {
  color: var(--ink);
}

.hero-text {
  margin-left: auto;
  margin-right: auto;
  max-width: 620px;
  color: #394756;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.7;
}

.hero-actions {
  justify-content: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(32, 33, 36, 0.16);
}

.button.primary {
  color: var(--white);
  background: var(--ink);
}

.button.secondary {
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
}

.hero-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 980px);
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transition: transform 240ms ease, box-shadow 240ms ease;
}

.hero-panel:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 64px rgba(32, 33, 36, 0.16);
}

.hero-panel div {
  position: relative;
  padding: 16px;
  border-left: 4px solid var(--amber);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  overflow: hidden;
}

.hero-panel div::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(155, 138, 111, 0.12), transparent);
  transform: translateX(-110%);
  transition: transform 520ms ease;
}

.hero-panel div:hover::after {
  transform: translateX(110%);
}

.hero-panel strong,
.hero-panel span {
  display: block;
}

.hero-panel strong {
  margin-bottom: 5px;
}

.hero-panel span {
  color: var(--muted);
}

.section {
  padding: clamp(58px, 8vw, 100px) clamp(20px, 5vw, 72px);
}

.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: clamp(24px, 4vw, 42px) clamp(20px, 5vw, 72px) 0;
  padding: clamp(44px, 7vw, 78px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(240, 237, 231, 0.86) 100%);
  box-shadow: 0 18px 54px rgba(32, 33, 36, 0.08);
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--page-bg);
  background-position: center;
  background-size: cover;
  opacity: 0.78;
  filter: contrast(1.08) saturate(1.04);
  transform: scale(1.02);
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.62) 42%, rgba(255, 255, 255, 0.26) 100%),
    radial-gradient(circle at 18% 40%, rgba(246, 245, 242, 0.52), transparent 32%);
}

.page-about,
.page-journey {
  --page-bg: url("assets/bg-academic-journey.png");
}

.page-about .page-hero::before,
.page-journey .page-hero::before {
  background-position: center right;
}

.page-skills,
.page-projects {
  --page-bg: url("assets/bg-code-projects.png");
}

.page-skills .page-hero::before,
.page-projects .page-hero::before {
  background-position: center;
}

.page-certificates {
  --page-bg: url("assets/bg-certificates.png");
}

.page-certificates .page-hero::before {
  background-position: center right;
}

.page-contact {
  --page-bg: url("assets/bg-contact.png");
}

.page-contact .page-hero::before {
  background-position: center;
}

.page-hero-inner {
  display: flex;
  align-items: center;
  gap: clamp(22px, 4vw, 48px);
  max-width: 1040px;
  position: relative;
}

.page-icon {
  display: grid;
  width: clamp(92px, 12vw, 138px);
  height: clamp(92px, 12vw, 138px);
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--amber);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.54);
  animation: iconFloat 4.8s ease-in-out infinite;
}

.page-icon svg {
  width: 42%;
  height: 42%;
  fill: none;
  stroke: var(--amber);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-hero h1 {
  margin-bottom: 0;
  font-size: clamp(2.6rem, 6vw, 5.6rem);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 30px;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
}

.about {
  background: var(--white);
}

.about-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}

.profile-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfaf7;
}

.avatar {
  display: grid;
  width: 112px;
  height: 112px;
  margin-bottom: 20px;
  place-items: center;
  border-radius: 18px;
  color: var(--white);
  background: var(--ink);
  font-size: 2.2rem;
  font-weight: 800;
}

.profile-card p,
.about-copy p,
.skill-grid p,
.timeline p {
  color: var(--muted);
  line-height: 1.75;
}

.about-copy {
  max-width: 820px;
  font-size: 1.08rem;
}

.skills {
  background: #f0ede7;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.skill-grid article,
.info-grid article {
  position: relative;
  min-height: 230px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  overflow: hidden;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.skill-grid article::before,
.info-grid article::before,
.profile-card::before,
.timeline article::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 20%), rgba(155, 138, 111, 0.16), transparent 34%);
  opacity: 0;
  transition: opacity 220ms ease;
  pointer-events: none;
}

.skill-grid article:hover,
.info-grid article:hover,
.profile-card:hover {
  border-color: rgba(155, 138, 111, 0.42);
  box-shadow: 0 18px 44px rgba(32, 33, 36, 0.1);
  transform: translateY(-6px);
}

.skill-grid article:hover::before,
.info-grid article:hover::before,
.profile-card:hover::before,
.timeline article:hover::before {
  opacity: 1;
}

.skill-grid span,
.info-grid span {
  color: var(--amber);
  font-weight: 800;
}

.certificates {
  background: var(--white);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.text-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--teal-dark);
  font-weight: 800;
  transition: color 180ms ease, transform 180ms ease;
}

.text-link:hover {
  color: var(--teal);
  transform: translateX(4px);
}

.projects {
  background: var(--white);
}

.journey {
  background: var(--white);
}

.timeline {
  display: grid;
  gap: 18px;
  max-width: 920px;
}

.timeline article {
  position: relative;
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 22px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  transition: padding-left 220ms ease, border-color 220ms ease;
}

.timeline article:hover {
  padding-left: 10px;
  border-color: rgba(155, 138, 111, 0.52);
}

.timeline time {
  color: var(--teal);
  font-weight: 800;
}

.contact {
  color: var(--white);
  background: #202124;
}

.contact .eyebrow {
  color: #d5cec2;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  gap: clamp(20px, 4vw, 44px);
  align-items: start;
}

.contact-form {
  display: grid;
  gap: 16px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.18);
}

.contact-form label {
  display: block;
  margin-bottom: 8px;
  color: #d5cec2;
  font-weight: 800;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  outline: none;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.46);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: rgba(213, 206, 194, 0.76);
  background: rgba(255, 255, 255, 0.11);
  box-shadow: 0 0 0 4px rgba(213, 206, 194, 0.1);
}

.contact-grid a {
  display: flex;
  align-items: center;
  min-height: 74px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 800;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.contact-grid a:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.1);
}

footer {
  padding: 24px clamp(20px, 5vw, 72px);
  color: #b9c4cf;
  background: #171819;
}

footer p {
  margin: 0;
}

.reveal-target {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 620ms ease, transform 620ms ease;
}

.reveal-target.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes iconFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@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;
  }

  body {
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .hero,
  .about-grid,
  .skill-grid,
  .info-grid,
  .contact-layout,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-panel {
    grid-template-columns: 1fr;
    max-width: 560px;
  }

  .skill-grid article {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 82px;
    left: 0;
    right: 56px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
  }

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

  .site-nav a {
    padding: 10px 4px;
  }

  .language-toggle {
    position: absolute;
    top: 86px;
    right: 10px;
  }

  .page-hero-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-media::after {
    background: rgba(247, 249, 251, 0.9);
  }

  .timeline article {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
