/* --- Poppins variable font (one file, all weights) --- */
@font-face {
    font-family: 'PoppinsVar';
    src: url('fonts/PoppinsVar.woff2') format('woff2-variations');
    font-weight: 100 900;
    /* full variable range */
    font-style: normal;
    font-display: swap;
    /* shows fallback immediately if font is slow */
}

html {
    scroll-padding-top: 70px;
    /* Offset for the fixed header height */
    scroll-behavior: smooth;
    /* Makes anchor jumps scroll smoothly */
}

/* ===== Base & Vars ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

body {
    font-family: 'PoppinsVar', system-ui, sans-serif;
    line-height: 1.6;
    color: #0a2239;
    background: #f0f2f5;
    /* A softer, calmer off-white to reduce eye strain */
    scroll-behavior: smooth
}

img {
    max-width: 100%;
    display: block;
    height: auto
}

a {
    text-decoration: none;
    color: inherit
}

h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.2;
    color: #001827
}

:root {
    --clr-dark: #001827;
    --clr-mid: #003d5b;
    --clr-accent: #009f9d;
    --clr-bg: #fafafa;
    --header-h: 140px;
    --header-h-small: 50px;
    /* Scrolled height for compact nav */
    --radius: 14px;
}

/* ===== Utilities ===== */
.container {
    width: 88%;
    max-width: 1200px;
    margin-inline: auto
}

.btn {
    display: inline-block;
    padding: .9rem 2rem;
    background: var(--clr-accent);
    color: #fff;
    border-radius: var(--radius);
    font-weight: 600;
    transition: background .25s ease
}

.btn:hover {
    background: #007d7c
}

.text-centre {
    text-align: center
}

/* ===== Header & Navigation ===== */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    z-index: 999;
    transition: height .35s ease, box-shadow .35s ease, background .35s ease
}

.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    /* Let clicks pass through to elements underneath */
    background: transparent;
    transition: background .35s ease
}

/* --- Logo Sizing --- */
/* Initial state of the logo */
.logo img {
    width: 300px;
    /* Large logo at the top of the page */
    height: auto;
    /* Let height adjust automatically */
    transition: width .35s ease, height .35s ease;
    /* Animate both properties */
}

/* Scrolled state of the logo */
.site-header.scrolled .logo img {
    width: auto;
    /* Let width adjust automatically */
    height: 60px;
    /* Set height directly to fit in the bar */
}

/* Nav strip */
nav.nav-strip {
    position: relative
}

/* =========  FLUID NAV-STRIP PADDING  ========= */
/*  ≥ 1440 px → 4 rem  |  1232 px → 0 rem  */
@media (min-width: 993px) {
    .site-header.scrolled {
        height: var(--header-h-small);
        /* 50 px */
        background: rgba(180, 245, 244, 0.4);
        /* light‑teal overlay */
        box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    nav.nav-strip ul {
        /* top/bottom 0, left/right fluid                             */
        /* 0 … 64 px (≈4 rem) over a 208 px viewport range             */
        padding: 0 clamp(0px, calc((100vw - 992px) * 0.260), 4rem);
        display: flex;
        background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.15) 25%, rgba(255, 255, 255, 0.15) 75%, rgba(255, 255, 255, 0) 100%);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        transition: background .35s ease
    }
}

.site-header.scrolled nav.nav-strip ul {
    background: transparent;
    /* Make background see-through to the main header bar */
    backdrop-filter: none;
    /* Turn off the blur effect */
    mask-image: none;
    /* Turn off the fade effect */
}

nav.nav-strip li {
    list-style: none
}

nav.nav-strip a {
    display: block;
    font-weight: 500;
    font-size: 1.05rem;
    position: relative;
    color: #e1e1e1;
    padding: .6rem 1rem;
    transition: color .35s ease
}

nav.nav-strip a:hover,
nav.nav-strip a.current-page:hover {
    background: rgba(255, 255, 255, .08);
}

/* Style for the current page link (half-opacity hover) */
nav.nav-strip a.current-page {
    background: rgba(255, 255, 255, .04);
}

.site-header.scrolled nav.nav-strip a:hover {
    background: rgba(0, 0, 0, .08)
}

