/* 
Baseline 2024 Feature Use:
Used `color-mix()` to blend theme colors 
without hard-coding new hex values. 

Used the new `:has()` selector to apply styles 
to any section that contains media elements, improving 
semantic styling without extra markup.
*/


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

:root {
  --primary-color: #3498db;
  --accent-color: #e67e22;
  --bg-color: #fdfdfd;
  --font-main: 'Poppins', Arial, sans-serif;
}


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

body {
  font-family: var(--font-main, sans-serif);
  color: var(--text-color);
  background: var(--bg);
  line-height: 1.6;
  padding: 2rem 5%;
}


header nav ul {
  display: flex;             
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
}

nav a {
  text-decoration: none;
  color: var(--nav-text);
  transition: color 0.3s ease; 
}

nav a:hover {
  color: var(--accent-color);
}


main {
  display: grid;                               
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}


h1 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 1rem;
}


section {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.8s ease both;            
}


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


header {
  min-height: 25dvh;                            
  display: flex;
  align-items: center;
  justify-content: center;
}


nav {
  ul {
    li {
      a {
        font-weight: 600;
      }
    }
  }
}



@media (max-width: 768px) {
  body {
    font-size: 0.9rem;
  }
  nav ul {
    flex-direction: column;
  }
}

h2 {
  color: color-mix(in srgb, var(--primary-color) 70%, white);
}

button, nav a {
  transition: transform 0.3s ease, color 0.3s ease;
}
button:hover, nav a:hover {
  transform: scale(1.05);
}


section:has(audio), section:has(video) {
  border: 2px solid var(--accent-color);
}

.button-link {
  display: inline-block;
  background: var(--accent-color);
  color: white;
  text-decoration: none;
  padding: 0.8em 1.5em;
  border-radius: 0.5em;
  transition: transform 0.3s ease, background 0.3s ease;
}

.button-link:hover {
  transform: scale(1.05);
  background: color-mix(in srgb, var(--accent-color) 80%, black);
}

.playlist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.track {
  background: var(--track-bg);
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s;
}

.track:hover {
  transform: scale(1.03);
}

.track h3 {
  color: #7a2e2e;
  margin-bottom: 4px;
}

.track p {
  color: #555;
  font-style: italic;
  margin-bottom: 8px;
}

img {
  max-width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 0.5rem;
  display: block;
  margin: 0 auto;
  object-position: center;

}

.inspiration {
  text-align: center;
  background: var(--card-bg);
  padding: 40px 20px;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  max-width: 900px;
  width: 90%;
  margin: 0 auto;
}

.inspiration iframe {
  width: 100%;
  aspect-ratio: 16 / 9; 
  border: none;
  border-radius: 12px; 
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  overflow: hidden;
  display: block;
}

.welcome p {
  font-size: 1.3rem;
  line-height: 1.6;
  margin-bottom: 25px; /* adds space before the button */
}

.button-link {
  display: inline-block;
  background-color: #a32c2c;
  color: white;
  padding: 14px 32px;
  font-size: 1.1rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.3s ease;
  margin-top: 10px; /* optional extra space */
}

.about-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px; /* Adds space between blocks */
  margin: 60px auto;
  max-width: 1100px;
  padding: 0 20px;
}

.about-block {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 25px 30px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}

