/* ==========================================================================
   Max Braz — Personal Site
   Token system: rugged/alpine palette + slab serif (stone-chiseled) display
   paired with IBM Plex Sans (engineer's typeface) for body, and Plex Mono
   for the show log — because a log book should look like data, not prose.
   ========================================================================== */

:root {
    --ink:        #1F2A24; /* deep pine charcoal — nav, footer, overlays */
    --ink-soft:   #3B4A40; /* softened ink for secondary dark surfaces */
    --paper:      #F6F4EE; /* warm stone-white page background */
    --stone:      #E9E3D5; /* alternating section band */
    --rust:       #B6562D; /* primary accent — links, hovers, CTAs */
    --rust-soft:  rgba(182, 86, 45, 0.14);
    --pine:       #3B5245; /* secondary accent — nav links, table zebra */
    --sky:        #6E8FA6; /* tertiary accent — sparingly, table header rule */
    --text:       #262620;
    --text-muted: #5B5C52;
    --radius:     10px;
    --max-width:  760px;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * , *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    font-family: 'IBM Plex Sans', Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.65;
    color: var(--text);
    background: var(--paper);
}

h1, h2 {
    font-family: 'Zilla Slab', Georgia, serif;
    font-weight: 600;
    letter-spacing: -0.01em;
}

a {
    color: var(--rust);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

a:hover { color: var(--pine); }

:focus-visible {
    outline: 2px solid var(--rust);
    outline-offset: 3px;
    border-radius: 4px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--ink);
    color: #fff;
    padding: 10px 16px;
    z-index: 100;
    border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Nav ---------- */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--ink);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.site-nav .brand {
    color: #fff;
    font-family: 'Zilla Slab', Georgia, serif;
    font-weight: 600;
    font-size: 1.15em;
    text-decoration: none;
}
.site-nav .brand:hover { color: var(--stone); }

.site-nav ul {
    list-style: none;
    display: flex;
    gap: 22px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.site-nav a:not(.brand) {
    color: var(--stone);
    text-decoration: none;
    font-size: 0.95em;
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 4px 2px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.25s ease, color 0.25s ease;
}
.site-nav a:not(.brand):hover {
    color: #fff;
    border-bottom-color: var(--rust);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    background-image: url('images/rainbow.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    height: 86vh;
    min-height: 480px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    overflow: hidden;
}

@media (max-width: 768px) {
    .hero { background-attachment: scroll; }
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(31,42,36,0.25) 0%, rgba(31,42,36,0.35) 45%, rgba(31,42,36,0.75) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 3.2em;
    margin: 0;
    text-shadow: 0 4px 18px rgba(0,0,0,0.45);
    opacity: 0;
    animation: fadeUp 0.9s ease 0.15s forwards;
}

.hero-content p {
    font-size: 1.25em;
    margin-top: 14px;
    font-weight: 400;
    text-shadow: 0 2px 10px rgba(0,0,0,0.4);
    opacity: 0;
    animation: fadeUp 0.9s ease 0.4s forwards;
}

.scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 1;
    color: #fff;
    opacity: 0.85;
    animation: bob 2.2s ease-in-out infinite;
}

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

@keyframes bob {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(8px); }
}

/* ---------- Ridge divider (signature element) ---------- */
.ridge-divider {
    display: block;
    width: 100%;
    height: 32px;
    line-height: 0;
}
.ridge-divider svg { width: 100%; height: 100%; display: block; }

/* ---------- Sections ---------- */
section {
    padding: 64px 20px;
    margin: 0;
    text-align: center;
    scroll-margin-top: 74px;
}

section.band-stone { background: var(--stone); }
section.band-paper  { background: var(--paper); }

h2 {
    margin-top: 0;
    font-size: 2em;
    color: var(--ink);
}

.section-intro {
    max-width: var(--max-width);
    margin: 0 auto 28px;
    color: var(--text-muted);
}

/* Fade-in-on-scroll (reused pattern from the show log rows) */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- About ---------- */
#about p {
    max-width: var(--max-width);
    margin: 0 auto 18px;
    text-align: left;
    color: var(--text);
}

blockquote.pull {
    max-width: var(--max-width);
    margin: 32px auto 0;
    padding: 20px 26px;
    border-left: 4px solid var(--rust);
    background: var(--rust-soft);
    font-family: 'Zilla Slab', Georgia, serif;
    font-size: 1.3em;
    font-style: italic;
    text-align: left;
    color: var(--ink);
    border-radius: 0 8px 8px 0;
}

