:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-alt: #f1f5fb;
  --text: #1f2a44;
  --muted: #5d6a84;
  --line: #dce4f2;
  --primary: #2f6fed;
  --primary-dark: #2459be;
  --shadow: 0 10px 25px rgba(31, 42, 68, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top right, #edf3ff 0%, var(--bg) 40%, #fdfefe 100%);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
  border-radius: 12px;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 0;
  gap: 1rem;
}

.logo {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--muted);
  font-weight: 600;
}

.hero {
  padding-bottom: 2.2rem;
}

.hero-compact {
  padding-bottom: 0;
}

.hero-compact .nav {
  padding-bottom: 0.8rem;
}

.hero-content {
  padding: 3rem 0 4rem;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 1.4rem;
}

.hero-text {
  min-width: 0;
}

.hero-photo {
  position: relative;
  min-height: 420px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.hero-photo-bg {
  position: absolute;
  inset: 16% 8% 3% 8%;
  border-radius: 220px;
  background: linear-gradient(180deg, #e9f1ff 0%, #dce8ff 100%);
  border: 1px solid #d4e1fb;
}

.hero-photo img {
  width: min(100%, 430px);
  position: relative;
  z-index: 1;
  border-radius: 0;
  filter: drop-shadow(0 20px 35px rgba(36, 89, 190, 0.18));
}

.tag {
  display: inline-block;
  background: var(--surface-alt);
  color: var(--primary-dark);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-bottom: 0.8rem;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 1rem;
}

.intro,
.specialites {
  color: var(--muted);
  max-width: 700px;
}

.hero-actions {
  margin-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 0.75rem 1.1rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  text-decoration: none;
}

.btn-secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface-alt);
  text-decoration: none;
}

.section {
  padding: 2rem 0;
}

.section-head p {
  margin-top: -0.4rem;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.projects-grid,
.skills-grid,
.services-list,
.contact-grid {
  display: grid;
  gap: 1rem;
}

.projects-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.project-card {
  padding: 0.8rem;
  overflow: hidden;
}

.project-card[hidden] {
  display: none;
}

.card-body {
  padding: 0.8rem 0.3rem 0.2rem;
}

.tech {
  color: var(--muted);
  font-weight: 600;
}

.project-links,
.projects-actions,
.project-meta,
.project-main {
  display: flex;
  gap: 0.8rem;
}

.project-links {
  flex-wrap: wrap;
}

.projects-actions {
  justify-content: center;
  margin-top: 1.2rem;
}

.project-page {
  min-height: 100vh;
}

.back-link {
  display: inline-flex;
  margin-bottom: 1rem;
  font-weight: 700;
}

.project-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.2rem;
  align-items: center;
}

.project-hero img {
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.project-meta {
  flex-wrap: wrap;
  margin: 1rem 0 0;
  color: var(--muted);
  font-weight: 600;
}

.project-content {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 0.95fr);
  align-items: start;
  margin-top: 1rem;
}

.project-main {
  flex-direction: column;
}

.project-content > .card {
  min-width: 0;
}

.project-sidebar {
  position: sticky;
  top: 1rem;
}

.project-sidebar h2:not(:first-child) {
  margin-top: 1.5rem;
}

.skills-grid,
.services-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

ul {
  margin: 0;
  padding-left: 1.1rem;
}

.contact-grid {
  grid-template-columns: 1fr;
}

.contact-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.8rem;
}

.form-field {
  display: grid;
  gap: 0.35rem;
}

.form-field label {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.required-mark {
  color: #d92d20;
  font-weight: 700;
}

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

.span-full {
  grid-column: 1 / -1;
}

.contact-note,
.form-note {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem;
  font: inherit;
  color: var(--text);
  background: #fff;
}

input:focus,
textarea:focus {
  outline: 2px solid #bfd4ff;
  border-color: var(--primary);
}

.footer {
  border-top: 1px solid var(--line);
  background: #f3f7fe;
  margin-top: 2rem;
}

.footer-content {
  padding: 1.1rem 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.footer p {
  margin: 0;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 1rem;
}

@media (max-width: 720px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-content {
    padding-top: 2rem;
  }

  .hero-layout {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .project-hero,
  .project-content {
    grid-template-columns: 1fr;
  }

  .hero-photo {
    min-height: 300px;
    margin-top: 0.5rem;
  }

  .hero-photo-bg {
    inset: 14% 14% 3% 14%;
  }

  .contact-form {
    grid-template-columns: 1fr;
  }

  .span-2,
  .span-3,
  .span-full {
    grid-column: 1;
  }

  .project-sidebar {
    position: static;
  }
}
