/* Ayinesh Kumar's Blog - Custom Styles
   Design inspired by tim.blog
   Colors: White, Off-white, Terracotta (#A85439), Olive (#6B7B5E)
*/

/* Font fallbacks with metric overrides to minimize CLS */
@font-face {
    font-family: 'Playfair Display Fallback';
    src: local('Georgia');
    ascent-override: 108.2%;
    descent-override: 25.1%;
    line-gap-override: 0%;
}

@font-face {
    font-family: 'Literata Fallback';
    src: local('Georgia');
    ascent-override: 117.7%;
    descent-override: 30.8%;
    line-gap-override: 0%;
}

/* Self-hosted webfonts (06-04: latin subset woff2, same-origin, font-display:swap — replaces render-blocking Google css2) */
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/playfairdisplay-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/playfairdisplay-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Literata';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/literata-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Literata';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/literata-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Literata';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/literata-italic-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
    /* Colors */
    --color-white: #FFFFFF;
    --color-off-white: #F9F9F9;
    --color-terracotta: #A85439;
    --color-olive: #6B7B5E;
    --color-slate-blue: #4A6573;
    --color-warm-bronze: #8B7355;
    --color-heading: #1A1A1A;
    --color-body: #4A4A4A;
    --color-secondary: #6B6B6B;
    --color-border: #E5E5E5;

    /* Typography */
    --font-serif: 'Playfair Display', 'Playfair Display Fallback', Georgia, Cambria, serif;
    --font-body: 'Literata', 'Literata Fallback', Georgia, Cambria, serif;
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ============================================
   Base Styles
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.7;
    color: var(--color-body);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    color: var(--color-heading);
    font-weight: 400;
    line-height: 1.3;
    margin-top: 0;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.25rem; }

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-normal);
}

a:hover {
    color: var(--color-terracotta);
}

/* ============================================
   Utility Classes (Tailwind-like)
   ============================================ */

/* Colors */
.text-terracotta { color: var(--color-terracotta); }
.text-olive { color: var(--color-olive); }
.text-slate-blue { color: var(--color-slate-blue); }
.text-warm-bronze { color: var(--color-warm-bronze); }
.text-heading { color: var(--color-heading); }
.text-body { color: var(--color-body); }
.text-secondary { color: var(--color-secondary); }

