@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700&display=swap');

/* =====================================================
   RESET & ROOT
===================================================== */

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

:root {
    --blue: #01017D;
    --blue-light: #11119b;
    --white: #ffffff;
    --grid: rgba(1, 1, 125, 0.05);
    --text: #01017D;
    --text-secondary: #44445e;
    --border-light: rgba(1, 1, 125, 0.12);
    --border-lighter: rgba(1, 1, 125, 0.08);
}

html {
    direction: rtl;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    overflow: hidden;
    background: var(--white);
    color: var(--text);
    font-family: "Cairo", sans-serif;
}

button,
input,
textarea,
select {
    font-family: "Cairo", sans-serif;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Accessibility: Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* =====================================================
   BACKGROUND & MOTIF
===================================================== */

.background-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: var(--white);
    background-image: none !important;
    pointer-events: none;
}

.moroccan-pattern {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: none;
    background: rgba(1, 1, 125, 0.085);
}

.moroccan-pattern img {
    display: block;
    width: 100%;
    height: 12.5vh;
    min-height: 12.5vh;
    flex: 0 0 12.5vh;
    object-fit: fill;
    opacity: 1;
    margin: 0;
    padding: 0;
}

main {
    position: relative;
    z-index: 2;
}

/* =====================================================
   HEADER
===================================================== */

.header {
    position: fixed;
    top: 30px;
    left: 36px;
    right: 36px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* LOGO */

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: opacity 0.3s ease;
}

.logo:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 4px;
    border-radius: 4px;
}

.logo-circle {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blue);
    color: var(--white);
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    direction: ltr;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.logo-text strong {
    font-size: 13px;
    font-weight: 600;
}

.logo-text span {
    margin-top: 2px;
    font-size: 10px;
    opacity: 0.5;
}

/* VIEW SWITCH */

.view-switch {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 13px;
}

.view-btn {
    border: none;
    background: none;
    color: var(--blue);
    font-size: 13px;
    opacity: 0.35;
    transition: opacity 0.3s ease;
    padding: 8px 12px;
    border-radius: 4px;
}

.view-btn:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.view-btn.active {
    opacity: 1;
    font-weight: 600;
}

.view-btn:hover {
    opacity: 0.65;
}

.dot {
    font-size: 8px;
    opacity: 0.5;
}

/* =====================================================
   SPIRAL PAGE
===================================================== */

.spiral-page {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* =====================================================
   HERO
===================================================== */

.hero-content {
    position: absolute;
    right: 6vw;
    top: 50%;
    transform: translateY(-48%);
    z-index: 50;
    width: 400px;
    text-align: right;
}

.hero-kicker {
    font-size: 15px;
    font-weight: 500;
    opacity: 0.6;
    letter-spacing: 0.02em;
}

.hero-content h1 {
    margin-top: 12px;
    font-size: 92px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0;
    color: var(--blue);
}

.hero-content h1 span {
    display: block;
    color: transparent;
    -webkit-text-stroke: 1.4px var(--blue);
}

/* CANDIDATE */

.candidate {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    text-align: right;
}

.candidate strong {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
}

.candidate span {
    margin-top: 10px;
    font-size: 17px;
    line-height: 1.8;
    opacity: 0.68;
}

/* BUTTONS */

.hero-buttons {
    display: flex;
    gap: 8px;
    margin-top: 22px;
}

.button {
    border-radius: 50px;
    padding: 11px 17px;
    font-size: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-weight: 500;
}

.button:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 1, 125, 0.15);
}

.button-primary {
    background: var(--blue);
    color: var(--white);
    border: 1px solid var(--blue);
}

.button-secondary {
    background: var(--white);
    color: var(--blue);
    border: 1px solid var(--border-lighter);
}

/* =====================================================
   3D SCENE
===================================================== */

.scene {
    position: absolute;
    left: 0;
    top: 0;
    width: 68%;
    height: 100%;
    perspective: 1200px;
    perspective-origin: 50% 50%;
    z-index: 10;
    cursor: grab;
    touch-action: none;
}

.scene:active {
    cursor: grabbing;
}

.spiral {
    position: absolute;
    left: 48%;
    top: 50%;
    transform-style: preserve-3d;
}

