:root {
  --max-width: 900px;
  --gap: 1rem;
  --bg: #fafafa;
  --card: #fff;
  --muted: #6b7280;
  --accent: #2563eb;
  --text: #111827;
  --radius: 8px;
  --shadow: 0 6px 18px rgba(0,0,0,0.06);
}

@media (prefers-color-scheme: dark) {
  :root.dark-mode {
    --bg: #111827;
    --card: #1f2937;
    --muted: #9ca3af;
    --text: #f3f4f6;
  }
}

* { box-sizing: border-box; }

body {
  font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  transition: background 0.3s, color 0.3s;
}

header {
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 1rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

header .container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
}

header nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

header a {
  font-weight: 500;
  font-size: 0.95rem;
}

.dark-toggle {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.dark-toggle:hover { filter: brightness(0.95); }

main {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 2rem auto;
  padding: 0 1rem;
}

footer {
  background: var(--card);
  border-top: 1px solid rgba(0,0,0,0.05);
  padding: 2rem 1rem;
  margin-top: 3rem;
  box-shadow: 0 -6px 18px rgba(0,0,0,0.06);
}

footer .container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  text-align: center;
}

footer p { margin: 0.5rem 0; }

footer a { font-weight: 500; }

h1 { margin-top: 0; }

form {
  display: grid;
  gap: 0.75rem;
  background: var(--card);
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

input[type="file"],
input[type="number"],
input[type="checkbox"] {
  font-size: 1rem;
}

label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; }

button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
button:hover { filter: brightness(0.95); }

#result { margin-top: 1rem; }

#result img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  display: block;
}

.gallery-link {
  display: inline-block;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  margin-top: 1rem;
  transition: filter 0.2s;
}

.gallery-link:hover {
  filter: brightness(0.95);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

#gallery {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
}

.entry {
  background: var(--card);
  padding: 0.75rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.entry .thumbs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.entry img {
  width: calc(50% - 0.25rem);
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.04);
}

.entry .meta {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  word-break: break-all;
}

.contact-section {
  background: var(--card);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.contact-section h2 { margin-top: 0; }

.contact-section a {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  text-decoration: none;
  margin: 0.5rem 0;
}

.contact-section a:hover { filter: brightness(0.95); }

@media (max-width: 520px) {
  .entry img { width: 100%; }
  form { padding: 0.75rem; }
  header .container { flex-direction: column; gap: 1rem; }
  header nav { flex-direction: column; width: 100%; gap: 1rem; }
  footer .container { grid-template-columns: 1fr; gap: 1rem; }
}
