/* ==========================================================================
   SPACEX DESIGN SYSTEM — ktcomfenix
   Inspired by SpaceX cinematic aerospace aesthetic
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CUSTOM PROPERTIES (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
    /* Colors */
    --space-black: #000000;
    --spectral-white: #f0f0fa;
    --ghost-surface: rgba(240, 240, 250, 0.1);
    --ghost-border: rgba(240, 240, 250, 0.35);
    --dark-overlay: rgba(0, 0, 0, 0.5);
    --spectral-dim: rgba(240, 240, 250, 0.7);

    /* Typography */
    --font-display: 'Inter', Arial, Verdana, sans-serif;
    --font-body: 'Inter', Arial, Verdana, sans-serif;

    /* Spacing (8px base) */
    --space-xs: 3px;
    --space-sm: 5px;
    --space-md: 12px;
    --space-lg: 18px;
    --space-xl: 24px;
    --space-2xl: 30px;
    --space-3xl: 48px;
    --space-4xl: 80px;

    /* Border radius */
    --radius-sharp: 4px;
    --radius-button: 32px;
}

/* --------------------------------------------------------------------------
   2. BASE RESET & BODY
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--space-black);
    color: var(--spectral-white);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    min-width: 300px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.96px;
    line-height: 1.0;
    color: var(--spectral-white);
    margin-top: 0;
}

h1, .display-hero {
    font-size: 3rem;   /* 48px */
    letter-spacing: 0.96px;
}

h2 {
    font-size: 2rem;
    letter-spacing: 0.96px;
}

h3 {
    font-size: 1.5rem;
    letter-spacing: 0.96px;
}

h4 {
    font-size: 1.25rem;
    letter-spacing: 0.96px;
}

p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--spectral-white);
    margin-bottom: var(--space-lg);
}

a {
    color: var(--spectral-white);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    color: var(--spectral-white);
    opacity: 0.8;
}

i, em {
    color: var(--spectral-dim);
}

strong, b {
    font-weight: 700;
}

ul {
    list-style-type: none;
    padding: 0;
}

/* Override Bootstrap .text-dark */
.text-dark {
    color: var(--spectral-white) !important;
}

/* --------------------------------------------------------------------------
   4. NAVIGATION
   -------------------------------------------------------------------------- */
.spacex-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: transparent;
    padding: var(--space-lg) var(--space-xl);
    transition: background 0.3s ease;
    z-index: 1000;
}

.spacex-nav.scrolled {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
}

.nav-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1.17px;
    color: var(--spectral-white);
    position: relative;
    white-space: nowrap;
}

.nav-brand:hover {
    color: var(--spectral-white);
    opacity: 0.8;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--ghost-border);
    padding: 4px 8px;
    border-radius: var(--radius-sharp);
    cursor: pointer;
}

.nav-toggle:focus {
    box-shadow: 0 0 0 2px var(--ghost-border);
    outline: none;
}

.nav-toggle-icon {
    display: inline-block;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgb(240, 240, 250)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 1.5rem;
    height: 1.5rem;
    vertical-align: middle;
}

.nav-menu {
    display: flex;
    flex-basis: auto;
    flex-grow: 1;
    align-items: center;
}

.nav-list {
    display: flex;
    flex-direction: row;
    margin: 0 0 0 auto;
    padding: 0;
    list-style: none;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    font-family: var(--font-body);
    font-size: 0.81rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.17px;
    color: var(--spectral-white);
    padding: var(--space-md) var(--space-lg);
    display: block;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--spectral-white);
    opacity: 0.7;
    outline: none;
}

/* Dropdown menu */
.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    display: none;
    min-width: 10rem;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--ghost-border);
    border-radius: var(--radius-sharp);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-dropdown.show .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    color: var(--spectral-white);
    font-family: var(--font-body);
    font-size: 0.81rem;
    text-transform: uppercase;
    letter-spacing: 1.17px;
    padding: var(--space-md) var(--space-lg);
    clear: both;
    white-space: nowrap;
    border: none;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--ghost-surface);
    color: var(--spectral-white);
    text-decoration: none;
}

/* Search input in nav */
.nav-search-form {
    display: flex;
    margin-left: var(--space-md);
}

.nav-search-input {
    display: block;
    width: 100%;
    background: var(--ghost-surface);
    border: 1px solid var(--ghost-border);
    color: var(--spectral-white);
    font-family: var(--font-body);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: var(--radius-button);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: 0;
}

