/* 
   Alejandro Cabrera - Institutional Website Core Stylesheet
   Design System: Absolute Black (#000000), White (#ffffff), Slate Blue (#2e4257), Steel Blue (#c7d9e5)
   Typography: Erstoria (Serif) & Poppins (Sans-serif)
*/

/* -------------------------------------------------------------
   01. VARIABLES & FONT DECLARATIONS
   ------------------------------------------------------------- */
@font-face {
    font-family: 'Erstoria';
    src: url('fonts/Erstoria.ttf') format('truetype'),
         url('fonts/Erstoria.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
    descent-override: 30%;
    ascent-override: 95%;
}

:root {
    /* Color Palette */
    --color-bg-black: #000000;
    --color-text-white: #ffffff;
    --color-slate-blue: #2e4257;
    --color-steel-blue: #c7d9e5;
    --color-lino: #f3eeea;
    
    /* Semantic Colors */
    --color-border: #2e4257;
    --color-accent: #c7d9e5;
    --color-card-bg: rgba(18, 18, 18, 0.6);
    --color-input-bg: rgba(15, 23, 33, 0.4);
    
    /* Typography */
    --font-headers: 'Erstoria', Georgia, Cambria, 'Times New Roman', serif;
    --font-body: 'Poppins', system-ui, -apple-system, sans-serif;
    
    /* Layout Constants */
    --navbar-height: 80px;
    --container-max-width: 1400px;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.2s ease;
}

/* -------------------------------------------------------------
   02. RESET & BASE STYLES
   ------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--navbar-height);
    background-color: var(--color-bg-black);
    color: var(--color-text-white);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    background-color: var(--color-bg-black);
    color: var(--color-text-white);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.nav-active {
    overflow: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg-black);
}
::-webkit-scrollbar-thumb {
    background: var(--color-slate-blue);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-steel-blue);
}

/* Selection */
::selection {
    background-color: var(--color-slate-blue);
    color: var(--color-text-white);
}

/* Accessibility skip link */
.skip-link {
    position: absolute;
    top: -80px;
    left: 20px;
    background: var(--color-steel-blue);
    color: var(--color-bg-black);
    padding: 10px 20px;
    font-weight: 500;
    z-index: 10000;
    transition: top 0.3s ease;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
}
.skip-link:focus {
    top: 0;
}

/* Links & Typography */
a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

h1, h2 {
    font-family: var(--font-headers);
    font-weight: normal;
    letter-spacing: -0.01em;
    line-height: 1.35;
    padding-bottom: 0.25em;
    overflow: visible;
}

h3, h4, h5, h6 {
    font-family: var(--font-body);
    font-weight: 500;
    letter-spacing: -0.04em;
}

p {
    font-weight: 300;
    color: var(--color-steel-blue);
}

.text-highlight {
    color: var(--color-text-white);
    font-weight: 400;
}

.link-inline {
    color: var(--color-steel-blue);
    border-bottom: 1px solid var(--color-slate-blue);
    transition: var(--transition-fast);
}
.link-inline:hover {
    color: var(--color-text-white);
    border-bottom-color: var(--color-text-white);
}

/* -------------------------------------------------------------
   03. NAVBAR (STICKY / GLASSMORPHIC)
   ------------------------------------------------------------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--navbar-height);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(46, 66, 87, 0.25);
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: var(--transition-smooth);
}

.navbar-container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    height: 100%;
}
.logo-img {
    height: 48px;
    width: auto;
    min-width: 150px; /* Force minimum footprint to prevent collapsing in flex containers */
    max-width: 250px;
    display: block;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}
.nav-logo:hover .logo-img {
    opacity: 1;
}

.nav-menu {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 40px;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--color-steel-blue);
    letter-spacing: 0.05em;
    position: relative;
    padding: 8px 0;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-text-white);
    transition: var(--transition-smooth);
}
.nav-link:hover {
    color: var(--color-text-white);
}
.nav-link:hover::after {
    width: 100%;
}