/* =====================================================
   CARDS
===================================================== */

.spiral-card {
    position: absolute;
    width: 300px;
    height: 190px;
    margin-left: -150px;
    margin-top: -95px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    box-shadow: 0 25px 60px rgba(1, 1, 125, 0.14);
    transition: box-shadow 0.3s ease;
    will-change: transform, opacity, filter;
}

.spiral-card:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.spiral-card:hover {
    box-shadow: 0 35px 80px rgba(1, 1, 125, 0.22);
}

.card-inner {
    position: absolute;
    inset: 0;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(145deg, var(--blue), var(--blue-light));
    color: var(--white);
    text-align: right;
}

.spiral-card.light .card-inner {
    background: linear-gradient(145deg, var(--white), #f5f5ff);
    color: var(--blue);
    border: 1px solid var(--border-lighter);
}

/* CARD ELEMENTS */

.card-number {
    font-family: Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    opacity: 0.6;
    direction: ltr;
    align-self: flex-start;
    position: relative;
    z-index: 3;
}

.card-bottom {
    position: relative;
    z-index: 3;
}

.card-bottom h3 {
    font-size: 23px;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: 0;
}

.card-bottom p {
    margin-top: 5px;
    font-size: 10px;
    line-height: 1.8;
    opacity: 0.55;
}

/* CARD DECORATION */

.card-decoration {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
    opacity: 0.16;
}

.circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid currentColor;
}

.circle-1 {
    width: 230px;
    height: 230px;
    top: -120px;
    left: -70px;
}

.circle-2 {
    width: 130px;
    height: 130px;
    bottom: -65px;
    right: -45px;
    opacity: 0.45;
}

.arc {
    position: absolute;
    width: 180px;
    height: 180px;
    top: 18px;
    left: 30px;
    border-radius: 50%;
    border-top: 1px solid currentColor;
    border-left: 1px solid currentColor;
    transform: rotate(-28deg);
    opacity: 0.5;
}

/* =====================================================
   SCROLL INDICATOR
===================================================== */

.scroll-indicator {
    position: absolute;
    right: 27px;
    bottom: 35px;
    display: flex;
    align-items: center;
    gap: 10px;
    writing-mode: vertical-rl;
    font-size: 9px;
}

.scroll-indicator div {
    width: 1px;
    height: 45px;
    background: var(--blue);
    opacity: 0.25;
}

.scroll-indicator b {
    font-size: 7px;
}

/* =====================================================
   SECTION COUNTER
===================================================== */

.section-counter {
    position: absolute;
    left: 110px;
    bottom: 39px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: Arial, sans-serif;
    font-size: 9px;
    direction: ltr;
}

.section-counter div {
    width: 55px;
    height: 1px;
    background: var(--blue);
    opacity: 0.25;
}

/* =====================================================
   SOUND BUTTON
===================================================== */

.sound-button {
    position: fixed;
    left: 34px;
    bottom: 26px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1px solid rgba(1, 1, 125, 0.17);
    background: var(--white);
    color: var(--blue);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    direction: ltr;
    transition: opacity 0.3s ease;
}

.sound-button:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.sound-button:hover {
    box-shadow: 0 4px 12px rgba(1, 1, 125, 0.15);
}

.sound-button small {
    font-size: 7px;
    letter-spacing: -2px;
}

.sound-button.muted {
    opacity: 0.4;
}

/* =====================================================
   LIST VIEW
===================================================== */

.list-page {
    display: none;
    width: 100vw;
    min-height: 100vh;
    padding: 150px 8vw 70px;
    overflow-y: auto;
}

.list-page.active {
    display: block;
}

/* HEADING */

.list-heading {
    text-align: right;
    margin-bottom: 40px;
}

.list-heading span {
    font-size: 10px;
    opacity: 0.45;
}

.list-heading h2 {
    margin-top: 15px;
    font-size: 68px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0;
}

/* LIST */

.list-navigation {
    border-top: 1px solid var(--border-light);
}

.list-row {
    display: grid;
    grid-template-columns: 35px 1fr 30px;
    align-items: center;
    gap: 15px;
    padding: 17px 5px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: padding-right 0.3s ease;
}

