:root {
  --bg: #fdfcfb;
  --bg-alt: #f5f5f4;
  --text: #1c1917;
  --text-muted: #78716c;
  --accent: #dc2626;
  --border: #e7e5e4;
  --font: "Manrope", sans-serif;
  --radius: 4px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-family: var(--font);
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  color: var(--text);
  line-height: 1.6;
  background: var(--bg);
  overflow-x: hidden;
  touch-action: manipulation;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

::selection {
  background: var(--accent);
  color: white;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.5rem 1rem;
  background: var(--text);
  color: var(--bg);
  font-size: 0.85rem;
  font-weight: 700;
  z-index: 100;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.entry {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 2rem;
  text-align: center;
}

.signature-svg {
  width: min(680px, 85vw);
  height: auto;
  shape-rendering: geometricPrecision;
}

.animated-path {
  opacity: 0;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
  animation-timing-function: cubic-bezier(0.5, 1, 0.4, 1);
}

#path4 {
  animation-name: grow-path4;
  animation-duration: 3s;
  animation-delay: 0.5s;
}

#path5 {
  animation-name: grow-path5;
  animation-duration: 3.2s;
  animation-delay: 0.5s;
}

#path6 {
  animation-name: grow-path6;
  animation-duration: 1.5s;
  animation-delay: 1.7s;
}

@keyframes grow-path4 {
  0% {
    opacity: 1;
    stroke-dasharray: 0 45;
  }
  100% {
    opacity: 1;
    stroke-dasharray: 45 0;
  }
}

@keyframes grow-path5 {
  0% {
    opacity: 1;
    stroke-dasharray: 0 45;
  }
  100% {
    opacity: 1;
    stroke-dasharray: 45 0;
  }
}

@keyframes grow-path6 {
  0% {
    opacity: 1;
    stroke-dasharray: 0 12;
  }
  100% {
    opacity: 1;
    stroke-dasharray: 12 0;
  }
}

.entry::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("img/edited_inev_00086710.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.15;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(
    to bottom,
    black 0%,
    black 45%,
    transparent 75%
  );
  mask-image: linear-gradient(to bottom, black 0%, black 45%, transparent 75%);
}

.subtitle {
  margin-top: 1.5rem;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0;
  animation: fade-in 1.75s 2.75s forwards;
}

@keyframes fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.hero-socials {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0;
  animation: fade-in 1.5s 3s forwards;
  flex-wrap: wrap;
}

.hero-socials a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}

.hero-socials a:hover {
  color: var(--accent);
}

.dot {
  color: var(--text-muted);
  opacity: 0.5;
}

.section {
  padding: 6rem 2rem;
}

#bio {
  padding-top: 0rem;
}

.section--alt {
  background: var(--bg-alt);
}

.section-inner {
  max-width: 1040px;
  margin: 0 auto;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 2.5rem;
  position: relative;
  padding-bottom: 0.25em;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

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

.bio-content {
  max-width: 100%;
}

.bio-text {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.bio-text a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  transition: border-color var(--transition);
}

.bio-text a:hover {
  border-bottom-color: var(--accent);
}

.bio-text strong {
  font-weight: 700;
}

.bio-text em {
  font-style: italic;
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.split-heading {
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.split-item {
  margin-bottom: 2rem;
}

.split-item:last-child {
  margin-bottom: 0;
}

.split-date {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.split-item h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.split-item p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.project-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1rem;
}

.project-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.project-links {
  display: flex;
  gap: 1.25rem;
}

.project-links a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}

.project-links a:hover {
  color: var(--accent);
}

.beyond-row {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}

.beyond-row:last-child {
  border-bottom: none;
}

.beyond-icon {
  flex-shrink: 0;
  margin-top: 0.15rem;
  color: var(--text-muted);
}

.beyond-body {
  flex: 1;
}

.beyond-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.beyond-body p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.beyond-body ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.beyond-body li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.beyond-body li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.beyond-body a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  transition: border-color var(--transition);
}

.beyond-body a:hover {
  border-bottom-color: var(--accent);
}

.contact-text {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  color: var(--text);
  text-align: left;
}

.accent {
  color: var(--accent);
}

.contact-email {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  transition: color var(--transition);
  text-align: center;
}

.contact-email:hover {
  color: var(--accent);
}

.contact-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-wrap: wrap;
  width: 100%;
}

.contact-socials a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.contact-socials a:hover {
  color: var(--accent);
}

