* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0a0a0a;
    color: #e5e5e5;
    line-height: 1.6;
}

.layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background-color: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
}

.logo img {
    border-radius: 25%;
}

img.watch,
video.watch {
    border-radius: 18% / 14%;
    width: 240px;
    height: auto;
    aspect-ratio: 0.82 / 1;
    border: 2px solid #3a3a3a;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    background: #1a1a1a;
    margin-right: 10px;
}
img.phone,
video.phone {
    width: 320px;
    border-radius: 0.75rem;
    border: 2px solid #3a3a3a;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    background: #1a1a1a;
}

.nav-tabs {
    display: flex;
    gap: 24px;
}

.nav-tab {
    color: #a1a1aa;
    text-decoration: none;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-tab.active {
    color: #e5e5e5;
    border-bottom-color: #80ba59;
}

.nav-tab:hover {
    color: #e5e5e5;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-btn {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 8px 12px;
    color: #a1a1aa;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 200px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.search-btn:hover {
    background: #3a3a3a;
}

.search-shortcut {
    margin-left: auto;
    font-size: 12px;
    color: #71717a;
}

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

.header-link {
    color: #a1a1aa;
    text-decoration: none;
    transition: color 0.2s;
}

.header-link:hover {
    color: #e5e5e5;
}

/* Main Content */
.main-content {
    flex: 1;
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 0;
}

.main-content img {
    max-width: 100%;
}

/* Sidebar */
.sidebar {
    background-color: #1a1a1a;
    border-right: 1px solid #2a2a2a;
    padding: 24px 0;
    overflow-y: auto;
    height: calc(100vh - 60px);
    position: sticky;
    top: 60px;
}

.sidebar-nav {
    padding: 0 24px;
}

.nav-section {
    margin-bottom: 32px;
}

.nav-section-title {
    color: #e5e5e5;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-subsection {
    margin-top: 24px;
}

.nav-subsection-title {
    color: #a1a1aa;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    color: #a1a1aa;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    display: block;
    transition: all 0.2s;
    font-size: 14px;
}

.nav-link:hover {
    background-color: #2a2a2a;
    color: #e5e5e5;
}

.nav-link.active {
    background-color: #80ba5920;
    color: #80ba59;
    border-left: 3px solid #80ba59;
    padding-left: 13px;
}

/* Content */
.content {
    padding: 48px;
    max-width: none;
    overflow-x: auto;
}

.content-header {
    margin-bottom: 0;
}

.cover-image {
    position: relative;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin: -48px -48px 48px -48px;
    overflow: hidden;
}

.cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.3) 100%);
    display: flex;
    align-items: flex-end;
    padding: 48px 24px 24px;
}

.cover-header {
    margin-bottom: 0 !important;
}