.btn-nav-cta {
    border: 1px solid var(--color-slate-blue);
    padding: 8px 20px !important;
    border-radius: 50px;
    transition: var(--transition-smooth);
    background-color: rgba(46, 66, 87, 0.1);
}
.btn-nav-cta::after {
    display: none;
}
.btn-nav-cta:hover {
    border-color: var(--color-steel-blue);
    background-color: rgba(199, 217, 229, 0.15);
    color: var(--color-text-white);
}

.nav-toggle {
    display: none;
    background: var(--color-text-white);
    border: 1px solid var(--color-text-white);
    border-radius: 4px;
    cursor: pointer;
    padding: 13px 9px;
    width: 44px;
    height: 44px;
    position: relative;
    z-index: 1010;
    transition: var(--transition-smooth);
}
.nav-toggle:hover, .nav-toggle:focus {
    background: var(--color-bg-black);
    border-color: var(--color-steel-blue);
    outline: none;
}
.nav-toggle:hover .bar, .nav-toggle:focus .bar {
    background-color: var(--color-text-white);
}
.nav-toggle.active {
    background: var(--color-bg-black);
    border-color: var(--color-steel-blue);
}
.nav-toggle.active .bar {
    background-color: var(--color-text-white);
}
.nav-toggle .bar {
    display: block;
    width: 24px;
    height: 3px;
    margin: 4px 0;
    background-color: var(--color-bg-black);
    transition: var(--transition-smooth);
    border-radius: 2px;
}

/* -------------------------------------------------------------
   04. COMMON SECTION COMPONENTS
   ------------------------------------------------------------- */
.section-container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 120px 40px;
}

.section-header {
    margin-bottom: 60px;
    max-width: 800px;
}

.section-subtitle {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-steel-blue);
    margin-bottom: 12px;
}

.section-title {
    font-size: 2.8rem;
    color: var(--color-text-white);
    line-height: 1.3;
    margin-bottom: 20px;
    padding-bottom: 12px;
    overflow: visible;
}

.section-desc {
    font-size: 1.1rem;
    color: var(--color-steel-blue);
    font-weight: 300;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    background-color: var(--color-steel-blue);
    color: var(--color-bg-black);
    padding: 16px 36px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 50px;
    border: 1px solid var(--color-steel-blue);
    cursor: pointer;
    transition: var(--transition-smooth);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.btn-primary:hover {
    background-color: transparent;
    color: var(--color-text-white);
    border-color: var(--color-text-white);
    box-shadow: 0 0 25px rgba(199, 217, 229, 0.2);
}

.btn-outline {
    display: inline-block;
    background-color: transparent;
    color: var(--color-text-white);
    padding: 16px 36px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: var(--transition-smooth);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
}
.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--color-text-white);
    border-color: var(--color-steel-blue);
    box-shadow: 0 0 25px rgba(199, 217, 229, 0.15);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

/* -------------------------------------------------------------
   05. HERO SECTION (ASYMMETRIC & PORTRAIT BLENDING)
   ------------------------------------------------------------- */
.hero-section {
    min-height: calc(100vh - var(--navbar-height));
    margin-top: var(--navbar-height);
    background-color: var(--color-bg-black);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 60px 40px;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
    gap: 60px;
}

.hero-content {
    z-index: 10;
}

.hero-tagline {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.25em;
    color: var(--color-steel-blue);
    margin-bottom: 20px;
}

.hero-title {
    font-size: 3.8rem;
    line-height: 1.3;
    color: var(--color-text-white);
    margin-bottom: 24px;
    padding-bottom: 16px;
    overflow: visible;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--color-steel-blue);
    font-weight: 300;
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 680px;
}

/* Portrait Image Container and Blending */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.hero-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 4 / 5;
    background-color: var(--color-bg-black);
    overflow: hidden;
    border-radius: 4px;
}

.hero-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(0.95) contrast(1.05);
}

