/* Reset and base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  html {
    scroll-behavior: smooth;
    font-family: 'EB Garamond', serif;
    background-color: var(--bg, #f8f1e4);
    color: var(--text, #4b3b2b);
  }
  
  body {
    min-height: 100vh;
    position: relative;
    padding-bottom: 80px; /* For footer */
  }
  
  /* Custom variables for colors */
  :root {
    --bg: #f8f1e4;
    --accent: #7b4f24;
    --bar-bg: #e2d6c3;
    --bar-fill: #a37340;
    --footer-bg: #5a3e1b;
    --footer-text: #e8d9b5;
  }
  #main-content {
    opacity: 0;
    transition: opacity 1s ease-in-out;
  }

  /* Show main content with fade */
  #main-content.visible {
    opacity: 1;
  }
  /* Curtain Loader */
  #curtain-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    overflow: hidden;
  }
  
  .curtain-left, .curtain-right {
    position: fixed;
    top: 0;
    width: 50vw;
    height: 100vh;
    background: var(--accent);
    transition: transform 1.5s ease-in-out;
    z-index: 10001;
  }
  
  .curtain-left {
    left: 0;
    transform: translateX(0);
  }
  
  .curtain-right {
    right: 0;
    transform: translateX(0);
  }
  .curtain-left.open {
    transform: translateX(-100vw);
  }

  .curtain-right.open {
    transform: translateX(100vw);
  }

  #curtain-text {
    position: fixed;
    color: var(--footer);
    font-family: 'EB Garamond', serif;
    font-size: 1.8rem;
    z-index: 10002;
    pointer-events: none;
    user-select: none;
  }
  #curtain-loader.fade-out {
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease-in-out;
  }
  /* Navigation */
  nav {
    background-color: var(--accent);
    padding: 1rem 2rem;
    text-align: center;
    font-family: 'MedievalSharp', cursive;
    font-weight: 700;
    letter-spacing: 0.05em;
    user-select: none;
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-bottom: 4rem;
  }
  
  nav a {
    color: var(--bg);
    margin: 0 1rem;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    font-size: clamp(1rem, 2vw, 1.1rem);
  }
  
  nav a:hover,
  nav a:focus {
    color: #f3dcb1;
    text-decoration: underline;
  }
  
  /* Header section */
  header {
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 1rem;
  }
  
  /* Header Text Overlay Style */
  .header-text-overlay {
    display: flex;
    flex-wrap: wrap; /* allow wrapping on small widths */
    align-items: center;
    gap: 1.5rem;
    background: #f6f0e4 url('https://www.transparenttextures.com/patterns/paper-fibers.png') repeat;
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 5.5rem;
    margin-top: -3rem;
    box-shadow: 4px 6px 10px rgb(125 79 36 / 0.3);
    justify-content: center; /* center horizontally */
    align-items: center;
    flex-direction: row;
  }  
  
  .header-text-overlay img {
    max-width: 150px;
    width: 100%;
    height: auto;
    border-radius: 50%;
    border: 4px solid var(--accent);
    box-shadow: 2px 2px 6px rgb(123 79 36 / 0.6);
    flex-shrink: 0;
  }
  
  .header-text-overlay h1,
  .header-text-overlay h2,
  .header-text-overlay h3 {
    font-family: 'EB Garamond', serif;
    color: var(--accent);
    margin-bottom: 1rem;
  }
  
  .header-text-overlay p {
    line-height: 1.6;
    font-size: 1.1rem;
    color: var(--text);
  }

  .header-text-content {
    flex: 1 1 300px;
  }
  

  /* Tabs Container */
  #tabContainer {
    background-color: #f2e9d8;
    border: 2px solid var(--accent);
    border-radius: 8px;
    padding: clamp(2rem, 0.5vw, 0.5rem) clamp(1rem, 3vw, 7rem);
    font-family: 'EB Garamond', serif;
    max-width: 1000px; /* match the header */
    width: 100%;
    margin: 0 auto 1rem auto; /* centered and spaced below */
    box-sizing: border-box;
    justify-content: center; /* center horizontally */
    align-items: center;
  }  
  
  /* Tab Buttons */
  .tab-buttons {
    display: flex;
    justify-content: center; /* center horizontally */
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .tab-btn {
    background-color: var(--bar-bg);
    border: 2px solid var(--accent);
    border-bottom: none;
    padding: 1rem 4rem;
    font-family: 'EB Garamond', serif;
    font-weight: 700;
    color: var(--accent);
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    border-radius: 6px 6px 0 0;
    padding: clamp(0.5rem, 1vw, 1rem) clamp(1rem, 3vw, 4rem);
  }
  
  .tab-btn:hover,
  .tab-btn:focus {
    background-color: var(--accent);
    color: var(--bg);
    outline: none;
  }
  
  .tab-btn.active {
    background-color: var(--accent);
    color: var(--bg);
    border-bottom: 2px solid var(--bg);
    cursor: default;
  }
  
  /* Tab Content */
  .tab-content {
    border: 2px solid var(--accent);
    background-color: var(--bar-bg);
    padding: clamp(0.5rem, 2vw, 1rem) clamp(1rem, 7vw, 4rem);
    border-radius: 0 0 8px 8px;
    display: none;
    font-size: 1rem;
    color: var(--text);
    width: 100%;
    animation: fadeIn 0.3s ease-in-out;
    justify-content: center; /* center horizontally */
    align-items: center;
  }
  
  .tab-content.active {
    display: block;
  }
  
  .tab-content div {
    margin-bottom: 1.2rem;
  }
  /* Highlight the summary of the open details */
  details[open] > summary {
    background-color: var(--accent); /* or any highlight color you want */
    color: white;
    cursor: pointer;
    padding: 0.5em 1em;
    border-radius: 4px;
    box-shadow: 0 0 6px var(--accent);
  }

  /* Skill bars */
  .skills-dropdown-content {
    padding: 0 1rem;
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
  }

  .skill-bar-bg {
    width: 100%;
    height: 14px;
    background-color: var(--bar-bg);
    border-radius: 7px;
    border: 1px solid var(--accent);
    margin-top: 0.25rem;
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
  }

  .skill-bar-fill {
    height: 100%;
    background-color: var(--bar-fill);
    border-radius: 7px 0 0 7px;
    box-shadow: 1px 1px 3px rgba(162, 115, 64, 0.7);
    transition: width 0.6s ease;
  }

  #skillsDropdowns {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* space between dropdowns */
    width: 100%; /* full width of parent container */
    max-width: 1000px; /* optional max width to roughly match .header-text-overlay width */
    margin: 1rem; /* center horizontally if needed */
    text-align: center;
  }

  #skillsDropdowns details {
    width: 100%;
    border: 1px solid var(--accent);
    border-radius: 5px;
    background: var(--footer);
    overflow: hidden;
  }

  #skillsDropdowns summary {
    display: block;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    padding: 0.8rem 1rem;
    background-color: var(--footer); /* corrected var */
    color: var(--bar-bg);          /* corrected var */
    border-radius: 5px;
    user-select: none;
    width: 100%;
    box-sizing: border-box;
  }
  #skillsDropdowns summary::-webkit-details-marker {
    display: none;
  }

  #skillsDropdowns summary:hover {
    background-color: var(--bar-bg);
    color: var(--bg);
  }

  #skillsDropdowns details:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  }

  #skillsDropdowns details > div {
    max-height: 200px; /* adjust as needed */
    overflow-y: auto;
    box-sizing: border-box;
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--accent) transparent;
    margin-top: 2rem;
    margin-bottom: 2rem;
  }
  
  /* Projects Section */
  .projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.8rem;
  }
  
  .card {
    background: #f7f2de;
    border: 2px solid var(--accent);
    border-radius: 10px;
    box-shadow: 3px 4px 8px rgba(123, 79, 36, 0.3);
    overflow: hidden;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: transform 0.3s ease;
  }
  
  .card:hover {
    transform: translateY(-6px);
  }
  
  .card img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 1rem auto; /* ensures image is centered */
    border-radius: 8px;
  }
  
  .card h3 {
    font-family: 'EB Garamond', serif;
    color: var(--accent);
    margin-bottom: 0.6rem;
  }
  
  .card p {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text);
  }
  
  .card a {
    display: inline-block;
    font-size: 1rem;
    margin-top: 0.6rem;
    color: var(--accent);
    text-decoration: underline;
    font-weight: 700;
    transition: color 0.3s ease;
    text-align: center;
  }
  
  .card a:hover,
  .card a:focus {
    color: #c49a4d;
    outline: none;
  }
  .card-links {
    display: flex;
    justify-content: center;
    gap: 1rem; /* spacing between buttons */
    margin-top: 0.6rem;
  }

  .card-links a {
    display: inline-block;
    font-size: 1rem;
    color: var(--accent);
    text-decoration: underline;
    font-weight: 700;
    transition: color 0.3s ease;
  }

  /* Footer Bar */
  #footer-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 1rem 1.5rem;
    box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.3);
    font-family: 'EB Garamond', serif;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    z-index: 1000;
  }
  
  #footer-bar.visible {
    opacity: 1;
    pointer-events: auto;
  }
  
  #footer-bar a {
    color: var(--footer-text);
    text-decoration: underline;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
  }
  
  #footer-bar a:hover,
  #footer-bar a:focus {
    color: #f3dcb1;
    outline: none;
  }
  
  /* Responsive */
  @media (max-width: 600px) {
    nav a {
      margin: 0 0.6rem;
      font-size: 1rem;
    }
  
    .header-text-overlay img {
      float: none;
      display: block;
      margin: 0 auto 1.5rem auto;
    }
  
    .projects {
      grid-template-columns: 1fr;
    }
  
    .tab-buttons {
        display: flex;
        justify-content: center;
        gap: 1rem;
        margin-bottom: 1rem;
        flex-wrap: wrap;
    }
    
    .tab-btn {
        background-color: var(--bar-bg);
        border: 2px solid var(--accent);
        border-radius: 6px 6px 0 0;
        padding: 0.6rem 1.2rem;
        color: var(--accent);
        cursor: pointer;
        font-family: 'EB Garamond', serif;
        font-weight: 700;
        justify-content: center; /* center horizontally */
    }
    
  
    .tab-btn.active {
      border-bottom: none;
      border-radius: 6px;
    }
  }
  @media (max-width: 600px) {
    .tab-buttons {
      flex-direction: column;
      align-items: center;
    }
  
    .tab-btn {
      width: 100%;
      border-radius: 6px;
      border-bottom: 2px solid var(--accent);
    }
  
    .tab-btn.active {
      border-bottom: none;
    }
  }
  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(-0.5rem);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .iframe-wrapper {
    max-width: 100%;
    overflow: hidden;
    position: relative;
    padding-top: 56.25%; /* 16:9 aspect ratio */
  }
  .iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
  #games .play-btn {
    margin-top: 1rem;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }

  #games .play-btn:hover {
    background-color: darken(var(--accent), 10%);
  }
  /* Normal state - keep aspect ratio or container sizing */
  /* Normal state - keep aspect ratio or container sizing */
  #iframe-container {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    height: 56.25vw; /* 16:9 */
    max-height: 100vh;
    margin: 0 auto;
    background: black;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.5s ease;
  }






