/* ==========================================================================
   FONTS
   ========================================================================== */

@font-face {
    font-family: 'PPNeueMontreal';
    src: url('fonts/PPNeueMontreal-Regular.woff2') format('woff2'),
        url('fonts/PPNeueMontreal-Regular.woff') format('woff'),
        url('fonts/PPNeueMontreal-Regular.ttf') format('truetype'),
        url('fonts/PPNeueMontreal-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   CSS VARIABLES
   ========================================================================== */

:root {
    /* Brand colors */
    --bg-color: #edeadb;
    --highlight: #c5ee63;

    /* Text colors */
    --text-color: #333;
    --text-color-secondary: #666;
    --text-color-tertiary: #555;
    --heading-color: #000;

    /* UI colors */
    --card-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.1);
    --card-shadow-hover: rgba(0, 0, 0, 0.15);
    --link-color: #00341f;
    --error-bg: #ffebee;
    --error-color: #d32f2f;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

* {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    padding-bottom: 100px;
    font-family: 'PPNeueMontreal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-weight: 400;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 5em;
}

body.homepage {
    gap: 130px;
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.container {
    width: 83%;
    margin: 0 auto;
    padding: 0;
}

#page-content {
    width: 83%;
    margin: 80px auto 0;
    transition: opacity 0.3s ease-in-out;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1 {
    font-size: 40px;
    width: 83%;
    margin: 0;
    color: var(--heading-color);
    transition: color 0.3s ease;
    padding-bottom: 1.1em;
    font-weight: 400;
}

h2 {
    font-size: 32px;
    font-weight: 400;
    margin: 12px 0 20px 0;
    color: var(--text-color-secondary);
    transition: color 0.3s ease;
}

h3 {
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin: 24px 0 12px 0;
    color: var(--heading-color);
    text-transform: uppercase;
}

p,
li {
    font-size: 26px;
    line-height: 1.6;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

header {
    margin-bottom: 0;
    padding: 0;
    height: auto;
    display: flex;
    flex-direction: row;
    font-size: 12px;
}

.logo {
    position: fixed;
    top: 20px;
    left: 8.5%;
    font-size: 16px;
    z-index: 1000;
    text-decoration: none;
    color: inherit;
    display: block;
}

.logo:hover {
    text-decoration: none;
}

.logo .logo-text {
    font-weight: bold;
}

.logo p {
    margin: 0;
    font-size: 14px;
}

.social-icons {
    position: fixed;
    top: 20px;
    right: 8.5%;
    display: flex;
    gap: 15px;
    z-index: 1000;
}

.social-icon {
    width: 18px;
    height: 18px;
    color: #000;
    transition: color 0.3s ease;
}

.social-icon:hover {
    color: var(--highlight);
}

.social-icon svg {
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.menu {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background-color: rgba(0, 0, 0, 0.92);
    border-radius: 50px;
    z-index: 1000;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
}

.menu-links {
    display: flex;
    align-items: center;
    gap: 0;
}

.menu a {
    color: #999;
    text-decoration: none;
    padding: 12px 20px;
    transition: color 0.3s ease, background-color 0.3s ease;
    font-size: 16px;
    white-space: nowrap;
    border-radius: 999px;
}

.menu a:hover,
.menu a:focus-visible {
    color: #fff;
}

.menu a.active {
    color: #fff;
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 999px;
    background: transparent;
    color: #f0f0f0;
    font-size: 15px;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
    color: #fff;
}

/* ==========================================================================
   CONTENT
   ========================================================================== */
.content p {
    font-size: 26px;
}

.content section {
    margin-bottom: 40px;
}

.content ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.content li {
    margin-bottom: 20px;
    padding-left: 0;
}

.content a {
    color: var(--link-color);
    text-decoration: underline;
    text-decoration-style: dashed;
    transition: color 0.3s ease;
}

.content a:hover {
    color: var(--highlight);
    text-decoration-style: dashed;
}

/* Section padding for writing page */
#page-content main section {
    padding-bottom: 5.5em;
}

/* Exclude buttons from content link styles */
.content a.medium-more-btn,
.content .medium-more-btn {
    color: var(--bg-color);
    text-decoration: none;
}

.content a.medium-more-btn:hover,
.content .medium-more-btn:hover {
    color: var(--heading-color);
    text-decoration: none;
}

.text-scramble__content {
    max-width: 40ch;
    font-size: max(2rem, min(5.69579vw + 0.665049rem, 3rem));
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.1;
    padding-bottom: 1.1em;
    position: relative;
}

/* ==========================================================================
   FORMS
   ========================================================================== */

.contact-form {
    width: 100%;
    max-width: 600px;
    margin: 0;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--card-shadow);
    border-radius: 4px;
    font-family: 'PPNeueMontreal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    color: var(--text-color);
    background-color: var(--card-bg);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--highlight);
    box-shadow: 0 0 0 2px rgba(197, 238, 99, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    background-color: var(--heading-color);
    color: var(--bg-color);
    border: none;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 500;
    font-family: 'PPNeueMontreal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
    margin-top: 8px;
}

.submit-btn:hover:not(:disabled) {
    background-color: var(--highlight);
    color: var(--heading-color);
    transform: translateY(-1px);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-message {
    margin-top: 20px;
    padding: 12px;
    border-radius: 4px;
    text-align: center;
    display: none;
}

.form-message.success {
    display: block;
    background-color: rgba(197, 238, 99, 0.2);
    color: var(--heading-color);
    border: 1px solid var(--highlight);
}

.form-message.error {
    display: block;
    background-color: var(--error-bg);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.g-recaptcha {
    margin: 16px 0;
}

/* ==========================================================================
   ARTICLES (MEDIUM FEED)
   ========================================================================== */

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-color-secondary);
    transition: color 0.3s ease;
}

.error {
    text-align: center;
    padding: 40px;
    color: var(--error-color);
    background-color: var(--error-bg);
    border-radius: 8px;
    margin: 20px 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

.article {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px var(--card-shadow);
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.article:hover {
    box-shadow: 0 4px 8px var(--card-shadow-hover);
}

.article-title {
    margin: 0 0 12px 0;
    font-size: 24px;
    line-height: 1.3;
}

.article-title a {
    color: var(--heading-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-title a:hover {
    text-decoration: underline;
}

.article-meta {
    color: var(--text-color-secondary);
    font-size: 14px;
    margin-bottom: 12px;
    transition: color 0.3s ease;
}

.article-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 16px;
}

.article-excerpt {
    color: var(--text-color-tertiary);
    line-height: 1.6;
    margin: 0;
    transition: color 0.3s ease;
}

.article-link {
    display: inline-block;
    margin-top: 12px;
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.article-link:hover {
    text-decoration: underline;
}

.no-articles {
    text-align: center;
    color: var(--text-color-secondary);
}

.medium-more-btn {
    display: block;
    margin: 40px auto 0;
    padding: 12px 32px;
    background-color: var(--heading-color);
    color: var(--bg-color);
    text-decoration: none;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    font-family: 'PPNeueMontreal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    max-width: 300px;
    cursor: pointer;
}

.medium-more-btn:hover {
    background-color: var(--highlight);
    color: var(--heading-color);
    transform: translateY(-1px);
    text-decoration: none;
}

.medium-more-btn:active {
    transform: translateY(0);
}

@media (min-width: 769px) {
    .articles {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

/* ==========================================================================
   HTMX TRANSITIONS
   ========================================================================== */

.htmx-swapping #page-content {
    opacity: 0;
}

.htmx-swapped #page-content {
    opacity: 1;
}



/* ==========================================================================
   COACHING TIMELINE
   ========================================================================== */

.coaching-timeline {
    position: relative;
    padding: 20px 0;
}

.coaching-timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--text-color-secondary);
    opacity: 0.3;
}

.coaching-item {
    position: relative;
    padding-left: 80px;
    margin-bottom: 40px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.coaching-item:last-child {
    margin-bottom: 0;
}

.coaching-item::before {
    content: '';
    position: absolute;
    left: 22px;
    top: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--highlight);
    border: 3px solid var(--bg-color);
    z-index: 1;
}

.coaching-badge {
    width: 60px;
    object-fit: cover;
    flex-shrink: 0;
}

.coaching-details {
    flex: 1;
}

.coaching-position {
    font-weight: 600;
    font-size: 18px;
    color: var(--heading-color);
    margin: 0 0 4px 0;
}

.coaching-club {
    font-size: 16px;
    color: var(--text-color);
    margin: 0 0 8px 0;
}

.coaching-dates {
    font-size: 14px;
    color: var(--text-color-secondary);
    margin: 0;
}

.consulting-cta {
    font-size: 22px !important;
}

/* ============ Tablets & Small Laptops (≤ 768px) ============ */
@media (max-width: 768px) {

    p,
    li {
        font-size: 22px;
    }

    .coaching-timeline::before {
        left: 20px;
    }

    .coaching-item {
        padding-left: 60px;
    }

    .coaching-item::before {
        left: 12px;
        width: 14px;
        height: 14px;
    }

    .coaching-badge {
        width: 50px;
    }
}

/* ==========================================================================
   RESPONSIVE STYLES
   ========================================================================== */

@media (max-width: 768px) {
    .container {
        width: 90%;
    }

    #page-content {
        width: 90%;
    }

    .logo {
        left: 5%;
    }

    .social-icons {
        top: 15px;
        right: 5%;
        gap: 12px;
    }

    .menu {
        bottom: 15px;
        width: calc(100% - 40px);
        left: 50%;
        transform: translateX(-50%);
        padding: 10px 16px;
        gap: 16px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .menu-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .menu a {
        flex: 1 1 calc(33.333% - 12px);
        min-width: 130px;
        text-align: center;
        padding: 10px 12px;
        font-size: 14px;
        white-space: normal;
    }
}

/* ============ Large Phones & Small Tablets (≤ 640px) ============ */
@media (max-width: 640px) {
    h1 {
        font-size: 24px;
    }

    p,
    li {
        font-size: 20px;
    }

    .menu {
        padding: 12px 18px;
        gap: 10px;
    }

    .menu-toggle {
        display: inline-flex;
        min-width: 120px;
    }

    .menu-links {
        flex: 1;
        justify-content: flex-start;
    }

    .menu.menu--collapsible {
        flex-wrap: nowrap;
        width: calc(100% - 32px);
    }

    .menu.menu--collapsible .menu-links {
        position: absolute;
        bottom: calc(100% + 12px);
        left: 50%;
        transform: translateX(-50%);
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 14px;
        min-width: min(360px, calc(100vw - 48px));
        background: rgba(0, 0, 0, 0.95);
        border-radius: 28px;
        border: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
        pointer-events: none;
        visibility: hidden;
    }

    .menu.menu--collapsible .menu-links a {
        flex: 1 1 auto;
        width: 100%;
        text-align: center;
        background-color: rgba(255, 255, 255, 0.04);
        font-size: 15px;
        padding: 12px;
    }

    .menu.menu--collapsible.menu--open .menu-links {
        pointer-events: auto;
        visibility: visible;
    }
}

/* ============ Small Phones (≤ 480px) ============ */
@media (max-width: 480px) {
    h1 {
        font-size: 20px;
    }
    
    p,
    li {
        font-size: 18px;
    }

    .menu-toggle {
        min-width: 100px;
        font-size: 14px;
        padding: 9px 18px;
    }

    .menu.menu--collapsible .menu-links {
        min-width: min(320px, calc(100vw - 40px));
        padding: 12px;
    }

    .menu.menu--collapsible .menu-links a {
        font-size: 14px;
    }
}