#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 14px;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

#splash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%); /* Safari */
    z-index: 0;
    /* Start as a circle big enough to cover the screen */
    clip-path: circle(150% at 50% 50%);
    transition: clip-path 1.2s cubic-bezier(0.7, 0, 0.3, 1);
    will-change: clip-path, backdrop-filter;
}

/* Hint text on splash */
#splash-hint {
    z-index: 1;
    text-align: center;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
#splash-hint .hint-title { font-size: 1.1rem; font-weight: 600; }
#splash-hint .hint-sub { font-size: 0.95rem; color: rgba(255,255,255,0.85); margin-top: 4px; }

#splash-overlay.animate-out {
    clip-path: circle(0% at 50% 50%);
}

#enter-button {
    background: var(--background-color);
    border: 3px solid var(--accent-color);
    color: var(--accent-color);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    font-size: 40px;
    z-index: 1;
    padding-left: 10px;
    transition: opacity 0.5s ease-out, transform 0.5s ease;
}

#enter-button.hidden {
    opacity: 0;
    transform: scale(0.5);
}

#audio-controls {
    position: fixed;
    bottom: 16px;
    left: 12px;
    right: 12px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background-color: rgba(13, 17, 23, 0.88);
    padding: 12px 16px;
    border-radius: 24px;
    backdrop-filter: blur(8px);
    transition: opacity 0.5s ease-in-out;
    width: calc(100vw - 24px);
    max-width: 760px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    #audio-controls {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(var(--container-width, 1140px), calc(100vw - 40px));
        max-width: none;
    }
}

#audio-controls.hidden {
    opacity: 0;
    pointer-events: none;
}

#mute-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
}

#mute-button svg {
    width: 100%;
    height: 100%;
    fill: white;
}

#volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 4px;
    background: #444;
    outline: none;
    border-radius: 2px;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-color);
    cursor: pointer;
    border-radius: 50%;
}

#volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent-color);
    cursor: pointer;
    border-radius: 50%;
    border: none;
}


.social-links {
    margin-top: calc(var(--spacing-unit) * 1.5);
    display: flex;
    gap: 25px;
    justify-content: center;
}

.social-links a {
    color: var(--secondary-color);
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.social-links a:hover {
    color: var(--accent-color);
    transform: translateY(-2px);
}

.social-links svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.contact-email {
    display: block;
    margin-top: calc(var(--spacing-unit) * 1);
    color: var(--secondary-color);
    font-size: 0.95rem;
    cursor: pointer;
    transition: color 0.2s ease-in-out;
    text-align: center;
}
.contact-email:hover {
    color: var(--accent-color);
}

@media (min-width: 768px) {
    .contact-email { text-align: left; }
}


.me-photo img {
    display: block;
    width: 25vmin;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}


.background-gigachad {
    position: fixed;
    z-index: -1;
    opacity: 0.1;
    pointer-events: none;
    width: 250px;
    height: auto;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.background-gigachad.right {
    display: none;
}


@media (min-width: 768px) {
    .social-links {
        justify-content: flex-start;
    }
}

/* Switch from one to two gigachads when aspect ratio passes 1x1 (square) */
@media (min-aspect-ratio: 1/1) {
    /* Landscape or wider than square: show two */
    .background-gigachad {
        width: 300px;
    }
    .background-gigachad.left {
        left: 20px;
        transform: none;
    }
    .background-gigachad.right {
        display: block;
        left: auto;
        right: 20px;
        transform: scaleX(-1);
    }
}

@media (max-aspect-ratio: 1/1) {
    /* Portrait or narrower than square: show one centered */
    .background-gigachad {
        left: 50%;
        transform: translateX(-50%);
    }
    .background-gigachad.right { display: none; }
}

/* === Compact audio controls tweaks === */
#audio-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Mobile-first: title row above controls */
.current-track {
    order: 1;
    flex: 1 1 100%;
    min-width: 0;
    font-size: 1rem;
    color: #ddd;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
}

#prev-button { order: 2; }
#pause-button { order: 3; }
#next-button { order: 4; }
#mute-button { order: 5; }
#volume-slider {
    order: 6;
    flex: 0 0 108px;
    min-width: 84px;
    max-width: 124px;
}

/* Desktop: keep title + controls in one row */
@media (min-width: 900px) {
    #audio-controls {
        flex-wrap: nowrap;
        align-items: center;
    }

    .current-track {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
    }

    #prev-button { order: 2; }
    #pause-button { order: 3; }
    #next-button { order: 4; }
    #mute-button { order: 5; }
    #volume-slider {
        order: 6;
        flex: 0 0 122px;
        min-width: 96px;
        max-width: 138px;
    }
}

