


body {
    visibility: hidden; /* Hide everything initially */
    user-select: none;
}

body.fonts-loaded {
    visibility: visible; /* Show the body when fonts are loaded */
    transition: visibility 0.3s ease-in; /* Smooth transition */
}


body {
    background: linear-gradient(to left, rgb(20, 20, 10) 0%, rgb(35, 35, 40) 100%);
    color: white;
    text-align: center;
    margin: 0px;
    padding: 0px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

h1 {
    font-family: 'Urbanist';
    font-style: normal;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: white;
}

#pronounce span {
    will-change: transform, opacity;
    display: inline-block;
    transition: transform 0.6s ease, opacity 0.6s ease;
    font-kerning: normal;
    letter-spacing: normal;
    line-height: 1;
    display: flex; /* Optional: Use flexbox for precise alignment */
    gap: 0; /* Eliminate extra gaps */
}

.pronounce-button {
    background: transparent;  /* Ensures transparency */
    display: inline-block;     /* Ensures inline-block behavior */
    border: none;              /* Remove the button border */
    padding: 0;                /* Remove any padding */
    cursor: pointer;
    margin-left: 10px;
  }

.instructionText {
    font-family: "Trocchi", serif;
    font-size: 1.4rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: white;
}

#buttons-container {
    opacity: 0 !important;
    position: absolute;
    top: 30px;
    right: 50px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px; /* Add space between theme buttons and dark mode button */
    transition: opacity 2.5s ease;
  }
  
  #theme-buttons {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 5px; /* Space between individual theme buttons */
  }
  
  #darkmode-button {
    display: flex;
    align-items: center;
  }

.bracketgramHeader {
    font-family: "Garamond";
    font-weight: 300;
    font-size: 3.5rem;
    letter-spacing: 2px;
    color: white;
    position: relative; /* For positioning the underline */
    display: inline-block; /* Wrap tightly around the text */
    margin-right: 10px;
    z-index: 1; /* Text stays on top */
    transition: transform 1.5s ease;
}

.bracketgramHeader::after {
    content: '';
    opacity: 0.6;
    position: absolute;
    left: 0;
    bottom: 7px; /* Place the underline just below the text */
    height: 3px; /* Thickness of the squiggle */
    width: 100%; /* Full underline */
    background-image: repeating-linear-gradient(
        90deg,
        red 0%,
        red 25%,
        transparent 25%,
        transparent 50%
    );
    background-size: 20px 3px; /* Squiggle pattern size */
    z-index: -1; /* Underline stays behind the text */
    transition: width 0.9s ease-in, transform 1.5s ease, opacity 1.0s ease;
}

.bracketgramHeader.add-underline::after {
    transform: translateX(0%);
    opacity: 0.6; /* Fade out the underline */
}

.bracketgramHeader.remove-underline::after {
    transform: translateX(-100%); /* Move underline completely off-screen */
    opacity: 0; /* Fade out the underline */
}

.typing-text {
    font-family: Urbanist, sans-serif;
    font-size: 0.6em;
    color: gold;
    display: inline-block;
    position: relative;
}

.typing-letter {
    opacity: 0; /* Start invisible */
    transform: scale(0.5); /* Start smaller */
    display: inline-block;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.invisible-text {
    visibility: hidden; /* Make invisible but still contribute to layout */
}

.caret {
    color: gold;
    display: inline-block;
    transition: opacity 0.3s ease;
}

.constructor-text {
    display: inline-block;
}

.constructor-letter {
    font-family: "Saira Stencil One", serif;
    font-weight: 400;
    font-style: normal;
    display: inline-block;
    font-size: 2.3rem;
    font-weight: bold;
    opacity: 0;
    transform: translateY(-30px) rotate(-10deg) scale(0.8);
    transition: opacity 0.5s ease-out, transform 0.5s cubic-bezier(0.3, 1.3, 0.3, 1);

    background: linear-gradient(to bottom, 
        rgb(100, 149, 237) 0%,   /* Cornflower Blue */
        rgb(100, 149, 237) 40%,  
        rgb(255, 165, 0) 70%,   /* Orange */
        rgb(255, 165, 0) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; /* Makes the text transparent so the gradient shows */
}


#mainHeader {
    position: absolute; /* Anchor the element to the parent container */
    opacity: 1;
    top: 0px;
    width: 100vw; /* Extend to full viewport width */
    height: auto; /* Adjust height as needed */
    background-color: rgba(0, 0, 0, 0); /* Fully transparent background */
    left: 0; /* Ensure it starts at the left edge */
    right: 0; /* Ensure it extends to the right edge */
    z-index: 1; /* Position it above other elements, if necessary */
}

.byline {
    display: none; /* Initially hidden */
  }

#landing {
    display: block;
    position: absolute;
    top: 110px;
    margin: 0 auto;
    width: auto; /* Start with dynamic width */
    height: auto; /* Start with dynamic height */
    overflow: visible; /* Prevent overflow during resizing */
  }

