:root {
  --bg: #08090a;
  --bg-2: #101214;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-strong: rgba(255, 255, 255, 0.095);
  --text: #f5f7f8;
  --muted: #a5adb4;
  --soft: #737d86;
  --line: rgba(255, 255, 255, 0.13);
  --accent: #27e4d8;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius: 16px;
  --radius-sm: 10px;
  --max: 1180px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(126deg, rgba(39, 228, 216, .13), transparent 24rem),
    linear-gradient(220deg, rgba(255, 255, 255, .08), transparent 27rem),
    linear-gradient(135deg, #08090a 0%, #111417 48%, #070808 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 80%);
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .14;
  background: linear-gradient(110deg, transparent 0 42%, rgba(39, 228, 216, .22) 48%, transparent 56% 100%);
  transform: translateX(-45%);
  animation: scan 14s var(--ease) infinite;
  z-index: -1;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, textarea { font: inherit; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 50;
  padding: .75rem 1rem;
  border-radius: 999px;
  color: #03110f;
  background: var(--accent);
  transition: top .2s ease;
}

.skip-link:focus { top: 1rem; }

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease;
}

.site-header.scrolled {
  border-color: var(--line);
  background: rgba(8, 9, 10, 0.84);
  backdrop-filter: blur(18px);
}

.nav-shell {
  max-width: var(--max);
  height: 72px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  min-width: max-content;
  font-weight: 760;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(39, 228, 216, 0.5);
  border-radius: 12px;
  color: var(--accent);
  background: linear-gradient(135deg, rgba(39, 228, 216, 0.14), rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: .2rem;
  color: var(--muted);
  font-size: .93rem;
}

.nav-links a {
  padding: .6rem .72rem;
  border-radius: 999px;
  transition: color .2s ease, background .2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: .2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .045);
}

.lang-btn {
  min-width: 34px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 760;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.lang-btn:hover,
.lang-btn:focus-visible {
  color: var(--text);
  outline: none;
}

.lang-btn.active {
  color: #03110f;
  background: var(--accent);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
  border-radius: 999px;
  transition: transform .2s ease, opacity .2s ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

main { overflow: hidden; }

.section {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 6.5rem 1.25rem;
}

.section.compact {
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: .78rem;
}

.section-kicker::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

h1, h2, h3 { letter-spacing: 0; line-height: 1; }

h1 {
  max-width: 10ch;
  font-size: clamp(3.45rem, 9vw, 7.8rem);
  font-weight: 840;
}

h2 {
  max-width: 12ch;
  font-size: clamp(2.25rem, 4.8vw, 4.7rem);
  font-weight: 800;
}

h3 {
  font-size: 1.15rem;
  line-height: 1.18;
}

p {
  color: var(--muted);
  line-height: 1.75;
}

.hero {
  min-height: 100dvh;
  padding-top: 7.4rem;
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(340px, .97fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}

.hero-copy { padding-bottom: 2rem; }

.hero .intro-line {
  max-width: 64ch;
  margin-top: 1.4rem;
  font-size: clamp(1.05rem, 1.7vw, 1.28rem);
  color: #c6ccd1;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: .86rem 1.05rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
  white-space: nowrap;
}

.btn.primary {
  border-color: transparent;
  color: #02100f;
  background: var(--accent);
  font-weight: 760;
  box-shadow: 0 18px 48px rgba(39, 228, 216, 0.18);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(39, 228, 216, 0.55);
  background: rgba(39, 228, 216, 0.1);
  outline: none;
}

.btn.primary:hover,
.btn.primary:focus-visible {
  color: #020b0a;
  background: #69fff5;
}

.btn:active { transform: translateY(0) scale(.985); }

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
  margin-top: 2.4rem;
  max-width: 580px;
}

.meta-item {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.045);
}

.meta-item strong {
  display: block;
  color: var(--text);
  font-size: 1.35rem;
}

.meta-item span {
  color: var(--soft);
  font-size: .82rem;
}

.hero-visual {
  position: relative;
  min-height: 520px;
  perspective: 1100px;
}

.orbit {
  position: absolute;
  inset: 10% 4% 6% 12%;
  border: 1px solid rgba(39, 228, 216, .24);
  border-radius: 999px;
  transform: rotate(-16deg);
  animation: orbitPulse 8s ease-in-out infinite;
}

.orbit.second {
  inset: 3% 13% 14% 2%;
  border-color: rgba(255, 255, 255, .14);
  transform: rotate(22deg);
  animation-delay: -2s;
}

.profile-card {
  position: absolute;
  inset: 9% 2% auto 10%;
  min-height: 410px;
  padding: 1.2rem;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .035)), rgba(13, 15, 17, .76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  transform: rotateX(7deg) rotateY(-10deg);
  transform-style: preserve-3d;
  transition: transform .35s var(--ease);
}

.profile-card:hover { transform: rotateX(2deg) rotateY(-4deg) translateY(-6px); }

.terminal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  color: var(--soft);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .75rem;
}

