:root {
  --bg: #f7f2ec;
  --paper: rgba(255, 255, 255, 0.82);
  --card: #ffffff;
  --text: #2e2622;
  --muted: #75675f;
  --accent: #b97965;
  --accent-dark: #8d5c4b;
  --border: rgba(80, 56, 46, 0.12);
  --shadow: 0 18px 50px rgba(74, 46, 33, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.65), transparent 30%),
    linear-gradient(135deg, #f6efe7, #eadfd2, #ddd0c4);
  min-height: 100vh;
}

a { color: inherit; }
button, input { font: inherit; }

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  background: rgba(247, 242, 236, 0.72);
  border-bottom: 1px solid var(--border);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  line-height: 1.05;
}

.brand-main {
  font-size: 22px;
  font-weight: 700;
}

.brand-sub {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-dark);
}

.burger {
  display: none;
  border: none;
  background: transparent;
  font-size: 28px;
  cursor: pointer;
}

.menu {
  display: flex;
  align-items: center;
  gap: 18px;
}

.menu a,
.link-button {
  text-decoration: none;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.inline-form { margin: 0; }
.page-content { padding: 36px 0 64px; }

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 28px;
  align-items: stretch;
}

.hero-card,
.stat-card,
.photo-card,
.upload-panel,
.admin-card,
.empty-state {
  background: var(--paper);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 24px;
}

.hero-card {
  padding: 40px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 700;
}

h1, h2 { margin: 0 0 12px; }
.hero h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.03; }
.hero-text, .section-text, .upload-hint, .stat-label, .page-indicator { color: var(--muted); }
.hero-text, .section-text { font-size: 18px; max-width: 760px; }

.hero-home { align-items: start; }

.hero-welcome {
  padding: 48px;
}

.hero-names {
  font-family: Georgia, serif;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
  margin-bottom: 16px;
}

.hero-names span {
  color: var(--accent);
}

.hero-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.hero-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.68);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

.main-btn,
.secondary-btn,
.delete-btn,
.like-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: 0.2s ease;
}

.main-btn {
  background: var(--accent);
  color: white;
}
.main-btn:hover { background: var(--accent-dark); }

.secondary-btn {
  background: transparent;
  border-color: var(--border);
}
.secondary-btn:hover { background: rgba(255,255,255,0.65); }

.stats-grid {
  display: grid;
  gap: 18px;
}
.stat-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stat-value {
  font-size: clamp(32px, 4vw, 50px);
  font-weight: 700;
  margin-bottom: 6px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}
.upload-panel {
  padding: 22px;
  min-width: 290px;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.toolbar-chip {
  background: rgba(255,255,255,0.62);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
}

.grid.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.photo-card {
  padding: 12px;
}

.image-button {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: none;
  padding: 0;
  background: #f0e7df;
  border-radius: 18px;
  overflow: hidden;
  cursor: zoom-in;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
}

.like-btn {
  background: rgba(185, 121, 101, 0.12);
  color: var(--accent-dark);
}
.like-btn.liked { background: var(--accent); color: white; }
.delete-btn { background: #2e2622; color: white; }

.flash-wrap { display: grid; gap: 10px; margin-bottom: 18px; }
.flash {
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.7);
}
.flash-success { border-color: rgba(62, 154, 104, 0.2); }
.flash-error { border-color: rgba(184, 77, 77, 0.2); }

.empty-state, .admin-card { padding: 32px; text-align: center; }
.admin-wrap { display: flex; justify-content: center; }
.admin-card { width: min(100%, 460px); }
.admin-form { display: grid; gap: 12px; margin-top: 20px; }
.admin-form input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.72);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: rgba(20, 14, 12, 0.88);
  padding: 20px;
  z-index: 100;
}
.modal.show { display: flex; }
.modal img {
  max-width: min(92vw, 1200px);
  max-height: 82vh;
  border-radius: 18px;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
}
#modal-caption { color: white; margin: 0; }

@media (max-width: 860px) {
  .brand-main { font-size: 18px; }
  .brand-sub { font-size: 11px; letter-spacing: 0.12em; }
  .hero-welcome { padding: 32px; }
  .hero,
  .section-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .burger { display: block; }
  .menu {
    display: none;
    position: absolute;
    right: 16px;
    top: 62px;
    background: rgba(255,255,255,0.96);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: flex-start;
  }
  .menu.show { display: flex; }
}


.toolbar-link { text-decoration: none; }
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.video-card { padding: 12px; }
.video-frame {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 18px;
  background: #efe5dd;
}
.video-frame video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}
.file-name {
  padding: 12px 4px 0;
  color: var(--muted);
  font-size: 14px;
  word-break: break-word;
}