.footer {
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.lang-btn {
  background: none;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0.4;
  transition:
    opacity var(--transition),
    color var(--transition);
  font-family: var(--font);
  padding: 0;
}

.lang-btn:hover {
  opacity: 0.8;
  color: var(--accent);
}

.lang-btn.active {
  opacity: 1;
  color: var(--text);
}

.cv-page {
  background: white;
}

.cv-back {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem 2rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cv-back a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.cv-back a:hover {
  color: var(--accent);
}

.cv-back button {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  transition: var(--transition);
  font-family: var(--font);
}

.cv-back button:hover {
  background: var(--text);
  color: white;
  border-color: var(--text);
}

.cv-main {
  padding: 2.5rem 2rem 4rem;
}

.cv-sheet {
  max-width: 800px;
  margin: 0 auto;
}

.cv-header {
  text-align: center;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--text);
  margin-bottom: 1.25rem;
}

.cv-name {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.15rem;
}

.cv-role {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.cv-contact-bar {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cv-contact-bar a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.cv-contact-bar a:hover {
  color: var(--accent);
}

.cv-block {
  margin-bottom: 1.5rem;
}

.cv-block-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}

.cv-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}

.cv-entry {
  margin-bottom: 0.9rem;
}

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

.cv-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.15rem;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.cv-entry-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.cv-entry-date {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.cv-skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.cv-skill-group h4 {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.cv-skill-group p {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  #path4,
  #path5,
  #path6 {
    animation: none;
    opacity: 1;
  }
  .animated-path {
    animation: none;
    opacity: 1;
  }
  .subtitle {
    animation: none;
    opacity: 1;
  }
  .hero-socials {
    animation: none;
    opacity: 1;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.visited #path4,
.visited #path5,
.visited #path6 {
  animation: none;
  opacity: 1;
}

.visited .subtitle,
.visited .hero-socials {
  animation: none;
  opacity: 1;
}

.visited .reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

@media print {
  @page {
    margin: 15mm;
  }
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .cv-contact-bar {
    font-size: 0.7rem;
    gap: 0.4rem;
  }
  .cv-back,
  .cv-back button {
    display: none !important;
  }
  .cv-page {
    background: white;
  }
  .cv-main {
    padding: 0;
  }
  .cv-sheet {
    max-width: 100%;
  }
  .cv-block {
    break-inside: avoid;
    margin-bottom: 1.25rem;
  }
  .cv-entry {
    break-inside: avoid;
  }
  body {
    font-size: 11pt;
    line-height: 1.4;
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal-panel {
  position: relative;
  width: min(720px, 90vw);
  max-height: 85vh;
  background: var(--bg);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.open .modal-panel {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background var(--transition),
    color var(--transition);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.modal-close:hover {
  background: var(--accent);
  color: white;
}

.modal-scroll {
  overflow-y: auto;
  padding: 2rem 2.25rem;
  border-radius: 8px;
}

.modal-body h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
  padding-right: 2rem;
}

.modal-body .modal-subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.modal-body .modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.modal-body .modal-badges .badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.75rem;
}

.modal-gallery {
  margin-bottom: 1.5rem;
}

.modal-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 1.5px solid var(--border);
  transition:
    border-color var(--transition),
    opacity var(--transition);
}

.modal-thumb:hover {
  border-color: var(--accent);
  opacity: 0.85;
}

.modal-body .modal-description {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.modal-section {
  margin-bottom: 1.5rem;
}

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-section-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.modal-section p {
  margin-bottom: 0.75rem;
}

.modal-section p:last-child {
  margin-bottom: 0;
}

.modal-body .modal-links {
  display: flex;
  gap: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.modal-body .modal-links a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}

.modal-body .modal-links a:hover {
  color: var(--accent);
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.lightbox-overlay.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-img {
  position: relative;
  max-width: 90vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 1.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav.prev {
  left: 1rem;
}

.lightbox-nav.next {
  right: 1rem;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .split-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .cv-skills-grid {
    grid-template-columns: 1fr;
  }
  .section {
    padding: 4rem 1.5rem;
  }
  .entry {
    padding: 1.5rem;
  }
  .contact-email {
    font-size: 1.15rem;
  }
  .beyond-row {
    gap: 1rem;
  }
  .modal-scroll {
    padding: 1.5rem 1.25rem;
  }
  .modal-body h2 {
    font-size: 1.25rem;
  }
}
