:root {
  --sky: #dff6ff;
  --blue: #76c7e8;
  --green: #6fbd45;
  --leaf: #2f7d3c;
  --button-yellow: #ffd84d;
  --button-yellow-dark: #d49a00;
  --purple: #8f61ff;
  --deep-blue: #3478ff;
  --light-blue: #8fe8ff;
  --yellow: #ffdc5f;
  --pink: #f57ac1;
  --ink: #1f3524;
  --paper: #ffffff;
  --soft: #f7fff3;
  --shadow: 0 18px 45px rgba(31, 53, 36, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 220, 95, 0.34), transparent 26%),
    linear-gradient(180deg, var(--sky), #f3fff6 72%);
}

a {
  color: inherit;
}

.site-shell {
  min-height: 100vh;
  padding: 24px 24px 24px 220px;
}

.topbar {
  position: fixed;
  top: 150px;
  left: max(28px, calc((100vw - 1120px) / 2 - 160px));
  z-index: 10;
  width: 148px;
  display: grid;
  gap: 14px;
}

.brand {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.15;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav a,
.button,
.edit-panel button {
  border: 2px solid var(--button-yellow-dark);
  border-radius: 999px;
  background: var(--button-yellow);
  color: #573b00;
  font-weight: 800;
  text-decoration: none;
  padding: 10px 18px;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(150, 101, 0, 0.2);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  text-align: center;
}

.nav a:hover,
.button:hover,
.edit-panel button:hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 0 rgba(150, 101, 0, 0.16);
}

.nav a[aria-current="page"],
.button.primary,
.edit-panel button.primary {
  background: var(--button-yellow-dark);
  color: white;
}

.hero,
.page-header,
.content-section {
  max-width: 1120px;
  margin: 0 auto;
}

.hero-title,
.page-title {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(143, 232, 255, 0.95), transparent 28%),
    radial-gradient(circle at 78% 28%, rgba(143, 97, 255, 0.9), transparent 32%),
    radial-gradient(circle at 48% 82%, rgba(52, 120, 255, 0.88), transparent 36%),
    linear-gradient(135deg, var(--purple), var(--deep-blue), var(--light-blue));
  background-size: 170% 170%;
  color: white;
  border: 3px solid var(--deep-blue);
  border-radius: 8px;
  padding: 34px 28px;
  text-align: center;
  box-shadow: var(--shadow);
}

.hero-title::before,
.page-title::before {
  content: "";
  position: absolute;
  inset: -45%;
  background:
    conic-gradient(from 0deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.34), rgba(143, 97, 255, 0.18), rgba(143, 232, 255, 0.34), rgba(255, 255, 255, 0.04));
  animation: swirl 12s linear infinite;
}

.hero-title h1,
.page-title h1 {
  position: relative;
  z-index: 1;
  text-shadow: 0 3px 12px rgba(31, 53, 36, 0.28);
}

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  line-height: 0.95;
}

.subtitle-strip {
  margin: 16px auto 28px;
  background:
    linear-gradient(100deg, var(--purple), var(--deep-blue), var(--light-blue), var(--purple));
  background-size: 220% 220%;
  color: white;
  border-radius: 999px;
  padding: 13px 24px;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(280px, 1fr);
  gap: 28px;
  align-items: stretch;
}

.intro-card,
.photo-frame,
.gallery-card,
.about-card,
.edit-panel,
.upload-panel {
  background: var(--paper);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.intro-card,
.about-card,
.edit-panel,
.upload-panel {
  padding: 26px;
}

.intro-card {
  border-left: 10px solid var(--yellow);
}

.hero .intro-card {
  display: flex;
  min-height: 420px;
  flex-direction: column;
  justify-content: center;
  padding: 42px;
}

.intro-card h2,
.about-card h2 {
  margin-top: 0;
  font-size: 2rem;
}

.hero .intro-card h2 {
  color: var(--deep-blue);
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  line-height: 1;
  margin-bottom: 18px;
}

.intro-card p,
.about-card p,
.caption p {
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero .intro-card p {
  color: #173d86;
  font-size: clamp(1.28rem, 2.2vw, 1.75rem);
  font-weight: 800;
  line-height: 1.45;
  margin: 0 0 18px;
}

.photo-frame {
  overflow: hidden;
  min-height: 420px;
  border: 8px solid var(--paper);
}

.photo-frame img,
.gallery-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 22px;
  margin: 26px auto 0;
}

.gallery-card {
  overflow: hidden;
  border-bottom: 6px solid var(--pink);
}

.image-wrap {
  position: relative;
  overflow: hidden;
}

.image-wrap img {
  aspect-ratio: 4 / 5;
  height: auto;
}

.download-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(31, 53, 36, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  color: #573b00;
  font-size: 0.72rem;
  font-weight: 900;
  text-decoration: none;
  opacity: 0.72;
  box-shadow: 0 5px 14px rgba(31, 53, 36, 0.12);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease, background 160ms ease;
}

.download-button:hover {
  transform: translateY(-2px) scale(1.04);
  opacity: 1;
  background: var(--button-yellow);
  box-shadow: 0 8px 18px rgba(31, 53, 36, 0.18);
}

.caption {
  padding: 18px;
}

.caption h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.caption dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 10px;
}

.caption dt {
  font-weight: 800;
  color: var(--leaf);
}

.caption dd {
  margin: 0;
}

.caption label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-weight: 800;
  color: var(--leaf);
}

.caption input,
.caption textarea,
.edit-panel input {
  width: 100%;
  border: 2px solid #b9dfaa;
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  color: var(--ink);
}

.caption textarea {
  min-height: 92px;
  resize: vertical;
}

.edit-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 22px;
}

.upload-panel {
  margin-top: 22px;
}

.upload-panel h2 {
  margin: 0 0 16px;
  font-size: 1.5rem;
}

.upload-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.upload-form label {
  display: grid;
  gap: 6px;
  font-weight: 800;
  color: var(--leaf);
}

.upload-form .wide {
  grid-column: 1 / -1;
}

.upload-form input,
.upload-form textarea {
  width: 100%;
  border: 2px solid #b9dfaa;
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  color: var(--ink);
}

.upload-form textarea {
  min-height: 92px;
  resize: vertical;
}

.edit-panel input {
  max-width: 220px;
}

.status {
  font-weight: 800;
  color: var(--leaf);
}

@media (prefers-reduced-motion: no-preference) {
  .hero-title,
  .page-title,
  .intro-card,
  .photo-frame,
  .gallery-card,
  .about-card {
    animation: rise-in 520ms ease both;
  }

  .hero-title,
  .page-title,
  .subtitle-strip {
    animation-name: rise-in, color-drift;
    animation-duration: 520ms, 8s;
    animation-timing-function: ease, ease-in-out;
    animation-iteration-count: 1, infinite;
    animation-direction: normal, alternate;
  }

  .photo-frame img,
  .gallery-card img {
    transition: transform 240ms ease;
  }

  .photo-frame:hover img,
  .gallery-card:hover img {
    transform: scale(1.025);
  }
}

@keyframes swirl {
  from {
    transform: rotate(0deg) scale(1);
  }
  to {
    transform: rotate(360deg) scale(1.08);
  }
}

@keyframes color-drift {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 100% 50%;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .site-shell {
    padding: 16px;
  }

  .topbar {
    position: static;
    width: auto;
    align-items: flex-start;
  }

  .nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .upload-form {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .photo-frame {
    min-height: 320px;
  }

  .subtitle-strip {
    border-radius: 8px;
    font-size: 1.05rem;
  }
}