p {
    font-size: 1.2rem;
    color: white;
}

.definition {
    font-family: "Trocchi", serif;
    font-size: 1.4rem;
    line-height: 1.8;
    margin: 0;
    white-space: nowrap; /* Prevent wrapping */
    overflow: hidden; /* Hide content outside the bounds during animation */
    color: white;
    width: 0; /* Start fully collapsed */
    transition: width 1s ease; /* Smooth width expansion */
}

.definition-container {
    position: relative;
    display: flex;
    justify-content: center; /* Center the definition */
    align-items: center;
    overflow: hidden; /* Prevent content overflow */
}


.definitionBracket-left,
.definitionBracket-right {
    padding: 3px;
    color: white;
    font-size: 1.6rem;
    line-height: 1.8;
    opacity: 1;
}


@media (max-width: 768px) {
    body {
        --is-mobile: true;
        min-height: 80vh !important;
    }
    .example {
        font-size: 1rem !important;
        margin-bottom: 0rem !important;
    }
    #landing {
        top: 140px;
      }
    .buttons {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: 0rem !important;
    }
    .button {
        margin: 10px 0;
        font-size: 1rem !important;
    }
    #container {
        font-size: 1.05rem !important; /* Adjust font size for smaller screens */
    }
    .definition {
        font-size: 1.1rem !important;
    }
    #instruction {
        font-size: 0.9rem !important; 
    }
    .small-caps {
        transform: scale(0.3, 0.7);
        position: relative;
        top: 0.1em;
        transition: transform 0.5s ease, top 0.5s ease;
    }
    .normal-caps {
        transform: scale(1, 1);
        top: 0;
    }

    #puzzleButton {
        opacity: 1;
    }

    #pronounce {
        display: inline-block; /* Keep it on the same line as the button */
        margin-left: 0
        0; /* Remove left margin */
        margin-top: 5px; /* Optional: Adds some space below bracketgramHeader */
        text-align: center; /* Center the pronunciation text */
    }
    
    #pronounceButton {
        display: inline-block; /* Keeps the button inline with the text */
        vertical-align: middle; /* Vertically align the button with the text */
        margin-left: 5px; /* Optional: Add space between text and button */
    }
    
    #bracketgramHeader {
        text-align: center; /* Center header on mobile */
    }

    #constructorButton {
        display: none;
    }
}

.buttons {
    cursor: default;
    pointer-events: none;
    margin-top: 1rem;
}

.button {
    padding: 15px 40px;
    font-size: 1.2rem;
}

.button {
    font-family: "Trocchi", serif;
    text-decoration: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    color: white;
    background-color: rgba(215, 158, 158, 0.2);
    border: 2px solid white;
    border-radius: 10px;
    transition: background-color 0.3s, color 0.3s, box-shadow 0.3s, opacity 1s;
    margin: 10px;
    cursor: pointer;
    opacity: 0;
}
.button:hover {
    background-color: rgba(215, 158, 158, 0.6);
    color: white;
    box-shadow: 0px 4px 4px rgba(255, 255, 255, 0.3); /* Add subtle depth */
}

#container {
    font-family: "Spline Sans Mono", monospace;
    text-align: center;
    white-space: pre;
    font-size: 1.8rem;
    line-height: 1.2;
    padding-bottom: 1rem;
    opacity: 0; /* Start completely transparent */
    min-height: calc(2.8em * 3);
    transition: opacity 1s ease; /* Smooth fade-in effect */
    cursor:default; 
}

#container.visible {
    opacity: 1; /* Fully visible when this class is added */
    transition: opacity 0.5s ease;
}

#container.invisible {
    opacity: 0; /* Makes the text completely invisible */
    transition: opacity 0.5s ease; /* Optional: Smooth fade effect */
}

#instruction {
    opacity: 0; /* Start invisible */
    position: relative;
    font-size: 1.2rem;
    color: rgb(237, 230, 213);
    transform: scaleY(1); /* Normal height */
    transform-origin: top; /* Shrink from the top */
    transition: transform 0.5s ease, opacity 0.5s ease; /* Smooth transition */
}

#instruction.visible {
    opacity: 1;
    animation: pulse 1.5s infinite;
    transition: opacity 0.5s ease; /* Smooth fade-in */

}

#instruction.invisible {
    opacity: 0;
    transform: scaleY(0); /* Shrink vertically */
}


/* Wrapper for smooth exit */
#instructionWrapper {
    display: flex; /* Centering if needed */
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transform: scaleY(0);
    transition: opacity 0.5s ease, transform 0.5s ease; /* Smooth exit */
}

/* Fade out the wrapper instead of the animated element */
#instructionWrapper.invisible {
    opacity: 0;
    transform: scaleY(0);
    pointer-events: none; /* Disable interaction */
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.letter {
    display: inline-block;
    transition: all 0.5s ease;
}
.non-letter {
    display: inline-block;
    width: 0.6em;
    opacity: 1;
    transition: all 0.5s ease;
}
.at-letter {
    display: inline-block;
    width: 0.6em; /* Matches the non-letter default width */
    opacity: 1;
    transition: all 0.5s ease; /* Smooth transition */
}