.nav-search-input::placeholder {
    color: var(--spectral-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-search-input:focus {
    background: rgba(240, 240, 250, 0.15);
    border-color: var(--spectral-white);
    color: var(--spectral-white);
    box-shadow: none;
    outline: none;
}

/* Mobile Menu */
@media (max-width: 1199.98px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-basis: 100%;
        flex-grow: 1;
        align-items: center;
        background: rgba(10, 10, 10, 0.98); 
        padding: var(--space-2xl) var(--space-xl);
        margin-top: var(--space-lg);
        border: 1px solid rgba(240, 240, 250, 0.1);
        border-radius: var(--radius-sharp);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .nav-menu.show {
        display: flex;
        flex-direction: column;
    }

    .nav-list {
        flex-direction: column;
        width: 100%;
        margin: 0;
    }
    
    .nav-item {
        width: 100%;
        text-align: center;
    }

    .nav-link {
        padding: var(--space-lg) 0;
        font-size: 1rem;
        letter-spacing: 2px;
        border-bottom: 1px solid rgba(240, 240, 250, 0.05);
        width: 100%;
        text-align: center;
    }
    
    .nav-item:last-of-type .nav-link {
        border-bottom: none;
    }

    .nav-search-form {
        justify-content: center;
        margin-top: var(--space-xl);
        margin-left: 0;
        width: 100%;
    }

    .nav-search-input {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
    
    .dropdown-menu {
        position: static;
        width: 100%;
        float: none;
        background: transparent;
        border: none;
        box-shadow: none;
        padding-top: 0;
        margin-top: 0;
        display: none;
    }
    
    .dropdown-item {
        text-align: center;
        padding: var(--space-md) 0;
        border-bottom: 1px solid rgba(240, 240, 250, 0.05);
    }
}

/* --------------------------------------------------------------------------
   5. GHOST BUTTON — The sole interactive element
   -------------------------------------------------------------------------- */
.ghost-btn,
.contact-button,
.color-button {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.81rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.17px;
    color: var(--spectral-white);
    background: var(--ghost-surface);
    border: 1px solid var(--ghost-border);
    border-radius: var(--radius-button);
    padding: var(--space-lg);
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease;
    text-decoration: none;
    text-align: center;
    line-height: 1;
    width: auto;
}

.ghost-btn:hover,
.contact-button:hover,
.color-button:hover {
    background: rgba(240, 240, 250, 0.2);
    border-color: var(--spectral-white);
    color: var(--spectral-white);
    text-decoration: none;
}

/* Remove old contact-button styles that conflict */
.contact-button {
    font-family: var(--font-body);
}

/* --------------------------------------------------------------------------
   6. HERO & PARALLAX SECTIONS — Full-viewport cinematic frames
   -------------------------------------------------------------------------- */
.parallax1,
.parallax2,
.parallax3,
.hero-section {
    position: relative;
    min-height: 100vh;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
}

.parallax1 {
    background-image: url(/media/photos/background1.webp);
}

.parallax2 {
    background-image: url(/media/photos/background2.webp);
}

.parallax3 {
    background-image: url(/media/photos/background3.webp);
}

/* Dark gradient overlay for text legibility */
.parallax1::after,
.parallax2::after,
.parallax3::after,
.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.6) 100%
    );
    pointer-events: none;
}

/* Content inside hero sections sits above the overlay */
.parallax1 > *,
.parallax2 > *,
.parallax3 > *,
.hero-section > * {
    position: relative;
    z-index: 1;
}

/* --------------------------------------------------------------------------
   7. CONTENT SECTIONS — Text on dark
   -------------------------------------------------------------------------- */
.content-container-outer {
    padding-top: 0;
}

.pt-navbar {
    padding-top: 120px !important;
}

.content-container-inner {
    margin: 0;
    padding: var(--space-3xl) var(--space-xl);
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

.content-container-inner a,
.content-container-inner a:hover {
    color: var(--spectral-white);
    text-decoration: underline;
    text-decoration-color: var(--ghost-border);
    text-underline-offset: 3px;
}

.content-container-inner a:hover {
    text-decoration-color: var(--spectral-white);
}

.content-container-centered {
    text-align: center;
}

.content-container-centered img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 15em;
}