.window-dots { display: inline-flex; gap: .38rem; }

.window-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .9;
}

.window-dots i:nth-child(2) { background: #f5d86f; }
.window-dots i:nth-child(3) { background: #ff6c7a; }

.avatar-core {
  position: relative;
  min-height: 210px;
  display: grid;
  place-items: center;
  margin: .8rem 0 1rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 20px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(135deg, rgba(39, 228, 216, .22), transparent 58%),
    #0b0d0f;
  background-size: 32px 32px, 32px 32px, auto, auto;
}

.avatar-ring {
  position: absolute;
  width: 152px;
  height: 152px;
  border-radius: 999px;
  border: 1px solid rgba(39, 228, 216, .55);
  animation: rotate 12s linear infinite;
}

.avatar-ring::before,
.avatar-ring::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent);
}

.avatar-ring::before { top: 18px; right: 16px; }
.avatar-ring::after { left: 20px; bottom: 15px; }

.avatar-initials {
  position: relative;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  color: var(--text);
  background: linear-gradient(145deg, rgba(39, 228, 216, .22), rgba(255, 255, 255, .06));
  border: 1px solid rgba(255, 255, 255, .19);
  font-size: 2rem;
  font-weight: 820;
  box-shadow: 0 24px 64px rgba(39, 228, 216, .14);
}

.code-lines {
  display: grid;
  gap: .7rem;
  margin-top: 1rem;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: .82rem;
  color: #c7d2d7;
}

.code-line {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .82rem .9rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, .055);
}

.code-line span:first-child { color: var(--accent); }

.floating-chip {
  position: absolute;
  right: -2%;
  bottom: 12%;
  padding: .85rem 1rem;
  border: 1px solid rgba(39, 228, 216, .36);
  border-radius: 999px;
  color: var(--text);
  background: rgba(8, 9, 10, .72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  animation: floatY 5s var(--ease) infinite;
}

.about-grid,
.skills-layout,
.achievements,
.contact-shell {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.about-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.skills-layout { grid-template-columns: minmax(260px, .82fr) minmax(0, 1.18fr); }
.achievements { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); align-items: center; }

.about-lead,
.skills-copy p {
  margin-top: 1.35rem;
  font-size: 1.08rem;
}

.about-panel,
.cert-list { display: grid; gap: 1rem; }

.timeline-item {
  position: relative;
  padding: 1.15rem 1.2rem 1.15rem 3.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: transform .24s ease, border-color .24s ease, background .24s ease;
}

.timeline-item:hover {
  transform: translateY(-4px);
  border-color: rgba(39, 228, 216, .36);
  background: var(--panel-strong);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 1.2rem;
  top: 1.35rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(39, 228, 216, .1);
}

.timeline-item small,
.project-link { color: var(--accent); font-weight: 700; }
.timeline-item small { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.timeline-item p, .project-card p, .cert-item p { margin-top: .45rem; }

.skill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.skill-tag {
  padding: .8rem .95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #dfe6e8;
  background: rgba(255, 255, 255, .052);
  transition: transform .2s ease, color .2s ease, border-color .2s ease;
}

.skill-tag:hover {
  transform: translateY(-3px);
  color: var(--accent);
  border-color: rgba(39, 228, 216, .42);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.project-card {
  position: relative;
  min-height: 270px;
  padding: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: transform .25s var(--ease), border-color .25s ease, background .25s ease;
}

.project-card.large { grid-column: span 7; }
.project-card.medium { grid-column: span 5; }
.project-card.small { grid-column: span 4; min-height: 230px; }

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(39, 228, 216, .42);
  background: rgba(255, 255, 255, .08);
}

.project-card::after {
  content: "";
  position: absolute;
  inset: auto -18% -38% 28%;
  height: 170px;
  background: linear-gradient(135deg, rgba(39, 228, 216, .2), transparent 64%);
  transform: skewY(-8deg);
  transition: transform .25s ease;
}

.project-card:hover::after { transform: skewY(-8deg) scale(1.16); }
.project-card h3, .project-card p, .project-card .project-tech, .project-card a { position: relative; z-index: 1; }
.project-card p { max-width: 54ch; margin-top: .8rem; }

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.25rem;
}

.project-tech span {
  padding: .45rem .58rem;
  border-radius: 999px;
  color: #cfd7da;
  background: rgba(255, 255, 255, .07);
  font-size: .78rem;
}

.project-link { display: inline-flex; margin-top: 1.35rem; }

.cert-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .95rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .052);
}

