:root {
  --bg: #080d16;
  --surface: #0e1624;
  --surface-raised: #121d2d;
  --border: #233044;
  --border-strong: #31425a;
  --text: #f3f6fa;
  --muted: #9aa9bc;
  --blue: #3b82f6;
  --blue-bright: #60a5fa;
  --blue-dark: #1d4ed8;
  --radius: 12px;
  --shadow: 0 18px 45px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-bright); }
a:hover { color: #93c5fd; }

.skip-link {
  position: fixed;
  z-index: 1100;
  top: 1rem;
  left: 1rem;
  padding: .65rem 1rem;
  color: #fff;
  background: var(--blue-dark);
  border-radius: 6px;
  transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  z-index: 1000;
  top: 0;
  background: rgba(8, 13, 22, .94);
  border-bottom: 1px solid rgba(49, 66, 90, .65);
  backdrop-filter: blur(12px);
}

.navbar { min-height: 72px; }
.navbar-brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--blue-dark);
  border: 1px solid var(--blue-bright);
  border-radius: 8px;
  font-size: .75rem;
  letter-spacing: .04em;
}
.navbar-nav { gap: .2rem; }
.navbar .nav-link {
  position: relative;
  padding: .55rem .75rem !important;
  color: var(--muted);
  font-size: .93rem;
  font-weight: 600;
}
.navbar .nav-link:hover,
.navbar .nav-link.active { color: var(--text); }
.navbar .nav-link::after {
  position: absolute;
  right: .75rem;
  bottom: .3rem;
  left: .75rem;
  height: 2px;
  content: "";
  background: var(--blue);
  transform: scaleX(0);
  transition: transform .18s ease;
}
.navbar .nav-link.active::after,
.navbar .nav-link:hover::after { transform: scaleX(1); }
.nav-cv { margin-left: .45rem; }
.btn-cv {
  padding: .46rem .8rem;
  color: #dbeafe;
  border: 1px solid #365b8d;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 700;
}
.btn-cv:hover { color: #fff; background: #172c49; border-color: var(--blue-bright); }
.language-switcher {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-left: 1.1rem;
  padding-left: 1.1rem;
  color: #506078;
  border-left: 1px solid var(--border);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
}
.language-switcher a { color: #71829a; text-decoration: none; }
.language-switcher a:hover,
.language-switcher a.active { color: var(--blue-bright); }

.site-main { display: flex; flex: 1; flex-direction: column; }
.hero {
  display: flex;
  min-height: calc(100vh - 145px);
  align-items: center;
  padding: clamp(3.5rem, 8vh, 7rem) 0;
  background:
    radial-gradient(circle at 84% 40%, rgba(37, 99, 235, .12), transparent 25rem),
    linear-gradient(90deg, rgba(8, 13, 22, 0), rgba(14, 22, 36, .22));
}
.hero-copy { max-width: 780px; }
.eyebrow {
  margin: 0 0 .7rem;
  color: var(--blue-bright) !important;
  font-size: .78rem !important;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -.055em;
  line-height: .98;
}
.hero-role {
  margin: 1rem 0 1.2rem;
  color: #c5d6eb;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -.025em;
}
.hero-intro {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.17rem);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.btn {
  border-radius: 8px;
  font-weight: 700;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--blue-dark); border-color: var(--blue); }
.btn-primary:hover { background: #2563eb; border-color: var(--blue-bright); }
.btn-outline-light { color: #dbe5f2; border-color: #506078; }
.btn-outline-light:hover { color: #fff; background: #1c293a; border-color: #7e90a9; }
.btn-link-cv { color: var(--blue-bright); text-decoration: none; }
.btn-link-cv:hover { color: #bfdbfe; }
.tech-list { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 2rem; }
.tech-list span {
  padding: .32rem .65rem;
  color: #b8c7da;
  background: #101a29;
  border: 1px solid #26364c;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .75rem;
}
.tech-list.compact { margin-top: 1.15rem; }
.tech-list.compact span { padding: .24rem .5rem; font-size: .7rem; }
.hero-portrait-wrap { display: flex; justify-content: center; }
.portrait-frame {
  position: relative;
  width: min(100%, 390px);
  aspect-ratio: 1;
  padding: 9px;
  border: 1px solid rgba(96, 165, 250, .75);
  border-radius: 50%;
  box-shadow: 0 0 0 10px rgba(59, 130, 246, .035), 0 22px 70px rgba(29, 78, 216, .18);
}
.portrait-frame::after {
  position: absolute;
  right: 9%;
  bottom: 5%;
  width: 18px;
  height: 18px;
  content: "";
  background: #22c55e;
  border: 4px solid var(--bg);
  border-radius: 50%;
}
.profile-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.page-section { width: 100%; padding: clamp(3.5rem, 7vw, 6rem) 0; }
.container-narrow { max-width: 960px; }
.page-heading { max-width: 760px; margin-bottom: 2.5rem; }
.page-heading h1,
.project-detail h1 {
  margin-bottom: .85rem;
  font-size: clamp(2rem, 5vw, 3.35rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.08;
}
.page-heading > p:last-child { color: var(--muted); font-size: 1.08rem; }

.project-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .14);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.project-card:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.project-card.featured { border-color: rgba(59, 130, 246, .55); }
.project-image-link {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #0a111d;
  border-bottom: 1px solid var(--border);
}
.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease, opacity .2s ease;
}
.project-card:hover .project-image { opacity: .94; transform: scale(1.015); }
.project-card-body { display: flex; min-height: 295px; flex-direction: column; padding: 1.5rem; }
.project-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.project-title { margin: 0; color: var(--text); font-size: 1.35rem; font-weight: 750; letter-spacing: -.02em; }
.project-title a { color: inherit; text-decoration: none; }
.project-title a:hover { color: #bfdbfe; }
.status-badge {
  flex: 0 0 auto;
  padding: .25rem .48rem;
  color: #bfdbfe;
  background: rgba(37, 99, 235, .16);
  border: 1px solid rgba(96, 165, 250, .38);
  border-radius: 5px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.project-description { margin: 1rem 0 0; color: var(--muted); }
.project-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: auto; padding-top: 1.5rem; }
.project-link { font-size: .86rem; font-weight: 700; text-decoration: none; }
.project-link.primary { color: #93c5fd; }
.empty-state { padding: 4rem 1rem; text-align: center; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty-state i { color: var(--blue-bright); font-size: 2rem; }
.empty-state h2 { margin-top: 1rem; font-size: 1.25rem; }
.empty-state p { color: var(--muted); }

.back-link { display: inline-block; margin-bottom: 1.5rem; color: var(--muted); font-weight: 650; text-decoration: none; }
.back-link:hover { color: var(--text); }
.project-detail { padding: clamp(1.5rem, 4vw, 3.5rem); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.project-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; }
.project-detail-image {
  width: 100%;
  height: auto;
  max-height: 520px;
  aspect-ratio: 16 / 9;
  margin-top: 1.75rem;
  object-fit: cover;
  background: #0a111d;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.detail-copy { margin-top: 2rem; color: #bdc9d8; font-size: 1.03rem; line-height: 1.8; }
.detail-copy p:last-child { margin-bottom: 0; }
.feature-section { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.feature-section h2 { font-size: 1.25rem; }
.feature-section .detail-copy { margin-top: 1rem; }

.about-layout { display: grid; grid-template-columns: minmax(190px, .7fr) 2fr; gap: clamp(2rem, 6vw, 5rem); }
.about-summary { align-self: start; padding: 1.3rem 0; border-top: 2px solid var(--blue); border-bottom: 1px solid var(--border); }
.summary-number { color: var(--text); font-size: 2rem; font-weight: 800; }
.about-summary p { margin: .2rem 0; color: var(--muted); font-size: .9rem; }
.about-summary hr { margin: 1.25rem 0; border-color: var(--border); opacity: 1; }
.about-summary strong { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.about-content { color: #c3cedd; font-size: 1.06rem; line-height: 1.85; }
.about-content p { margin-bottom: 1.35rem; }

.contact-shell { display: grid; max-width: 1040px; grid-template-columns: .8fr 1.2fr; margin: 0 auto; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.contact-details { padding: clamp(1.5rem, 4vw, 2.5rem); background: #0b1320; border-right: 1px solid var(--border); }
.contact-details h2 { font-size: 1.2rem; }
.contact-details > p { color: var(--muted); }
.contact-list { display: flex; flex-direction: column; gap: 1.3rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.contact-list li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: .7rem; align-items: start; }
.contact-list i { color: var(--blue-bright); font-size: 1.05rem; }
.contact-list div { min-width: 0; }
.contact-list span { display: block; color: #7889a0; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.contact-list a { display: block; overflow: hidden; color: #d3deeb; font-size: .88rem; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.contact-list a:hover { color: #fff; }
.contact-form-panel { padding: clamp(1.5rem, 4vw, 2.5rem); }
.contact-form { display: flex; flex-direction: column; gap: 1.15rem; }
.form-group label { display: inline-block; margin-bottom: .4rem; color: #dbe5f2; font-size: .88rem; font-weight: 650; }
.contact-form .form-control {
  padding: .72rem .85rem;
  color: #fff;
  background: #0a111d;
  border: 1px solid #34445a;
  border-radius: 7px;
}
.contact-form .form-control:hover { border-color: #52657f; }
.contact-form .form-control:focus { color: #fff; background: #0a111d; border-color: var(--blue-bright); box-shadow: 0 0 0 .2rem rgba(59, 130, 246, .17); }
.contact-form textarea { resize: vertical; min-height: 145px; }
.alert-success { display: flex; gap: .6rem; align-items: center; color: #bbf7d0; background: #0e2d20; border-color: #236443; }

.site-footer { color: #718096; background: #070b12; border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; padding-top: 1.35rem; padding-bottom: 1.35rem; font-size: .8rem; }

@media (max-width: 991.98px) {
  .navbar-collapse { padding: 1rem 0 .5rem; border-top: 1px solid var(--border); }
  .navbar-nav { align-items: stretch !important; }
  .navbar .nav-link { padding: .65rem .2rem !important; }
  .navbar .nav-link::after { right: auto; bottom: .3rem; left: .2rem; width: 30px; }
  .nav-cv { margin: .5rem 0; }
  .btn-cv { width: 100%; }
  .language-switcher { margin: .5rem 0 0; padding: .8rem 0 0; border-top: 1px solid var(--border); border-left: 0; }
  .hero { min-height: auto; text-align: center; }
  .hero-copy { margin: 0 auto; }
  .hero-intro { margin: 0 auto; }
  .hero-actions, .tech-list { justify-content: center; }
  .hero-portrait-wrap { order: -1; }
  .portrait-frame { width: min(58vw, 300px); }
}

@media (max-width: 767.98px) {
  .page-section { padding: 3rem 0; }
  .about-layout, .contact-shell { grid-template-columns: 1fr; }
  .contact-details { border-right: 0; border-bottom: 1px solid var(--border); }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 575.98px) {
  .hero { padding: 2.8rem 0 3.5rem; }
  .hero h1 { font-size: 2.8rem; }
  .hero-role { font-size: 1.25rem; }
  .portrait-frame { width: min(66vw, 245px); }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .project-detail-header { flex-direction: column; }
  .project-actions { gap: .75rem; }
  .project-card-body, .project-detail { padding: 1.25rem; }
}

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