/* =========================================================
   Портфолио LM — палитра с оригинального Tilda-сайта
   Серо-голубой градиент, бежевый акцент, тёмный футер
   ========================================================= */

:root {
  --ink: #333333;
  --ink-soft: #4f514c;
  --muted: #686a68;
  --line: #e0e0e0;
  --paper: #f7f6f4;
  --white: #ffffff;
  --blue-soft: #9cbaed;
  --gray-mid: #686a68;
  --beige: #cdc0af;
  --beige-light: #e4e5e8;
  --green-accent: #5a8c3c;
  --footer: #000000;
  --footer-text: #949494;
  --shadow: 0 5px 7px rgba(51, 51, 51, 0.12);
  --shadow-hover: 0 14px 28px rgba(0, 11, 48, 0.18);
  --radius: 18px;
  --font-display: "Montserrat", Arial, sans-serif;
  --font-body: "Manrope", Georgia, system-ui, sans-serif;
  --grad-primary: linear-gradient(180deg, rgba(104, 106, 104, 1) 0%, rgba(156, 186, 237, 1) 100%);
  --grad-secondary: linear-gradient(180deg, rgba(205, 192, 175, 1) 0%, rgba(228, 229, 232, 1) 100%);
  --grad-hero: linear-gradient(135deg, #f3f1ed 0%, #e8eef8 45%, #dfe8f6 100%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ----- Nav ----- */
.site-nav {
  background: rgba(247, 246, 244, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(104, 106, 104, 0.12);
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 600;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--ink);
}

.nav-link {
  color: var(--muted) !important;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.45rem 0.85rem !important;
  transition: color 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--ink) !important;
}

/* Кнопки меню: серо-голубой градиент — контраст к бежевой «Заявка» */
.nav-link.nav-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff !important;
  background-image: var(--grad-primary);
  border-radius: 65px;
  padding: 0.45rem 1.15rem !important;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow);
  isolation: isolate;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    color 0.3s ease,
    background-image 0.3s ease;
}

.nav-link.nav-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: var(--grad-secondary);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
}

.nav-link.nav-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 255, 255, 0.45),
    transparent
  );
  transform: skewX(-20deg);
  z-index: 1;
  pointer-events: none;
}

.nav-link.nav-btn:hover,
.nav-link.nav-btn:focus-visible {
  color: var(--ink-soft) !important;
  transform: translateY(-3px) scale(1.03);
  box-shadow: var(--shadow-hover);
}

.nav-link.nav-btn:hover::before,
.nav-link.nav-btn:focus-visible::before {
  opacity: 1;
}

.nav-link.nav-btn:hover::after,
.nav-link.nav-btn:focus-visible::after {
  animation: nav-shine 0.65s ease forwards;
}

.nav-link.nav-btn.active {
  color: #fff !important;
  box-shadow: 0 0 0 2px rgba(156, 186, 237, 0.55), var(--shadow);
  transform: translateY(-1px);
}

.nav-link.nav-btn.active:hover {
  color: var(--ink-soft) !important;
}

.nav-link.nav-btn:active {
  transform: translateY(0) scale(0.98);
}

@keyframes nav-shine {
  from {
    left: -100%;
  }
  to {
    left: 140%;
  }
}

.btn-nav {
  background-image: var(--grad-secondary);
  color: var(--muted) !important;
  border-radius: 65px;
  padding: 0.45rem 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, color 0.3s ease, background-image 0.3s ease;
}

.btn-nav:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: var(--shadow-hover);
  color: #fff !important;
  background-image: var(--grad-primary);
}

.navbar-toggler {
  border: 1px solid rgba(104, 106, 104, 0.25);
}

.flash-wrap {
  padding-top: 1rem;
}

/* ----- Buttons ----- */
.btn-primary-grad,
.btn-secondary-grad {
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: 65px;
  padding: 0.85rem 1.7rem;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.08em;
  font-weight: 500;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
  z-index: 1;
}

.btn-primary-grad {
  color: #fff !important;
  background-image: var(--grad-primary);
}

.btn-secondary-grad {
  color: var(--muted) !important;
  background-image: var(--grad-secondary);
}

.btn-primary-grad:hover,
.btn-secondary-grad:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.btn-primary-grad:hover {
  color: var(--ink-soft) !important;
  background-image: var(--grad-secondary);
}

.btn-secondary-grad:hover {
  color: #fff !important;
  background-image: var(--grad-primary);
}

.btn-link-more {
  color: var(--ink);
  font-weight: 600;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: gap 0.25s ease, color 0.25s ease;
}