.letter, .non-letter {
    color: rgb(255, 255, 255);
    pointer-events: none; /* Prevent individual elements from blocking clicks */
}

#container {
    pointer-events: auto; /* Ensure the container itself captures the click */
}

.example {
    font-family: 'Urbanist';
    font-size: 1.6rem;
    line-height: calc(1.6rem + 15px);
    background-color: rgb(255, 241, 207); /* Solid orange background */
    color: rgb(91, 64, 0);
    border-radius: 5px;
    margin-bottom: 3rem;
    cursor: default;
    pointer-events: auto; /* Allow interaction unless transitioning */
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease, opacity 0.3s ease;
    overflow: hidden;
    opacity: 0;
    width: 200px;
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    border: 2px solid white;
}

/* Hover effect */
.example:hover {
    background-color: rgb(175, 143, 143); /* Slightly lighter hover effect */
    color: white;
    transform: scale(1.05); /* Slight zoom effect */
}

/* When the element is transitioning */
.example.transitioning {
    opacity: 0.3 !important; /* Semi-transparent */
    pointer-events: none !important; /* Completely disable interaction */
    transition: opacity 0.5s ease, height 0.5s ease, visibility 0.5s ease;
}

/* Prevent hover effects when transitioning */
.example.transitioning:hover {
    background-color: inherit !important;
    color: inherit !important;
    transform: none !important;
    box-shadow: none !important;
}


.small-caps {
    transform: scale(0.7, 0.7);
    position: relative;
    top: 0.1em;
    transition: transform 0.5s ease, top 0.5s ease;
}
.normal-caps {
    transform: scale(1, 1);
    top: 0;
}


/*===============
   Transitions
===============*/

/* Define the initial and final states for the animation */
.move-to-top {
    animation: moveTop 0.6s ease-out; /* Adjust duration as needed */
    position: relative; /* Ensure the element moves within its parent context */
  }
  
  /* Keyframes for the move-to-top animation */
  @keyframes moveTop {
    0% {
      top: 40px;
    }
    100% {
      top: 0px;
    }
  }
  
  .fade-in {
    animation: fadeOut 0.5s; /* Adjust duration as needed */
  }
  
  @keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
  }
  
  .fade-out {
    animation: fadeOut 0.5s; /* Adjust duration as needed */
  }
  
  @keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95); /* Slight shrink effect */
    }
  }
  
  /* Initial styles */
  #landing {
    opacity: 1;
    transition: opacity 0.5s ease;
  }
  
  #landing.fade-out {
    opacity: 0;
    pointer-events: none; /* Prevent interactions during fade-out */
  }
  
  #landing.fade-in {
    opacity: 1;
    pointer-events: auto; /* Enable interactions during fade-in */
  }

  /* Container to stack the textboxes */
.text-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 600px;
    max-width: 600px; /* Adjust width as needed */
    margin: 20px auto;
    transition: opacity 0.3s ease;
}

  .constructorOpening {
    font-family: "Trocchi", serif;
    font-size: 1.4rem;
    line-height: 1.8;
    margin-bottom: 20px;
    white-space: nowrap; /* Prevent wrapping */
    overflow: hidden; /* Hide content outside the bounds during animation */
    color: white;
    transition: opacity 0.3s ease;
}

.constructorButton {
    font-family: "Trocchi", serif;
    text-decoration: none;
    padding: 5px 10px;
    font-size: 0.9rem;
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    border-radius: 10px;
    transition: background-color 0.3s, color 0.3s, box-shadow 0.3s, opacity 0.3s ease;
    margin: 10px;
    cursor: pointer;
}

.constructorButton:hover {
    background-color: rgba(215, 158, 158, 0.6);
    color: white;
    box-shadow: 0px 4px 4px rgba(255, 255, 255, 0.3); /* Add subtle depth */
}

.suggestButton {
    opacity: 1;
}

.blankSlateButton {
    opacity: 1;
}







#constructorButton {
    display: none;
}






/*=============
Fonts
=============*/

/* urbanist-regular - latin */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Urbanist';
    font-style: normal;
    font-weight: 400;
    src: url('../fonts/urbanist-v15-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
  }
  /* urbanist-600 - latin */
  @font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Urbanist';
    font-style: normal;
    font-weight: 600;
    src: url('../fonts/urbanist-v15-latin-600.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
  }

/* trocchi-regular - latin */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Trocchi';
    font-style: normal;
    font-weight: 400;
    src: url('../fonts/trocchi-v17-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* saira-stencil-one-regular - latin */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Saira Stencil One';
    font-style: normal;
    font-weight: 400;
    src: url('../fonts/saira-stencil-one-v16-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}