:root {
  --background: #f7efe9;
  --surface: #fdf8f4;
  --surface-strong: #fffdfb;
  --ink: #2e241f;
  --muted: #7d6556;
  --accent: #f97316;
  --accent-deep: #d75d0a;
  --accent-soft: #f8c38f;
  --line: rgba(46, 36, 31, 0.12);
  --shadow: 0 22px 50px rgba(46, 36, 31, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(249, 115, 22, 0.18), transparent 28%),
    linear-gradient(180deg, #f8f1eb 0%, #f7efe9 100%);
}

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

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

button,
input,
textarea {
  font: inherit;
}

.site-header,
.site-footer,
.hero,
.section,
.admin-shell {
  width: min(1120px, calc(100vw - 2rem));
  margin: 0 auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
}

.brand-mark {
  font-family: "Lobster", cursive;
  font-size: 2.2rem;
  line-height: 1;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  gap: 1rem;
  color: var(--muted);
}

.hero {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 2rem;
  align-items: center;
  padding: 2rem 0 4rem;
}

.hero-copy h1,
.admin-panel h1 {
  margin: 0;
}

.section-heading h2,
.admin-panel h1 {
  margin: 0;
  line-height: 1.05;
}

.hero-copy h1 {
  font-family: "Oswald", sans-serif;
  font-size: clamp(2.4rem, 5.8vw, 4.2rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: 0.02em;
  max-width: 13ch;
  text-wrap: balance;
}

.section-heading h2 {
  font-family: "Oswald", sans-serif;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-wrap: balance;
}

.admin-panel h1 {
  font-family: "Gloock", serif;
  font-weight: 400;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent-deep);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero-text,
.section-text,
.story-card p,
.gallery-description,
.gallery-details,
.site-footer {
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 0 1.15rem;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.button:hover,
.gallery-button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  color: #fff;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.55);
  border-color: var(--line);
}

.button-danger {
  background: #241914;
  color: #fff;
}

.hero-art {
  position: relative;
  border-radius: 2rem;
  padding: 0.5rem 0 1.5rem;
}

.hero-art::after {
  content: "";
  position: absolute;
  left: 9%;
  right: 9%;
  bottom: 0.2rem;
  height: 58px;
  border-radius: 999px;
  background: rgba(46, 36, 31, 0.16);
  filter: blur(28px);
  z-index: -1;
  pointer-events: none;
}

.hero-art img {
  width: 100%;
  filter: drop-shadow(0 28px 30px rgba(46, 36, 31, 0.18));
}

.section {
  padding: 3rem 0;
}

.section-accent {
  position: relative;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  margin-bottom: 1.75rem;
}

.section-heading h2,
.admin-panel h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.gallery-controls {
  display: flex;
  gap: 0.75rem;
}

.gallery-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.gallery-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.2rem 0 1.5rem;
  scroll-snap-type: x proximity;
}

.gallery-track::-webkit-scrollbar {
  height: 10px;
}

.gallery-track::-webkit-scrollbar-thumb {
  background: rgba(46, 36, 31, 0.18);
  border-radius: 999px;
}

.gallery-card {
  position: relative;
  flex: 0 0 min(360px, calc(100vw - 3rem));
  scroll-snap-align: start;
  background: var(--surface-strong);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 18px 34px rgba(46, 36, 31, 0.1);
}

.gallery-card::after {
  display: none;
}

.gallery-card-empty {
  display: flex;
  align-items: center;
  min-height: 220px;
}

.gallery-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: linear-gradient(135deg, #f8e6d5, #f4d7bc);
  border-radius: 1.5rem 1.5rem 0 0;
}

.gallery-card-body {
  padding: 1.15rem;
  background: var(--surface-strong);
}

.gallery-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.gallery-title,
.story-card h3 {
  margin: 0;
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.story-card,
.admin-panel,
.admin-item,
.admin-empty-state {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 1.5rem;
  box-shadow: var(--shadow);
}

.story-card {
  padding: 1.4rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 0 3rem;
}

.admin-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.admin-shell {
  padding: 2rem 0;
}

.admin-panel {
  padding: 1.5rem;
}

.stack-form,
.admin-item-form {
  display: grid;
  gap: 1rem;
}

.form-grid,
.admin-toolbar,
.admin-item {
  display: grid;
  gap: 1rem;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.78);
}

textarea {
  resize: vertical;
}

.hidden {
  display: none;
}

.admin-toolbar {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 1.5rem;
}

.admin-toolbar-actions,
.admin-item-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.upload-form {
  margin-bottom: 1.5rem;
}

.admin-list {
  display: grid;
  gap: 1rem;
}

.admin-item {
  grid-template-columns: 220px 1fr;
  padding: 1rem;
}

.admin-item-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 1rem;
  background: linear-gradient(135deg, #f8e6d5, #f4d7bc);
}

.admin-empty-state {
  padding: 1.25rem;
  color: var(--muted);
}

@media (max-width: 860px) {
  .hero,
  .story-grid,
  .admin-item,
  .form-grid,
  .admin-toolbar,
  .section-heading,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 1rem;
  }

  .hero-art {
    order: -1;
  }

  .site-header,
  .site-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-heading {
    align-items: start;
  }

  .hero-copy h1,
  .section-heading h2 {
    max-width: none;
  }
}