.btn-link-more:hover {
  gap: 0.75rem;
  color: #4a6fa5;
}

/* ----- Hero ----- */
.hero {
  position: relative;
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 4.5rem 0 5rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 85% 20%, rgba(156, 186, 237, 0.45), transparent 60%),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(205, 192, 175, 0.35), transparent 55%),
    var(--grad-hero);
  z-index: 0;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(104, 106, 104, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(104, 106, 104, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

.hero-eyebrow,
.page-hero .hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
  font-weight: 600;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6.5vw, 4.4rem);
  font-weight: 600;
  line-height: 1.05;
  margin-bottom: 1.1rem;
  color: var(--ink);
  max-width: none;
}

.hero-name-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  transition: color 0.25s ease, transform 0.25s ease;
}

.hero-name-link:hover,
.hero-name-link:focus-visible {
  color: #4a6fa5;
  outline: none;
  transform: translateY(-2px);
}

.hero-name-hint {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hero-name-hint::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  margin-bottom: 0.05rem;
}

.hero-lead {
  font-size: clamp(1.05rem, 2.2vw, 1.28rem);
  color: var(--ink-soft);
  max-width: 38rem;
  margin-bottom: 0.85rem;
}

.hero-sub {
  color: var(--muted);
  max-width: 36rem;
  margin-bottom: 1rem;
}

.hero-result {
  max-width: 40rem;
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(104, 106, 104, 0.12);
  box-shadow: var(--shadow);
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.hero-result strong {
  color: var(--ink);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.about-page-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid rgba(104, 106, 104, 0.1);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.about-more-text {
  color: var(--muted);
  margin: 0;
  line-height: 1.7;
  font-size: 1.05rem;
}

.niche-text {
  font-size: 1.08rem;
  color: var(--ink-soft);
  line-height: 1.7;
  margin: 0;
}

.benefits-section {
  background: linear-gradient(180deg, #eef2f8 0%, var(--paper) 100%);
}

.benefit-card {
  height: 100%;
  padding: 1.6rem 1.5rem;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid rgba(104, 106, 104, 0.1);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.benefit-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.benefit-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: #fff;
  background-image: var(--grad-primary);
  font-size: 1.25rem;
}

.benefit-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 0.55rem;
}

.benefit-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

/* ----- Sections ----- */
.section {
  padding: 5rem 0;
}

.section-title,
.page-title {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin-bottom: 0.5rem;
}

.section-lead,
.page-lead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 34rem;
}

.section-head {
  margin-bottom: 2.75rem;
}

.page-hero {
  padding: 3.5rem 0 2rem;
  background: var(--grad-hero);
  border-bottom: 1px solid rgba(104, 106, 104, 0.08);
}

.page-title {
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  margin-bottom: 0.75rem;
}

/* ----- About ----- */
.about-section {
  background: var(--white);
}

.about-grid {
  display: grid;
  gap: 1.1rem;
}

.about-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid rgba(104, 106, 104, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.about-item i {
  font-size: 1.45rem;
  color: #6f8fc4;
  margin-top: 0.15rem;
}

.about-item h3 {
  font-size: 1.05rem;
  margin: 0 0 0.25rem;
  font-weight: 700;
}

.about-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ----- Case cards ----- */
.cases-preview {
  background: linear-gradient(180deg, var(--paper), #eef2f8);
}

.case-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(104, 106, 104, 0.1);
  box-shadow: var(--shadow);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  display: flex;
  flex-direction: column;
}

.case-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.case-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #e8eef6;
}

.case-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.case-card:hover .case-card-media img {
  transform: scale(1.05);
}

.case-tag {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.page-hero .case-tag,
.case-tag.d-inline-block {
  position: static;
}

.case-card-body {
  padding: 1.35rem 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.case-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  margin-bottom: 0.55rem;
  line-height: 1.2;
}

.case-card-text {
  color: var(--muted);
  flex: 1;
  margin-bottom: 1rem;
}

.meta-chip {
  font-size: 0.85rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ----- CTA ----- */
.cta-section {
  padding-top: 1rem;
}

.cta-box {
  text-align: center;
  padding: 3.5rem 2rem;
  border-radius: 28px;
  background-image: var(--grad-primary);
  color: #fff;
  box-shadow: var(--shadow-hover);
}

.cta-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 0.75rem;
}

.cta-text {
  opacity: 0.92;
  max-width: 32rem;
  margin: 0 auto 1.75rem;
}

.cta-box .btn-primary-grad {
  background-image: var(--grad-secondary);
  color: var(--ink-soft) !important;
}

.cta-box .btn-primary-grad:hover {
  background-image: linear-gradient(180deg, #fff, #e4e5e8);
  color: var(--ink) !important;
}

/* ----- Case detail ----- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--ink);
}

.detail-media {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(104, 106, 104, 0.1);
  background: #e8eef4;
}

.detail-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  display: block;
  background: #e8eef4;
}

.case-gallery {
  margin-bottom: 2.5rem;
}

.case-gallery-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  margin-bottom: 1rem;
}

.case-shot {
  margin: 0;
  background: var(--white);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(104, 106, 104, 0.14);
  box-shadow: var(--shadow);
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.case-shot:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.case-shot a {
  display: block;
  background: #e8eef4;
}

.case-shot img {
  width: 100%;
  min-height: 220px;
  max-height: 360px;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  display: block;
  background: #e8eef4;
}

.case-shot figcaption {
  padding: 0.75rem 0.9rem 0.95rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
}

.detail-block {
  margin-bottom: 1.75rem;
}

.detail-block h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.65rem;
  margin-bottom: 0.6rem;
}

.detail-block p {
  color: var(--ink-soft);
}

.detail-aside {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid rgba(104, 106, 104, 0.1);
  box-shadow: var(--shadow);
  position: sticky;
  top: 90px;
}

.aside-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.aside-row span {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.aside-features-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  margin: 1.25rem 0 0.75rem;
}

.aside-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.aside-features li {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin-bottom: 0.55rem;
  color: var(--ink-soft);
}

.aside-features i {
  color: var(--green-accent);
  margin-top: 0.15rem;
}

/* ----- Contact form ----- */
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid rgba(104, 106, 104, 0.1);
  box-shadow: var(--shadow);
}

.form-label {
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}

.form-control {
  border-radius: 12px;
  border: 1px solid rgba(104, 106, 104, 0.25);
  padding: 0.75rem 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  border-color: var(--blue-soft);
  box-shadow: 0 0 0 0.2rem rgba(156, 186, 237, 0.35);
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
}

.msg-preview {
  max-width: 260px;
  white-space: normal;
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* ----- Footer ----- */
.site-footer {
  background: var(--footer);
  color: var(--footer-text);
  padding: 2.75rem 0 2rem;
  margin-top: auto;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 600;
  color: #fff;
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.footer-text {
  color: var(--footer-text);
  font-size: 0.92rem;
}

.footer-link {
  color: #cfcfcf;
  margin-left: 1.1rem;
  font-size: 0.92rem;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #fff;
}

.footer-hr {
  border-color: rgba(255, 255, 255, 0.12);
  margin: 1.5rem 0 1rem;
}

.footer-copy {
  font-size: 0.8rem;
  color: #777;
}

/* ----- Admin ----- */
.admin-auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-hero);
  padding: 1.5rem;
}

.admin-auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-hover);
  border: 1px solid rgba(104, 106, 104, 0.1);
}

