/* Core Palette Variables */
:root {
    --bg-color: #0c0c0e;
    --card-bg: #151519;
    --card-hover: #1e1e24;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --accent: #a78bfa;
    --accent-dark: #7c3aed;
    --border: #24242b;
}

/* Explicit layout resets */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: 40px 16px;
    display: flex;
    justify-content: center;
    letter-spacing: 0.03em;
    line-height: 1.5;
}

.container {
    width: 100%;
    max-width: 460px; /* Rigid constraint to stop scaling blowouts */
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header & SVGs Elements */
.profile-header {
    text-align: center;
    padding-bottom: 8px;
}

.avatar-placeholder {
    width: 88px;
    height: 88px;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    border-radius: 50%;
    margin: 0 auto 12px auto;
    border: 2px solid var(--border);
}

.profile-header h1 {
    font-size: 1.6rem;
    color: var(--text-main);
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.social-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 14px;
}

.social-row a {
    width: 24px;
    height: 24px;
    display: block;
}

.social-row svg {
    width: 24px !important;
    height: 24px !important;
    display: block;
    fill: var(--text-muted);
}

.social-row a:hover svg {
    fill: var(--accent);
}

/* Dropdown Accordion alignment rules */
.dropdown-section {
    display: flex;
    flex-direction: column;
}

details {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
}

summary {
    list-style: none;
    padding: 14px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
}

summary::-webkit-details-marker { display: none; }

summary::after {
    content: '↓';
    position: absolute;
    right: 16px;
    color: var(--text-muted);
}

details[open] summary::after {
    content: '↑';
    color: var(--accent);
}

.dropdown-content {
    padding: 0 14px 14px 14px;
    border-top: 1px solid var(--border);
    background-color: #0e0e11;
    font-size: 0.9rem;
    color: var(--text-main);
}

/* Premium Communication Module UI Layout */
.comms-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.comms-intro {
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.5;
}

.comms-channels {
    width: 100%;
}

.channel-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: transform 0.15s, background-color 0.15s;
}

.primary-channel {
    background-color: #ffffff;
    color: #000000;
}

.primary-channel:hover {
    background-color: #e4e4e7;
    transform: translateY(-1.5px);
}

.channel-icon {
    width: 18px;
    height: 18px;
    fill: #000000;
    display: block;
}

/* Secure Form Inputs & Architecture Constraints */
.secure-email-form {
    background-color: #0e0e11;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.form-header {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.form-rules {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.input-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.secure-email-form input[type="email"],
.secure-email-form textarea {
    width: 100% !important;
    max-width: 100% !important;
    background-color: var(--bg-color);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}

.secure-email-form textarea {
    resize: none;
}

.secure-email-form input[type="email"]:focus,
.secure-email-form textarea:focus {
    border-color: var(--accent);
}

.form-submit-btn {
    background-color: var(--accent-dark);
    color: #ffffff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.15s;
    width: 100%;
}

.form-submit-btn:hover {
    background-color: var(--accent);
}

/* Sub-heading Module Labels */
.matrix-section h2, .links-section h2, .comms-card h2 {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
    font-weight: 700;
}

/* Kink Matrix Layout Block track */
.boundary-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.matrix-block {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    width: 100%;
}

.matrix-block h3 {
    font-size: 0.9rem;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.matrix-block p {
    font-size: 0.85rem;
    color: var(--text-main);
    line-height: 1.4;
}

.block-green h3 { color: #4ade80; }
.block-green { border-color: rgba(74, 222, 128, 0.15); }

.block-amber h3 { color: #facc15; }
.block-amber { border-color: rgba(250, 204, 21, 0.15); }

.block-red h3 { color: #f87171; }
.block-red { border-color: rgba(248, 113, 113, 0.15); }

/* Anchor Links Layout track */
.links-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.link-btn {
    background-color: var(--card-bg);
    color: var(--text-main);
    text-decoration: none;
    padding: 14px;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    border: 1px solid var(--border);
    display: block;
    font-size: 0.95rem;
    transition: background-color 0.15s;
    width: 100%;
}

.link-btn:hover {
    background-color: var(--card-hover);
}

.link-btn.support-link {
    border-color: rgba(167, 139, 250, 0.3);
}

.link-btn.support-link:hover {
    background-color: var(--accent-dark);
    color: #fff;
}

footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Standalone AMA Navigation Button overrides */
.return-home-btn {
    background-color: transparent !important;
    color: var(--text-muted) !important;
    border: 1px dashed var(--border) !important;
    font-size: 0.9rem !important;
}

.return-home-btn:hover {
    background-color: var(--card-bg) !important;
    color: var(--text-main) !important;
    border-style: solid !important;
}

/* Styling to ensure the name text input fields scale consistently with textareas */
.secure-email-form input[type="text"] {
    width: 100% !important;
    max-width: 100% !important;
    background-color: var(--bg-color);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}

.secure-email-form input[type="text"]:focus {
    border-color: var(--accent);
}
/* Gallery Container Track */
/* Gallery Container & Expanded Sizing Locks */
.gallery-wide-container {
    max-width: 900px !important; /* Expands wider to let the grid shine on desktop */
    width: 100%;
}

.gallery-section {
    width: 100%;
}

/* Base Mobile Matrix: Fixed 3 Columns wide */
.gallery-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important; /* Forces 3 items per row */
    gap: 12px; /* Generous padding spacing between tiles */
    width: 100%;
}

.gallery-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Image scaling & geometric lock boxes */
.gallery-image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1; /* Squarish grid layouts handle rows best on narrow devices */
    background-color: #0e0e11;
    overflow: hidden;
}

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

.gallery-card:hover .gallery-image-wrapper img {
    transform: scale(1.04);
}

/* Text Captions formatting inside small cells */
.gallery-card-info {
    padding: 10px;
    border-top: 1px solid var(--border);
    background-color: #0e0e11;
}

.gallery-card-info h3 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Keeps titles clean on mobile if text runs long */
}

.gallery-card-info p {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 🖥️ Desktop Media Mode Query (Triggers on laptop screens and larger monitors) */
@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr) !important; /* Steps smoothly up to 4 items per row */
        gap: 16px; /* Wider spacing layout for larger viewports */
    }
    
    .gallery-image-wrapper {
        aspect-ratio: 4 / 3; /* Switches to crisp landscape aspect ratios on desktop screens */
    }
    
    .gallery-card-info h3 {
        font-size: 0.9rem;
    }
    
    .gallery-card-info p {
        font-size: 0.75rem;
        white-space: normal; /* Allows long descriptions to wrap on big screens */
    }
}
/* Premium Engineering Data Log Layout */
.spec-log-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px !important;
}

.spec-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 10px;
}

.spec-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.spec-value {
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.4;
}

/* Responsive adjustment for laptop viewports */
@media (min-width: 400px) {
    .spec-row {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        gap: 16px;
    }
    .spec-label {
        min-width: 110px;
        margin-top: 2px;
    }
    .spec-value {
        text-align: right;
        max-width: 280px;
    }
}
/* Secure Fixed Profile Picture Sizing Locks */
.avatar-frame {
    width: 88px;
    height: 88px;
    margin: 0 auto 12px auto;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: linear-gradient(135deg, var(--accent-dark), var(--accent)); /* Soft backup glow gradient */
    overflow: hidden;
}

.avatar-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Keeps proportions perfect and crops to center automatically */
    display: block;
}
