:root {
  --bg: #020202;
  --bg-alt: #080808;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-strong: #111111;
  --text: #f5f5f0;
  --text-soft: #b2b2ab;
  --line: rgba(255, 255, 255, 0.1);
  --primary: #f1f1eb;
  --primary-strong: #d6d6d0;
  --accent: #8c8c86;
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.32);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --container: 1180px;
  --header-height: 86px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 24%),
    radial-gradient(circle at 85% 12%, rgba(255, 255, 255, 0.05), transparent 20%),
    linear-gradient(180deg, #050505 0%, var(--bg) 48%, #000000 100%);
  line-height: 1.6;
}

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

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

button,
input,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.3);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 20px;
  top: -80px;
  z-index: 1000;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--primary);
  color: #050505;
  transition: top 0.25s ease;
}

.skip-link:focus {
  top: 20px;
}

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  height: 3px;
  z-index: 1200;
  background: transparent;
}

.reading-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.12s linear;
}

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin-inline: auto;
}

.section {
  position: relative;
  padding: 104px 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0.03));
}

.section-shell {
  display: grid;
  gap: 40px;
}

.eyebrow {
  margin: 0 0 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.section-heading {
  max-width: 780px;
}

.section-heading h2,
.hero-copy h1 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.06;
}

.section-heading h2 {
  font-size: clamp(2rem, 5vw, 3.25rem);
}

.section-heading p {
  margin: 18px 0 0;
  max-width: 640px;
  color: var(--text-soft);
  font-size: 1.02rem;
}

/* ===========================
   Language Switcher
   =========================== */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-soft);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: color 0.25s ease, background 0.25s ease;
}

.lang-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.lang-btn.active {
  color: #050505;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.lang-divider {
  color: var(--accent);
  font-size: 0.8rem;
  user-select: none;
}

/* ===========================
   Header & Navigation
   =========================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1100;
  backdrop-filter: blur(18px);
  background: rgba(5, 5, 5, 0.72);
  border-bottom: 1px solid var(--line);
}

.header-shell {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #050505;
  font-family: "Sora", sans-serif;
  font-size: 0.95rem;
}

.brand-text {
  font-family: "Sora", sans-serif;
  font-size: 0.95rem;
  letter-spacing: -0.03em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  position: relative;
  padding: 11px 14px;
  color: var(--text-soft);
  font-weight: 600;
  transition: color 0.25s ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 8px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.active {
  color: var(--text);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after,
.site-nav a.active::after {
  transform: scaleX(1);
}

/* ===========================
   Contact Nav Button (Redesigned for legibility)
   =========================== */
.button-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text) !important;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
}

.button-contact::after {
  display: none !important;
}

.button-contact:hover,
.button-contact:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.06);
}

/* ===========================
   Buttons
   =========================== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #050505;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(255, 255, 255, 0.08);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(255, 255, 255, 0.12);
}

.button-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  box-shadow: none;
}

.button-ghost:hover,
.button-ghost:focus-visible {
  box-shadow: 0 12px 24px rgba(255, 255, 255, 0.04);
}

.button-sm {
  min-height: 44px;
  padding-inline: 18px;
}

.nav-toggle {
  display: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ===========================
   Hero
   =========================== */
.hero-section {
  padding-top: 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.88fr);
  align-items: stretch;
  gap: 48px;
}

.hero-name-row {
  display: flex;
  align-items: center;
  gap: 24px;
}

.hero-avatar-mobile {
  display: none;
}

.hero-copy h1 {
  font-size: clamp(3rem, 9vw, 5.75rem);
}

.hero-lead {
  margin: 18px 0 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(1.2rem, 3vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
}

.hero-description {
  max-width: 640px;
  margin: 22px 0 0;
  color: var(--text-soft);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.hero-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

.hero-highlights li {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow-md);
}

.hero-highlights strong,
.contact-list span,
.stack-label,
.timeline-label {
  display: block;
  margin-bottom: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.hero-highlights span {
  color: var(--text-soft);
  font-size: 0.95rem;
}

/* ===========================
   Portrait (smaller, square)
   =========================== */
.portrait-card {
  position: relative;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.portrait-glow {
  position: absolute;
  inset: auto auto 16% -8%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  filter: blur(26px);
}

.portrait-frame {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0a0a0a;
  flex: 1;
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===========================
   About
   =========================== */
.about-grid,
.formation-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 28px;
}

.content-card,
.stack-card,
.skill-group,
.project-card,
.timeline-content,
.formation-card,
.contact-shell {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-md);
}

.content-card,
.stack-card,
.skill-group,
.project-card,
.formation-card {
  border-radius: var(--radius-lg);
}

.content-card,
.stack-card,
.formation-card {
  padding: 30px;
}

.content-card p,
.stack-card strong,
.project-card p,
.timeline-content p,
.formation-card p,
.contact-shell p,
.contact-list a {
  color: var(--text-soft);
}

.content-card p + p {
  margin-top: 18px;
}

.stack-card {
  display: grid;
  gap: 18px;
}

.stack-card strong {
  display: block;
  font-size: 1.08rem;
  line-height: 1.45;
}

/* ===========================
   Skills
   =========================== */
.skills-grid,
.projects-grid {
  display: grid;
  gap: 22px;
}

.skills-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.skill-group {
  padding: 24px;
}

.skill-group h3,
.project-card h3,
.timeline-content h3,
.formation-card h3,
.contact-copy h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
  letter-spacing: -0.03em;
}

.skill-group h3,
.formation-card h3 {
  font-size: 1.2rem;
}

.tag-list,
.project-stack,
.contact-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.tag-list li,
.project-stack li {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.92rem;
  color: var(--text-soft);
}

/* ===========================
   Projects
   =========================== */
.projects-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 26px;
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.project-card:hover,
.project-card:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.16);
}

