/**
 * Custom Layout System – No Bootstrap
 * Semantic class names for grid, flex, spacing and utilities.
 */

/* ========== CONTAINER ========== */
.container {
    width: 100%;
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 768px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* ========== GRID ========== */
.grid {
    display: grid;
    gap: 1rem;
}

.grid--gap-sm { gap: 0.75rem; }
.grid--gap-md { gap: 1.25rem; }
.grid--gap-lg { gap: 1.5rem; }
.grid--gap-xl { gap: 2rem; }

/* 2 cols from tablet */
.grid--cols-2 {
    grid-template-columns: 1fr;
}
@media (min-width: 768px) {
    .grid--cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 3 cols from tablet */
.grid--cols-3 {
    grid-template-columns: 1fr;
}
@media (min-width: 768px) {
    .grid--cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 4 cols: 2 on tablet, 4 on desktop */
.grid--cols-4 {
    grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px) {
    .grid--cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (min-width: 1200px) {
    .grid--cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Grid item full width on mobile, half from tablet */
.grid__span-6 {
    grid-column: 1 / -1;
}
@media (min-width: 992px) {
    .grid__span-6 {
        grid-column: span 1;
    }
}

/* Grid item half width on tablet, third on desktop */
.grid__span-4 {
    grid-column: 1 / -1;
}
@media (min-width: 768px) {
    .grid__span-4 {
        grid-column: span 1;
    }
}

/* Grid item quarter on desktop */
.grid__span-3 {
    grid-column: 1 / -1;
}
@media (min-width: 768px) {
    .grid__span-3 {
        grid-column: span 1;
    }
}

/* Center grid items (for 2-col centered layout) */
.grid--center {
    justify-items: center;
}
.grid__item--half {
    grid-column: 1 / -1;
    max-width: 480px;
    justify-self: center;
}
@media (min-width: 768px) {
    .grid__item--half {
        grid-column: span 1;
        max-width: none;
    }
}

/* 5-7 split (e.g. founder image + text) */
.grid--cols-5-7 {
    grid-template-columns: 1fr;
}
@media (min-width: 768px) {
    .grid--cols-5-7 {
        grid-template-columns: 5fr 7fr;
    }
}
.grid__span-half {
    grid-column: 1 / -1;
}
@media (min-width: 768px) {
    .grid__span-half {
        grid-column: span 1;
    }
}

/* ========== FLEX ========== */
.flex {
    display: flex;
}

.flex--wrap {
    flex-wrap: wrap;
}

.flex--col {
    flex-direction: column;
}

.flex--center {
    align-items: center;
    justify-content: center;
}

.flex--between {
    justify-content: space-between;
}

.flex--align-end {
    align-items: flex-end;
}

.flex--align-center {
    align-items: center;
}

.flex--grow {
    flex-grow: 1;
}

.flex--push-bottom {
    margin-top: auto;
}

/* ========== SPACING – STACK (margin-bottom) ========== */
.stack-xs { margin-bottom: 0.25rem; }
.stack-sm { margin-bottom: 0.5rem; }
.stack-1 { margin-bottom: 0.75rem; }
.stack-2 { margin-bottom: 1rem; }
.stack-3 { margin-bottom: 1.5rem; }
.stack-4 { margin-bottom: 2rem; }
.stack-5 { margin-bottom: 2.5rem; }
.stack-lg { margin-bottom: 3rem; }
.stack-xl { margin-bottom: 4rem; }
.stack-none { margin-bottom: 0; }

/* ========== SPACING – PADDING ========== */
.pad-sm { padding: 0.75rem; }
.pad-md { padding: 1rem; }
.pad-lg { padding: 1.5rem; }
.pad-xl { padding: 2rem; }
.pad-section { padding: 2rem 1rem; }
@media (min-width: 768px) {
    .pad-section { padding: 2.5rem 1.5rem; }
}
.pad-none { padding: 0; }
.pad-top-3 { padding-top: 1.5rem; }
.pad-top-4 { padding-top: 2rem; }
.pad-bottom-4 { padding-bottom: 2rem; }
.pad-vertical-md { padding-top: 2rem; padding-bottom: 2rem; }
.pad-vertical-lg { padding-top: 3rem; padding-bottom: 3rem; }

/* ========== SPACING – GAP ========== */
.gap-xs { gap: 0.25rem; }
.gap-sm { gap: 0.5rem; }
.gap-1 { gap: 0.75rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.25rem; }
.gap-4 { gap: 1.5rem; }

/* ========== SPACING – MARGIN TOP ========== */
.m-top-1 { margin-top: 0.75rem; }
.m-top-2 { margin-top: 1rem; }
.m-top-3 { margin-top: 1.5rem; }
.m-top-4 { margin-top: 2rem; }

/* ========== TYPOGRAPHY & TEXT ========== */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary, #a1a1aa); }
.text-accent { color: var(--text-primary, #fff); }
.text-small { font-size: 0.85rem; }
.text-tiny { font-size: 0.8rem; }
.font-bold { font-weight: 700; }
.lead { font-size: 1.1rem; line-height: 1.6; }

/* ========== WIDTH & HEIGHT ========== */
.fill-height { height: 100%; }
.width-full { width: 100%; }
.max-width-narrow {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ========== BORDER ========== */
.border-top-subtle {
    border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
}

/* ========== INLINE SPACING (between inline elements) ========== */
.inline-end-sm { margin-inline-end: 0.25rem; }
.inline-end-1 { margin-inline-end: 0.5rem; }
.inline-end-2 { margin-inline-end: 0.75rem; }

/* ========== NAVIGATION (custom, no Bootstrap) ========== */
/* Header: brand left, nav center, buttons right */
.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.navbar-brand {
    order: 0;
    flex-shrink: 0;
}

.nav-trigger {
    order: 1;
}
@media (min-width: 992px) {
    .nav-trigger {
        order: 2;
    }
}

.nav-menu {
    display: none;
    width: 100%;
    order: 99;
}
@media (min-width: 992px) {
    .nav-menu {
        display: flex;
        flex: 1;
        order: 1;
        align-items: center;
        justify-content: space-between;
        gap: 1.5rem;
        min-width: 0;
    }
}

.nav-menu--open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
@media (min-width: 992px) {
    .nav-list {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        flex: 1;
        gap: 0.25rem;
    }
}

.nav-actions {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
}
@media (min-width: 992px) {
    .nav-actions {
        flex-direction: row;
        align-items: center;
        flex-shrink: 0;
        margin-left: auto;
    }
}

.nav-trigger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (min-width: 992px) {
    .nav-trigger {
        display: none;
    }
}

.nav-trigger-icon {
    width: 24px;
    height: 24px;
    display: block;
    position: relative;
}
.nav-trigger-icon span {
    display: block;
    height: 2px;
    background: currentColor;
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}
.nav-trigger-icon span::before,
.nav-trigger-icon span::after {
    content: '';
    display: block;
    height: 2px;
    background: currentColor;
    position: absolute;
    left: 0;
    right: 0;
}
.nav-trigger-icon span::before { top: -6px; }
.nav-trigger-icon span::after { top: 6px; }

/* ========== MODAL (custom, no Bootstrap) ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.is-open {
    display: flex;
}

.modal-dialog {
    width: 100%;
    max-width: 900px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
}

.modal-body {
    background: var(--bg-surface, #0a0a0a);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
    border-radius: 20px;
    overflow: hidden;
}

.ratio-16x9 {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
}
.ratio-16x9 iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ========== UTILITY ========== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hover-muted:hover {
    color: var(--text-primary, #fff);
}