.bg-white { background-color: var(--color-white); }
.bg-off-white { background-color: var(--color-off-white); }
.bg-terracotta { background-color: var(--color-terracotta); }
.bg-terracotta\/10 { background-color: rgba(168, 84, 57, 0.1); }
.bg-olive\/10 { background-color: rgba(107, 123, 94, 0.1); }
.bg-slate-blue\/10 { background-color: rgba(74, 101, 115, 0.1); }
.bg-warm-bronze\/10 { background-color: rgba(139, 115, 85, 0.1); }
.bg-gray-100 { background-color: #f3f4f6; }

/* Typography */
.font-serif { font-family: var(--font-serif); }
.font-sans { font-family: var(--font-sans); }
.font-body { font-family: var(--font-body); }
.font-medium { font-weight: 500; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }
.text-7xl { font-size: 4.5rem; }

.uppercase { text-transform: uppercase; }
.tracking-widest { letter-spacing: 0.1em; }
.leading-relaxed { line-height: 1.7; }
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-center { text-align: center; }

/* Layout */
.min-h-screen { min-height: 100vh; }
.min-h-\[80vh\] { min-height: 80vh; }
.h-16 { height: 4rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-grow { flex-grow: 1; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.grid { display: grid; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }

.space-x-6 > * + * { margin-left: 1.5rem; }
.space-x-8 > * + * { margin-left: 2rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* Spacing */
.p-2 { padding: 0.5rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.pb-2 { padding-bottom: 0.5rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mt-auto { margin-top: auto; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }

.mx-auto { margin-left: auto; margin-right: auto; }

/* Sizing */
.w-6 { width: 1.5rem; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-6xl { max-width: 72rem; }

/* Borders */
.border { border: 1px solid var(--color-border); }
.border-t { border-top: 1px solid var(--color-border); }
.border-b { border-bottom: 1px solid var(--color-border); }
.border-b-2 { border-bottom: 2px solid; }
.border-transparent { border-color: transparent; }
.border-terracotta { border-color: var(--color-terracotta); }
.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: var(--color-border); }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

/* Positioning */
.fixed { position: fixed; }
.relative { position: relative; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.z-50 { z-index: 50; }

/* Display */
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }

/* Overflow */
.overflow-hidden { overflow: hidden; }

/* Object Fit */
.object-cover { object-fit: cover; }

/* Aspect Ratio */
.aspect-video {
    aspect-ratio: 16 / 9;
}

/* ============================================
   Components
   ============================================ */

/* Navigation */
.nav-transparent {
    background-color: transparent;
}

.nav-solid {
    background-color: var(--color-white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Accent Bar / Reading Progress */
#accent-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent 5%, var(--color-terracotta) 30%, var(--color-terracotta) 70%, transparent 95%);
    z-index: 60;
    pointer-events: none;
}

/* On blog post pages: becomes reading progress bar */
[data-page-type="blog-post"] #accent-bar {
    background: var(--color-terracotta);
    width: 0%;
    transition: width 0.15s ease-out;
}

/* Nav Link Underline Animation */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-terracotta);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.2s ease;
}

.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* CTA Arrow Animation */
.cta-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}

.hero-cta:hover .cta-arrow {
    transform: translateX(4px);
}

/* Cards */
.card {
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Pillar accent borders */
.card-accent-builder  { border-top: 3px solid var(--color-terracotta); }
.card-accent-mariner  { border-top: 3px solid var(--color-slate-blue); }
.card-accent-learner  { border-top: 3px solid var(--color-olive); }

/* Featured post card */
.card-featured {
    grid-column: 1 / -1;
}

.card-featured .p-6 {
    padding: 2rem;
}

.card-featured h2 {
    font-size: 1.75rem;
}

@media (min-width: 768px) {
    .card-featured {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .card-featured h2 {
        font-size: 2rem;
    }
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    padding: 6rem 2rem;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 250 250' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px;
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 72rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
}

.hero-text {
    /* Natural flow container for hero text children */
}

.hero-tagline {
    display: block;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-secondary);
    margin-bottom: 1rem;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 6vw, 5rem);
    color: var(--color-heading);
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--color-body);
    max-width: 32rem;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-cta {
    display: inline-block;
    padding: 0.875rem 2rem;
    background-color: var(--color-terracotta);
    color: var(--color-white);
    font-size: 1rem;
    border-radius: 0.25rem;
    transition: background-color var(--transition-normal);
}

.hero-cta:hover {
    background-color: #8E4530;
    color: var(--color-white);
}

.hero-image img {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 0.5rem;
    object-fit: cover;
    aspect-ratio: 4 / 5;
}

/* About Section */
.about {
    padding: 5rem 2rem;
    background-color: var(--color-off-white);
}

.about-inner {
    max-width: 48rem;
    margin: 0 auto;
}

.about-label {
    display: block;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-secondary);
    margin-bottom: 1.5rem;
}

.about-pullquote {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-style: italic;
    color: var(--color-terracotta);
    border: none;
    padding: 2rem 0;
    margin: 2rem 0;
    position: relative;
}

.about-pullquote::before {
    content: '\201C';
    font-family: var(--font-serif);
    font-size: 6rem;
    color: var(--color-terracotta);
    opacity: 0.2;
    position: absolute;
    top: -1.5rem;
    left: -0.5rem;
    line-height: 1;
}

.about-story {
    margin-top: 2rem;
}

.about-story p {
    font-size: 1.125rem;
    color: var(--color-body);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.about-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.about-stat {
    display: flex;
    flex-direction: column;
}

.about-stat-number {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--color-heading);
    font-weight: 400;
}

.about-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-secondary);
}

.about-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2rem;
}

.about-tag {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    color: var(--color-secondary);
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 9999px;
}

/* Hero & About Responsive (Mobile) */
@media (max-width: 768px) {
    .hero {
        padding: 4rem 1rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-image {
        order: -1;
    }

    .hero-image img {
        max-height: 300px;
        width: auto;
        margin: 0 auto;
        display: block;
    }

    .about {
        padding: 3rem 1rem;
    }

    .about-stats {
        gap: 1.5rem;
    }
}

/* Footer */
.site-footer {
    margin-top: auto;
    padding: 2rem 1rem 1.5rem;
    background-color: #FAF8F5;
    text-align: center;
}

.footer-separator {
    max-width: 72rem;
    margin: 0 auto 1.5rem;
    height: 1px;
    background-color: var(--color-terracotta);
    opacity: 0.4;
}

.footer-signoff {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--color-secondary);
    margin: 0 0 1rem;
}