.cover-header .breadcrumb {
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.cover-header .content-title {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    margin-bottom: 0;
}

.breadcrumb {
    color: #80ba59;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

.content-title {
    color: #e5e5e5;
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.draft-tag {
    background: linear-gradient(135deg, #80ba59, #6ba045);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(128, 186, 89, 0.3);
    flex-shrink: 0;
    border: 1px solid rgba(128, 186, 89, 0.4);
}

.content-body {
    color: #a1a1aa;
    font-size: 16px;
    line-height: 1.7;
}

.content-body h1,
.content-body h2,
.content-body h3,
.content-body h4,
.content-body h5,
.content-body h6 {
    color: #e5e5e5;
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
}

.content-body h1 {
    font-size: 32px;
}

.content-body h2 {
    font-size: 24px;
}

.content-body h3 {
    font-size: 20px;
}

.content-body p {
    margin-bottom: 16px;
}

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

.content-body li {
    margin-bottom: 8px;
}

.content-body a {
    color: #80ba59;
    text-decoration: none;
}

.content-body a:hover {
    text-decoration: underline;
}

.content-body code {
    background-color: #2a2a2a;
    color: #e5e5e5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 14px;
}

.content-body pre {
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.content-body pre code {
    background: none;
    padding: 0;
    color: #e5e5e5;
}

.content-body blockquote {
    border-left: 4px solid #80ba59;
    padding-left: 16px;
    margin: 16px 0;
    color: #d4d4d8;
}

.content-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.content-body th,
.content-body td {
    border: 1px solid #2a2a2a;
    padding: 12px;
    text-align: left;
}

.content-body th {
    background-color: #1a1a1a;
    color: #e5e5e5;
    font-weight: 600;
}

/* Table of Contents */
.toc {
    background-color: #0a0a0a;
    padding: 24px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    position: sticky;
    top: 60px;
}

.toc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e5e5e5;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.toc-header svg {
    color: #a1a1aa;
}

.toc-nav {
    border-left: 1px solid #2a2a2a;
}

.toc-list {
    list-style: none;
}

.toc-item {
    margin-bottom: 4px;
}

.toc-link {
    color: #71717a;
    text-decoration: none;
    font-size: 13px;
    padding: 4px 16px;
    display: block;
    border-left: 2px solid transparent;
    transition: all 0.2s;
}

.toc-link:hover {
    color: #a1a1aa;
}

.toc-link.active {
    color: #80ba59;
    border-left-color: #80ba59;
}

.toc-level-1 {
    margin-left: 0;
}

.toc-level-2 {
    margin-left: 16px;
}

.toc-level-3 {
    margin-left: 32px;
}

.toc-level-4 {
    margin-left: 48px;
}

.toc-level-5 {
    margin-left: 64px;
}

.toc-level-6 {
    margin-left: 80px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #a1a1aa;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.mobile-menu-toggle:hover {
    background: #2a2a2a;
    color: #e5e5e5;
}

/* Mobile TOC Dropdown */
.mobile-toc-dropdown {
    display: none;
    margin-bottom: 24px;
}

.mobile-toc-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 12px 16px;
    color: #e5e5e5;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.mobile-toc-toggle:hover {
    background: #3a3a3a;
    border-color: #4a4a4a;
}

.mobile-toc-toggle svg:first-of-type {
    color: #a1a1aa;
}

.mobile-toc-toggle span {
    flex: 1;
}

.mobile-toc-chevron {
    color: #a1a1aa;
    transition: transform 0.2s;
}

.mobile-toc-dropdown.open .mobile-toc-chevron {
    transform: rotate(180deg);
}

.mobile-toc-content {
    background: #2a2a2a;
    /*border: 1px solid #3a3a3a;*/
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-toc-dropdown.open .mobile-toc-content {
    max-height: 400px;
}

.mobile-toc-nav {
    padding: 16px;
}

.mobile-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-toc-item {
    margin-bottom: 4px;
}

.mobile-toc-link {
    color: #a1a1aa;
    text-decoration: none;
    font-size: 13px;
    padding: 6px 12px;
    display: block;
    border-radius: 4px;
    transition: all 0.2s;
    border-left: 2px solid transparent;
}

.mobile-toc-link:hover {
    color: #e5e5e5;
    background: #1a1a1a;
}

.mobile-toc-link.active {
    color: #80ba59;
    background: #80ba5915;
    border-left-color: #80ba59;
}

.mobile-toc-level-1 {
    margin-left: 0;
}

.mobile-toc-level-2 {
    margin-left: 16px;
}

.mobile-toc-level-3 {
    margin-left: 32px;
}

.mobile-toc-level-4 {
    margin-left: 48px;
}

.mobile-toc-level-5 {
    margin-left: 64px;
}

.mobile-toc-level-6 {
    margin-left: 80px;
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.sidebar.mobile-open {
    transform: translateX(0);
}

/* Responsive */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 280px 1fr;
    }
    
    .toc {
        display: none;
    }
    
    .mobile-toc-dropdown {
        display: block;
    }
}

@media (max-width: 768px) {
    .header-left {
        gap: 8px;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .content-title {
        font-size: 42px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .draft-tag {
        font-size: 12px;
        padding: 4px 8px;
    }

    .content-body h1 {
        font-size: 30px;
    }

    .content-body h2 {
        font-size: 22px;
    }

    .content-body h3 {
        font-size: 18px;
    }

    .main-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        height: calc(100vh - 60px);
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
    }
    
    .sidebar-nav {
        padding-bottom: 48px;
    }
    
    .content {
        padding: 24px;
    }

    .cover-image {
        margin: -24px -24px 24px -24px;
    }

    .header-right .search-btn {
        min-width: auto;
        min-height: 44px;
        padding: 12px;
        touch-action: manipulation;
    }
    
    .search-btn span:first-of-type {
        display: none;
    }
    
    .header-actions {
        display: none;
    }
    
    .logo span {
        display: none;
    }
}

/* Contact Page Styles */
.contact-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 48px 24px;
}

.contact-content .content-header {
    text-align: center;
    margin-bottom: 48px;
}

.contact-content .content-body {
    max-width: none;
}

.contact-content h2 {
    margin-top: 48px;
    margin-bottom: 16px;
    color: #80ba59;
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 8px;
}

.contact-content h2:first-of-type {
    margin-top: 0;
}

.contact-content ul {
    margin-bottom: 24px;
}

.contact-content li {
    margin-bottom: 8px;
}

.contact-content strong {
    color: #e5e5e5;
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.search-overlay.active {
    display: flex;
    opacity: 1;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
}

.search-modal {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    width: 100%;
    max-width: 640px;
    max-height: 520px;
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    animation: search-slide-in 0.2s ease-out;
}

@keyframes search-slide-in {
    from {
        transform: translateY(-16px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.search-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a2a;
    gap: 16px;
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #0a0a0a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 12px 16px;
    transition: border-color 0.2s;
}

.search-input-wrapper:focus-within {
    border-color: #80ba59;
}

.search-icon {
    color: #71717a;
    flex-shrink: 0;
}

#searchInput {
    flex: 1;
    background: none;
    border: none;
    color: #e5e5e5;
    font-size: 16px;
    outline: none;
    font-family: inherit;
}

#searchInput::placeholder {
    color: #71717a;
}

.search-close {
    background: none;
    border: none;
    color: #71717a;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-close:hover {
    background: #2a2a2a;
    color: #e5e5e5;
}

.search-shortcut-hint {
    color: #71717a;
    font-size: 12px;
    font-weight: 500;
    background: #2a2a2a;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #3a3a3a;
    font-family: monospace;
}

.search-results {
    max-height: 440px;
    overflow-y: auto;
    padding: 8px 0;
}

.search-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    color: #71717a;
    text-align: center;
}

.search-empty-icon {
    margin-bottom: 16px;
    opacity: 0.5;
}

.search-result-item {
    padding: 12px 20px;
    border-bottom: 1px solid #2a2a2a;
    cursor: pointer;
    transition: background-color 0.2s;
    display: block;
    text-decoration: none;
    color: inherit;
}

.search-result-item:hover,
.search-result-item.selected {
    background: #2a2a2a;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    color: #e5e5e5;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 0;
}

.search-result-title::before {
    content: "📄";
    font-size: 14px;
    opacity: 0.7;
    margin-right: 8px;
}

.search-result-excerpt {
    color: #a1a1aa;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 4px;
}

.search-result-path {
    color: #71717a;
    font-size: 12px;
    font-weight: 500;
}

.search-highlight {
    background: #80ba5930;
    color: #80ba59;
    padding: 1px 0;
    border-radius: 2px;
}

.search-no-results {
    padding: 48px 24px;
    text-align: center;
    color: #71717a;
}

.search-no-results-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    opacity: 0.5;
}

/* Mobile Search Overlay */
@media (max-width: 768px) {
    .search-overlay.active {
        padding-top: 80px;
    }
    
    .search-modal {
        margin: 0 16px;
        max-width: none;
    }
    
    .search-header {
        padding: 12px 16px;
    }
    
    .search-input-wrapper {
        padding: 10px 12px;
    }
    
    #searchInput {
        font-size: 16px;
    }
    
    .search-result-item {
        padding: 16px 20px;
    }
}

/* External Link Icon */
.external-link-icon {
    display: inline-block;
    color: #a1a1aa;
    opacity: 0.7;
    transition: opacity 0.2s;
    vertical-align: text-top;
    margin-top: 0;
}

.content-body a:hover .external-link-icon {
    opacity: 1;
    color: #80ba59;
}

/* Anchor Link Offset for Sticky Header */
.content-body h1[id],
.content-body h2[id],
.content-body h3[id],
.content-body h4[id],
.content-body h5[id],
.content-body h6[id] {
    scroll-margin-top: 80px;
}

/* Page Navigation */
.page-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #2a2a2a;
}

.page-navigation .nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #e5e5e5;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    max-width: 200px;
}

