@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500&family=Poppins:wght@600;700&display=swap");

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  color: #333;
  line-height: 1.6;
  font-size: 1rem;
  background-image: url("../images/Magi2.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

h1,
h2,
h3 {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  color: #222;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}
h2 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}
h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
p {
  margin-bottom: 1rem;
  font-size: 1rem;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s, transform 0.3s;
}
a:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #2563eb;
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
  border-radius: 4px;
}
.skip-link:focus {
  top: 0;
}

.cta-btn,
.custom-button {
  display: inline-block;
  font-weight: 600;
  text-align: center;
  padding: 0.75em 1.5em;
  border-radius: 999px;
  transition: all 0.3s ease-in-out;
  cursor: pointer;
  border: none;
}
.cta-btn {
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  color: #fff;
}
.cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}
.custom-button {
  background: #fff;
  border: 2px solid #2563eb;
  color: #2563eb;
}
.custom-button:hover {
  background: #2563eb;
  color: #fff;
  transform: translateY(-2px);
}

header {
  text-align: center;
  padding: 2rem 1rem;
  background-color: rgba(245, 245, 247, 0.85);
  backdrop-filter: blur(8px);
}

.hero {
  position: relative;
  background-image: url("../images/kusti.jpg");
  background-size: cover;
  background-position: center;
  padding: 6rem 1rem 4rem 1rem;
  border-radius: 16px;
  color: #fff;
  margin-top: 1.5rem;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.4),
    rgba(0, 0, 0, 0.2)
  );
  z-index: 0;
  border-radius: 16px;
}
.hero h2,
.hero p,
.hero .cta-btn {
  position: relative;
  z-index: 1;
}

main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.section {
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.pilt-ja-tekst {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.pilt-ja-tekst img {
  width: 120px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}
.pilt-ja-tekst .tekst {
  flex: 1;
  text-align: left;
}

.kaardid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.kaart {
  background: #f5f5f7;
  padding: 2rem 1rem;
  border-radius: 16px;
  text-align: center;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}
.kaart:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}
.kaart svg {
  margin-bottom: 1rem;
}
.kaart h3 {
  margin-bottom: 0.5rem;
}

.section video,
#teooria iframe,
.youtube-video {
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  display: block;
  margin: 2rem auto 0 auto;
  border: none;
}

#kontakt a {
  display: inline-block;
  margin: 0.5rem 1rem;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  background-color: #f0f0f0;
  color: #2563eb;
  font-weight: 500;
}
#kontakt a:hover {
  background-color: #2563eb;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

footer {
  text-align: center;
  padding: 2rem;
  color: #777;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .pilt-ja-tekst {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  nav[aria-label="Põhinavigatsioon"] {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1rem;
  }
  nav[aria-label="Põhinavigatsioon"] a {
    width: 80%;
    text-align: center;
  }
  .hero h2 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1.1rem;
  }
}
