:root {
  --brick: #9c2f1a;
  --brick-dark: #6e1f10;
  --clay: #c45a2c;
  --sand: #e8d5c4;
  --stone: #2c241e;
  --mist: #f6efe8;
  --ink: #1a1410;
  --line: rgba(44, 36, 30, 0.12);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(196, 90, 44, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(156, 47, 26, 0.12), transparent 50%),
    linear-gradient(180deg, #fbf7f2 0%, var(--mist) 40%, #efe4d8 100%);
  min-height: 100vh;
}

a { color: var(--brick); text-decoration: none; }
a:hover { color: var(--brick-dark); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(251, 247, 242, 0.88);
  border-bottom: 1px solid var(--line);
}
.nav-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--stone);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.brand img {
  height: 42px;
  width: auto;
  object-fit: contain;
}
.brand span { font-family: var(--font-display); font-size: 1.45rem; }
.nav-links { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; align-items: center; }
.nav-links a {
  color: var(--stone);
  font-size: 0.95rem;
  font-weight: 600;
}
.nav-links a:hover { color: var(--brick); }

.hero {
  position: relative;
  min-height: min(78vh, 720px);
  display: grid;
  place-items: end start;
  overflow: hidden;
  color: #fff;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(26, 20, 16, 0.72) 10%, rgba(156, 47, 26, 0.35) 55%, rgba(26, 20, 16, 0.55) 100%),
    url("../uploads/images/app3.jpg") center/cover no-repeat;
  transform: scale(1.02);
  animation: heroDrift 18s ease-in-out infinite alternate;
}
@keyframes heroDrift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.08) translate3d(-1.5%, -1%, 0); }
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 4rem 1.25rem 3.5rem;
}
.hero-logo {
  max-height: 88px;
  width: auto;
  margin-bottom: 1rem;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.35));
  animation: fadeUp .8s ease both;
}
.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.05;
  animation: fadeUp .9s ease .08s both;
}
.hero p {
  margin: 0.85rem 0 0;
  max-width: 36rem;
  font-size: 1.1rem;
  opacity: 0.92;
  animation: fadeUp 1s ease .16s both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3rem 1.25rem;
}
.section-head {
  margin-bottom: 1.75rem;
}
.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: var(--stone);
}
.section-head p {
  margin: 0.4rem 0 0;
  color: rgba(26, 20, 16, 0.72);
  max-width: 40rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.cat-tile {
  position: relative;
  display: block;
  min-height: 220px;
  overflow: hidden;
  border-radius: 4px;
  color: #fff;
  isolation: isolate;
  transition: transform .35s ease, box-shadow .35s ease;
  box-shadow: 0 10px 30px rgba(44, 36, 30, 0.12);
}
.cat-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(44, 36, 30, 0.18);
  color: #fff;
}
.cat-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
  z-index: -2;
}
.cat-tile:hover img { transform: scale(1.08); }
.cat-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(26,20,16,.15), rgba(26,20,16,.78));
  z-index: -1;
}
.cat-tile .label {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
}
.cat-tile .label strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
}
.cat-tile .label span {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.92rem;
  opacity: 0.9;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: rgba(26,20,16,.65);
}
.breadcrumb a { color: var(--brick-dark); }

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 0.5rem;
  color: var(--stone);
}
.page-desc { margin: 0 0 1.75rem; color: rgba(26,20,16,.7); max-width: 46rem; }

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
}
.media-grid a {
  display: block;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 3px;
  background: #ddd;
  box-shadow: 0 6px 18px rgba(44,36,30,.1);
}
.media-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.media-grid a:hover img { transform: scale(1.06); }

.doc-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: grid;
  gap: 0.65rem;
}
.doc-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  background: rgba(255,255,255,.65);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.doc-list .badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--brick);
  background: rgba(156,47,26,.1);
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
}
.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  background: var(--brick);
  color: #fff !important;
  padding: 0.65rem 1.1rem;
  border-radius: 3px;
  font-weight: 600;
  transition: background .2s ease;
}
.btn:hover { background: var(--brick-dark); }
.btn-ghost {
  background: transparent;
  color: var(--brick) !important;
  border: 1px solid rgba(156,47,26,.35);
}
.btn-ghost:hover { background: rgba(156,47,26,.08); }

.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  padding: 2rem 1.25rem;
  text-align: center;
  color: rgba(26,20,16,.65);
  font-size: 0.92rem;
}
.site-footer strong { color: var(--stone); }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10,8,6,.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}
.lightbox.open { display: flex; animation: fadeUp .25s ease; }
.lightbox img, .lightbox embed, .lightbox video {
  max-width: min(1100px, 96vw);
  max-height: 88vh;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.lightbox .close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  color: #fff;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
}

/* Admin */
.admin-body { background: #f3eee8; min-height: 100vh; }
.admin-nav {
  background: var(--stone);
  color: #fff;
  padding: 0.9rem 1.25rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.admin-nav a { color: #f5ebe1; font-weight: 600; }
.admin-nav .brand-admin { margin-right: auto; font-family: var(--font-display); font-size: 1.3rem; color: #fff; }
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.admin-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.7rem 0.5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: 0.82rem; text-transform: uppercase; letter-spacing: .04em; color: rgba(26,20,16,.55); }
.form-row { margin-bottom: 0.9rem; }
.form-row label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.form-row input[type=text],
.form-row input[type=password],
.form-row input[type=number],
.form-row select,
.form-row textarea {
  width: 100%;
  max-width: 520px;
  padding: 0.6rem 0.7rem;
  border: 1px solid #cdbbaa;
  border-radius: 3px;
  font: inherit;
}
.alert {
  padding: 0.8rem 1rem;
  border-radius: 3px;
  margin-bottom: 1rem;
}
.alert-ok { background: #e7f5ea; color: #1f5c2e; }
.alert-err { background: #fdecea; color: #8a1f11; }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  padding: 1.1rem;
  border-radius: 4px;
}
.stat strong { display: block; font-size: 1.8rem; color: var(--brick); font-family: var(--font-display); }
.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 2px; }

@media (max-width: 720px) {
  .nav-wrap { flex-direction: column; align-items: flex-start; }
  .hero { min-height: 62vh; }
  .doc-list li { flex-direction: column; align-items: flex-start; }
}