.admin-auth-badge {
  margin: 0.5rem 0 1rem;
}

.admin-auth-badge img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  box-shadow: var(--shadow);
  display: block;
}

.admin-auth-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.admin-auth-sub {
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.admin-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.admin-body {
  background: #f0f1f3;
  min-height: 100vh;
}

.admin-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 1.25rem 0;
}

.admin-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.85rem;
}

.admin-sub {
  color: var(--muted);
  font-size: 0.92rem;
}

.admin-table-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid rgba(104, 106, 104, 0.1);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.admin-table thead {
  background: #f5f5f5;
}

.admin-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}

.row-unread {
  background: rgba(156, 186, 237, 0.12);
  font-weight: 600;
}

.badge-unread {
  background: var(--grad-primary);
  color: #fff;
}

.badge-read {
  background: var(--beige-light);
  color: var(--muted);
}

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}

.empty-state i {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.75rem;
}

/* ----- Animations ----- */
.animate-fade-up {
  opacity: 0;
  transform: translateY(22px);
  animation: fadeUp 0.8s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.35s; }
.delay-4 { animation-delay: 0.5s; }

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

/* ----- Responsive ----- */
@media (max-width: 991.98px) {
  .hero {
    min-height: auto;
    padding: 3.5rem 0 4rem;
  }

  .detail-aside {
    position: static;
  }

  .footer-link {
    margin-left: 0;
    margin-right: 1rem;
  }
}

@media (max-width: 575.98px) {
  .section {
    padding: 3.5rem 0;
  }

  .form-card,
  .admin-auth-card {
    padding: 1.35rem;
  }

  .cta-box {
    padding: 2.5rem 1.25rem;
  }

  .brand-text {
    font-size: 1.05rem;
  }
}