/* Cross-browser blending system using overlay gradients */
.hero-image-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Gradient mask to fade portrait into absolute black #000000 */
    background: 
        linear-gradient(to right, #000000 0%, transparent 15%, transparent 85%, #000000 100%),
        linear-gradient(to bottom, transparent 70%, #000000 100%),
        linear-gradient(to top, transparent 85%, #000000 100%);
    pointer-events: none;
}

/* -------------------------------------------------------------
   06. PROFILE SECTION (ACADEMIC GRID)
   ------------------------------------------------------------- */
.profile-section {
    background-color: var(--color-bg-black);
    border-top: 1px solid rgba(46, 66, 87, 0.2);
}

.profile-meta-text {
    font-size: 1.35rem;
    font-weight: 300;
    color: var(--color-steel-blue);
    line-height: 1.7;
    margin-bottom: 80px;
    max-width: 1000px;
}

.profile-meta-text p {
    margin-bottom: 24px;
}

.profile-meta-text p:last-child {
    margin-bottom: 0;
}

.credentials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    background-color: transparent;
    border: none;
}

.credential-card {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-slate-blue);
    border-radius: 4px;
    padding: 32px;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.credential-card:hover {
    border-color: var(--color-steel-blue);
    background-color: rgba(46, 66, 87, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(199, 217, 229, 0.08);
}

.credential-institution {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-steel-blue);
    margin-bottom: 24px;
    display: block;
}

.credential-title {
    font-size: 1.5rem;
    color: var(--color-text-white);
    line-height: 1.3;
    margin-bottom: 20px;
    flex-grow: 1;
}

.credential-status {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--color-steel-blue);
    border-left: 2px solid var(--color-steel-blue);
    padding-left: 10px;
}

.credential-date {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--color-steel-blue);
    opacity: 0.8;
    margin-top: auto;
}

/* -------------------------------------------------------------
   07. INSIGHTS SECTION (CARD REPOSITORY)
   ------------------------------------------------------------- */
.insights-section {
    background-color: var(--color-bg-black);
    border-top: 1px solid rgba(46, 66, 87, 0.2);
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.insights-actions {
    display: flex;
    justify-content: center;
    margin-top: 50px;
}

.insight-card {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-slate-blue);
    border-radius: 4px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: var(--transition-smooth);
}

.insight-card:hover {
    border-color: var(--color-steel-blue);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(199, 217, 229, 0.05);
}

.insight-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    row-gap: 8px;
    margin-bottom: 24px;
}

.insight-date {
    font-size: 0.8rem;
    color: var(--color-steel-blue);
    font-weight: 400;
}

.insight-tag {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-steel-blue);
    background-color: rgba(46, 66, 87, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(199, 217, 229, 0.15);
    white-space: nowrap;
}

.insight-title {
    font-size: 1.8rem;
    line-height: 1.35;
    color: var(--color-text-white);
    margin-bottom: 20px;
    padding-bottom: 8px;
    flex-grow: 1;
    overflow: visible;
}

.insight-excerpt {
    font-size: 0.95rem;
    color: var(--color-steel-blue);
    margin-bottom: 30px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-read-analysis {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-white);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    width: fit-content;
    text-decoration: none;
}

.btn-read-analysis svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.insight-card:hover .btn-read-analysis {
    color: var(--color-steel-blue);
}

.insight-card:hover .btn-read-analysis svg {
    transform: translateX(4px);
}

