* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f5f5;
    color: #222222;
    min-height: 100vh;
    margin: 0;
}

.site-header {
    padding: 1rem 1.5rem 0;
    max-width: 960px;
    margin: 0 auto;
}

.nav-links {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.95rem;
    color: #800020;
    text-decoration: none;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 1px rgba(128, 0, 32, 0.1);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
    background: #800020;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(128, 0, 32, 0.3);
}

.nav-group {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.4rem;
    background: rgba(128, 0, 32, 0.08);
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(128, 0, 32, 0.15);
}

.nav-group .nav-item {
    background: transparent;
    box-shadow: none;
    padding: 0.25rem 0.7rem;
}

.nav-group .nav-item:hover {
    background: #800020;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(128, 0, 32, 0.3);
}

.banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 80px;
    height: 100vh;
    background-image: url("visual/sado_pixel.jpg");
    background-repeat: repeat-y;
    background-size: 80px auto;
    background-position: top left;
    margin: 0;
    padding: 0;
    z-index: 10;
}

body {
    padding-left: 80px;
}

.container {
    max-width: 960px;
    margin: 4rem auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr 260px;
    column-gap: 4rem;
    align-items: start;
}

.content {}

h1 {
    font-size: clamp(2rem, 9vw, 3.5rem);
    font-weight: 300;
    margin-bottom: 1rem;
    color: #111111;
    line-height: 1.2;
    overflow-wrap: break-word;
}

.first-name {
    font-weight: 400;
}

.name-arabic {
    font-family: inherit;
    font-size: clamp(1.9rem, 7.5vw, 3rem);
    font-weight: 300;
    color: #111111;
    margin-top: -0.85rem;
    margin-bottom: 0.75rem;
}

.affiliation {
    font-size: 1.125rem;
    color: #800020;
    margin-bottom: 2rem;
}

.contact-inline {
    font-size: 0.98rem;
    color: #555555;
    margin-top: -1.25rem;
    margin-bottom: 2rem;
    overflow-wrap: anywhere;
}

.bio {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #333333;
    text-align: justify;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
}

.greeting {
    font-size: 1.5rem;
    font-weight: 400;
    color: #800020;
}

.greeting-arabic {
    font-size: 1.5rem;
    font-weight: 400;
    color: #800020;
    position: relative;
    cursor: default;
    border-bottom: 1px dashed #800020;
}

.greeting-tooltip {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    background: #fff;
    border: 1px solid rgba(128, 0, 32, 0.2);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    white-space: nowrap;
    z-index: 100;
    flex-direction: column;
    gap: 0.25rem;
}

.greeting-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 16px;
    width: 10px;
    height: 10px;
    background: #fff;
    border-left: 1px solid rgba(128, 0, 32, 0.2);
    border-top: 1px solid rgba(128, 0, 32, 0.2);
    transform: rotate(45deg);
}

.greeting-arabic:hover .greeting-tooltip,
.greeting-arabic:focus .greeting-tooltip {
    display: flex;
}

.tooltip-note {
    font-size: 0.82rem;
    color: #666666;
    font-style: italic;
}

.interests {
    margin-top: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
}

.interests h2 {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #800020;
    margin-bottom: 0.5rem;
}

.interests p {
    font-size: 1rem;
    line-height: 1.7;
    color: #333333;
}

.bio a {
    color: #800020;
    text-decoration: none;
    border-bottom: 1px solid rgba(128, 0, 32, 0.3);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.bio a:hover {
    border-bottom-color: #800020;
    color: #5a0016;
}

.listening-link {
    color: #800020;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
    border-bottom: 1px solid rgba(128, 0, 32, 0.3);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.listening-link:hover {
    border-bottom-color: #800020;
    color: #5a0016;
}

/* ── Journey section ── */

.journey-section {
    max-width: 960px;
    margin: 1.5rem auto 3rem;
    padding: 0 1.5rem;
}

.journey-title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #800020;
    margin-bottom: 1rem;
}

.journey-subtitle {
    font-size: 0.95rem;
    color: #888;
    margin-bottom: 1.25rem;
    letter-spacing: 0.05em;
}

.journey-map-wrap {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(128, 0, 32, 0.12);
    box-shadow: 0 12px 30px rgba(17, 17, 17, 0.06);
}

.journey-map {
    height: 380px;
    width: 100%;
    background: #f0f0f0;
}

.journey-number {
    background: none !important;
    border: none !important;
}
.journey-number span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #800020;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ── Proverb footer ── */

.proverb-footer {
    max-width: 960px;
    margin: 0 auto 3rem;
    padding: 2rem 1.5rem;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

.proverb-arabic {
    font-family: 'Amiri', 'Traditional Arabic', 'Noto Naskh Arabic', serif;
    font-size: 1.6rem;
    color: #800020;
    margin-bottom: 0.5rem;
    direction: rtl;
}

.proverb-english {
    font-size: 0.95rem;
    color: #888;
    font-style: italic;
}

.proverb-source {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 0.75rem;
}

.proverb-source a {
    color: #aaa;
    text-decoration: none;
    border-bottom: 1px solid rgba(170, 170, 170, 0.3);
    transition: color 0.2s ease;
}

.proverb-source a:hover {
    color: #800020;
}

.section-divider {
    max-width: 960px;
    margin: 2rem auto 0;
    border: none;
    border-top: 1px solid #e0e0e0;
}

/* ── Listening page ── */

.listening-page {
    max-width: 700px;
    margin: 4rem auto;
    padding: 0 1.5rem;
}

.listening-title {
    font-size: 2.5rem;
    font-weight: 300;
    color: #111111;
    margin-bottom: 0.5rem;
}

.listening-subtitle {
    font-size: 1rem;
    color: #666666;
    font-style: italic;
    margin-bottom: 3rem;
}

.song-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.song-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid #e8e8e8;
}

.song-item:first-child {
    border-top: 1px solid #e8e8e8;
}

.song-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.song-name {
    font-size: 1rem;
    color: #111111;
    font-weight: 500;
}

.song-artist {
    font-size: 0.9rem;
    color: #666666;
}

.song-link {
    font-size: 0.85rem;
    color: #800020;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.song-link:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.listening-section-title {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #800020;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

.playlist-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 2.5rem;
}

.playlist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid #e8e8e8;
    text-decoration: none;
    transition: background 0.15s ease;
}