.list-row:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: -2px;
}

.list-row:hover {
    padding-right: 15px;
}

.list-number {
    font-family: Arial, sans-serif;
    font-size: 9px;
    opacity: 0.4;
    direction: ltr;
}

.list-row h3 {
    font-size: 18px;
    font-weight: 500;
    text-align: right;
}

.list-arrow {
    font-size: 14px;
}

/* =====================================================
   MENU PANEL
===================================================== */

.menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 520px;
    height: 100vh;
    background: var(--blue);
    color: var(--white);
    z-index: 2000;
    padding: 80px 55px 40px;
    transform: translateX(105%);
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.menu-panel.open {
    transform: translateX(0);
}

/* CLOSE BUTTON */

.close-button {
    position: absolute;
    top: 25px;
    left: 30px;
    border: none;
    background: none;
    color: var(--white);
    font-size: 34px;
    cursor: pointer;
    padding: 8px;
    transition: opacity 0.3s ease;
}

.close-button:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

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

.menu-label {
    font-size: 9px;
    opacity: 0.45;
}

/* MENU NAV */

.menu-panel nav {
    margin-top: 35px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.menu-panel nav button {
    width: 100%;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    background: none;
    color: var(--white);
    padding: 15px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: right;
    font-size: 17px;
    transition: padding-right 0.3s ease;
    cursor: pointer;
}

.menu-panel nav button:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: -2px;
}

.menu-panel nav button:hover {
    padding-right: 12px;
}

.menu-panel nav button span {
    width: 25px;
    font-family: Arial, sans-serif;
    font-size: 8px;
    opacity: 0.45;
    direction: ltr;
}

.menu-bottom {
    margin-top: auto;
    font-size: 8px;
    opacity: 0.4;
}

/* =====================================================
   DETAIL PANEL
===================================================== */

.detail-panel {
    position: fixed;
    inset: 0;
    background: var(--white);
    z-index: 1800;
    transform: translateY(105%);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
}

.detail-panel.open {
    transform: translateY(0);
}

/* CLOSE BUTTON */

.detail-close {
    position: absolute;
    top: 30px;
    left: 35px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: var(--white);
    color: var(--blue);
    font-size: 25px;
    z-index: 20;
    cursor: pointer;
    transition: background 0.3s ease;
}

.detail-close:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.detail-close:hover {
    background: #f5f5ff;
}

/* LARGE NUMBER */

.detail-number {
    position: absolute;
    left: 7vw;
    top: 11vh;
    font-family: Arial, sans-serif;
    font-size: 180px;
    font-weight: 300;
    line-height: 1;
    color: rgba(1, 1, 125, 0.035);
    direction: ltr;
    pointer-events: none;
}

/* CONTENT */

.detail-content {
    width: 65%;
    margin-right: 7vw;
    padding: 18vh 0 100px;
    position: relative;
    z-index: 5;
    text-align: right;
}

.detail-kicker {
    font-size: 10px;
    opacity: 0.45;
}

.detail-content h2 {
    margin-top: 15px;
    max-width: 850px;
    font-size: 70px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0;
}

.detail-content p {
    max-width: 620px;
    margin-top: 30px;
    font-size: 15px;
    line-height: 2;
    color: var(--text-secondary);
}

/* =====================================================
   HERO PORTRAIT
===================================================== */

.hero-portrait {
    position: absolute;
    right: 23vw;
    bottom: 100px;
    width: 500px;
    height: 88vh;
    z-index: 30;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
}