/* Skeleton Loader CSS */
.insights-skeleton-loader {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.skeleton-card {
    height: 380px;
    background: linear-gradient(90deg, #121212 25%, #1d2b38 50%, #121212 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    border: 1px solid var(--color-slate-blue);
}
@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* -------------------------------------------------------------
   08. CONTACT SECTION (GATED CONDITIONAL FORM & CALENDLY)
   ------------------------------------------------------------- */
.contact-section {
    background-color: var(--color-bg-black);
    border-top: 1px solid rgba(46, 66, 87, 0.2);
}

.contact-card-wrapper {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-slate-blue);
    border-radius: 6px;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* Panel transitions */
.contact-form-container, .contact-calendly-container {
    padding: 60px;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.active-panel {
    display: block;
    opacity: 1;
    transform: scale(1);
}

.hidden-panel {
    display: none;
    opacity: 0;
    transform: scale(0.98);
}

/* Header Inside Form Card */
.contact-header {
    margin-bottom: 40px;
}

.contact-tag {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    color: var(--color-steel-blue);
    margin-bottom: 10px;
}

.contact-title {
    font-size: 2.2rem;
    color: var(--color-text-white);
    margin-bottom: 15px;
    line-height: 1.3;
    padding-bottom: 4px;
}

.contact-desc {
    font-size: 0.95rem;
    color: var(--color-steel-blue);
    font-weight: 300;
}

/* Form Styles */
.gatekeeper-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-white);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background-color: var(--color-input-bg);
    border: 1px solid var(--color-slate-blue);
    border-radius: 4px;
    padding: 14px 18px;
    color: var(--color-text-white);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-steel-blue);
    background-color: rgba(46, 66, 87, 0.25);
    box-shadow: 0 0 10px rgba(199, 217, 229, 0.1);
}

/* Select styling */
.select-wrapper {
    position: relative;
    width: 100%;
}
.select-wrapper select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
    cursor: pointer;
}
.select-wrapper::after {
    content: '';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-right: 1px solid var(--color-steel-blue);
    border-bottom: 1px solid var(--color-steel-blue);
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
}

/* Error states */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: #ff6b6b;
}

.email-error-msg {
    font-size: 0.8rem;
    color: #ff6b6b;
    margin-top: 4px;
    display: none;
}

/* Form Actions */
.btn-submit {
    width: 100%;
    background-color: var(--color-steel-blue);
    color: var(--color-bg-black);
    border: 1px solid var(--color-steel-blue);
    padding: 16px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-submit:hover {
    background-color: transparent;
    color: var(--color-text-white);
    border-color: var(--color-text-white);
    box-shadow: 0 0 25px rgba(199, 217, 229, 0.2);
}

.btn-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0,0,0,0.15);
    border-radius: 50%;
    border-top-color: var(--color-bg-black);
    animation: spin 0.8s linear infinite;
    position: absolute;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Loading State for submit button */
.btn-submit.loading .btn-text {
    opacity: 0;
}
.btn-submit.loading .btn-spinner {
    display: block;
}

/* Calendly panel specific styles */
.calendly-success-header {
    text-align: center;
    margin-bottom: 30px;
}