.cert-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #03110f;
  background: var(--accent);
  font-weight: 820;
}

.cert-item p { font-size: .95rem; }

.social-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
  margin-top: 2rem;
}

.social-card {
  min-height: 145px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .05);
  transition: transform .24s ease, border-color .24s ease, background .24s ease;
}

.social-card:hover,
.social-card:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(39, 228, 216, .46);
  background: rgba(39, 228, 216, .08);
  outline: none;
}

.social-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  border: 1px solid rgba(39, 228, 216, .38);
  font-weight: 800;
}

.social-card span:last-child { color: var(--muted); font-size: .9rem; }

.contact-shell {
  grid-template-columns: minmax(0, .9fr) minmax(280px, 1fr);
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(39, 228, 216, .1), rgba(255, 255, 255, .04)), rgba(255, 255, 255, .045);
  box-shadow: var(--shadow);
}

.contact-form { display: grid; gap: .85rem; }
.field { display: grid; gap: .42rem; }
.field label { color: #dce3e5; font-size: .9rem; }

.field input,
.field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 12px;
  color: var(--text);
  background: rgba(0, 0, 0, .22);
  padding: .9rem 1rem;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.field textarea { min-height: 130px; resize: vertical; }

.field input:focus,
.field textarea:focus {
  border-color: rgba(39, 228, 216, .65);
  box-shadow: 0 0 0 4px rgba(39, 228, 216, .1);
  background: rgba(0, 0, 0, .32);
}

.form-note {
  min-height: 1.5rem;
  color: var(--accent);
  font-size: .9rem;
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.8rem 1.25rem 2.4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--soft);
  border-top: 1px solid var(--line);
  font-size: .93rem;
}

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

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

@keyframes scan {
  from { transform: translateX(-45%); }
  to { transform: translateX(45%); }
}

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

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes orbitPulse {
  0%, 100% { opacity: .48; transform: rotate(-16deg) scale(1); }
  50% { opacity: .9; transform: rotate(-10deg) scale(1.04); }
}

@media (max-width: 960px) {
  .hero,
  .about-grid,
  .skills-layout,
  .achievements,
  .contact-shell { grid-template-columns: 1fr; }

  .hero { padding-top: 6.2rem; gap: 1rem; }
  .hero-visual { min-height: 460px; max-width: 560px; width: 100%; margin: 0 auto; }
  .project-card.large, .project-card.medium, .project-card.small { grid-column: span 6; }
  .social-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .nav-shell { height: 66px; }
  .menu-toggle { display: inline-block; }
  .language-switch { margin-left: auto; }
  .nav-links {
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: 72px;
    display: grid;
    gap: .25rem;
    padding: .7rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(8, 9, 10, .95);
    backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  }

  .nav-links.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .section { padding: 5rem 1rem; }
  h1 { max-width: 9ch; font-size: clamp(3.2rem, 17vw, 5.1rem); }
  h2 { max-width: 11ch; }
  .hero-meta { grid-template-columns: 1fr; }
  .hero-visual { min-height: 405px; }
  .profile-card { inset: 5% 1% auto 1%; min-height: 360px; transform: none; }
  .profile-card:hover { transform: translateY(-4px); }
  .floating-chip { right: .5rem; bottom: .4rem; }
  .project-grid { grid-template-columns: 1fr; }
  .project-card.large, .project-card.medium, .project-card.small { grid-column: auto; }
  .social-strip { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; }
}

@media (max-width: 460px) {
  .brand span:last-child { display: none; }
  .btn { width: 100%; }
  .language-switch { gap: .12rem; padding: .16rem; }
  .lang-btn { min-width: 31px; height: 28px; font-size: .72rem; }
  .social-strip { grid-template-columns: 1fr; }
  .avatar-core { min-height: 180px; }
}

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