.playlist-item:first-child {
    border-top: 1px solid #e8e8e8;
}

.playlist-name {
    font-size: 1rem;
    color: #111111;
    font-weight: 500;
}

.talk-date {
    font-size: 0.85rem;
    color: #888888;
    font-weight: 400;
    margin-left: 0.4rem;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    margin-top: 4.5rem;
}

.profile-photo {
    width: 100%;
    max-width: 260px;
    aspect-ratio: 3 / 4;
    height: auto;
    object-fit: cover;
    object-position: center top;
    /* white mat + crimson keyline, matching the site accent */
    padding: 9px;
    background: #fff;
    border: 1px solid #800020;
    border-radius: 2px;
    box-shadow:
        0 0 0 4px #fff inset,
        0 10px 26px rgba(0, 0, 0, 0.14);
}

.location {
    font-size: 0.95rem;
    color: #800020;
    font-family: monospace;
    text-align: center;
}

.papers {
    margin-top: 2rem;
    padding-top: 0.5rem;
    margin-left: 0;
    margin-right: calc(-4rem - 260px - 1rem);
}

.papers h2 {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #800020;
    margin-bottom: 1.5rem;
}

.paper-item {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
    margin-bottom: 2.5rem;
}

.paper-figure {
    width: 300px;
    height: auto;
    background: transparent;
    border: none;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.paper-figure img,
.paper-figure embed {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.paper-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.paper-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

.paper-title a {
    color: #800020;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.paper-title a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.paper-description {
    font-size: 1rem;
    line-height: 1.7;
    color: #333333;
}

.paper-publication {
    font-size: 1rem;
    color: #800020;
    font-style: italic;
}

.papers-section {
    margin-left: 80px;
    padding: 3rem 2rem;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
}

.papers-section h2 {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #800020;
    margin-bottom: 2rem;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1.5rem;
}

.papers-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

@media (max-width: 1100px) {
    .papers {
        margin-right: 0;
    }
}

@media (max-width: 900px) {
    .container {
        max-width: 100%;
        margin: 2rem auto;
        padding: 0 1.25rem;
        grid-template-columns: 1fr;
        row-gap: 2rem;
    }

    .sidebar {
        order: -1;
        margin-top: 0;
        flex-direction: row;
        align-items: center;
        gap: 1.5rem;
    }

    .profile-photo {
        width: 140px;
        max-width: 140px;
    }

    .papers {
        margin-right: 0;
    }

    .paper-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .paper-figure {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .bio {
        text-align: left;
        hyphens: auto;
    }

    .listening-page {
        padding: 0 1rem;
    }
}

@media (max-width: 600px) {
    .banner {
        width: 50px;
        background-size: 50px auto;
    }

    body {
        padding-left: 50px;
    }

    .site-header {
        padding: 0.75rem 1rem 0;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-item {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
    }

    .container {
        margin: 1.5rem auto;
        padding: 0 1rem;
    }

    .affiliation {
        font-size: 1.05rem;
        margin-bottom: 1.5rem;
    }

    .bio,
    .interests p,
    .paper-description,
    .paper-publication {
        font-size: 1rem;
    }

    .sidebar {
        flex-direction: column;
    }

    .profile-photo {
        width: 160px;
        max-width: 160px;
    }

    .paper-figure {
        max-width: 100%;
    }

    .journey-section,
    .proverb-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .journey-map {
        height: 300px;
    }

    .proverb-arabic {
        font-size: 1.35rem;
    }

    .listening-title {
        font-size: 1.8rem;
    }

    .modal-content {
        max-width: 95%;
        max-height: 85%;
    }

    .modal-close {
        top: 10px;
        right: 15px;
        font-size: 36px;
    }
}

@media (max-width: 400px) {
    .banner {
        width: 32px;
        background-size: 32px auto;
    }

    body {
        padding-left: 32px;
    }

    .site-header {
        padding: 0.6rem 0.75rem 0;
    }

    .nav-links {
        justify-content: flex-end;
    }

    .nav-item {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
        gap: 0.25rem;
    }

    .container {
        padding: 0 0.85rem;
        margin: 1.25rem auto;
    }

    .journey-section,
    .proverb-footer {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .journey-map {
        height: 260px;
    }
}

.expandable-image {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.expandable-image:hover {
    opacity: 0.85;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.modal.show {
    background-color: rgba(0, 0, 0, 0.95);
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.7);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #ffffff;
    font-size: 50px;
    font-weight: 300;
    cursor: pointer;
    transition: opacity 0.2s ease;
    z-index: 1001;
}

.modal-close:hover {
    opacity: 0.7;
}

/* ── Visitors page ── */

.visitors-page {
    max-width: 1100px;
    margin: 3.5rem auto 4rem;
    padding: 0 1.5rem 2rem;
}

.visitors-hero {
    margin-bottom: 2rem;
}

.visitors-kicker {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #800020;
    margin-bottom: 0.75rem;
}

.visitors-title {
    font-size: 2.9rem;
    font-weight: 300;
    color: #111111;
    margin-bottom: 0.75rem;
    line-height: 1.12;
}

.visitors-subtitle {
    font-size: 1.08rem;
    line-height: 1.8;
    color: #444444;
    max-width: 62ch;
}

.visitors-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.visitors-stat-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(128, 0, 32, 0.12);
    border-radius: 14px;
    padding: 1.15rem 1.25rem;
    box-shadow: 0 12px 30px rgba(17, 17, 17, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.visitors-stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #800020;
}

.visitors-stat-value {
    font-size: 1.4rem;
    font-weight: 600;
    color: #111111;
    word-break: break-word;
    line-height: 1.3;
}

.visitors-layout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.visitors-map-panel {
    grid-column: 1 / 3;
}

.visitors-panel {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(128, 0, 32, 0.12);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(17, 17, 17, 0.08);
    overflow: hidden;
}

.visitors-map-panel {
    padding: 1.25rem;
}

.visitors-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}

.visitors-panel-copy {
    font-size: 0.95rem;
    color: #666666;
}

.visitors-section-title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #800020;
}

.visitors-map {
    height: 520px;
    width: 100%;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, #f6f7fb 0%, #edf0f6 100%);
}

.visitors-summary-panel {
    padding: 1.25rem;
}

.visitors-note {
    font-size: 0.98rem;
    line-height: 1.75;
    color: #555555;
    margin-bottom: 1.5rem;
}

.visitors-summary-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.visitors-summary-item {
    padding: 0.95rem 1rem;
    border-radius: 16px;
    background: #f8f8f8;
    border: 1px solid #ece6e8;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.visitors-summary-item.highlight-current {
    background: #fffafa;
    border-color: #f1c6cf;
}

.visitors-summary-key {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #800020;
}

.visitors-summary-value {
    font-size: 1rem;
    color: #222222;
}

.visitors-you {
    background: rgba(128, 0, 32, 0.06);
    border-color: rgba(128, 0, 32, 0.3);
}

.visitors-analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.visitors-analytics-subtitle {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #800020;
    margin-bottom: 0.75rem;
}

.visitors-analytics-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.visitors-analytics-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
}

.visitors-analytics-bar-wrap {
    flex: 1;
    height: 6px;
    background: #f0eaec;
    border-radius: 3px;
    overflow: hidden;
}

.visitors-analytics-bar {
    height: 100%;
    background: #800020;
    border-radius: 3px;
    opacity: 0.6;
    transition: width 0.4s ease;
}

.visitors-analytics-label {
    min-width: 110px;
    font-size: 0.9rem;
    color: #333;
}

.visitors-analytics-count {
    min-width: 24px;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    color: #800020;
}

.visitors-you-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: #800020;
    padding: 0.15em 0.5em;
    border-radius: 8px;
    margin-left: 0.4em;
    vertical-align: middle;
}

@media (max-width: 900px) {
    .visitors-layout {
        grid-template-columns: 1fr;
    }

    .visitors-map {
        height: 460px;
    }
}

@media (max-width: 600px) {
    .visitors-page {
        margin: 2rem auto 3rem;
        padding: 0 1rem 1.5rem;
    }

    .visitors-title {
        font-size: 2rem;
        max-width: none;
    }

    .visitors-subtitle {
        font-size: 1rem;
    }

    .visitors-stats {
        grid-template-columns: 1fr;
    }

    .visitors-panel-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .visitors-map {
        height: 360px;
    }
}