.success-icon-badge {
    width: 60px;
    height: 60px;
    background-color: rgba(199, 217, 229, 0.15);
    border: 1px solid var(--color-steel-blue);
    color: var(--color-text-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.success-icon-badge svg {
    width: 28px;
    height: 28px;
}

.calendly-title {
    font-size: 2rem;
    color: var(--color-text-white);
    margin-bottom: 10px;
}

.calendly-subtitle {
    font-size: 0.95rem;
    color: var(--color-steel-blue);
    max-width: 600px;
    margin: 0 auto;
}

.calendly-widget-target {
    width: 100%;
    height: 650px;
    background-color: #ffffff; /* Default background for light theme */
    border: 1px solid var(--color-slate-blue);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 24px;
}

@media (prefers-color-scheme: dark) {
    .calendly-widget-target {
        background-color: #ffffff; /* Keep white background for Google Calendar text readability */
    }
}

.calendly-actions {
    display: flex;
    justify-content: center;
}

.btn-back-form {
    background: none;
    border: none;
    color: var(--color-steel-blue);
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 10px;
    transition: var(--transition-fast);
}
.btn-back-form:hover {
    color: var(--color-text-white);
}

/* -------------------------------------------------------------
   09. IMMERSIVE ARTICLE READER MODAL (GLASSMORPHIC)
   ------------------------------------------------------------- */
.article-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-modal.modal-active {
    opacity: 1;
    pointer-events: all;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-wrapper {
    position: relative;
    width: 90%;
    max-width: 900px;
    height: 85vh;
    background-color: #0c0e12;
    border: 1px solid var(--color-slate-blue);
    border-radius: 6px;
    z-index: 2010;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(30px) scale(0.98);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
}

.article-modal.modal-active .modal-wrapper {
    transform: translateY(0) scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(46, 66, 87, 0.2);
    border: 1px solid var(--color-slate-blue);
    color: var(--color-steel-blue);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2020;
    transition: var(--transition-fast);
}

.modal-close-btn:hover {
    background-color: var(--color-steel-blue);
    color: var(--color-bg-black);
    border-color: var(--color-steel-blue);
    transform: rotate(90deg);
}

.modal-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 60px 80px;
}
.modal-body::-webkit-scrollbar {
    width: 6px;
}
.modal-body::-webkit-scrollbar-track {
    background: #0c0e12;
}
.modal-body::-webkit-scrollbar-thumb {
    background: var(--color-slate-blue);
    border-radius: 3px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--color-steel-blue);
}

/* Modal typography styling for long-form reading */
.modal-article-header {
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(46, 66, 87, 0.3);
    padding-bottom: 30px;
}

.modal-article-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.modal-article-title {
    font-size: 2.8rem;
    color: var(--color-text-white);
    line-height: 1.2;
    margin-bottom: 24px;
}

.modal-article-content {
    font-size: 1.1rem;
    line-height: 1.75;
    font-weight: 300;
    color: #e0e5eb;
}

.modal-article-content p {
    color: #e0e5eb;
    margin-bottom: 24px;
}

.modal-article-content h2 {
    font-size: 1.8rem;
    color: var(--color-text-white);
    margin: 48px 0 20px;
    line-height: 1.3;
}

.modal-article-content h3 {
    font-size: 1.4rem;
    color: var(--color-text-white);
    margin: 36px 0 16px;
    line-height: 1.3;
}

.modal-article-content ul, 
.modal-article-content ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.modal-article-content li {
    margin-bottom: 12px;
}

.modal-article-content strong {
    color: var(--color-text-white);
    font-weight: 500;
}

.modal-article-content blockquote {
    border-left: 3px solid var(--color-steel-blue);
    background-color: rgba(46, 66, 87, 0.15);
    padding: 20px 30px;
    margin: 30px 0;
    font-style: italic;
    border-radius: 0 4px 4px 0;
}

.modal-article-content blockquote p {
    margin-bottom: 0;
    color: var(--color-steel-blue);
}

.modal-article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 0.95rem;
}
.modal-article-content th, 
.modal-article-content td {
    border: 1px solid var(--color-slate-blue);
    padding: 12px 18px;
    text-align: left;
}
.modal-article-content th {
    background-color: rgba(46, 66, 87, 0.2);
    color: var(--color-text-white);
    font-weight: 500;
}

.modal-article-content a {
    color: var(--color-steel-blue);
    border-bottom: 1px solid rgba(199, 217, 229, 0.4);
}
.modal-article-content a:hover {
    color: var(--color-text-white);
    border-bottom-color: var(--color-text-white);
}

/* -------------------------------------------------------------
   10. FOOTER (SYMMETRICAL & CENTERED)
   ------------------------------------------------------------- */
.footer {
    background-color: var(--color-bg-black);
    border-top: 1px solid rgba(46, 66, 87, 0.3);
    padding: 60px 40px;
    text-align: center;
}

.footer-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.footer-emblem-wrapper {
    margin-bottom: 10px;
}

.footer-emblem {
    width: 48px;
    height: auto;
    display: block;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}
.footer-emblem:hover {
    opacity: 1;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-copyright {
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--color-steel-blue);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-link {
    font-size: 0.8rem;
    color: var(--color-steel-blue);
    font-weight: 300;
}
.footer-link:hover {
    color: var(--color-text-white);
}

.footer-location {
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-steel-blue);
    margin-top: 10px;
}