.page-navigation .nav-link:hover {
    background: #2a2a2a;
    border-color: #80ba59;
    color: #80ba59;
}

.page-navigation .nav-link .nav-icon {
    color: #a1a1aa;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.page-navigation .nav-link:hover .nav-icon {
    color: #80ba59;
}

.page-navigation .nav-link .nav-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.page-navigation .nav-prev .nav-text {
    margin-left: 4px;
}

.page-navigation .nav-next .nav-text {
    margin-right: 4px;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .page-navigation {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .page-navigation .nav-link {
        justify-content: center;
        max-width: none;
    }
    
    .page-navigation .nav-prev {
        order: 2;
    }
    
    .page-navigation .nav-next {
        order: 1;
    }
}

/* Footer */
.content-footer {
    /*background-color: #1a1a1a;*/
    border-top: 1px solid #2a2a2a;
    padding: 32px 0 0;
    margin-top: 48px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
}

.footer-branding {
    flex: 1;
}

.footer-title {
    color: #e5e5e5;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.footer-subtitle {
    color: #a1a1aa;
    font-size: 14px;
    margin: 0;
}

.footer-actions {
    display: flex;
    align-items: center;
}

.app-store-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #80ba59 0%, #6fa647 100%);
    color: #ffffff;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 24px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    box-shadow: 0 4px 16px rgba(128, 186, 89, 0.3);
}

