/* Non-critical styles - loaded asynchronously */

/* Additional typography refinements */
.lead {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Code blocks for notes */
code {
    background: var(--bg-secondary);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-family: ui-monospace, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.875em;
}

pre {
    background: var(--bg-secondary);
    padding: var(--spacing-sm);
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: var(--spacing-sm);
}

pre code {
    background: none;
    padding: 0;
}

/* Blockquotes */
blockquote {
    border-left: 3px solid var(--accent);
    padding-left: var(--spacing-sm);
    margin: var(--spacing-sm) 0;
    color: var(--text-secondary);
    font-style: italic;
}

/* Lists styling */
ul, ol {
    margin-bottom: var(--spacing-sm);
    padding-left: var(--spacing-md);
}

li {
    margin-bottom: 0.25rem;
}

/* Tag cloud for notes filtering */
.tag-filter {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-md);
}

.tag-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-primary);
}

.tag-btn:hover,
.tag-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Note detail page styles */
.note-detail {
    max-width: 70ch;
    margin: 0 auto;
}

.note-detail h1 {
    margin-bottom: var(--spacing-sm);
}

.note-detail .note-meta {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border);
}

/* App Store badge styling */
.project-badge {
    margin-bottom: var(--spacing-sm);
}

/* Project card flexbox layout for bottom-anchored action */
.project-card {
    display: flex;
    flex-direction: column;
}

.project-badge-row {
    display: flex;
    gap: var(--spacing-sm);
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
    flex-wrap: wrap;
}

.project-badge-row > * {
    margin-top: 0;
}

.app-store-badge {
    display: inline-block;
    height: 55px;
    transition: opacity 0.15s ease;
    vertical-align: top;
    margin-top: 0 !important;
}

.app-store-badge:hover {
    opacity: 0.8;
}

.app-store-badge img {
    height: 100%;
    width: auto;
    display: block;
}

/* Website button styling - matches App Store badge height */
.btn-website {
    height: 55px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--spacing-md);
    border: 2px solid var(--accent);
    background: transparent;
    color: white;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-align: center;
    vertical-align: top;
}

.btn-website:hover {
    background: var(--accent);
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* TestFlight button styling - full width, shorter height */
.btn-testflight {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--spacing-md);
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.btn-testflight:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

@media (prefers-reduced-motion: reduce) {
    .btn-website:hover,
    .btn-testflight:hover {
        transform: none;
    }
}

/* Project buttons styling */
.project-buttons {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-top: var(--spacing-xs);
}

.project-buttons .btn {
    text-decoration: none;
}

/* Project action area spacing - anchored to bottom */
.project-action {
    margin-top: auto;
    padding-top: var(--spacing-sm);
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Error states */
.error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c00;
    padding: var(--spacing-sm);
    border-radius: 6px;
    margin-bottom: var(--spacing-sm);
}

/* Print styles */
@media print {
    header,
    footer,
    .hero-cta,
    .app-action {
        display: none;
    }
    
    main {
        padding: 0;
    }
    
    a {
        color: inherit;
        text-decoration: underline;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --accent: #0066cc;
        --shadow: 0 0 0 2px currentColor;
    }
    
    .btn,
    .app-card {
        border: 2px solid currentColor;
    }
}

/* Reduced transparency for better readability */
@media (prefers-reduced-transparency) {
    header {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--bg-primary);
    }
}

/* Animation utilities */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fade-in 0.3s ease-out forwards;
}

@media (prefers-reduced-motion: reduce) {
    .fade-in {
        animation: none;
    }
}

/* Teaching section link styling */
.teaching-link {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}

.teaching-link:hover {
    border-bottom-color: var(--text-primary);
    opacity: 1;
}

.teaching-link:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-bottom-color: transparent;
}
