:root {
  --peach: #f2c9b4;
  --teal: #7fb5ac;
  --sky: #a9d4d6;
  --navy: #24344a;
  --cream: #fdf6ee;
  --orange: #d7743f;
  --ink: #2b2620;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Georgia', 'Iowan Old Style', serif;
  background: linear-gradient(180deg, var(--cream) 0%, #fbeee0 100%);
  color: var(--ink);
}

.sunburst {
  background: repeating-conic-gradient(
    from 0deg,
    var(--peach) 0deg 10deg,
    var(--teal) 10deg 20deg
  );
  opacity: 0.15;
  position: fixed;
  inset: 0;
  z-index: -1;
}

header {
  text-align: center;
  padding: 3rem 1rem 2rem;
}

header img.logo {
  width: 220px;
  height: 220px;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.25));
}

h1 {
  font-size: 2rem;
  color: var(--navy);
  margin: 1rem 0 0.25rem;
  letter-spacing: 0.03em;
}

.tagline {
  color: var(--orange);
  font-style: italic;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  color: var(--cream);
  background: var(--navy);
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  transition: transform 0.15s ease, background 0.15s ease;
}

nav a:hover {
  background: var(--orange);
  transform: translateY(-2px);
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.card {
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(36,52,74,0.1);
  border-radius: 18px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 18px rgba(36,52,74,0.08);
}

footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  font-size: 0.85rem;
  color: var(--navy);
}

footer a {
  color: var(--orange);
  text-decoration: none;
}

footer a:hover { text-decoration: underline; }

/* Gallery page */
.upload-box {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.upload-box label {
  font-weight: bold;
  color: var(--navy);
}

.upload-box input[type="password"],
.upload-box input[type="file"] {
  padding: 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(36,52,74,0.25);
  background: white;
  font-family: inherit;
}

.upload-box button {
  align-self: flex-start;
  background: var(--orange);
  color: white;
  border: none;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.upload-box button:hover { background: #bd5f2c; }
.upload-box button:disabled { opacity: 0.6; cursor: not-allowed; }

#status {
  min-height: 1.4em;
  font-size: 0.9rem;
}

#status.ok { color: #2f6e4a; }
#status.err { color: #a3312a; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.8rem;
}

.grid figure {
  margin: 0;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #e9ddcf;
}

.grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  display: block;
  transition: transform 0.2s ease;
}

.grid img:hover { transform: scale(1.05); }

.grid .del {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(36,52,74,0.75);
  color: white;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1;
}

.empty-note {
  color: var(--navy);
  opacity: 0.7;
  font-style: italic;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20,16,10,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 2rem;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}

.lightbox .close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  color: white;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
}