.site-header.scrolled nav.nav-strip a.current-page {
    background: rgba(0, 0, 0, .04);
    /* Dark, half-opacity for scrolled active link */
}

.site-header.scrolled nav.nav-strip a.current-page:hover {
    background: rgba(0, 0, 0, .08);
    /* Ensure full hover opacity */
}

/* Dark highlight for scrolled menu */
.site-header.scrolled nav.nav-strip a {
    color: var(--clr-dark);
    padding: .3rem 1rem
}

/* Adjust text color and padding for scrolled menu */

/* Burger */
.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    margin-left: 1rem
}

.burger span {
    display: block;
    width: 28px;
    height: 3px;
    background: #ffffff;
    border-radius: 2px;
    transition: background .35s ease, transform .3s ease, opacity .3s ease
}

.site-header.scrolled .burger span {
    background: var(--clr-dark)
}

/* ====== DESKTOP: CENTRE NAV BETWEEN LOGO EDGE & WINDOW EDGE ====== */
@media (min-width: 993px) {

    /* 1. Park the NAV midway between logo’s right edge & viewport edge */
    nav.nav-strip {
        position: absolute;
        top: 50%;
        left: calc(75vw + 75px);
        /* midpoint between (50 vw + 150 px) & 100 vw */
        transform: translate(-50%, -50%);
        width: auto;
        /* keep natural width               */
    }

    /* 2. Make absolutely sure nothing wraps */
    nav.nav-strip ul,
    nav.nav-strip a {
        white-space: nowrap;
        /* one long line, never two          */
    }

    /* 3. Lock the font back to its original size, in case inheritance shifted */
    nav.nav-strip a {
        font-size: 1.05rem;
        /* same value as your base desktop rule */
    }
}

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Horizontally centers the items */
    justify-content: space-evenly;
    /* Distributes items vertically with equal spacing */
    gap: 1.5rem;
    /* Adds a minimum vertical gap between the logo and the content */
    background: linear-gradient(130deg, #002a40 0%, #003d5b 40%, #009f9d 100%);
    color: #fff;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2.3rem, 5vw, 4rem);
    max-width: 900px;
    /* --- Gradient Text Effect --- */
    background: linear-gradient(to bottom, #EFEFEF 40%, #78C7C6);
    -webkit-background-clip: text;
    /* Clips the background to the text */
    background-clip: text;
    color: transparent;
    /* Makes the text transparent to show the gradient */
}

.hero p {
    font-size: clamp(1rem, 1.5vw, 1.35rem);
    margin-block: 1.2rem 2.2rem;
    max-width: 700px
}

/* Add extra space below the main call-to-action button */
.hero .btn {
    margin-bottom: 4rem;
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    /* Distributes items vertically */
    align-items: center;
    /* Horizontally centers items AND fixes the paragraph alignment */
    flex-grow: 1;
    /* Makes this container fill the space below the logo */
}

/* ===== Guide Page Specific Styles ===== */
.guide-hero {
    min-height: 55vh;
    /* Slightly taller for better spacing */
}

/* New class to remove top padding from the first content section */
.section.guide-content-start {
    padding-top: 0;
    padding-bottom: 1.5rem;
    /* Reduce bottom padding to close the final gap */
}

.guide-logo {
    width: 66%;
    /* Set a flexible width relative to the container */
    max-width: 300px;
    /* But ensure it never gets larger than 300px */
    margin-inline: auto;
    /* Center it horizontally */
    margin-bottom: 0.5rem;
    /* Reduced space below the logo */
}

/* Make all content within the guide sections left-aligned for readability */
.guide-section {
    text-align: left;
}

/* Add a small gap between a paragraph and a list that follows it */
.guide-section p+ol,
.guide-section p+ul {
    margin-top: 0.5rem;
}

/* Helper class to reduce the large bottom padding on a section */
.guide-section.compact-bottom {
    padding-bottom: 1rem;
}

/* ===== Parallax ===== */
.parallax {
    background-image: url('Violin Sketch.jpg?auto=format&fit=crop&w=1600&q=70');
    background-attachment: fixed;
    background-size: cover;
    background-position: left center;
    min-height: 60vh;
    display: flex;
    align-items: center;
    position: relative;
    color: var(--clr-dark)
}

/* On mobile, disable the fixed parallax effect to prevent extreme zooming */
@media (max-width: 768px) {
    .parallax {
        /* Re-enable fixed attachment to stop jitter from content above */
        background-attachment: fixed;
        background-position: left top;
        /* Lock the image size to prevent the 'cover' zoom issue */
        background-size: 768px auto;
        background-repeat: no-repeat;
        /* Prevent tiling */
    }
}

.parallax::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.37) 100%, rgba(255, 255, 255, 0) 100%);
    z-index: 0
}