.about-block:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.about-block:nth-of-type(1) h3 {
  color: color-mix(in srgb, #6a8fd6 70%, #000);
}
.about-block:nth-of-type(2) h3 {
  color: color-mix(in srgb, #a25dc7 70%, #000);
}
.about-block:nth-of-type(3) h3 {
  color: color-mix(in srgb, #f0a500 70%, #000);
}
.about-block:nth-of-type(4) h3 {
  color: color-mix(in srgb, #53b89c 70%, #000);
}

.about-block p {
  color: color-mix(in srgb, #222 80%, #555);
  font-size: 1.05rem;
  line-height: 1.6;
}

.about-block strong {
  color: color-mix(in srgb, #000 80%, #6a8fd6 20%);
}

.about-block em {
  color: color-mix(in srgb, #6a8fd6 60%, #000);
  font-style: italic;
}

h2 {
  text-align: center;
  font-size: 2.5rem;
  color: #5a8de0;
  margin-bottom: 40px;
}

dialog {
  position: relative;
  margin: auto;
  padding: 20px 30px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(145deg, #fff7fb, #f0f7ff);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  text-align: center;
  width: 280px;
  font-size: 1.05rem;
  color: #444;
  animation: floatIn 0.6s ease-out;
}

dialog p {
  font-size: 1.1rem;
  color: #5a6be0;
  margin-bottom: 12px;
}

dialog button {
  background-color: #a6b6ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

dialog button:hover {
  background-color: #8298ff;
}

@keyframes floatIn {
  0% {
    opacity: 0;
    transform: translateY(15px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* tablet adjustment */
@media (max-width: 900px) {
  main {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
  }

  header h1 {
    font-size: 2rem;
  }

  nav ul {
    flex-wrap: wrap;
    justify-content: space-around;
  }
}

.hamburger {
  display: none;
}


footer {
  margin-top: 3rem;
  text-align: center;
  padding: 1rem 0;
  background: color-mix(in srgb, var(--primary-color) 5%, white);
  color: color-mix(in srgb, #000 70%, var(--primary-color));
  font-size: 0.9rem;
}

@media (prefers-color-scheme: dark) {
    nav a:hover {
        color: var(--accent-color);
    }
  body {
    background: color-mix(in srgb, #222 80%, #000);
    color: #f3f3f3;
  }
  section {
    background: var(--card-bg);
    box-shadow: 0 0 10px rgba(255,255,255,0.1);
  }
  nav ul{
    background: #222;
  }
  nav a{
    color: #fff;
  }
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

header h1 {
  margin-right: 1rem; 
}

@media (min-width: 601px) {
  header h1 {
    margin-right: 2rem;
  }
}

section iframe,
section audio {
  display: block;
  width: 100%;
  border-radius: 12px;
  margin-top: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

h2 {
  text-align: center;
  font-size: 2.5rem;
  color: #5a8de0;
  margin-bottom: 40px;
  margin-top: 0; /* reset default top margin */
  padding-top: 1rem; /* ✅ adds spacing from section edge */
}

/* --- Header Responsive Refinement --- */

/* Tablet: slightly smaller title and tighter nav */
@media (max-width: 900px) and (min-width: 601px) {
  header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: 1rem 0;
  }

  header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
  }

  nav ul {
    gap: 0.8rem;
  }
}

/* --- Mobile (≤600px) layout --- */
@media (max-width: 600px) {
  body {
    font-size: 0.9rem;
    padding: 1rem;
  }

  header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    text-align: left;
  }

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

  /* Hamburger icon on the right */
  .hamburger {
    display: block;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--accent-color);
    cursor: pointer;
  }

  /* Hide regular horizontal nav by default */
  nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    right: 1rem;
    width: 180px;
    background: var(--nav-bg);
    border-radius: 10px;
    padding: 1rem;
    list-style: none;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  }

  nav ul li {
    margin: 0.5rem 0;
  }

  /* Show nav when checkbox is toggled */
  #menu-toggle:checked + label + nav ul {
    display: flex;
    animation: slideDown 0.3s ease forwards;
  }

  main {
    grid-template-columns: 1fr;
  }

  img, iframe {
    width: 100%;
    height: auto;
  }
}

/* Smooth slide-down animation for mobile nav */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

header {
  position: relative; /* makes the dropdown position relative to header */
  z-index: 10;
}

nav ul li a {
  color: var(--nav-text);
  font-weight: 600;
}

nav ul li a:hover {
  color: var(--accent-color);
}

#menu-toggle:checked + label + nav ul {
  display: flex;
  flex-direction: column;
  animation: slideDown 0.3s ease forwards;
}

.form-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

#contact-form {
  display: grid;
  gap: 1rem;
  max-width: 480px;
  width: 100%;
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  background: var(--bg, #ffffff);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

label {
  font-weight: 600;
}

input,
textarea {
  padding: 0.6rem 0.8rem;
  border-radius: 0.5rem;
  border: 1px solid #ccc;
  font: inherit;
}

input:focus,
textarea:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* outputs stacked below fields */
.form-messages {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 2.5rem;
}

.form-error {
  color: #b00020;
  font-size: 0.9rem;
}

.form-info {
  color: #0b6b4b;
  font-size: 0.9rem;
}

button[type="submit"] {
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

/* Required indicator visually (optional) */
input[required] + .required-indicator::before {
  content: "*";
}

/* Valid / invalid styling */
input:required:user-invalid,
textarea:required:user-invalid {
  border-color: #b00020;
  background: var(--card-bg);
}

input:valid,
textarea:valid {
  border-color: #0b6b4b;
  background: var(--card-bg);
}

/* Placeholder-shown if you want subtle style for untouched fields */
input:placeholder-shown,
textarea:placeholder-shown {
  background: var(--card-bg);

}

/* added part3 */
input.flash {
  animation: flash 0.2s alternate 3;
}

@keyframes flash {
  from { background: #ffecec; }
  to   { background: #ffffff; }
}

.form-info.warning {
  font-weight: 600;
  text-decoration: underline;
}

.form-info.error {
  color: #b00020;
}

/* part 4 */
:root[data-theme="light"] {
  --bg: #ffffff;
  --card-bg: #f7f7f7;
  --text-color: #000000;
  --heading-color: #222;
  --nav-bg: #6ba2df;
  --nav-text: #ffffff;
  --track-bg: #f8f8f8;
  --track-hover-bg: #f0ece6;
  --input-bg: var(--card-bg);
  --input-text-color: var(--text-color);

}

:root[data-theme="dark"] {
  --bg: #111;
  --card-bg: #2b2b2b;
  --text-color: #ffffff;
  --heading-color: #d9e2ff;
  --nav-bg: #1e1e1e;
  --nav-text: #e6e6e6;
  --track-bg: #333;
  --track-hover-bg: #404040;
  --input-bg: var(--card-bg);
  --input-text-color: var(--text-color);

}

body {
  background: var(--bg);
  color: var(--text-color);
}

section {
  background: var(--card-bg);
}

h1, h2, h3 {
  color: var(--heading-color);
}

nav ul {
  background: var(--nav-bg);
}

nav a {
  color: var(--nav-text);
}

.track {
  background: var(--track-bg);
}

.track:hover {
  background: var(--track-hover-bg);
}

input, textarea {
  background: var(--input-bg);
  color: var(--input-text-color);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
  max-width: 1100px;
  margin-inline: auto;
}

.about-projects {
  grid-column: 1 / -1;
  background: transparent;
  box-shadow: none;
  padding-inline: 0;  
}