.project-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.project-index {
  font-family: "JetBrains Mono", monospace;
  color: var(--primary);
  font-weight: 600;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.project-card h3 {
  font-size: 1.42rem;
}

.project-card p {
  margin: 0;
}

.project-card a {
  margin-top: auto;
  font-weight: 700;
  color: var(--text);
}

.project-card a::after {
  content: " ↗";
  color: var(--primary);
}

/* ===========================
   Timeline
   =========================== */
.timeline {
  position: relative;
  display: grid;
  gap: 22px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 16px;
  bottom: 16px;
  width: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.1));
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.timeline-marker {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  border: 6px solid #050505;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.08);
}

.timeline-content {
  padding: 26px;
  border-radius: 22px;
}

.timeline-content h3 {
  font-size: 1.22rem;
}

.timeline-content p {
  margin: 14px 0 0;
}

/* ===========================
   Formation
   =========================== */
.formation-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.formation-card {
  min-height: 100%;
}

.formation-card p {
  margin: 14px 0 0;
}

/* ===========================
   Contact
   =========================== */
.contact-section {
  padding-bottom: 120px;
}

.contact-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 28px;
  padding: 40px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.07), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
}

.contact-copy h2 {
  font-size: clamp(2rem, 5vw, 3rem);
}

.contact-copy p {
  margin: 18px 0 0;
  max-width: 620px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-content: start;
}

.contact-list {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.contact-list li {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.contact-list a {
  word-break: break-word;
}

/* ===========================
   Footer
   =========================== */
.site-footer {
  padding: 0 0 40px;
}

.footer-shell {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.footer-name {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-weight: 700;
}

.footer-role,
.footer-meta p {
  margin: 6px 0 0;
  color: var(--text-soft);
}

.footer-meta {
  text-align: right;
}

/* ===========================
   Reveal Animation
   =========================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ===========================
   Accessibility
   =========================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

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

/* ===========================
   Responsive: Tablet (≤ 1080px)
   =========================== */
@media (max-width: 1080px) {
  .skills-grid,
  .formation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .projects-grid,
  .contact-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-grid,
  .about-grid,
  .contact-shell {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    display: none;
  }

  .hero-avatar-mobile {
    display: block;
    flex-shrink: 0;
  }

  .hero-avatar-mobile img {
    width: 110px;
    height: 110px;
    border-radius: 20px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  }

  .hero-highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-actions {
    align-content: initial;
  }


}

/* ===========================
   Responsive: Mobile Nav (≤ 820px)
   =========================== */
@media (max-width: 820px) {
  :root {
    --header-height: 74px;
  }

  .section {
    padding: 84px 0;
  }

  .nav-toggle {
    display: inline-block;
    position: relative;
    z-index: 1200;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 12px);
    left: 1rem;
    right: 1rem;
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(8, 8, 8, 0.94);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  .nav-open .site-nav {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .site-nav a {
    padding: 12px 14px;
  }

  /* Contact button inside mobile nav */
  .site-nav .button-contact {
    width: 100%;
    text-align: center;
    margin-top: 4px;
  }

  .hero-section {
    padding-top: 36px;
  }

  .hero-copy h1 {
    font-size: clamp(2.6rem, 14vw, 4.2rem);
  }

  .hero-highlights,
  .skills-grid,
  .projects-grid,
  .formation-grid,
  .contact-list {
    grid-template-columns: 1fr;
  }

  .portrait-card {
    padding: 22px;
  }

  .timeline-item {
    gap: 18px;
  }

  .footer-shell {
    flex-direction: column;
  }

  .footer-meta {
    text-align: left;
  }


}

/* ===========================
   Responsive: Small phones (≤ 560px)
   =========================== */
@media (max-width: 560px) {
  .container {
    width: min(var(--container), calc(100% - 1.25rem));
  }

  .button,
  .button-sm {
    width: 100%;
  }

  .hero-actions,
  .contact-actions {
    flex-direction: column;
  }

  .content-card,
  .stack-card,
  .skill-group,
  .project-card,
  .timeline-content,
  .formation-card,
  .contact-shell {
    padding: 22px;
  }

  .hero-highlights li,
  .contact-list li {
    padding: 16px;
  }

  .portrait-card {
    padding: 16px;
  }

  .hero-copy h1 {
    font-size: clamp(2rem, 12vw, 3rem);
  }

  .hero-name-row {
    gap: 16px;
  }

  .hero-avatar-mobile img {
    width: 90px;
    height: 90px;
    border-radius: 16px;
  }

  .section-heading h2 {
    font-size: clamp(1.6rem, 6vw, 2.2rem);
  }

  .brand-text {
    font-size: 0.85rem;
  }

  .contact-shell {
    padding: 20px;
  }
}

/* ===========================
   Responsive: Very small phones (≤ 380px)
   =========================== */
@media (max-width: 380px) {
  .container {
    width: min(var(--container), calc(100% - 0.75rem));
  }

  .hero-copy h1 {
    font-size: 2rem;
  }

  .hero-lead {
    font-size: 1.1rem;
  }

  .brand-text {
    font-size: 0.78rem;
  }

  .lang-btn {
    padding: 4px 6px;
    font-size: 0.7rem;
  }
}