.hero-portrait > img {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    transform: scale(1.22);
    transform-origin: center bottom;
    user-select: none;
    pointer-events: none;
    filter: drop-shadow(0 20px 35px rgba(1, 1, 125, 0.07));
    -webkit-mask-image: linear-gradient(
        to bottom,
        black 0%,
        black 65%,
        rgba(0, 0, 0, 0.98) 70%,
        rgba(0, 0, 0, 0.9) 76%,
        rgba(0, 0, 0, 0.7) 82%,
        rgba(0, 0, 0, 0.45) 88%,
        rgba(0, 0, 0, 0.2) 94%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to bottom,
        black 0%,
        black 65%,
        rgba(0, 0, 0, 0.98) 70%,
        rgba(0, 0, 0, 0.9) 76%,
        rgba(0, 0, 0, 0.7) 82%,
        rgba(0, 0, 0, 0.45) 88%,
        rgba(0, 0, 0, 0.2) 94%,
        transparent 100%
    );
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

.portrait-halo {
    position: absolute;
    z-index: 1;
    left: 50%;
    top: 48%;
    transform: translate(-50%, -50%);
    width: 390px;
    height: 390px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(1, 1, 125, 0.065) 0%,
        rgba(1, 1, 125, 0.025) 42%,
        rgba(1, 1, 125, 0) 72%
    );
    filter: blur(6px);
    pointer-events: none;
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 1200px) {
    .hero-portrait {
        right: 15vw;
        width: 400px;
    }

    .hero-portrait > img {
        transform: scale(1.15);
    }

    .portrait-halo {
        width: 320px;
        height: 320px;
    }
}

