/* Cleaned and debugged CSS for Nadia Kasenovich Ceramics */
@import url('https://fonts.googleapis.com/css2?family=Amatic+SC:wght@400;700&display=swap');

:root {
  --error: red;
  --success: green;
  --bg: #fffaf3;
  --text: #333;
  --accent: #d2691e;
  --nav-bg: #f5deb3;
  --nav-text: #4a3f35;
  --button-label: #6b4c3b;
  --accent-color: #d2691e;
  --button-bg: #eee;
  --button-text: #333;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e1e1e;
    --text: #eee;
    --accent: #ffa500;
    --nav-bg: #333;
    --nav-text: #f5deb3;
    --button-label: #f5deb3;
    --accent-color: #ffa500;
    --button-bg: #444;
    --button-text: #fff;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Amatic SC', cursive;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  animation: fadeIn 0.8s ease-in;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

footer {
  background-color: var(--nav-bg);
  color: var(--nav-text);
  text-align: center;
  padding: 1rem;
  font-size: 1.2rem;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

header {
  position: sticky;
  top: 0;
  z-index: 999;
  background-color: var(--nav-bg);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  width: 100%;
}

.navbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.logo {
  max-height: 80px;
  max-width: 200px;
  object-fit: contain;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px;
  z-index: 100;
  transition: top 0.3s;
  font-size: 1rem;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.nav-links li a {
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--nav-text);
  transition: color 0.3s ease;
  position: relative;
}

.nav-links li a:hover,
.nav-links li a:focus {
  color: var(--accent);
  outline: none;
}

.nav-links li a:focus::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  height: 3px;
  width: 100%;
  background-color: var(--accent);
  border-radius: 2px;
}

/* Grid & Buttons */
.grid, .portfolio-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 2rem;
  padding: 2rem;
  max-width: 1200px;
  margin: auto;
}

.button-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.button,
.filter-button {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.button:hover,
.filter-button:hover,
.button:focus,
.filter-button:focus {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
  outline: none;
}

.button:focus-visible,
.filter-button:focus-visible {
  outline: 3px dashed var(--accent);
  outline-offset: 4px;
}

.button-label,
.filter-label {
  margin-top: 0.5rem;
  font-size: 1.2rem;
  color: var(--button-label);
  text-align: center;
}

/* Responsive */
@media (max-width: 600px) {
  .navbar {
    grid-template-columns: 1fr auto;
    padding: 0.5rem 1rem;
  }
  .logo {
    max-height: 60px;
    max-width: 150px;
  }
  .nav-links {
    flex-direction: column;
    font-size: 1.2rem;
    max-height: 0;
  }
  .nav-links.active {
    max-height: 500px;
  }
  .menu-toggle {
    display: block;
  }
}

/* Contact */
.contact-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form input,
.contact-form textarea {
  padding: 0.75rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 1.2rem;
  background-color: #fff;
  color: var(--text);
  transition: all 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 5px var(--accent);
}

.contact-form button {
  background-color: var(--button-label);
  color: #fff;
  padding: 0.75rem;
  font-size: 1.2rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s, background-color 0.2s;
}

.contact-form button:hover {
  transform: scale(1.02);
  background-color: var(--accent);
}

.form-status {
  font-size: 1.2rem;
  font-weight: bold;
}

.social-links ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.social-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 1.4rem;
}

.social-links a:hover {
  text-decoration: underline;
}

/* Spinner */
.loading-spinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 250, 243, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-spinner.active {
  display: flex;
}

.loading-spinner::after {
  content: '';
  width: 50px;
  height: 50px;
  border: 5px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Portfolio Filters */
.filters-container {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
  padding: 0 1rem;
}

.filter-buttons button,
#yearSelect {
  font-size: 1.4rem;
  margin: 0.5rem;
  cursor: pointer;
  background-color: white;
  border: 2px solid var(--accent-color);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-family: 'Amatic SC', cursive;
  transition: all 0.3s ease;
  color: var(--accent-color);
}

.filter-buttons button:hover,
#yearSelect:hover,
.filter-buttons .active {
  background-color: var(--accent-color);
  color: white;
}

/* Artwork */
.art-piece {
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.art-piece:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.art-piece img {
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
}

/* Lightbox */
#lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 2rem;
}

#lightbox img {
  max-width: 80vw;
  max-height: 80vh;
  border-radius: 12px;
}

#lightbox-caption {
  color: white;
  margin-top: 1rem;
  font-size: 1.4rem;
  text-align: center;
}

#lightbox button {
  background: transparent;
  border: none;
  color: white;
  font-size: 3rem;
  cursor: pointer;
  user-select: none;
  transition: color 0.3s;
}

#lightbox button:hover {
  color: var(--accent-color);
}

.lightbox-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}