/* -------------------------------------------------------------
   11. RESPONSIVE MEDIA QUERIES (MOBILE / TABLET / ULTRAWIDE)
   ------------------------------------------------------------- */

/* Breakpoint: Large Screens (Ultrawide support) */
@media (min-width: 1600px) {
    html {
        font-size: 18px; /* Globally scale typography on very large monitors */
    }
}

/* Breakpoint: Desktop / Tablet Landscaped */
@media (max-width: 1024px) {
    .navbar-container {
        padding: 0 24px;
    }
    
    .section-container {
        padding: 80px 24px;
    }
    
    .hero-container {
        grid-template-columns: 1.1fr 0.9fr;
        gap: 40px;
        padding: 40px 24px;
    }
    
    .hero-title {
        font-size: 3.2rem;
    }
    
    .profile-meta-text {
        font-size: 1.2rem;
    }
    
    .credentials-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-body {
        padding: 64px 50px 40px 50px;
    }
}

/* Breakpoint: Tablet Portrait */
@media (max-width: 768px) {
    /* Logo scaling */
    .logo-img {
        height: 48px;
        min-width: unset;
        max-width: 180px;
    }

    /* Navbar Toggle */
    .nav-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: var(--navbar-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--navbar-height));
        background-color: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 999;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        padding-top: 60px;
        border-top: 1px solid rgba(46, 66, 87, 0.2);
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 30px;
        text-align: center;
        width: 100%;
    }
    
    .nav-link {
        font-size: 1.25rem;
    }
    
    .btn-nav-cta {
        padding: 12px 30px !important;
        font-size: 1.2rem;
    }
    
    /* Toggle active animation */
    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Hero Responsive */
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    
    .hero-content {
        order: 1;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .hero-visual {
        order: 2;
    }
    
    .hero-image-wrapper {
        margin: 0 auto;
        max-width: 380px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-description {
        margin: 0 auto 30px;
    }
    
    /* Credentials */
    .credentials-grid {
        grid-template-columns: 1fr;
    }
    
    .credential-card {
        padding: 28px;
    }
    
    .profile-meta-text {
        font-size: 1.1rem;
        margin-bottom: 50px;
    }
    
    /* Insights & Cards */
    .insights-grid {
        grid-template-columns: 1fr;
    }
    
    .insight-card {
        padding: 30px;
    }
    
    .insight-title {
        font-size: 1.5rem;
    }

    /* Skeleton loader responsiveness */
    .insights-skeleton-loader {
        grid-template-columns: 1fr;
    }
    .skeleton-card:nth-child(even),
    .skeleton-card:nth-child(3) {
        display: none;
    }
    
    /* Contact Form */
    .contact-form-container, .contact-calendly-container {
        padding: 30px 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .contact-title {
        font-size: 1.8rem;
    }
    
    .calendly-title {
        font-size: 1.6rem;
    }
    
    .calendly-widget-target {
        height: 600px;
    }
    
    /* Reader Modal */
    .modal-wrapper {
        width: 95%;
        height: 90vh;
    }
    
    .modal-body {
        padding: 80px 24px 40px 24px;
    }
    
    .modal-article-header {
        padding-right: 50px;
    }

    .modal-article-title {
        font-size: 2rem;
    }
}

/* Breakpoint: Tiny Mobile Screens */
@media (max-width: 480px) {
    .section-container {
        padding: 60px 16px;
    }
    
    .hero-container {
        padding: 40px 16px;
        gap: 30px;
    }
    
    .navbar-container {
        padding: 0 16px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .btn-primary, .btn-outline {
        width: 100%;
        text-align: center;
        padding: 14px 24px;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .contact-form-container, .contact-calendly-container {
        padding: 30px 16px;
    }
}

/* -------------------------------------------------------------
   12. PRINT MEDIA STYLES (Clean PDF formatting)
   ------------------------------------------------------------- */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .navbar, .footer, .btn-primary, .modal-close-btn, .btn-back-form,
    .contact-section, .contact-tabs, #nav-toggle, #nav-menu, .lang-selector,
    .btn-read-analysis, .insights-skeleton-loader {
        display: none !important;
    }
    
    .modal-wrapper {
        border: none !important;
        box-shadow: none !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    .modal-body {
        padding: 0 !important;
        overflow: visible !important;
    }
    
    .modal-article-title {
        color: black !important;
    }
    
    .modal-article-content {
        color: black !important;
    }
    
    .modal-article-content p, 
    .modal-article-content h2, 
    .modal-article-content h3, 
    .modal-article-content strong, 
    .modal-article-content li {
        color: black !important;
    }
}

/* -------------------------------------------------------------
   13. LANGUAGE SELECTOR STYLES
   ------------------------------------------------------------- */
.lang-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 10px;
    border-left: 1px solid rgba(46, 66, 87, 0.4);
}

.lang-btn {
    background: none;
    border: none;
    color: var(--color-steel-blue);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 6px;
    transition: var(--transition-fast);
}

.lang-btn.active {
    color: var(--color-text-white);
    font-weight: 700;
}

.lang-btn:hover {
    color: var(--color-text-white);
}

.lang-separator {
    color: rgba(46, 66, 87, 0.4);
    font-size: 0.85rem;
    pointer-events: none;
}

/* Mobile responsive language selector placement */
@media (max-width: 768px) {
    .lang-selector {
        border-left: none;
        border-top: 1px solid rgba(46, 66, 87, 0.2);
        padding-left: 0;
        padding-top: 20px;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    
    .lang-btn {
        font-size: 1.1rem;
        padding: 6px 12px;
    }
    
    .lang-separator {
        font-size: 1.1rem;
    }
}

/* -------------------------------------------------------------
   09. CONTACT TABS STYLING
   ------------------------------------------------------------- */
.contact-tabs {
    display: flex;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--color-slate-blue);
    border-radius: 30px;
    padding: 4px;
    width: fit-content;
    margin: 0 auto 40px auto;
    gap: 4px;
}

.contact-tab-btn {
    background: transparent;
    border: none;
    color: var(--color-steel-blue);
    padding: 10px 28px;
    border-radius: 25px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-tab-btn:hover {
    color: var(--color-text-white);
}

.contact-tab-btn.active {
    background-color: var(--color-slate-blue);
    color: var(--color-text-white);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.contact-tab-panel {
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-tab-panel.hidden-panel {
    display: none !important;
    opacity: 0;
    transform: scale(0.98);
}

.contact-tab-panel.active-panel {
    display: block !important;
    opacity: 1;
    transform: scale(1);
}

/* The credentials grid now has 9 items, perfectly filling the 3-column layout. 
   Removed rule that forced the last item to span full width. */

/* Language-specific visibility rules for static multi-language elements */
[lang="es"] .lang-en {
    display: none !important;
}
[lang="en"] .lang-es {
    display: none !important;
}

/* Insights grid expansion */
.insights-grid:not(.show-all) .insight-card.insight-extra {
    display: none !important;
}

/* Reset button overrides inside articles */
.modal-article-content a.btn-primary,
.modal-article-content a.btn-outline {
    border-bottom: none !important;
    text-decoration: none !important;
}
.modal-article-content a.btn-primary {
    color: var(--color-bg-black) !important;
    background-color: var(--color-text-white) !important;
}
.modal-article-content a.btn-primary:hover {
    color: var(--color-text-white) !important;
    background-color: var(--color-bg-black) !important;
    border-color: var(--color-steel-blue) !important;
}
.modal-article-content a.btn-outline {
    color: var(--color-text-white) !important;
    background-color: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}
.modal-article-content a.btn-outline:hover {
    color: var(--color-text-white) !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--color-steel-blue) !important;
}