.footer-inner {
    max-width: 72rem;
    margin: 0 auto;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-icon {
    color: var(--color-secondary);
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-flex;
}

.footer-icon:hover {
    color: var(--color-terracotta);
    transform: scale(1.1);
}

.footer-copyright {
    font-size: 0.8rem;
    color: var(--color-secondary);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.fade-in-visible {
    opacity: 1;
    transform: translateY(0);
}

.transition-colors {
    transition: color var(--transition-normal);
}

.transition-transform {
    transition: transform var(--transition-normal);
}

.transition-all {
    transition: all var(--transition-normal);
}

.duration-300 {
    transition-duration: 0.3s;
}

/* Hover Effects */
.hover\:text-terracotta:hover {
    color: var(--color-terracotta);
}

.hover\:underline:hover {
    text-decoration: underline;
}

.hover\:border-terracotta:hover {
    border-color: var(--color-terracotta);
}

.group:hover .group-hover\:text-terracotta {
    color: var(--color-terracotta);
}

.group:hover .group-hover\:scale-105 {
    transform: scale(1.05);
}

/* ============================================
   Responsive Utilities
   ============================================ */
@media (min-width: 640px) {
    .sm\:flex-row { flex-direction: row; }
    .sm\:space-y-0 > * + * { margin-top: 0; }
}

@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:hidden { display: none; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:col-span-2 { grid-column: span 2 / span 2; }
    .md\:text-xl { font-size: 1.25rem; }
    .md\:text-4xl { font-size: 2.25rem; }
    .md\:text-7xl { font-size: 4.5rem; }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ============================================
   Prose Styles (for blog content)
   ============================================ */
.prose {
    color: var(--color-body);
    line-height: 1.8;
}

.prose h1 {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    color: var(--color-heading);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose h2 {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    color: var(--color-heading);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.prose h3 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    color: var(--color-heading);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.prose p {
    margin-bottom: 1.5rem;
}

.prose a {
    color: var(--color-terracotta);
    text-decoration: underline;
}

.prose a:hover {
    text-decoration: none;
}

.prose ul, .prose ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose blockquote {
    position: relative;
    border-left: 3px solid var(--color-terracotta);
    padding: 1.5rem 1.5rem 1.5rem 2rem;
    margin: 3rem 0;
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--color-body);
    background: transparent;
}

.prose blockquote::before {
    content: '\201C';
    font-family: var(--font-serif);
    font-size: 5rem;
    color: var(--color-terracotta);
    opacity: 0.15;
    position: absolute;
    top: -0.5rem;
    left: 0.25rem;
    line-height: 1;
    pointer-events: none;
}

.prose code {
    background-color: var(--color-off-white);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

.prose pre {
    background-color: var(--color-heading);
    color: var(--color-white);
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.prose pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

.prose hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 2rem 0;
}

/* ============================================
   Admin Styles
   ============================================ */
.shadow { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); }
.divide-y > * + * { border-top: 1px solid var(--color-border); }
.divide-gray-100 > * + * { border-color: #f3f4f6; }

/* Form elements */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-terracotta);
}

.resize-y { resize: vertical; }
.font-mono { font-family: ui-monospace, SFMono-Regular, monospace; }

/* Status colors */
.bg-red-50 { background-color: #fef2f2; }
.border-red-200 { border-color: #fecaca; }
.text-red-700 { color: #b91c1c; }
.text-red-500 { color: #ef4444; }
.hover\:text-red-700:hover { color: #b91c1c; }
.bg-green-100 { background-color: #dcfce7; }
.text-green-700 { color: #15803d; }
.bg-yellow-100 { background-color: #fef9c3; }
.text-yellow-700 { color: #a16207; }
.bg-blue-100 { background-color: #dbeafe; }
.text-blue-700 { color: #1d4ed8; }

/* ============================================
   Projects Section
   ============================================ */
.projects {
    padding: 5rem 2rem;
    background-color: var(--color-white);
}

.projects-inner {
    max-width: 72rem;
    margin: 0 auto;
}

.projects-label {
    display: block;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-secondary);
    margin-bottom: 0.5rem;
}

.projects-heading {
    font-family: var(--font-serif);
    font-size: clamp(1.875rem, 3vw, 2.5rem);
    color: var(--color-heading);
    margin-bottom: 0.75rem;
}

.projects-subtitle {
    font-size: 1rem;
    color: var(--color-body);
    max-width: 36rem;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.projects-empty {
    text-align: center;
    color: var(--color-secondary);
    padding: 3rem 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Base project card — equal size, vertical layout */
.project-card {
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.project-card:hover .project-card-title a {
    color: var(--color-terracotta);
}

/* Fixed-height thumbnail area — standard across all cards */
.project-card-thumb {
    height: 180px;
    overflow: hidden;
    background-color: var(--color-off-white);
    border-bottom: 1px solid var(--color-border);
}

.project-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform var(--transition-slow);
}

.project-card:hover .project-card-thumb img {
    transform: scale(1.03);
}

/* Placeholder for cards without a thumbnail */
.project-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-secondary);
    opacity: 0.4;
}

.project-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.project-card-title {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--color-heading);
    margin: 0;
    line-height: 1.4;
}

.project-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.project-card-badges {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.project-card-lang {
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    color: var(--color-secondary);
    background-color: var(--color-off-white);
    border: 1px solid var(--color-border);
    white-space: nowrap;
}

.project-card-badge {
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    white-space: nowrap;
}

.project-card-badge--proprietary {
    color: var(--color-warm-bronze);
    background-color: rgba(139, 115, 85, 0.1);
    border: 1px solid rgba(139, 115, 85, 0.25);
}

.project-card-desc {
    font-size: 0.875rem;
    color: var(--color-body);
    line-height: 1.6;
    margin: 0 0 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}

.project-card-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.project-card-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--color-secondary);
}

.project-card-link {
    font-size: 0.8125rem;
    color: var(--color-terracotta);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.project-card-link:hover {
    text-decoration: underline;
}

.projects-more {
    text-align: center;
    margin-top: 3rem;
}

.projects-more a {
    font-size: 0.9375rem;
    color: var(--color-terracotta);
    text-decoration: none;
}

.projects-more a:hover {
    text-decoration: underline;
}

@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .projects {
        padding: 3rem 1rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-card-thumb {
        height: 160px;
    }
}

/* ============================================
   Logbook Styles
   ============================================ */

/* Pillar filter tabs */
.logbook-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--spacing-sm);
}

.logbook-tab {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.875rem;
    color: var(--color-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color var(--transition-fast), border-color var(--transition-fast);
    margin-bottom: -1px;
}

.logbook-tab:hover {
    color: var(--color-terracotta);
    border-bottom-color: var(--color-terracotta);
}

.logbook-tab-active {
    color: var(--color-terracotta);
    border-bottom-color: var(--color-terracotta);
}

/* Entry list */
.logbook-entries {
    display: flex;
    flex-direction: column;
}

.logbook-entry {
    border-bottom: 1px solid var(--color-border);
}

.logbook-entry:first-child {
    border-top: 1px solid var(--color-border);
}

.logbook-entry-link {
    display: block;
    padding: var(--spacing-xl) 0;
    text-decoration: none;
    color: inherit;
    transition: background-color var(--transition-fast);
}

.logbook-entry-link:hover {
    background-color: var(--color-off-white);
    margin-left: calc(-1 * var(--spacing-md));
    margin-right: calc(-1 * var(--spacing-md));
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
    border-radius: 0.25rem;
}

.logbook-entry-link:hover .logbook-entry-title {
    color: var(--color-terracotta);
}

/* Entry meta line */
.logbook-entry-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    font-size: 0.8125rem;
}

.logbook-date {
    color: var(--color-secondary);
}

.logbook-readtime {
    color: var(--color-secondary);
}

.logbook-readtime::before {
    content: "\00b7";
    margin-right: var(--spacing-md);
}

/* Pillar labels */
.logbook-pillar {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
}

.logbook-pillar-builder {
    color: var(--color-terracotta);
    background-color: rgba(168, 84, 57, 0.1);
}

.logbook-pillar-mariner {
    color: var(--color-slate-blue);
    background-color: rgba(74, 101, 115, 0.1);
}

.logbook-pillar-learner {
    color: var(--color-olive);
    background-color: rgba(107, 123, 94, 0.1);
}

/* Entry title */
.logbook-entry-title {
    font-family: var(--font-serif);
    font-size: 1.375rem;
    font-weight: 400;
    color: var(--color-heading);
    margin: 0 0 var(--spacing-xs) 0;
    line-height: 1.4;
    transition: color var(--transition-fast);
}

/* Entry excerpt */
.logbook-entry-excerpt {
    font-size: 0.9375rem;
    color: var(--color-secondary);
    margin: 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    .logbook-entry-meta {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }

    .logbook-entry-title {
        font-size: 1.125rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .no-print { display: none !important; }
    nav, footer { display: none !important; }
    body { font-size: 12pt; }
}

/* ============================================
   Reduced Motion Accessibility
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .nav-link::after,
    .cta-arrow,
    .footer-icon,
    .card,
    #accent-bar,
    .fade-in {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

    [data-page-type="logbook-entry"] #accent-bar {
        transition: none !important;
    }
}