/* ---------- Gallery ---------- */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(31,42,36,0.12);
    aspect-ratio: 4 / 3;
    cursor: zoom-in;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img { transform: scale(1.06); }

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(31,42,36,0) 55%, rgba(31,42,36,0.45) 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
}
.gallery-item:hover::after { opacity: 1; }

.gallery-fallback {
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-style: italic;
}

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(15, 18, 16, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.lightbox.open { opacity: 1; pointer-events: auto; }

.lightbox.loading img { opacity: 0; }

.lightbox.loading::before {
    content: '';
    position: absolute;
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255,255,255,0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.lightbox img {
    max-width: 88vw;
    max-height: 78vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transition: opacity 0.2s ease;
}

.lightbox-caption {
    position: absolute;
    bottom: 26px;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-size: 0.95em;
}

.lightbox-btn {
    position: absolute;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    padding: 12px;
    transition: opacity 0.2s ease;
    opacity: 0.8;
}
.lightbox-btn:hover { opacity: 1; color: var(--rust); }

.lightbox-btn.close { top: 12px; right: 16px; font-size: 2rem; }
.lightbox-btn.prev  { left: 8px;  top: 50%; transform: translateY(-50%); font-size: 2.6rem; }
.lightbox-btn.next  { right: 8px; top: 50%; transform: translateY(-50%); font-size: 2.6rem; }

@media (max-width: 600px) {
    .lightbox-btn.prev, .lightbox-btn.next { font-size: 2rem; }
}

/* ---------- Contact ---------- */
.contact-list {
    list-style: none;
    max-width: 480px;
    margin: 0 auto;
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-list li {
    background: #fff;
    border: 1px solid rgba(31,42,36,0.08);
    border-radius: var(--radius);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.contact-list li:hover {
    transform: translateX(4px);
    box-shadow: 0 6px 16px rgba(31,42,36,0.1);
    border-color: var(--rust);
}

.contact-list a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
}

.contact-list a:hover { color: var(--rust); }

.contact-list svg {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    color: var(--pine);
}

.contact-list a:hover svg { color: var(--rust); }

/* ---------- Show Log ---------- */
.show-log-section {
    --log-max-width: 1080px;
}

.show-log-heading {
    max-width: var(--log-max-width);
    margin: 0 auto;
}

.show-log-intro strong {
    display: block;
    margin-top: 8px;
    color: var(--ink);
    font-family: 'Zilla Slab', Georgia, serif;
    font-size: 1.2em;
    font-weight: 600;
}

.show-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    max-width: var(--log-max-width);
    margin: 34px auto 26px;
}

.show-stat {
    position: relative;
    overflow: hidden;
    min-height: 118px;
    padding: 24px 18px;
    background: #fff;
    border: 1px solid rgba(31,42,36,0.09);
    border-radius: var(--radius);
    box-shadow: 0 5px 16px rgba(31,42,36,0.07);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.show-stat::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background-image: url('images/fishman-pattern.jpg');
    background-size: 180px auto;
    background-position: center;
}

.show-stat-number {
    display: block;
    color: var(--ink);
    font-family: 'Zilla Slab', Georgia, serif;
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1;
}

.show-stat-label {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.show-log-tools {
    max-width: var(--log-max-width);
    margin: 0 auto 20px;
    text-align: left;
}

.show-search-label {
    display: block;
    margin-bottom: 7px;
    color: var(--ink);
    font-size: 0.86rem;
    font-weight: 600;
}

.show-search {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid rgba(31,42,36,0.18);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font: inherit;
    box-shadow: inset 0 1px 2px rgba(31,42,36,0.03);
}

.show-search:focus {
    border-color: var(--rust);
    outline: 2px solid rgba(182,86,45,0.16);
    outline-offset: 1px;
}

.show-search-count {
    display: block;
    min-height: 1.4em;
    margin-top: 7px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.show-log-status {
    max-width: var(--log-max-width);
    margin: 0 auto;
    padding: 24px;
    color: var(--text-muted);
    font-style: italic;
}

.phish-shows {
    display: grid;
    gap: 12px;
    max-width: var(--log-max-width);
    margin: 0 auto;
    text-align: left;
}

.phish-show {
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(31,42,36,0.11);
    border-radius: var(--radius);
    box-shadow: 0 4px 14px rgba(31,42,36,0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.phish-show:hover {
    border-color: rgba(182,86,45,0.35);
    box-shadow: 0 7px 20px rgba(31,42,36,0.09);
}

.phish-show[open] {
    border-color: rgba(182,86,45,0.34);
}

.phish-show summary {
    display: grid;
    grid-template-columns: 78px 145px minmax(220px, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 20px 22px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.phish-show summary::-webkit-details-marker { display: none; }
.phish-show summary::marker { content: ''; }

.show-number {
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.show-date {
    color: var(--ink);
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 0.91rem;
    font-weight: 500;
}

.show-venue {
    min-width: 0;
}

.show-venue-name {
    display: block;
    color: var(--ink);
    font-family: 'Zilla Slab', Georgia, serif;
    font-size: 1.13rem;
    font-weight: 600;
    line-height: 1.25;
}

.show-location {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.show-song-count {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 0.82rem;
}

.show-expand {
    display: inline-block;
    color: var(--rust);
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.phish-show[open] .show-expand {
    transform: rotate(90deg);
}

.show-details {
    padding: 4px 22px 26px;
    border-top: 1px solid rgba(31,42,36,0.08);
}

.show-tour {
    margin: 18px 0 4px;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-style: italic;
}

.set-block {
    margin: 24px 0;
}

.set-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 9px;
    color: var(--ink);
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.set-song-count {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

.setlist-line {
    margin: 0;
    color: var(--text);
    font-size: 0.96rem;
    line-height: 1.95;
}

.setlist-line a {
    color: var(--pine);
    font-weight: 500;
    text-decoration-color: rgba(59,82,69,0.35);
}

.setlist-line a:hover {
    color: var(--rust);
    text-decoration-color: var(--rust);
}

.transition {
    color: var(--rust);
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-weight: 600;
}

.jam-chart {
    display: inline-block;
    margin-left: 3px;
    color: var(--rust);
    font-size: 0.72rem;
    vertical-align: 0.12em;
    cursor: help;
}

.set-footnotes,
.setlist-notes {
    margin-top: 12px;
    padding-left: 12px;
    border-left: 2px solid var(--stone);
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

.set-footnotes > div + div {
    margin-top: 5px;
}

.show-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.show-links a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--rust);
    font-size: 0.87rem;
    font-weight: 600;
}

.no-show-results {
    padding: 30px 20px;
    background: rgba(233,227,213,0.45);
    border-radius: var(--radius);
    color: var(--text-muted);
    text-align: center;
}

.phishnet-credit {
    max-width: var(--log-max-width);
    margin: 34px auto 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

@media (max-width: 820px) {
    .show-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .phish-show summary {
        grid-template-columns: 62px 1fr auto;
        gap: 6px 12px;
        padding: 17px;
    }

    .show-number {
        grid-row: 1 / span 3;
        align-self: start;
        padding-top: 2px;
    }

    .show-date,
    .show-venue {
        grid-column: 2;
    }

    .show-song-count {
        grid-column: 2 / 4;
        margin-top: 5px;
    }

    .show-expand {
        margin-left: auto;
    }

    .show-details {
        padding-left: 17px;
        padding-right: 17px;
    }
}

@media (max-width: 480px) {
    .show-stats { gap: 9px; }
    .show-stat { min-height: 96px; padding: 18px 10px; }
    .show-stat-number { font-size: 2rem; }
    .show-stat-label { font-size: 0.68rem; }
    .phish-show summary { grid-template-columns: 52px 1fr; }
    .show-song-count { grid-column: 2; }
}

/* ---------- Tour map ---------- */
.tour-map {
    height: 480px;
    max-width: 1000px;
    margin: 0 auto;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(31,42,36,0.12);
    background: var(--stone);
}

.leaflet-popup-content { font-family: 'IBM Plex Sans', Arial, sans-serif; line-height: 1.5; }
.leaflet-popup-content a { color: var(--rust); }

/* ---------- Footer ---------- */
footer {
    position: relative;
    background-color: var(--ink);
    color: var(--stone);
    text-align: center;
    padding: 28px 0;
    font-size: 0.9em;
}

/* ---------- Responsive type scale ---------- */
@media (max-width: 600px) {
    .hero-content h1 { font-size: 2.1em; }
    .hero-content p { font-size: 1.05em; }
    h2 { font-size: 1.6em; }
    section { padding: 48px 16px; }
}
