:root {
  --bg: #f6f4f0;
  --surface: #fbfaf8;
  --surface-2: #ffffff;
  --line: #e6e2db;
  --line-soft: #efebe5;
  --text: #2e2a27;
  --muted: #6c665f;
  --green: #71885b;
  --red: #c9364d;
  --shadow: 0 22px 60px rgba(34, 27, 20, 0.08);
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at left bottom, rgba(227, 177, 187, 0.14), transparent 28%),
    linear-gradient(180deg, #f7f5f1 0%, #f4f1ed 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; }

.container { width: min(calc(100% - 40px), var(--max)); margin: 0 auto; }
.narrow-wrap { width: min(calc(100% - 40px), 980px); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(216, 211, 203, 0.95);
  background: rgba(247, 245, 241, 0.88);
  backdrop-filter: blur(14px);
}
.header-inner {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.brand img,
.footer-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  background: transparent;
  border: 0;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}
.main-nav a {
  position: relative;
  padding: 10px 6px;
  color: #4f4942;
  font-size: 15px;
  transition: color .2s ease;
}
.main-nav a:hover,
.main-nav a.active { color: #1f1a17; }
.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 3px;
  height: 2px;
  border-radius: 999px;
  background: var(--red);
}
.main-nav .admin-pill {
  border: 1px solid #d7d1ca;
  border-radius: 999px;
  padding: 11px 20px;
  background: rgba(255,255,255,0.55);
}
.main-nav .admin-pill::after { display: none; }
.main-nav .active-pill { border-color: #cfc8c0; }
.menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 6px;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: #2c2723;
  margin: 5px 0;
}

.page-shell {
  position: relative;
  overflow: hidden;
}
.page-shell::before,
.page-shell::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: .32;
}
.page-shell::before {
  left: -50px;
  top: 170px;
  width: 260px;
  height: 280px;
  background: url('/assets/img/leaf-outline-left.svg') no-repeat center/contain;
}
.page-shell::after {
  right: -40px;
  bottom: 120px;
  width: 230px;
  height: 240px;
  background: url('/assets/img/leaf-outline-right.svg') no-repeat center/contain;
}

.page-section { padding: 74px 0 96px; }
.hero-wrap { position: relative; }
.hero-wrap::before {
  content: "";
  position: absolute;
  left: 36px;
  top: 26px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(170, 177, 155, 0.16);
}
.hero-panel,
.content-card {
  position: relative;
  border: 1px solid rgba(228, 223, 215, 0.96);
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}
.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: 40px;
  align-items: center;
  padding: 42px;
}
.hero-visual {
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: #ffffff;
  overflow: visible;
  box-shadow: none;
}
.hero-visual img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
}
.hero-content { padding-right: 8px; }
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .22em;
}
.section-label::before {
  content: "";
  width: 34px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}
.hero-content p,
.page-intro p,
.field span,
.message-text,
.message-meta a,
.empty-state,
.project-card p {
  color: var(--muted);
}
.hero-content .lead {
  margin-top: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 2.6vw, 30px);
  line-height: 1.48;
  color: #25211e;
}
.hero-content p {
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.85;
}
.hero-content p:last-child { margin-bottom: 0; }