.content-container-centered2 {
    padding: var(--space-3xl) var(--space-xl);
    text-align: center;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

/* Section titles — remove old teal color override */
.h2-title {
    color: var(--spectral-white);
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.96px;
}

/* Horizontal rules */
hr {
    border: none;
    border-top: 1px solid var(--ghost-border);
    margin: var(--space-xl) 0;
}

/* --------------------------------------------------------------------------
   8. REFERENCE IMAGES
   -------------------------------------------------------------------------- */
.ref-image {
    background: var(--ghost-surface);
    border: 1px solid var(--ghost-border);
    border-radius: var(--radius-sharp);
    padding: var(--space-xl);
    width: 60%;
    max-width: 600px;
    margin: 0 auto var(--space-3xl) auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.ref-image:hover {
    border-color: var(--spectral-white);
    transform: translateY(-2px);
}

.ref-image > a:first-of-type {
    width: 100%;
}

.ref-image img {
    display: block;
    border-radius: var(--radius-sharp);
    width: 100%;
    margin-bottom: var(--space-md);
    border: 1px solid var(--ghost-border);
    box-sizing: border-box;
    transition: opacity 0.3s ease;
}

.ref-image img:hover {
    opacity: 0.9;
}

.ref-image p {
    margin-bottom: var(--space-xs);
}

.ref-image p.text-dim {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   9. FORMS — Dark inputs with spectral borders
   -------------------------------------------------------------------------- */
input,
textarea,
select {
    width: 100%;
    display: block;
    background: var(--ghost-surface);
    border: 1px solid var(--ghost-border);
    border-radius: var(--radius-sharp);
    color: var(--spectral-white);
    font-family: var(--font-body);
    font-size: 1rem;
    padding: var(--space-md) var(--space-lg);
    transition: border-color 0.3s ease, background 0.3s ease;
    margin-bottom: var(--space-md);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--spectral-white);
    background: rgba(240, 240, 250, 0.15);
}

input::placeholder,
textarea::placeholder {
    color: var(--spectral-dim);
}

input[type="submit"],
button[type="submit"] {
    width: auto;
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.81rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.17px;
    color: var(--spectral-white);
    background: var(--ghost-surface);
    border: 1px solid var(--ghost-border);
    border-radius: var(--radius-button);
    padding: var(--space-lg) var(--space-xl);
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease;
}

input[type="submit"]:hover,
button[type="submit"]:hover {
    background: rgba(240, 240, 250, 0.2);
    border-color: var(--spectral-white);
}

/* Form labels */
label {
    font-family: var(--font-body);
    font-size: 0.81rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.17px;
    color: var(--spectral-white);
    display: block;
    margin-bottom: var(--space-sm);
}

/* --------------------------------------------------------------------------
   10. TABLES
   -------------------------------------------------------------------------- */
table {
    text-align: left;
    color: var(--spectral-white);
    width: 100%;
}

table td,
table th {
    padding: var(--space-md);
    border-bottom: 1px solid var(--ghost-border);
}

/* --------------------------------------------------------------------------
   11. CODE BLOCKS — Dark with subtle border
   -------------------------------------------------------------------------- */
pre {
    border: 1px solid var(--ghost-border);
    border-radius: var(--radius-sharp);
    margin-bottom: var(--space-xl);
    overflow: hidden;
}

/* Let highlight.js handle inner padding and colors */
pre code.hljs {
    padding: var(--space-lg);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Inline code (not in pre) */
p code,
li code,
td code {
    font-size: 0.875rem;
    color: var(--spectral-white);
    background: rgba(240, 240, 250, 0.1);
    padding: 3px 6px;
    border-radius: 4px;
}

/* --------------------------------------------------------------------------
   12. IMAGES (global)
   -------------------------------------------------------------------------- */
img {
    width: 100%;
    height: auto;
}

/* Profile image — circular crop */
img[alt*="mugshot"],
img[style*="border-radius: 50%"] {
    border-radius: 50%;
    border: 2px solid var(--ghost-border);
}

/* --------------------------------------------------------------------------
   13. FOOTER — Minimal spectral
   -------------------------------------------------------------------------- */
footer {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    font-family: var(--font-body);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--spectral-dim);
}

footer hr {
    border-top: 1px solid var(--ghost-border);
    max-width: 200px;
    margin: 0 auto var(--space-xl);
}

/* --------------------------------------------------------------------------
   14. NAVBAR SCROLL EFFECT (JS-driven class toggle)
   -------------------------------------------------------------------------- */
/* The navbar starts transparent and gains background on scroll.
   Add this class via JS: document.querySelector('.navbar').classList */

/* --------------------------------------------------------------------------
   15. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */

/* Mobile: <600px */
@media only screen and (max-width: 600px) {
    .parallax1,
    .parallax2,
    .parallax3 {
        min-height: 80vh;
        background-attachment: scroll; /* Fix iOS parallax bug */
    }

    .parallax1 {
        background-image: url(/media/photos/background1.webp);
    }

    .parallax2 {
        background-image: url(/media/photos/background2_mobile.webp);
    }

    .parallax3 {
        background-image: url(/media/photos/background3_mobile.webp);
    }

    h1, .display-hero {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .navbar-brand {
        font-size: 1.2rem !important;
    }

    .content-container-inner {
        padding: var(--space-xl) var(--space-lg);
    }

    .content-container-centered2 {
        padding: var(--space-xl) var(--space-lg);
    }

    .content-container-centered img {
        width: 12em;
    }

    .ref-image {
        width: 95%;
        padding: var(--space-md);
    }
}

/* Tablet Small: 600–960px */
@media only screen and (min-width: 601px) and (max-width: 960px) {
    .parallax1,
    .parallax2,
    .parallax3 {
        min-height: 70vh;
    }

    .ref-image {
        width: 80%;
    }
}

/* Tablet: 960–1280px */
@media only screen and (min-width: 961px) and (max-width: 1280px) {
    .content-container-inner {
        padding: var(--space-3xl) var(--space-2xl);
    }
}

/* --------------------------------------------------------------------------
   16. UTILITY CLASSES
   -------------------------------------------------------------------------- */
.text-spectral {
    color: var(--spectral-white);
}

.text-dim {
    color: var(--spectral-dim);
}

.section-dark {
    background: var(--space-black);
}

.mt-section {
    margin-top: var(--space-3xl);
}

.mb-section {
    margin-bottom: var(--space-3xl);
}

/* Fix Bootstrap .bg-dark override */
.bg-dark {
    background-color: transparent !important;
}

/* Ensure navbar-dark text stays spectral */
.navbar-dark .navbar-nav .nav-link {
    color: var(--spectral-white) !important;
}
