:root {
  --bg: #f2f5fb;
  --bg-soft: #ffffff;
  --text: #111c30;
  --muted: #54617a;
  --line: #d9e2f1;
  --accent: #1f6bff;
  --accent-2: #0f4fc8;
  --success: #e8fff2;
  --error: #ffeff3;
  --radius: 16px;
  --shadow: 0 20px 44px rgba(24, 62, 128, 0.1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: hidden; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 380px at 0% 0%, #eaf2ff 0%, transparent 72%),
    radial-gradient(860px 300px at 100% 0%, #dce9ff 0%, transparent 74%),
    var(--bg);
}
main { flex: 1 0 auto; }
a { text-decoration: none; color: inherit; }
.container { width: min(80%, 1320px); margin: 0 auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.brand img {
  width: auto;
  height: 38px;
  display: block;
  object-fit: contain;
  transform: translateY(0);
}
.brand span { line-height: 1; }

.nav { display: flex; align-items: center; gap: 0.35rem; }
.nav a {
  padding: 0.56rem 0.84rem;
  border-radius: 11px;
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 600;
  transition: .2s ease;
}
.nav a:hover { border-color: var(--line); background: #fff; color: var(--text); }

.menu-btn {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  padding: 0.45rem 0.76rem;
}

.section { padding: 2rem 0; }
.section-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}
.section-head h2 { margin: 0; font-size: clamp(1.45rem, 2.5vw, 2.1rem); }
.section-head p { margin: 0.4rem 0 0; color: var(--muted); }

.kicker {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-size: .76rem;
  color: #2b57aa;
  font-weight: 700;
}

.hero-home { padding: 2.2rem 0 1.2rem; }
.home-hero-grid {
  display: grid;
  gap: 1.6rem;
  grid-template-columns: 1.22fr 0.78fr;
  align-items: stretch;
}
.hero-copy,
.hero-panel,
.contact-intro,
.contact-form-wrap,
.about-story,
.about-box,
.admin {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}
.hero-copy,
.hero-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}
.hero-copy h1 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: clamp(2rem, 5.2vw, 4.1rem);
  line-height: 1.05;
  max-width: 13ch;
}
.hero-copy p { margin: .75rem 0 0; color: var(--muted); line-height: 1.72; max-width: 66ch; }
.hero-cta { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .7rem; }

.hero-panel {
  display: grid;
  gap: .7rem;
  align-content: center;
  color: #1d3357;
  transform: rotate(-2deg);
}
.hero-metric {
  border: 1px solid #cfe0ff;
  border-radius: 12px;
  padding: .8rem;
  background: linear-gradient(145deg, #ffffff 0%, #edf4ff 100%);
}
.hero-metric strong { display: block; font-size: 1.2rem; }
.hero-metric span { opacity: .92; font-size: .92rem; color: #4d5f7f; }

.btn {
  border: 0;
  border-radius: 12px;
  padding: .73rem 1.02rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  cursor: pointer;
}
.btn:hover { background: var(--accent-2); }
.btn.btn-ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn.danger { background: #d53142; }

.projects-list {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}
.project-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .2s ease;
}
.project-card:nth-child(odd) { transform: translateY(10px) rotate(-0.4deg); }
.project-card:nth-child(even) { transform: translateY(-8px) rotate(0.35deg); }
.project-card:hover { transform: translateY(-4px) rotate(0deg); }
.project-banner {
  width: 100%;
  aspect-ratio: 16/8;
  object-fit: cover;
  display: block;
}
.project-body { padding: .95rem; }
.project-body h3 { margin: 0 0 .38rem; }
.project-body p { margin: 0; color: var(--muted); line-height: 1.64; }
.project-body small {
  display: inline-flex;
  align-items: center;
  gap: .36rem;
  margin-top: .6rem;
  background: #eaf1ff;
  color: #2a4f98;
  padding: .28rem .56rem;
  border-radius: 999px;
}
.actions { margin-top: .78rem; display: flex; gap: .6rem; flex-wrap: wrap; }
.actions a {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .4rem .67rem;
  color: #2e4d84;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.social-row {
  margin-top: 1rem;
  display: grid;
  gap: .8rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.social {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: .85rem;
  display: grid;
  gap: .2rem;
}
.social i { color: #2758b1; }
.social span { font-weight: 700; }
.social small { color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }

.contact-shell {
  display: grid;
  grid-template-columns: .95fr 1.05fr;
  gap: 1rem;
}
.contact-intro h1 { margin: 0 0 .6rem; font-size: clamp(1.8rem, 4vw, 2.8rem); }
.contact-intro p { margin: 0; color: var(--muted); line-height: 1.72; }
.contact-meta { margin-top: 1rem; display: grid; gap: .5rem; }
.contact-meta div { display: flex; align-items: center; gap: .52rem; font-weight: 600; color: #31466f; }
.meta-icon { width: 22px; text-align: center; color: #2b5ab1; }
.contact-form-strong {
  border-color: #cbddff;
  box-shadow: 0 22px 48px rgba(26, 70, 145, 0.14);
}

.about-hero h1 {
  margin: 0;
  max-width: 24ch;
  font-size: clamp(1.9rem, 4.4vw, 3.2rem);
  line-height: 1.08;
}
.about-hero p { margin: .72rem 0 0; max-width: 74ch; color: var(--muted); line-height: 1.74; }
.about-layout {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 1rem;
}
.about-story h2, .about-story h3 { margin-top: 0; }
.about-story p { color: var(--muted); line-height: 1.72; }
.about-points { display: grid; gap: .75rem; margin-top: .9rem; }
.about-point {
  border: 1px solid #dae5f7;
  border-radius: 12px;
  background: linear-gradient(150deg, #fff 0%, #f8fbff 100%);
  padding: .78rem;
}
.about-point p { margin: .28rem 0 0; }
.about-side { display: grid; gap: 1rem; }
.about-box h3 { margin-top: 0; }

.about-portrait {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.about-portrait img {
  width: min(320px, 92%);
  height: auto;
  display: block;
  object-fit: contain;
  background: transparent;
  animation: floatPortrait 4.2s ease-in-out infinite;
}
@keyframes floatPortrait {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
  100% { transform: translateY(0px); }
}

.tools-grid { display: grid; gap: .52rem; }
.tool-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid #d8e5fb;
  border-radius: 10px;
  padding: .5rem .6rem;
  background: #f8fbff;
  font-weight: 600;
  color: #243d68;
}
.tool-icon { width: 20px; text-align: center; color: #2a58ad; }
.about-cta { margin-top: 1rem; display: flex; gap: .7rem; flex-wrap: wrap; }

.form { display: grid; gap: .8rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
label { display: grid; gap: .36rem; color: #384c6d; font-weight: 600; }
input, textarea, button { font: inherit; }
input, textarea {
  width: 100%;
  border: 1px solid #cfdbef;
  border-radius: 11px;
  padding: .65rem .74rem;
  color: var(--text);
  background: #fff;
}
input:focus, textarea:focus {
  outline: 0;
  border-color: #7aa8ff;
  box-shadow: 0 0 0 3px rgba(31, 107, 255, .12);
}
.form .full { grid-column: 1 / -1; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; margin-top: .55rem; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { border-bottom: 1px solid #e2ebf7; padding: .7rem; text-align: left; vertical-align: top; }

.msg { padding: .7rem .86rem; border-radius: 10px; }
.msg.ok { background: var(--success); border: 1px solid #b9f1d0; }
.msg.err { background: var(--error); border: 1px solid #ffcbd2; }

.footer {
  margin-top: 1.8rem;
  background: #fff;
  border-top: 1px solid var(--line);
}
.footer-grid {
  padding: 1.2rem 0;
  display: grid;
  grid-template-columns: 1.2fr 1fr .8fr;
  gap: 1rem;
  align-items: center;
}
.footer-brand { display: flex; align-items: center; gap: .7rem; }
.footer-brand img { width: auto; height: 36px; display: block; object-fit: contain; }
.footer-brand p { margin: .2rem 0 0; color: var(--muted); }
.footer-socials {
  margin-top: .7rem;
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
}
.footer-socials a {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2e4f8d;
  background: #fff;
}
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: .45rem; }
.footer-links a {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .35rem .58rem;
  color: #345182;
}
.footer-meta { text-align: right; color: var(--muted); }
.footer-meta p, .footer-meta small { margin: 0; display: block; }

@media (max-width: 1100px) {
  .container { width: min(92%, 1240px); }
  .home-hero-grid,
  .about-layout,
  .contact-shell,
  .projects-list { grid-template-columns: 1fr; }
  .social-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .nav {
    position: fixed;
    top: 78px;
    left: 0;
    right: 0;
    padding: .8rem;
    background: rgba(255,255,255,.98);
    border-bottom: 1px solid var(--line);
    display: none;
    flex-direction: column;
    align-items: stretch;
    z-index: 99;
  }
  .nav.open { display: flex; }
  .nav a { text-align: center; }
  .grid-2, .social-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-brand { justify-content: center; }
  .footer-meta { text-align: center; }
}
