/* pcunningham.works - Main Stylesheet */

/* CSS Custom Properties */
:root {
    --bg-primary: #1a1a24;
    --bg-card: rgba(255, 255, 255, 0.08);
    --bg-card-hover: rgba(255, 255, 255, 0.13);
    --bg-nav: rgba(20, 20, 28, 0.92);
    --text-primary: #D0D0D8;
    --text-secondary: #9090A0;
    --text-muted: #707080;
    --border-subtle: rgba(255, 255, 255, 0.1);
    --section-color: #CC3333;
}

/* Per-section color overrides (body-level for subdirectory pages) */
body[data-section="articles"]       { --section-color: #E06040; }
body[data-section="references"]     { --section-color: #D4A843; }
body[data-section="github"]         { --section-color: #4CAF50; }
body[data-section="youtube"]        { --section-color: #E05050; }
body[data-section="claude"]         { --section-color: #D4A0E0; }
body[data-section="presentations"]  { --section-color: #5090D0; }
body[data-section="guides"]         { --section-color: #50B8A0; }
body[data-section="charts"]         { --section-color: #E08050; }
body[data-section="business-plans"] { --section-color: #7080C0; }
body[data-section="websites"] { --section-color: #E0C050; }
body[data-section="coco"]     { --section-color: #33CC44; }

/* Per-section color overrides for home page nav-cards */
.nav-card[data-section="articles"]       { --section-color: #E06040; }
.nav-card[data-section="references"]     { --section-color: #D4A843; }
.nav-card[data-section="github"]         { --section-color: #4CAF50; }
.nav-card[data-section="youtube"]        { --section-color: #E05050; }
.nav-card[data-section="claude"]         { --section-color: #D4A0E0; }
.nav-card[data-section="presentations"]  { --section-color: #5090D0; }
.nav-card[data-section="guides"]         { --section-color: #50B8A0; }
.nav-card[data-section="charts"]         { --section-color: #E08050; }
.nav-card[data-section="business-plans"] { --section-color: #7080C0; }
.nav-card[data-section="websites"] { --section-color: #E0C050; }
.nav-card[data-section="coco"]     { --section-color: #33CC44; }

/* Links and Navigation */
a { color: var(--section-color); }
a:link { color: var(--section-color); text-decoration: none; font-weight: bold; }
a:visited { color: var(--section-color); text-decoration: none; font-weight: bold; }
a:hover, a:focus {
    color: var(--section-color);
    filter: brightness(1.3);
    text-decoration: none;
    font-weight: bold;
    transform: translateY(-3px) scale(1.05);
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* Prevent filter from breaking the gradient text effect on header */
header h1 a:hover,
header h1 a:focus {
    filter: none;
    transform: none;
    text-shadow: none;
}
a:focus { outline: 2px solid var(--section-color); }

/* Base Layout */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
    margin-left: 14rem;
    padding: 2rem 3rem;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(120, 0, 30, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(60, 0, 80, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(100, 20, 0, 0.12) 0%, transparent 50%);
    background-size: 200% 200%, 250% 250%, 180% 180%;
    animation: bgDrift 20s ease-in-out infinite;
}

@keyframes bgDrift {
    0%   { background-position: 0% 0%, 100% 0%, 50% 100%; }
    33%  { background-position: 100% 50%, 0% 100%, 0% 0%; }
    66%  { background-position: 50% 100%, 50% 0%, 100% 50%; }
    100% { background-position: 0% 0%, 100% 0%, 50% 100%; }
}

/* Typography */
h1, h2, h3 {
    color: var(--section-color);
    font-family: inherit;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Modern Header Styling */
header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--section-color) 0%, #FF4040 50%, var(--section-color) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 4s ease-in-out infinite;
    position: relative;
    display: inline-block;
    margin-bottom: 0.5rem;
}

header h1:hover {
    animation-duration: 1s;
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

header h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--section-color), #FF4040);
    transition: width 0.4s ease;
}

header h1:hover::after {
    width: 100%;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
p, li { font-family: inherit; }

/* Recent Cards */
.recent-cards-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.recent-card {
    background: var(--bg-card);
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    border-left: 4px solid var(--section-color);
    border-top: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.recent-card:hover {
    transform: translateY(-2px);
    background: var(--bg-card-hover);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.recent-card[data-section="articles"]       { --section-color: #E06040; }
.recent-card[data-section="references"]     { --section-color: #D4A843; }
.recent-card[data-section="github"]         { --section-color: #4CAF50; }
.recent-card[data-section="youtube"]        { --section-color: #E05050; }
.recent-card[data-section="claude"]         { --section-color: #D4A0E0; }
.recent-card[data-section="presentations"]  { --section-color: #5090D0; }
.recent-card[data-section="guides"]         { --section-color: #50B8A0; }
.recent-card[data-section="charts"]         { --section-color: #E08050; }
.recent-card[data-section="business-plans"] { --section-color: #7080C0; }
.recent-card[data-section="websites"]       { --section-color: #E0C050; }
.recent-card[data-section="coco"]           { --section-color: #33CC44; }

.recent-section-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--section-color);
    opacity: 0.8;
}

.recent-date {
    float: right;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.new-tag {
    display: inline-block;
    background: #E05050;
    color: #fff;
    font-size: 0.6rem;
    font-weight: bold;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

.recent-card h3 {
    margin: 0.25rem 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.recent-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.recent-more-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .recent-cards-container {
        grid-template-columns: 1fr;
    }
}

/* Navigation Bar */
ul.navbar {
    position: fixed;
    top: 2rem;
    left: 2rem;
    background: var(--bg-nav);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.4);
    border: 1px solid var(--border-subtle);
    width: 9rem;
    list-style: none;
    margin: 0;
}

ul.navbar li {
    margin-bottom: 0.5rem;
}

ul.navbar li:last-child {
    margin-bottom: 0;
}

/* Loading and Error States */
.loading {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 2rem;
    border-radius: 6px;
}

.error {
    color: #ff6b6b;
    font-weight: bold;
    background: rgba(220, 53, 69, 0.15);
    padding: 2rem;
    border-radius: 6px;
    text-align: center;
}

/* Content Sections */
.content-section {
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    margin: 0.5rem 0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    border-left: 4px solid var(--section-color);
    border-top: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.content-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: right;
    margin-bottom: 0.25rem;
}

.content-section:hover {
    transform: translateY(-2px);
    background: var(--bg-card-hover);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Grid Layouts */
.nav-cards-container, .content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* 2-column layout */
.content-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

/* 3-column layout */
.content-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Responsive behavior */
@media (max-width: 1024px) {
    .content-grid-3col {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        margin-left: 0;
        padding: 1rem;
    }

    ul.navbar {
        position: static;
        width: auto;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    ul.navbar li {
        margin-bottom: 0;
    }

    .content-grid-2col, .content-grid-3col {
        grid-template-columns: 1fr;
    }
}

.nav-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    border-left: 4px solid var(--section-color);
    border-top: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.nav-card:hover {
    transform: translateY(-2px);
    background: var(--bg-card-hover);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    text-decoration: none;
    color: inherit;
}

.nav-card h3 {
    margin: 0 0 0.5rem 0;
    color: var(--section-color);
    font-size: 1.25rem;
}

.nav-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Website Thumbnails */
.website-thumbnail {
    width: 100%;
    border-radius: 6px;
    margin: 0.5rem 0;
    border: 1px solid var(--border-subtle);
}

/* Video Embedding */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin: 20px 0;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Content Format Badges */
.presentation-format, .chart-format {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

/* Content Categories */
.video-category, .music-category,
.presentation-category, .guide-category {
    grid-column: 1 / -1;
}

.presentation-category, .guide-category {
    background: rgba(255, 255, 255, 0.04);
    border-left: 4px solid var(--section-color);
    margin: 1rem 0;
    padding: 1rem;
}

/* Footer */
footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer a {
    font-weight: normal;
}
