:root {
  --bg: #07111f;
  --bg-soft: #0c1727;
  --card: rgba(255, 255, 255, 0.06);
  --card-solid: #0f1d31;
  --line: rgba(255, 255, 255, 0.12);
  --text: #ecf3ff;
  --muted: #a9b8cf;
  --accent: #7dd3fc;
  --accent-2: #38bdf8;
  --white: #ffffff;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  --radius-sm: 14px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent 28%),
    radial-gradient(circle at 80% 20%, rgba(125, 211, 252, 0.10), transparent 24%),
    linear-gradient(180deg, #07111f 0%, #091625 45%, #07111f 100%);
  color: var(--text);
  line-height: 1.65;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.container {
  width: min(var(--max-width), calc(100% - 40px));
  margin: 0 auto;
}

/* LANGUAGE SWITCHER */
.language-switcher {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 200;
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.72);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.language-switcher a {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  transition: color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.language-switcher a:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.language-switcher a.active {
  color: #03121d;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* HERO */
.hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(125, 211, 252, 0.18), transparent 20%),
    radial-gradient(circle at 80% 30%, rgba(56, 189, 248, 0.12), transparent 18%),
    linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
  animation: pulseGlow 10s ease-in-out infinite;
}

.navbar {
  width: min(var(--max-width), calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-logo {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #04111b;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.28);
}

.nav-links {
  display: flex;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.62);
  backdrop-filter: blur(12px);
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 16px;
  border-radius: 999px;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.nav-links a:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.hero-content {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 90px);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 60px;
  padding: 60px 0 80px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 18px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.25);
  color: var(--accent);
  background: rgba(125, 211, 252, 0.08);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(3rem, 7vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero-subtitle {
  margin: 0 0 16px;
  max-width: 700px;
  font-size: 1.3rem;
  color: var(--text);
}

.hero-description {
  max-width: 620px;
  font-size: 1.02rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  padding: 14px 22px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease, background 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #05131e;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 30px rgba(56, 189, 248, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 18px 36px rgba(56, 189, 248, 0.34);
}

.btn-secondary {
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.hero-photo {
  display: flex;
  justify-content: center;
}

.photo-frame {
  width: min(420px, 100%);
  aspect-ratio: 1 / 1.08;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 36px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  transform: rotate(2deg);
  transition: transform 0.35s ease;
}

.photo-frame:hover {
  transform: rotate(0deg) translateY(-4px);
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 26px;
}

/* SECTIONS */
.section {
  padding: 110px 0 20px;
}

.section-heading {
  margin-bottom: 28px;
}

.section-tag {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.03em;
}

.glass-card,
.skill-card,
.project-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.about-card,
.contact-card {
  padding: 30px;
  border-radius: var(--radius);
}

.about-card p,
.contact-card p {
  margin: 0 0 14px;
  color: var(--muted);
}

.about-card p:last-child,
.contact-card p:last-child {
  margin-bottom: 0;
}

.contact-card a {
  color: var(--accent);
  text-decoration: none;
}

.contact-card a:hover {
  text-decoration: underline;
}

/* SKILLS */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.skill-card {
  padding: 24px;
  border-radius: var(--radius);
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.skill-card:hover {
  transform: translateY(-6px);
  border-color: rgba(125, 211, 252, 0.28);
  background: rgba(255, 255, 255, 0.07);
}

.skill-card h3 {
  margin: 0 0 18px;
  font-size: 1.1rem;
}

.skill-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-badges span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.10);
  border: 1px solid rgba(125, 211, 252, 0.16);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 0.25s ease, background 0.25s ease;
}

.skill-badges span:hover {
  transform: translateY(-2px);
  background: rgba(125, 211, 252, 0.16);
}

/* PROJECTS */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.project-card {
  position: relative;
  padding: 28px;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(125,211,252,0.06), rgba(255,255,255,0));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: rgba(125, 211, 252, 0.28);
  background: rgba(255, 255, 255, 0.07);
}

.project-card:hover::before {
  opacity: 1;
}

.project-number {
  margin-bottom: 18px;
  color: var(--accent);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

.project-card h3 {
  position: relative;
  margin: 0 0 14px;
  font-size: 1.28rem;
}

.project-card p {
  position: relative;
  margin: 0 0 24px;
  color: var(--muted);
}

.project-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
}

.project-link::after {
  content: "→";
  transition: transform 0.25s ease;
}

.project-link:hover::after {
  transform: translateX(4px);
}

/* PROJECT MODAL CSS-ONLY */
.project-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.project-modal:target {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.project-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 10, 20, 0.72);
  backdrop-filter: blur(8px);
}

.project-modal-box {
  position: relative;
  width: min(760px, calc(100% - 32px));
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  margin: 30px auto;
  padding: 32px;
  border-radius: 28px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04)),
    rgba(12, 23, 39, 0.96);
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  transform: translateY(24px) scale(0.98);
  transition: transform 0.3s ease;
}

.project-modal:target .project-modal-box {
  transform: translateY(0) scale(1);
}

.project-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  text-decoration: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  transition: background 0.25s ease, transform 0.25s ease;
}

.project-modal-close:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: rotate(90deg);
}

.project-modal-tag {
  display: inline-block;
  margin-bottom: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  color: var(--accent);
  background: rgba(125, 211, 252, 0.10);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.project-modal-box h3 {
  margin: 0 0 14px;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.03em;
}

.project-modal-box p {
  margin: 0 0 22px;
  color: var(--muted);
}

.project-modal-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.project-modal-section h4 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--white);
}

.project-modal-section ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.project-modal-section li + li {
  margin-top: 8px;
}

.project-modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project-modal-badges span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.10);
  border: 1px solid rgba(125, 211, 252, 0.16);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
}

/* FOOTER */
.footer {
  padding: 50px 20px 60px;
  text-align: center;
  color: var(--muted);
}

/* REVEAL ANIMATIONS */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  animation: revealUp 0.8s ease forwards;
}

.delay-1 {
  animation-delay: 0.18s;
}

@keyframes revealUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.03);
    opacity: 0.88;
  }
}

/* RESPONSIVE */
@media (max-width: 1100px) {
  .projects-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-content {
    grid-template-columns: 1fr;
    padding-top: 40px;
  }

  .hero-text {
    order: 2;
  }

  .hero-photo {
    order: 1;
    margin-top: 30px;
  }

  .photo-frame {
    max-width: 380px;
  }
}

@media (max-width: 820px) {
  .navbar {
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
  }

  .nav-links {
    flex-wrap: wrap;
    border-radius: 22px;
  }

  .skills-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-content {
    min-height: auto;
    gap: 34px;
    padding-bottom: 40px;
  }

  .project-modal-box {
    width: min(760px, calc(100% - 20px));
    margin: 20px auto;
    padding: 24px;
    max-height: calc(100vh - 40px);
  }
}

@media (max-width: 640px) {
  .container {
    width: min(var(--max-width), calc(100% - 24px));
  }

  .language-switcher {
    top: 12px;
    right: 12px;
  }

  .hero h1 {
    line-height: 1;
  }

  .hero-subtitle {
    font-size: 1.08rem;
  }

  .btn {
    width: 100%;
  }

  .hero-actions {
    flex-direction: column;
  }

  .about-card,
  .contact-card,
  .skill-card,
  .project-card {
    padding: 22px;
  }

  .photo-frame {
    border-radius: 24px;
  }

  .photo-frame img {
    border-radius: 16px;
  }

  .project-modal-box {
    padding: 22px 18px;
    border-radius: 22px;
  }

  .project-modal-box h3 {
    padding-right: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}