@media (max-width: 900px) {
    .logo-text {
        display: none;
    }

    .header {
        left: 18px;
        right: 18px;
        top: 18px;
    }

    .logo-circle {
        width: 46px;
        height: 46px;
        font-size: 12px;
    }

    .view-switch {
        top: 60px;
    }

    /* SCENE */
    .scene {
        width: 100%;
        perspective-origin: 45% 35%;
    }

    .spiral {
        left: 46%;
        top: 37%;
    }

    .spiral-card {
        width: 220px;
        height: 140px;
        margin-left: -110px;
        margin-top: -70px;
    }

    .card-bottom h3 {
        font-size: 13px;
    }

    .card-bottom p {
        display: none;
    }

    /* HERO */
    .hero-content {
        right: 22px;
        left: 22px;
        top: auto;
        bottom: 50px;
        width: auto;
        transform: none;
    }

    .hero-kicker,
    .candidate {
        display: none;
    }

    .hero-content h1 {
        font-size: 52px;
    }

    .hero-buttons {
        margin-top: 15px;
    }

    .button {
        padding: 9px 14px;
        font-size: 13px;
    }

    /* HIDE */
    .scroll-indicator,
    .section-counter {
        display: none;
    }

    .sound-button {
        left: 18px;
        bottom: 18px;
        width: 48px;
        height: 48px;
    }

    /* LIST */
    .list-page {
        padding: 125px 25px 60px;
    }

    .list-page.active {
        display: block;
    }

    .list-heading {
        margin-bottom: 40px;
    }

    .list-heading h2 {
        font-size: 50px;
    }

    /* MENU */
    .menu-panel {
        width: 100%;
        padding: 75px 30px 35px;
    }

    /* DETAIL */
    .detail-number {
        left: 20px;
        top: 100px;
        font-size: 100px;
    }

    .detail-content {
        width: auto;
        margin: 0 25px;
        padding-top: 190px;
    }

    .detail-content h2 {
        font-size: 45px;
    }

    /* PORTRAIT */
    .hero-portrait {
        position: fixed;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        bottom: auto;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 300px;
        height: 60vh;
        z-index: 5;
    }

    .hero-portrait > img {
        transform: scale(1);
    }

    .portrait-halo {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 600px) {
    .logo-circle {
        width: 40px;
        height: 40px;
        font-size: 11px;
    }

    .view-btn {
        font-size: 12px;
        padding: 6px 10px;
    }

    .hero-content {
        right: 16px;
        left: 16px;
        bottom: 30px;
    }

    .hero-content h1 {
        font-size: 36px;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .button {
        width: 100%;
        text-align: center;
        padding: 12px 16px;
        min-height: 44px;
    }

    .list-page {
        padding: 100px 18px 50px;
    }

    .list-heading h2 {
        font-size: 36px;
    }

    .list-row {
        grid-template-columns: 30px 1fr 25px;
        gap: 12px;
        padding: 12px 3px;
        min-height: 44px;
    }

    .list-number {
        font-size: 8px;
    }

    .list-row h3 {
        font-size: 15px;
    }

    .menu-panel {
        width: 100%;
        padding: 60px 20px 30px;
    }

    .menu-label {
        font-size: 8px;
    }

    .menu-panel nav button {
        font-size: 14px;
        padding: 12px 0;
        min-height: 44px;
    }

    .detail-content {
        margin: 0 18px;
        width: auto;
    }

    .detail-content h2 {
        font-size: 32px;
    }

    .detail-content p {
        font-size: 14px;
    }

    .sound-button {
        width: 44px;
        height: 44px;
        font-size: 10px;
    }

    .hero-portrait {
        width: 250px;
        height: 50vh;
    }

    .portrait-halo {
        width: 200px;
        height: 200px;
        filter: blur(4px);
    }
}

/* Enhanced mobile touchscreen optimization */
@media (max-width: 480px) {
    .header {
        left: 14px;
        right: 14px;
        top: 14px;
    }

    .logo-circle {
        width: 38px;
        height: 38px;
        font-size: 10px;
    }

    .view-switch {
        top: 56px;
    }

    .view-btn {
        font-size: 11px;
        padding: 5px 8px;
    }

    .dot {
        font-size: 7px;
    }

    .hero-content {
        right: 14px;
        left: 14px;
        bottom: 20px;
    }

    .hero-content h1 {
        font-size: 32px;
        line-height: 1.1;
        margin-top: 8px;
    }

    .hero-content h1 span {
        -webkit-text-stroke: 1px var(--blue);
    }

    .hero-buttons {
        gap: 8px;
        margin-top: 12px;
    }

    .button {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 44px;
    }

    .button-primary,
    .button-secondary {
        padding: 10px 12px;
    }

    .spiral-page {
        overflow-y: auto;
    }

    .scene {
        height: 100%;
    }

    .spiral-card {
        width: 180px;
        height: 120px;
        margin-left: -90px;
        margin-top: -60px;
    }

    .card-inner {
        padding: 14px 16px;
    }

    .card-number {
        font-size: 13px;
    }

    .card-bottom h3 {
        font-size: 11px;
    }

    .list-page {
        padding: 90px 16px 40px;
        min-height: 100vh;
    }

    .list-heading {
        margin-bottom: 32px;
    }

    .list-heading span {
        font-size: 9px;
    }

    .list-heading h2 {
        font-size: 32px;
        line-height: 1.2;
        margin-top: 12px;
    }

    .list-navigation {
        border-top: 1px solid var(--border-light);
    }

    .list-row {
        grid-template-columns: 28px 1fr 20px;
        gap: 10px;
        padding: 14px 0;
        min-height: 48px;
        align-items: center;
    }

    .list-number {
        font-size: 7px;
    }

    .list-row h3 {
        font-size: 14px;
        font-weight: 500;
    }

    .list-arrow {
        font-size: 12px;
    }

    .sound-button {
        left: 14px;
        bottom: 14px;
        width: 42px;
        height: 42px;
        font-size: 9px;
    }

    .sound-button small {
        font-size: 6px;
    }

    .menu-panel {
        width: 100%;
        padding: 55px 18px 25px;
    }

    .close-button {
        top: 20px;
        left: 25px;
        font-size: 30px;
        width: 40px;
        height: 40px;
        min-height: 44px;
    }

    .menu-label {
        font-size: 7px;
    }

    .menu-panel nav {
        margin-top: 30px;
    }

    .menu-panel nav button {
        font-size: 13px;
        padding: 13px 0;
        min-height: 44px;
        gap: 12px;
    }

    .menu-panel nav button span {
        width: 22px;
        font-size: 7px;
    }

    .menu-bottom {
        margin-top: auto;
        font-size: 7px;
    }

    .detail-panel {
        overflow-y: auto;
    }

    .detail-close {
        top: 20px;
        left: 20px;
        width: 40px;
        height: 40px;
        font-size: 22px;
        min-height: 44px;
    }

    .detail-number {
        left: 16px;
        top: 80px;
        font-size: 80px;
    }

    .detail-content {
        margin: 0 16px;
        padding: 140px 0 60px;
    }

    .detail-kicker {
        font-size: 9px;
    }

    .detail-content h2 {
        font-size: 28px;
        line-height: 1.25;
        margin-top: 12px;
    }

    .detail-content p {
        font-size: 13px;
        line-height: 1.8;
        margin-top: 20px;
    }

    .hero-portrait {
        width: 200px;
        height: 40vh;
    }

    .portrait-halo {
        width: 160px;
        height: 160px;
        filter: blur(3px);
    }
}

/* Extra small devices optimization */
@media (max-width: 380px) {
    .header {
        left: 12px;
        right: 12px;
        top: 12px;
    }

    .logo-circle {
        width: 36px;
        height: 36px;
        font-size: 9px;
    }

    .view-switch {
        top: 52px;
        gap: 10px;
    }

    .view-btn {
        font-size: 10px;
        padding: 4px 6px;
    }

    .hero-content h1 {
        font-size: 28px;
        margin-top: 6px;
    }

    .button {
        padding: 9px 12px;
        font-size: 12px;
        min-height: 42px;
    }

    .spiral-card {
        width: 160px;
        height: 110px;
        margin-left: -80px;
        margin-top: -55px;
    }

    .card-inner {
        padding: 12px 14px;
    }

    .card-number {
        font-size: 11px;
    }

    .card-bottom h3 {
        font-size: 10px;
    }

    .list-page {
        padding: 85px 14px 35px;
    }

    .list-heading h2 {
        font-size: 28px;
    }

    .list-row {
        grid-template-columns: 25px 1fr 18px;
        gap: 8px;
        padding: 12px 0;
        min-height: 46px;
    }

    .list-number {
        font-size: 6px;
    }

    .list-row h3 {
        font-size: 13px;
    }

    .sound-button {
        width: 40px;
        height: 40px;
        font-size: 8px;
    }

    .detail-content h2 {
        font-size: 26px;
    }

    .detail-content p {
        font-size: 12px;
        line-height: 1.7;
    }

    .hero-portrait {
        width: 180px;
        height: 35vh;
    }

    .portrait-halo {
        width: 140px;
        height: 140px;
        filter: blur(2px);
    }
}

@media (max-width: 320px) {
    .header {
        left: 10px;
        right: 10px;
        top: 10px;
    }

    .logo-circle {
        width: 34px;
        height: 34px;
        font-size: 8px;
    }

    .logo {
        gap: 8px;
    }

    .view-switch {
        gap: 8px;
    }

    .view-btn {
        font-size: 9px;
        padding: 3px 5px;
    }

    .hero-content {
        right: 12px;
        left: 12px;
        bottom: 18px;
    }

    .hero-content h1 {
        font-size: 26px;
        margin-top: 4px;
    }

    .hero-buttons {
        gap: 6px;
        margin-top: 10px;
    }

    .button {
        padding: 8px 10px;
        font-size: 11px;
        min-height: 40px;
        border-radius: 40px;
    }

    .spiral-card {
        width: 150px;
        height: 100px;
        margin-left: -75px;
        margin-top: -50px;
    }

    .card-inner {
        padding: 10px 12px;
    }

    .card-number {
        font-size: 10px;
    }

    .card-bottom h3 {
        font-size: 9px;
        line-height: 1.3;
    }

    .list-page {
        padding: 80px 12px 30px;
    }

    .list-heading h2 {
        font-size: 26px;
    }

    .list-row {
        grid-template-columns: 22px 1fr 15px;
        gap: 6px;
        padding: 10px 0;
        min-height: 44px;
    }

    .list-number {
        font-size: 5px;
    }

    .list-row h3 {
        font-size: 12px;
    }

    .sound-button {
        width: 38px;
        height: 38px;
        font-size: 7px;
        left: 10px;
        bottom: 10px;
    }

    .detail-content h2 {
        font-size: 24px;
    }

    .detail-number {
        font-size: 70px;
    }

    .detail-content {
        margin: 0 12px;
        padding: 120px 0 50px;
    }

    .detail-close {
        width: 38px;
        height: 38px;
        font-size: 20px;
        top: 18px;
        left: 18px;
    }

    .hero-portrait {
        width: 160px;
        height: 30vh;
    }

    .portrait-halo {
        width: 120px;
        height: 120px;
        filter: blur(2px);
    }
}