.app-store-button:hover {
    background: linear-gradient(135deg, #6fa647 0%, #80ba59 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(128, 186, 89, 0.4);
    color: #ffffff;
}

.app-store-icon {
    height: 22px;
    width: 22px;
    flex-shrink: 0;
}
.app-store-text {
    color: #ffffff;
    font-weight: 600;
}

.app-store-price {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
}

/* Mobile Footer */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        padding: 0 24px;
        gap: 24px;
    }
    
    .footer-branding {
        text-align: center;
    }
    
    .app-store-button {
        font-size: 14px;
        padding: 10px 18px;
    }
}

/* Image Overlay */
img.overlay {
    display: block;
}

/* Pages */

.content-body p.strava-header {
    position: relative;
    margin-bottom: 50px;
    overflow-x: hidden;
    padding-right: 0;
    margin-right: -24px;
    margin-bottom: 0;
    overflow-y: visible;
}
.strava-header .watch {
    position: absolute;
}
.strava-header .watch-workout {
    bottom: 180px;
    left: 230px;
}
.strava-header .watch-map {
    bottom: 0;
    left: 200px;
}

@media (max-width: 768px) {
    .strava-header .watch-workout {
        bottom: 200px;
        left: 160px;
    }
    .strava-header .watch-map {
        left: 130px;
    }
}
