*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
}

body {
    background: #ffffff;
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        sans-serif;
    color: #111;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.viewer-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 600px;
    margin: 0 auto;
    background: #ffffff;
}

.top-controls {
    display: flex;
    gap: 8px;
    padding: 14px 16px 0;
}

.btn {
    border: none;
    padding: 12px 18px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    flex: 1;
    transition:
        transform 0.15s ease,
        filter 0.15s ease,
        background-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.97);
}

.btn svg {
    flex-shrink: 0;
}

.btn-primary {
    background: #0a84ff;
    color: #ffffff;
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-secondary {
    background: #ffffff;
    color: #111;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: #f2f2f2;
}

.title-block {
    padding: 14px 20px 4px;
}

.title-species {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: #111;
}

.title-meta,
.title-size {
    margin: 4px 0 0;
    font-size: 15px;
    color: #7a7a7a;
    line-height: 1.35;
}

model-viewer {
    flex: 1;
    width: 100%;
    min-height: 280px;
    --poster-color: transparent;
    background: transparent;
}

.info-card {
    margin: 12px 12px 12px;
    background: #ececec;
    border-radius: 24px;
    overflow: hidden;
}

.info-card-body {
    padding: 18px 20px 16px;
}

.info-card-title {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    color: #111;
}

.info-card-text {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
    color: #1a1a1a;
}

.newsletter-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: #ececec;
    color: #0a84ff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.newsletter-trigger:hover {
    background: #e2e2e2;
}

.newsletter-trigger:active {
    background: #d8d8d8;
}

.newsletter-trigger svg {
    width: 18px;
    height: 18px;
    transition: transform 0.15s ease;
}

.newsletter-trigger:hover svg {
    transform: translateX(3px);
}

.newsletter-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.18s ease;
    pointer-events: none;
}

.newsletter-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.newsletter-modal[hidden] {
    display: none;
}

.newsletter-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.newsletter-modal-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 28px 24px 24px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(8px) scale(0.98);
    transition: transform 0.18s ease;
}

.newsletter-modal.is-open .newsletter-modal-card {
    transform: translateY(0) scale(1);
}

.newsletter-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.newsletter-modal-close:hover {
    background: rgba(0, 0, 0, 0.06);
}

.newsletter-modal-close svg {
    width: 20px;
    height: 20px;
}

.newsletter-modal-title {
    margin: 0 0 8px;
    padding-right: 36px;
    font-size: 22px;
    font-weight: 700;
    color: #111;
    line-height: 1.2;
}

.newsletter-modal-text {
    margin: 0 0 18px;
    font-size: 15px;
    line-height: 1.45;
    color: #333;
}

.newsletter-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.newsletter-input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    color: #1a1a1a;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.15s ease;
}

.newsletter-input::placeholder {
    color: #888;
}

.newsletter-input:focus {
    border-color: #0a84ff;
}

.newsletter-input:disabled {
    opacity: 0.5;
}

.newsletter-button {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: #0a84ff;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.15s ease;
}

.newsletter-button:hover:not(:disabled) {
    filter: brightness(1.05);
}

.newsletter-button:active:not(:disabled) {
    filter: brightness(0.95);
}

.newsletter-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.newsletter-button svg {
    width: 20px;
    height: 20px;
}

.newsletter-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

.newsletter-status {
    margin: 14px 0 0;
    font-size: 14px;
    line-height: 1.4;
    color: #555;
}

.newsletter-status:empty {
    display: none;
}

.newsletter-status[data-type="success"] {
    margin-top: 0;
    font-size: 16px;
    color: #1a7f3c;
}

.newsletter-status[data-type="error"] {
    color: #c0392b;
}

.cta-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #0a84ff;
    color: #ffffff;
    text-decoration: none;
    font-size: 17px;
    font-weight: 600;
    transition: filter 0.15s ease;
}

.cta-button:hover {
    filter: brightness(1.05);
}

.cta-button:active {
    filter: brightness(0.95);
}

.cta-logo {
    height: 26px;
    width: 26px;
    flex-shrink: 0;
    color: #ffffff;
}

.cta-logo path {
    fill: currentColor;
}

.cta-text {
    flex: 1;
    text-align: center;
    padding-right: 38px;
}

.hidden {
    display: none !important;
}

@media (max-width: 380px) {
    .btn {
        padding: 10px 14px;
        font-size: 14px;
    }
    .title-species {
        font-size: 22px;
    }
    .info-card-title {
        font-size: 18px;
    }
    .info-card-text {
        font-size: 15px;
    }
    .cta-button {
        font-size: 16px;
        padding: 12px 16px;
    }
    .cta-text {
        padding-right: 32px;
    }
    .cta-logo {
        height: 22px;
        width: 22px;
    }
}

.gallery-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 600px;
    margin: 0 auto;
    background: #ffffff;
    padding: 24px 16px 16px;
}

.gallery-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.gallery-logo {
    height: 32px;
    width: 32px;
    flex-shrink: 0;
    color: #0a84ff;
}

.gallery-logo path {
    fill: currentColor;
}

.gallery-brand {
    font-size: 15px;
    font-weight: 600;
    color: #7a7a7a;
    letter-spacing: 0.02em;
}

.gallery-title {
    margin: 0 0 8px;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #111;
}

.gallery-subtitle {
    margin: 0 0 24px;
    font-size: 16px;
    line-height: 1.45;
    color: #7a7a7a;
}

.gallery-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.parasite-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: #f4f4f4;
    border-radius: 20px;
    text-decoration: none;
    color: inherit;
    transition:
        background-color 0.15s ease,
        transform 0.15s ease;
}

.parasite-card:hover {
    background: #ececec;
}

.parasite-card:active {
    transform: scale(0.99);
}

.parasite-thumb {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid rgba(10, 132, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0a84ff;
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -0.02em;
    overflow: hidden;
    position: relative;
}

.parasite-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.parasite-body {
    flex: 1;
    min-width: 0;
}

.parasite-species {
    margin: 0 0 2px;
    font-size: 17px;
    font-weight: 700;
    color: #111;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.parasite-meta {
    margin: 0;
    font-size: 14px;
    color: #7a7a7a;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.parasite-arrow {
    flex-shrink: 0;
    color: #b0b0b0;
    width: 20px;
    height: 20px;
}

.gallery-info-card {
    margin-top: 20px;
    background: #ececec;
    border-radius: 24px;
    overflow: hidden;
}

@media (max-width: 380px) {
    .gallery-title {
        font-size: 26px;
    }
    .parasite-thumb {
        width: 60px;
        height: 60px;
    }
    .parasite-species {
        font-size: 16px;
    }
}