.parallax>.container {
    position: relative;
    z-index: 1;
    padding-block: 4rem
}

/* ===== Sections ===== */
section.section {
    padding-block: 4rem
}

.guide-section {
    padding-block: 2rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    max-width: 800px;
    margin-inline: auto;
}

.guide-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    /* Remove the bottom padding from the very last section */
}

.guide-section h2 {
    color: var(--clr-mid);
    margin-bottom: 1.5rem;
    text-align: center;
}

.guide-section h3 {
    color: var(--clr-accent);
    margin-top: 2rem;
    margin-bottom: 0.8rem;
}

.guide-section h4 {
    color: var(--clr-mid);
    /* Use the darker h2 color to subordinate it to the h3 */
    font-weight: 600;
    /* A solid bold, but not as heavy as h1/h2 */
    font-size: 1.2rem;
    /* Slightly larger than the paragraph text */
    margin-top: 1.8rem;
    /* Add space above to separate from previous content */
    margin-bottom: 0.8rem;
    /* Same bottom margin as h3 to connect to its content */
}

.guide-section p,
.guide-section li {
    font-size: 1.1rem;
    color: #334e68;
}

.guide-section ul {
    list-style-position: inside;
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.guide-section li {
    margin-bottom: 0.5rem;
}

/* Style for italicised, slightly smaller notes within guide sections */
.guide-note {
    font-size: 0.9em;
    color: #556f85;
}

.guide-image {
    display: block;
    max-width: 100%;
    /* This ensures the image is responsive but never stretched */
    margin-inline: auto;
    margin-block: 2rem 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, .06);
}

/* Card for quick links within the guide page */
.guide-links-card {
    width: 250px;
    /* Restore the fixed width for the card */
    max-width: 90%;
    /* Ensure it never overflows on very narrow screens */
    margin: 0 auto 1rem;
    /* Center the card horizontally */
    padding: 0.5rem 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    background: #fff;
}

/* Target the card ONLY when it comes directly after an h2 to reduce the gap */
h2+.guide-links-card {
    margin-top: -0.5rem;
    /* Use a negative margin to counteract the h2's bottom margin */
}

.guide-links-card p {
    margin-bottom: 0;
    font-weight: 600;
    color: var(--clr-mid);
    font-size: 0.95rem;
}

.instrument-link {
    display: block;
    /* This makes each link take its own line */
    margin-top: 0;
    /* Reduce the gap between the links */
    padding: 0.2rem 0.8rem;
    border-radius: 8px;
    transition: background-color 0.2s ease-in-out;
}

.instrument-link:hover {
    background-color: #f0f4f8;
    /* A subtle hover effect */
    color: var(--clr-dark);
}

.problem {
    display: grid;
    gap: 2rem
}

.problem h2 {
    color: var(--clr-mid)
}

.problem p {
    font-size: 1.1rem
}

.problem strong {
    color: var(--clr-accent)
}

/* Cards */
.cards {
    display: grid;
    gap: 1.8rem;
    margin-top: 3rem
}

@media(min-width:768px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
        /* 2-column layout for tablets */
    }
}

/* Re-introduce the 3-column layout for desktops */
@media(min-width:992px) {
    .cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

.card {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, .06);
    transition: transform .2s ease, box-shadow .2s ease
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .09)
}

.card h3 {
    margin-bottom: .8rem;
    font-size: 1.25rem;
    color: var(--clr-mid)
}

.card p {
    font-size: 1rem;
    color: #334e68
}

/* CTA */
.cta {
    background: linear-gradient(130deg, #003d5b 0%, #009f9d 100%);
    color: #fff;
    text-align: center;
    padding: 3rem 1rem
}

.cta h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem
}