/* Prev / Pause / Next buttons */
#prev-button, #pause-button, #next-button {
    background: rgba(255,255,255,0.10);
    border: none;
    color: #fff;
    font-size: 1.1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
    padding: 0;
}
#prev-button:hover, #pause-button:hover, #next-button:hover {
    background: rgba(255,255,255,0.20);
}
#pause-button { font-size: 1.2rem; }

/* Desktop: bigger player and text, but compact slider */
@media (min-width: 1024px) {
    #audio-controls { padding: 14px 18px; border-radius: 26px; gap: 10px; }
    .current-track { font-size: 1.08rem; }
    #prev-button, #pause-button, #next-button { width: 44px; height: 44px; font-size: 1.2rem; }
    #volume-slider { flex-basis: 122px; max-width: 138px; }
}

/* Tablet / small desktop */
@media (max-width: 1023px) {
    #audio-controls { gap: 8px; }
    #prev-button, #pause-button, #next-button { width: 38px; height: 38px; font-size: 1.05rem; }
    #mute-button.icon-button { width: 40px; height: 40px; }
    #volume-slider { flex-basis: 104px; max-width: 118px; }
}

/* Very small screens */
@media (max-width: 400px) {
    #volume-slider { display: none; }
    .current-track { font-size: 0.78rem; }
}

/* Track title: single-line ellipsis */
.track-clip {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bigger, tappable mute button on mobile */
#mute-button.icon-button {
    width: 44px; height: 44px; padding: 8px; border-radius: 999px;
    background: rgba(255,255,255,0.06);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
}
#mute-button.icon-button svg { width: 22px; height: 22px; }
@media (pointer: coarse) and (max-width: 480px) {
    #mute-button.icon-button { width: 48px; height: 48px; padding: 10px; }
    #mute-button.icon-button svg { width: 24px; height: 24px; }
}

/* Keep slider compact on phones */
@media (max-width: 480px) { #volume-slider { flex-basis: 92px; max-width: 104px; } }

/* Optional marquee-on-touch */
.track-marquee { white-space: nowrap; overflow: hidden; }
.track-marquee .scroll { display: inline-block; padding-left: 100%; animation: track-scroll 12s linear infinite; }
@keyframes track-scroll { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* About page header row: image aligned with title, single underline under both */
.about-block { width: 100%; }

.about-header-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap; /* allow wrap on very narrow screens */
}

.about-title {
    margin: 0;
    line-height: 1.2;
}

/* Override base.css h2/h3 sizes — too big on mobile */
.about-title.h2-title,
h2.about-title {
    font-size: clamp(1.2rem, 4vw, 2rem);
}

h3.about-title {
    font-size: clamp(0.9rem, 3vw, 1.3rem);
    font-weight: 400;
    color: var(--secondary-color);
}

.instructor-section {
    max-width: var(--container-width, 1140px);
    width: 100%;
}

/* Fix me-photo so it doesn't stretch on mobile */
.me-photo {
    flex-shrink: 0;
}

.me-photo img {
    display: block;
    width: clamp(70px, 20vw, 130px);
    height: auto;
    object-fit: contain;
    border-radius: 50%;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* About description text */
.about-description {
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    line-height: 1.65;
    color: var(--text-color);
    max-width: 100%;
}

/* Books */
.books-section { margin: 48px 0; }
.section-title { margin: 0 0 16px 0; font-size: 1.5rem; }
.books-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px;
}
.book-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; overflow: hidden; }
.book-card a { display: grid; gap: 8px; padding: 10px; color: inherit; text-decoration: none; height: 100%; }
.book-cover { width: 100%; aspect-ratio: 3 / 4; background: rgba(255,255,255,0.04); border-radius: 6px; display: grid; place-items: center; overflow: hidden; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-cover-fallback {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #111, #1a1f2e);
  color: #cbd5e1; font-weight: 700; font-size: 3rem;
  letter-spacing: 0.03em; position: relative;
}
.book-cover-fallback::after {
  content: attr(data-ext);
  position: absolute; bottom: 6px; right: 6px;
  font-size: 0.7rem; opacity: 0.7; background: rgba(0,0,0,0.4);
  border-radius: 4px; padding: 2px 6px;
}
.book-title { font-size: 0.95rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 480px) {
  .books-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
  .book-cover-fallback { font-size: 2.4rem; }
}

.section {
    padding-top: calc(var(--spacing-unit) * 3);
    padding-bottom: calc(var(--spacing-unit) * 3);
}