.page-intro { margin-bottom: 30px; }
.page-intro h1 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.05;
}
.page-intro p {
  margin: 0;
  font-size: 17px;
  line-height: 1.8;
}
.contact-card,
.admin-login-card,
.password-card,
.messages-card { padding: 34px; }

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-grid {
  display: grid;
  gap: 16px;
}
.compact-form { gap: 14px; }
.field {
  display: grid;
  gap: 8px;
}
.field span {
  font-size: 14px;
  font-weight: 600;
}
input, textarea {
  width: 100%;
  border: 1px solid #ddd6ce;
  background: rgba(255,255,255,0.92);
  color: var(--text);
  border-radius: 16px;
  padding: 15px 16px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
textarea { resize: vertical; min-height: 180px; }
input:focus, textarea:focus {
  border-color: #bdb3a8;
  box-shadow: 0 0 0 4px rgba(113, 136, 91, 0.08);
}
.form-actions { display: flex; justify-content: flex-start; padding-top: 6px; }
.primary-btn,
.secondary-btn {
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease;
}
.primary-btn {
  background: #2f2a27;
  color: #fff;
  box-shadow: 0 12px 30px rgba(23, 20, 17, .14);
}
.primary-btn:hover,
.secondary-btn:hover { transform: translateY(-1px); }
.secondary-btn {
  background: #f1eee9;
  color: #3a3531;
  border: 1px solid #ddd6ce;
}
.danger-btn { color: #8f2034; }

.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.flash {
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 14px;
  border: 1px solid transparent;
}
.flash.success {
  background: rgba(114, 142, 96, .12);
  color: #4f6840;
  border-color: rgba(114, 142, 96, .22);
}
.flash.error {
  background: rgba(201, 56, 81, .09);
  color: #8b2940;
  border-color: rgba(201, 56, 81, .18);
}
.admin-flash { margin-bottom: 18px; }

.clean-grid,
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.project-card {
  display: block;
  padding: 28px;
  border-radius: 28px;
  border: 1px solid rgba(228, 223, 215, 0.96);
  background: rgba(251, 250, 248, 0.92);
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.project-card:hover {
  transform: translateY(-3px);
  border-color: #d7cfc6;
}
.card-number {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .18em;
}
.project-card h2 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
}
.project-card p { margin: 0 0 22px; line-height: 1.7; }
.card-link { color: #322d29; font-weight: 600; }

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr);
  gap: 20px;
  align-items: start;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.card-head.small-gap { margin-bottom: 12px; }
.card-head h1,
.card-head h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
}
.card-head h1 { font-size: 40px; }
.card-head h2 { font-size: 30px; }
.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 13px;
  padding: 9px 14px;
  border: 1px solid #ddd6ce;
  background: rgba(255,255,255,.8);
  color: #5b564f;
}
.messages-list { display: grid; gap: 16px; }
.message-card {
  padding: 18px;
  border: 1px solid #e3ddd6;
  border-radius: 20px;
  background: rgba(255,255,255,.78);
}
.message-card.unread {
  border-color: rgba(201, 56, 81, .28);
  box-shadow: inset 0 0 0 1px rgba(201, 56, 81, .05);
}
.message-top,
.message-actions,
.message-meta {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.message-top strong { display: block; font-size: 18px; margin-bottom: 4px; }
.message-top span,
.message-meta a { font-size: 14px; }
.message-meta { margin: 12px 0 14px; justify-content: flex-start; }
.message-meta a { color: #5f594f; }
.message-text { line-height: 1.8; }
.empty-state {
  padding: 16px 0 6px;
  font-size: 16px;
}
.logout-link {
  white-space: nowrap;
  color: #5d5952;
  font-size: 14px;
  padding-top: 8px;
}

.site-footer {
  border-top: 1px solid rgba(216, 211, 203, 0.95);
  padding: 26px 0 34px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}
.site-footer span { color: #7a746c; font-size: 14px; }

@media (max-width: 1080px) {
  .hero-panel { grid-template-columns: 1fr; gap: 28px; }
  .hero-content { padding-right: 0; }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .main-nav {
    position: absolute;
    top: calc(100% + 12px);
    right: 20px;
    left: 20px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 16px;
    border-radius: 24px;
    border: 1px solid #e2ddd6;
    background: rgba(250,248,244,.98);
    box-shadow: 0 18px 40px rgba(29, 24, 20, 0.08);
  }
  .main-nav.is-open { display: flex; }
  .main-nav a,
  .main-nav .admin-pill {
    width: 100%;
    border-radius: 14px;
    padding: 13px 14px;
  }
  .main-nav a.active::after { left: 14px; right: 14px; bottom: 8px; }
  .main-nav .admin-pill { text-align: left; }
  .field-row,
  .project-grid,
  .clean-grid { grid-template-columns: 1fr; }
  .hero-panel { padding: 22px; border-radius: 28px; }
  .hero-visual { min-height: auto; }
  .hero-visual img { max-height: none; }
  .contact-card,
  .admin-login-card,
  .password-card,
  .messages-card { padding: 22px; }
  .card-head,
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 520px) {
  .container, .narrow-wrap { width: min(calc(100% - 24px), var(--max)); }
  .header-inner { min-height: 74px; }
  .brand { font-size: 22px; gap: 10px; }
  .brand img, .footer-brand img { width: 30px; height: 30px; }
  .page-shell::before,
  .page-shell::after { opacity: .18; }
  .page-section { padding: 42px 0 68px; }
  .hero-wrap::before { width: 160px; height: 160px; left: 12px; top: 24px; }
  .hero-panel { gap: 20px; }
  .hero-content .lead { font-size: 27px; }
  .hero-content p, .page-intro p { font-size: 15px; line-height: 1.75; }
  .page-intro h1 { font-size: 34px; }
  .card-head h1 { font-size: 32px; }
  .card-head h2 { font-size: 26px; }
  .project-card h2 { font-size: 26px; }
}

.required-mark { color: var(--red); font-weight: 700; margin-left: 2px; }