/* Footer */
footer {
    background: #001827;
    color: #9fb3c8;
    text-align: center;
    padding: 1.5rem 1rem;
    font-size: .9rem
}

/*
 * ===================================================================
 * MOBILE NAVIGATION STYLES (Adapted from Erik Terwan's MIT Licensed Code)
 * ===================================================================
*/

/* First, control the visibility of the two menus based on screen size */
.mobile-nav {
    display: block;
    /* Show mobile menu by default */
}

.nav-strip {
    display: none;
    /* Hide desktop menu by default */
}

/* On larger screens, swap the visibility */
@media (min-width: 993px) {
    .mobile-nav {
        display: none;
        /* Hide the mobile menu */
    }

    .nav-strip {
        display: flex;
        /* Show the desktop menu */
    }
}

/* --- Core Mobile Menu Styles --- */
#menuToggle {
    display: block;
    /* Position to the top-right of the viewport */
    position: fixed;
    top: 30px;
    right: 15px;
    z-index: 1000;
    /* Ensure it's above other header content */
    -webkit-user-select: none;
    user-select: none;
}

#menuToggle a {
    text-decoration: none;
    display: block;
    /* Allow padding and margin to apply correctly */
    color: var(--clr-dark);
    /* Match scrolled nav text color */
    padding: 8px 15px;
    /* Add space for the hover effect */
    white-space: nowrap;
    /* Prevent menu items from wrapping to a new line */
    margin-inline: -15px;
    /* Allow highlight to fill menu width */
}

#menuToggle a:hover {
    background: rgba(255, 255, 255, .8);
    /* Match scrolled desktop nav hover */
}

/* Style for the current page link in the mobile menu */
#menuToggle a.current-page {
    background: rgba(255, 255, 255, .4);
    /* Half-opacity of the hover effect */
}

#menuToggle a.current-page:hover {
    background: rgba(255, 255, 255, .8);
    /* Ensure it matches the full hover effect */
}

#menuToggle input {
    display: block;
    width: 40px;
    height: 32px;
    position: absolute;
    top: -7px;
    left: -5px;
    cursor: pointer;
    opacity: 0;
    /* hide this */
    z-index: 2;
    /* and place it over the hamburger */
    -webkit-touch-callout: none;
}

/* The hamburger icon spans */
#menuToggle span {
    display: block;
    width: 33px;
    height: 4px;
    margin-bottom: 5px;
    position: relative;
    background: #cdcdcd;
    border-radius: 3px;
    z-index: 1;
    transform-origin: 4px 0px;
    transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0),
        background 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0),
        opacity 0.55s ease;
}

#menuToggle span:first-child {
    transform-origin: 0% 0%;
}

#menuToggle span:nth-last-child(2) {
    transform-origin: 0% 100%;
}

/* Transform the spans into a crossmark when checked */
#menuToggle input:checked~span {
    opacity: 1;
    transform: rotate(45deg) translate(-2px, -1px);
    background: #232323;
}

/* Hide the middle one */
#menuToggle input:checked~span:nth-last-child(3) {
    opacity: 0;
    transform: rotate(0deg) scale(0.2, 0.2);
}

/* Turn the last one the other way */
#menuToggle input:checked~span:nth-last-child(2) {
    transform: rotate(-45deg) translate(0, -1px);
}

/* The menu list */
#menu {
    position: absolute;
    top: -20px;
    /* Position it at the top of the page */
    right: -5px;
    /* Nudge menu to viewport edge before transform */
    width: 151px;
    padding: 50px 15px 15px;
    box-sizing: border-box;

    /* Frosted glass effect to match scrolled header */
    background: rgba(180, 245, 244, 0.6);
    /* Semi-transparent light teal */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
    border-radius: 12px 0 0 12px;
    list-style-type: none;
    -webkit-font-smoothing: antialiased;

    /* Hide off-screen to the right, anchored to top-right */
    transform-origin: 100% 0%;
    transform: translateX(calc(100% + 10px));

    transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0);
}

#menu li {
    padding: 5px 0;
    font-size: 1.05rem;
    /* Match font style from desktop menu */
    font-weight: 500;
}

#menu li label {
    cursor: pointer;
}

/* Slide it in from the left */
#menuToggle input:checked~ul {
    transform: none;
}