:root {
    --friedso-black: #1f1c1a;
    --friedso-beige: #f5f0e6;
    --friedso-white: #ffffff;
    --friedso-offwhite: #fdfaf5;
    --friedso-hover: rgba(31, 28, 26, 0.08);
    --friedso-divider: rgba(31, 28, 26, 0.1);
}

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

html {
    scroll-padding-top: 64px; /* Account for sticky header height - position headings right below header */
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Calibri', 'Trebuchet MS', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--friedso-white);
    max-width: 100vw;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    min-height: 100%;
    color: var(--friedso-black);
    overflow-x: hidden;
    overflow-y: auto;
}

/* Home should be uniformly beige */
body.home-page {
    background: var(--friedso-beige);
}

.container {
    width: 100%;
    position: relative;
    max-width: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
}

html[data-device="handheld"][data-orientation="portrait"] body {
    overflow-y: auto;
    overscroll-behavior: contain;
}

html[data-device="handheld"][data-orientation="portrait"] .container {
    min-height: auto;
}

/* Hero Section */
.hero {
    width: 100%;
    min-height: 100%;
    height: auto;
    position: relative;
    background: transparent; /* allow page background to show through */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(24px, 4vw, 48px);
    padding: clamp(36px, 5vw, 72px) clamp(16px, 4vw, 48px);
}

.hero-logo-band {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--friedso-black);
    padding: clamp(14px, 2.2vw, 22px) clamp(32px, 8vw, 88px);
    border-radius: 999px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-logo-band:focus-visible {
    outline: 4px solid rgba(255, 255, 255, 0.35);
    outline-offset: 6px;
    transform: translateY(-2px);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.3);
}

.logo-image {
    width: clamp(136px, 12vw, 220px);
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.logo-image:hover {
    transform: scale(1.04);
}

/* Persistent logo navigation */
.logo-corner {
    position: sticky;
    top: clamp(24px, 6vw, 44px);
    right: clamp(24px, 6vw, 44px);
    left: auto;
    margin: clamp(24px, 6vw, 44px) clamp(24px, 6vw, 44px) 0 auto; /* reserve flow space and pin to right */
    background: rgba(31, 28, 26, 0.94);
    padding: clamp(7px, 1.1vw, 11px) clamp(16px, 4vw, 44px);
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.26);
    border: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 10;
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
    text-decoration: none;
}

.logo-corner:hover {
    transform: scale(1.05);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32);
}

.logo-corner:active {
    transform: scale(0.96);
}

.logo-corner:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.4);
    outline-offset: 4px;
}

.logo-corner img {
    width: clamp(68px, 6vw, 110px);
    height: auto;
    display: block;
}

body.home-page .logo-corner {
    display: none;
}

/* Global site header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 clamp(24px, 6vw, 64px);
    background: var(--friedso-beige);
    border-bottom: 1px solid rgba(31, 28, 26, 0.08);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}
.site-header.scrolled {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
.site-header .brand {
    display: inline-flex !important;
    align-items: center;
    text-decoration: none;
    visibility: visible !important;
    opacity: 1 !important;
}
.site-header .brand img {
    height: 38px !important;
    width: auto !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-width: none !important;
    min-width: 0 !important;
}
/* Page-specific header backgrounds */
.blog-page .site-header {
    background: var(--friedso-beige);
}
.blog-page.author-bot-page .site-header {
    background: #0b0b0c;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

@media (max-width: 640px) {
    .logo-corner {
        top: 16px;
        right: 16px;
        left: auto;
        margin: 16px 16px 0 auto;
        padding: 8px clamp(14px, 5vw, 20px);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
    }

    .logo-corner img {
        width: clamp(60px, 18vw, 90px);
    }
}

/* Reset any extra offset; logo is in corner */
body:not(.home-page) { padding-top: 0; }

.hero-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(24px, 4vw, 40px);
    width: min(1024px, 95vw);
    max-width: 920px;
}

.hero-video-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--friedso-black);
    border-radius: clamp(28px, 3vw, 40px);
    overflow: hidden;
    position: relative;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.35);
    border: 4px solid rgba(255, 255, 255, 0.08);
}

.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-tiles {
    display: flex;
    justify-content: center;
    gap: clamp(20px, 4vw, 40px);
    width: 100%;
}

.hero-tile {
    flex: 1;
    min-width: clamp(180px, 26vw, 260px);
    background: rgba(255, 255, 255, 0.9);
    border-radius: clamp(24px, 2.8vw, 36px);
    padding: clamp(24px, 3.2vw, 42px);
    text-decoration: none;
    color: var(--friedso-black);
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.18);
    transition: transform 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
    position: relative;
}

.hero-tile::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.05);
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: -1;
}

.hero-tile:hover,
.hero-tile:focus-visible {
    transform: scale(1.06) translateY(-12px);
    box-shadow: 0 38px 90px rgba(0, 0, 0, 0.28);
    background: rgba(255, 255, 255, 0.98);
}

.hero-tile:hover::after,
.hero-tile:focus-visible::after {
    opacity: 1;
}

.hero-tile:focus-visible {
    outline: 4px solid rgba(31, 28, 26, 0.35);
    outline-offset: 6px;
}

.hero-tile .tile-label {
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-tile .tile-sub {
    font-size: clamp(14px, 1.8vw, 18px);
    color: rgba(31, 28, 26, 0.64);
    letter-spacing: 0.06em;
}

html[data-device="handheld"][data-orientation="portrait"] .hero,
.viewport-wrapper.sim-handheld .hero {
    justify-content: flex-start;
    padding-top: clamp(36px, 12vh, 80px);
    padding-bottom: clamp(48px, 16vh, 120px);
    gap: clamp(28px, 8vh, 56px);
}

html[data-device="handheld"][data-orientation="portrait"] .hero-stage,
.viewport-wrapper.sim-handheld .hero-stage {
    width: 100%;
    max-width: 100%;
    gap: clamp(24px, 8vw, 48px);
}

html[data-device="handheld"][data-orientation="portrait"] .hero-video-frame,
.viewport-wrapper.sim-handheld .hero-video-frame {
    aspect-ratio: 9 / 16;
    border-radius: clamp(24px, 7vw, 48px);
}

html[data-device="handheld"][data-orientation="portrait"] .hero-tiles,
.viewport-wrapper.sim-handheld .hero-tiles {
    flex-direction: column;
    width: 100%;
    gap: clamp(18px, 6vw, 32px);
}

html[data-device="handheld"][data-orientation="portrait"] .hero-tile,
.viewport-wrapper.sim-handheld .hero-tile {
    min-width: 0;
    width: 100%;
}

/* ========================================
   RESPONSIVE DESIGN BREAKPOINTS
   ======================================== */

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
    .hero-stage {
        width: min(1100px, 88vw);
    }
}

/* Tablet Portrait and below */
@media (max-width: 767px) {
    .hero {
        padding-top: clamp(44px, 16vw, 72px);
        gap: clamp(20px, 7vw, 36px);
    }

    .hero-stage {
        gap: clamp(20px, 6vw, 32px);
        width: min(600px, 90vw);
    }

    .hero-video-frame {
        border-radius: clamp(18px, 5vw, 30px);
        border-width: 3px;
    }

    .hero-tiles {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-tile {
        min-width: auto;
    }

    .hero-tile:hover,
    .hero-tile:focus-visible {
        transform: translateY(-6px) scale(1.03);
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .hero-logo-band {
        padding: 16px clamp(28px, 10vw, 40px);
    }

    .hero-stage {
        width: 100%;
    }

    .hero-video-frame {
        aspect-ratio: 3 / 4;
    }

    .hero-tile {
        padding: clamp(22px, 8vw, 38px);
    }
}

/* ========================================
   DEVICE-SPECIFIC OPTIMIZATIONS
   ======================================== */

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .container {
        min-height: -webkit-fill-available;
    }
    
    .hero {
        min-height: -webkit-fill-available;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-image {
        /* Ensure crisp rendering on retina displays */
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape orientation on mobile */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .hero {
        padding-top: 24px;
    }

    .hero-stage {
        width: min(740px, 92vw);
        flex-direction: row;
        align-items: center;
        gap: clamp(20px, 4vw, 28px);
    }

    .hero-video-frame {
        flex: 1.2;
        aspect-ratio: 4 / 3;
    }

    .hero-tiles {
        flex-direction: column;
        align-items: stretch;
        flex: 1;
    }

    .hero-tile {
        padding: clamp(18px, 4vw, 24px);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .logo-image:hover {
        transform: none; /* Disable hover effects on touch devices */
    }
    
    .hero-tile:hover,
    .hero-tile:focus-visible {
        transform: translateY(-6px);
    }
}

/* Print styles */
@media print {
    .hero-video {
        display: none;
    }
}

/* ========================================
   MOBILE SIMULATOR CONTROLS
   ======================================== */

.simulator-controls {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 9999;
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.9);
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.sim-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sim-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.sim-btn:active {
    transform: scale(0.95);
}

.device-info {
    position: fixed;
    top: 60px;
    right: 20px;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    letter-spacing: 0.04em;
    display: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

/* Viewport Wrapper for Simulator */
.viewport-wrapper {
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--friedso-beige);
    transition: all 0.4s ease;
}

/* Desktop mode (default - full screen) */
.viewport-wrapper .container {
    width: 100%;
    min-height: 100vh;
    transition: all 0.4s ease;
    box-shadow: none;
}

html[data-device="handheld"][data-orientation="portrait"] .viewport-wrapper {
    align-items: flex-start;
    padding-bottom: env(safe-area-inset-bottom, 16px);
}

html[data-device="handheld"][data-orientation="portrait"] .viewport-wrapper .container {
    min-height: auto;
}

.viewport-wrapper.sim-handheld {
    align-items: flex-start;
    padding-bottom: 16px;
}

.viewport-wrapper.sim-handheld .container {
    min-height: auto;
    height: auto;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Mobile Simulator Mode (iPhone 14 Pro) */
.viewport-wrapper.sim-mobile .container {
    width: 393px;
    min-height: 852px;
    height: auto;
    max-width: 393px;
    max-height: none;
    border-radius: 40px;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 0 8px #e0e0e0,
                0 0 0 10px #f5f5f5;
    border: 2px solid #ddd;
}

/* Tablet Simulator Mode (iPad) */
.viewport-wrapper.sim-tablet .container {
    width: 768px;
    min-height: 1024px;
    height: auto;
    max-width: 768px;
    max-height: none;
    border-radius: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 0 12px #e0e0e0,
                0 0 0 14px #f5f5f5;
    border: 2px solid #ddd;
}


/* Hide simulator controls on actual mobile devices */
@media (max-width: 767px) {
    .simulator-controls {
        display: none !important;
    }
    
    .viewport-wrapper {
        background: var(--friedso-beige);
    }
}

/* Hide simulator controls on mobile devices using touch detection */
@media (hover: none) and (pointer: coarse) {
    .simulator-controls {
        display: none !important;
    }
}

/* Hide simulator controls on small screens */
@media (max-width: 1024px) {
    .simulator-controls {
        display: none !important;
    }
}

/* Hide simulator controls when screen is too small */
@media (max-width: 450px), (max-height: 450px) {
    .simulator-controls {
        display: none;
    }
}

/* Adjust simulator for smaller desktop screens */
@media (max-width: 1200px) and (min-width: 768px) {
    .viewport-wrapper.sim-mobile .container {
        transform: scale(0.85);
    }
    
    .viewport-wrapper.sim-tablet .container {
        transform: scale(0.75);
    }
}

/* Mobile-specific enhancements */
@media (max-width: 767px) {
    /* Improve touch targets */
    /* Prevent text selection on touch */
    .logo-image {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Smooth scrolling on mobile */
    body {
        -webkit-overflow-scrolling: touch;
    }
}

/* PWA / Fullscreen mode support */
@media (display-mode: fullscreen) {
    .simulator-controls {
        top: env(safe-area-inset-top, 10px);
        right: env(safe-area-inset-right, 10px);
    }
}

/* Notch support for iPhone X and newer */
@supports (padding: max(0px)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

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

body.blog-page {
    background: var(--friedso-offwhite);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Author-bot: dark theme for bot-written posts */
body.blog-page.author-bot-page {
    background: #0b0b0c;
    color: #f5f0e6;
}
body.blog-page.author-bot-page .blog-header {
    color: #f5f0e6;
}
body.blog-page.author-bot-page .blog-header a,
body.blog-page.author-bot-page .blog_post_article a {
    color: #f5f0e6;
    text-decoration-color: rgba(245, 240, 230, 0.5);
}
body.blog-page.author-bot-page .blog-meta {
    color: rgba(245, 240, 230, 0.7);
}
body.blog-page.author-bot-page .blog_post_article {
    color: rgba(245, 240, 230, 0.9);
}
body.blog-page.author-bot-page .blog_post_article h1,
body.blog-page.author-bot-page .blog_post_article h2,
body.blog-page.author-bot-page .blog_post_article h3 {
    color: #ffffff;
}
body.blog-page.author-bot-page .blog_post_article blockquote {
    border-left-color: #f5f0e6;
    background: rgba(255, 255, 255, 0.06);
}
body.blog-page.author-bot-page .blog_post_article figure {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}
body.blog-page.author-bot-page .blog_post_article figcaption {
    color: rgba(245, 240, 230, 0.7);
}
body.blog-page.author-bot-page .blog-post-toc .toc-heading {
    color: rgba(245, 240, 230, 0.6);
}
body.blog-page.author-bot-page .blog-post-toc .list .item {
    color: rgba(245, 240, 230, 0.8);
}
body.blog-page.author-bot-page .blog-post-toc .list .item::before {
    color: rgba(245, 240, 230, 0.45);
}
body.blog-page.author-bot-page .blog_footer,
body.blog-page.author-bot-page .blog-footer {
    color: rgba(245, 240, 230, 0.7);
}

/* Hybrid Theme: Human + AI Collaboration (author-collaboration-page) */
body.blog-page.author-collaboration-page {
    background: #f5f0e6;
    min-height: 100vh;
    position: relative;
}

body.blog-page.author-collaboration-page .site-header {
    background: #0b0b0c;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

body.blog-page.author-collaboration-page .site-header .brand {
    display: inline-flex;
    align-items: center;
}

body.blog-page.author-collaboration-page .site-header .brand img {
    filter: none !important;
    background: transparent;
    object-fit: contain;
}

body.blog-page.author-collaboration-page .blog-header {
    background: #0b0b0c;
    border-bottom: 2px solid rgba(255, 255, 255, 0.12);
    color: #f5f0e6;
}

body.blog-page.author-collaboration-page .blog-header a {
    color: #f5f0e6;
    text-decoration-color: rgba(245, 240, 230, 0.5);
}

body.blog-page.author-collaboration-page .blog-header h1 {
    color: #ffffff;
}

body.blog-page.author-collaboration-page .blog-meta {
    color: rgba(245, 240, 230, 0.7);
}

body.blog-page.author-collaboration-page .blog-meta time {
    color: rgba(245, 240, 230, 0.85);
}

body.blog-page.author-collaboration-page .blog-layout {
    background: transparent;
    border-radius: 0;
    padding: clamp(20px, 5vw, 60px) clamp(24px, 8vw, 120px) clamp(48px, 10vw, 140px);
    box-shadow: none;
    border: none;
    position: relative;
}

body.blog-page.author-collaboration-page .blog_post_sidebar {
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    position: relative;
    overflow: visible;
    max-height: none;
}

body.blog-page.author-collaboration-page .blog_post_sidebar::after {
    display: none;
}

body.blog-page.author-collaboration-page .blog_post_article {
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    color: rgba(31, 28, 26, 0.88);
    box-shadow: none;
    position: relative;
}

body.blog-page.author-collaboration-page .blog_post_article::before {
    display: none;
}

body.blog-page.author-collaboration-page .blog_post_article p,
body.blog-page.author-collaboration-page .blog_post_article li {
    color: rgba(31, 28, 26, 0.88);
}

body.blog-page.author-collaboration-page .blog_post_article h2,
body.blog-page.author-collaboration-page .blog_post_article h3 {
    color: var(--friedso-black);
    border-left: none;
    padding-left: 0;
}

body.blog-page.author-collaboration-page .blog-post-toc .toc-heading {
    color: rgba(31, 28, 26, 0.6);
}

body.blog-page.author-collaboration-page .blog-post-toc .list .item {
    color: rgba(31, 28, 26, 0.78);
}

body.blog-page.author-collaboration-page .blog-post-toc .list .item::before {
    color: rgba(31, 28, 26, 0.5);
}

body.blog-page.author-collaboration-page .blog-footer {
    background: #0b0b0c;
    border-top: 2px solid rgba(255, 255, 255, 0.12);
    color: rgba(245, 240, 230, 0.7);
}

/* Multiple Author Badges */
.author-badges-container {
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: flex-start;
}

.blog-author-stamp-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.blog-author-stamp-item img {
    width: 80px;
    height: 80px;
    display: block !important;
    border-radius: 16px;
    object-fit: contain;
}

/* Ensure author badges are side by side on collaboration page */
body.blog-page.author-collaboration-page .author-badges-container {
    display: flex !important;
    flex-direction: row !important;
    gap: 16px;
    align-items: flex-start;
}

body.blog-page.author-collaboration-page .blog-author-stamp.author-collaboration {
    display: block;
}

.author-dso-badge {
    background: rgba(31, 28, 26, 0.1);
    color: var(--friedso-black);
    border: 1px solid rgba(31, 28, 26, 0.2);
}

.author-dso-badge:hover,
.author-dso-badge:focus-visible {
    background: rgba(31, 28, 26, 0.15);
}

/* Prompt Source Link in Sidebar */
.prompt-source-link {
    margin-top: 24px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(31, 28, 26, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.prompt-source-link-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(31, 28, 26, 0.7);
    text-decoration: none;
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: lowercase;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(31, 28, 26, 0.05);
    border: 1px solid rgba(31, 28, 26, 0.1);
    transition: all 0.2s ease;
}

.prompt-logo-small {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    font-size: 0.9em;
    color: rgba(243, 108, 33, 0.9);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.prompt-source-link-item:hover,
.prompt-source-link-item:focus-visible {
    color: var(--friedso-black);
    background: rgba(31, 28, 26, 0.1);
    border-color: rgba(243, 108, 33, 0.3);
}

body.blog-page.author-collaboration-page .prompt-source-link-item {
    color: rgba(31, 28, 26, 0.7);
}

body.blog-page.author-collaboration-page .prompt-source-link-item:hover {
    color: var(--friedso-black);
}

/* Prompt Source Page (IDE-like Dark Theme) */
body.blog-page.prompt-source-page {
    background: #0b0b0c;
    color: #f5f0e6;
    min-height: 100vh;
}

.prompt-source-site-header {
    background: #0b0b0c !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f5f0e6;
}

.prompt-source-site-header .brand {
    display: inline-flex;
    align-items: center;
}

.prompt-source-site-header .brand img {
    filter: none;
    background: transparent;
    object-fit: contain;
}

.prompt-source-blog-header {
    color: #f5f0e6;
    padding: clamp(12px, 3vw, 24px) clamp(24px, 6vw, 80px);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    position: sticky;
    top: 64px;
    z-index: 99;
    background: #0b0b0c;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 0;
}

.prompt-source-blog-header a {
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-decoration-color: rgba(255, 255, 255, 0.8);
    opacity: 1;
}

.prompt-source-blog-header a:hover {
    color: #ffffff;
    text-decoration-color: #f5f0e6;
}

.prompt-source-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #ffffff;
}

.prompt-source-title .brand {
    display: inline-flex !important;
    align-items: center;
    margin-right: 16px;
}

.prompt-source-title .brand img {
    height: 32px !important;
    width: auto !important;
    display: block !important;
    filter: brightness(0) invert(1) !important;
}

.prompt-logo {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    font-size: 0.85em;
    color: rgba(243, 108, 33, 0.9);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.prompt-text {
    color: #f5f0e6;
}

.prompt-source-main {
    padding: clamp(20px, 5vw, 60px) clamp(24px, 8vw, 120px) clamp(48px, 10vw, 140px);
    max-width: 1400px;
    margin: 0 auto;
}

.prompt-source-container {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.prompt-source-section {
    margin-bottom: 40px;
}

.prompt-source-section:last-child {
    margin-bottom: 0;
}

.prompt-source-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 16px 0;
    letter-spacing: 0.02em;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.prompt-source-author-badge {
    margin-bottom: 16px;
}

.prompt-source-author-badge .author-dso-badge {
    background: rgba(31, 28, 26, 0.3);
    color: #f5f0e6;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.prompt-source-prompt {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
}

.prompt-source-notes-box {
    background: #f5f0e6;
    border: 1px solid rgba(31, 28, 26, 0.1);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.prompt-source-notes-box .prompt-source-code {
    color: #1f1c1a;
    background: transparent;
}

.prompt-source-notes-box .prompt-source-code code {
    color: #1f1c1a;
}

.prompt-source-content {
    position: relative;
}

.prompt-source-code {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    font-size: 15px;
    line-height: 1.8;
    color: rgba(245, 240, 230, 0.9);
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
}

.prompt-source-code code {
    display: block;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.prompt-source-footer {
    background: transparent;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(245, 240, 230, 0.7);
    padding: 24px;
    margin-top: 40px;
}

.prompt-source-footer span {
    color: rgba(245, 240, 230, 0.7);
}

/* Author-bot Landing page background */
body.blog-page.author-bot-landing {
    background-image:
        linear-gradient(0deg, rgba(11, 11, 12, 0.78), rgba(11, 11, 12, 0.78)),
        url('/assets/bot_write.png'),
        url('/blog/author-bot/bot_write.png');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
}
body.blog-page.author-bot-landing .blog-layout {
    background: rgba(31, 28, 26, 0.55); /* use palette black with transparency */
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
body.blog-page.author-bot-landing .blog_post_sidebar,
body.blog-page.author-bot-landing .blog_post_article {
    color: rgba(245, 240, 230, 0.92);
}
body.blog-page.author-bot-landing .blog_post_article a,
body.blog-page.author-bot-landing .blog-header a {
    color: #f5f0e6;
    text-decoration-color: rgba(245, 240, 230, 0.5);
}
body.blog-page.author-bot-landing .blog_post_article h1,
body.blog-page.author-bot-landing .blog_post_article h2,
body.blog-page.author-bot-landing .blog_post_article h3 {
    color: #ffffff;
}

/* Author stamp component */
.blog-author-stamp {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    margin-bottom: 24px;
    background: transparent;
    border: none;
    box-shadow: none;
}
.blog-author-stamp img {
    width: 120px;
    height: 120px;
    display: block;
    border-radius: 24px;
    margin-bottom: 16px; /* extra spacing between image and text */
}
.blog-author-stamp.author-bot {
    color: inherit;
}
/* Distinct author-bot badge link */
.blog-author-badge {
    display: inline-block;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    text-transform: none;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(243, 108, 33, 0.22);
    color: var(--friedso-white);
    border: 1px solid rgba(243, 108, 33, 0.55);
    text-decoration: none;
}
.blog-author-badge:hover,
.blog-author-badge:focus-visible {
    background: rgba(243, 108, 33, 0.34);
}
.blog-author-note {
    font-size: 0.95rem;
    line-height: 1.6;
}
.blog-header {
    padding: clamp(20px, 5vw, 48px) clamp(24px, 6vw, 80px);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
}

.blog-header a {
    color: var(--friedso-black);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.blog-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(31, 28, 26, 0.68);
}

.blog-meta time {
    font-size: 12px;
    letter-spacing: 0.18em;
    color: rgba(31, 28, 26, 0.5);
}
/* Dark theme timestamp legibility */
body.blog-page.author-bot-page .blog-meta time {
    color: rgba(245, 240, 230, 0.85);
    background: rgba(245, 240, 230, 0.12);
    padding: 2px 6px;
    border-radius: 6px;
}

/* Global rule: Hide Blog ID on production (friedso.com) */
@media screen {
  /* Production hosts */
  body:not([data-env="staging"]):not([data-env="local"]) .blog-meta span:contains("Blog #") {
    display: none !important;
  }
}

/* Additional CSS rule for production - hide blog IDs */
body .blog-meta span[style*="display: none"] {
  display: none !important;
}

.blog-layout {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    align-items: start;
    gap: clamp(40px, 6vw, 96px);
    padding: clamp(20px, 5vw, 60px) clamp(24px, 8vw, 120px) clamp(48px, 10vw, 140px);
}

.blog_post_sidebar {
    position: sticky;
    top: calc(64px + clamp(20px, 6vh, 60px)); /* Account for site-header height (64px) + spacing */
    align-self: start;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    max-height: calc(100vh - 64px - clamp(20px, 6vh, 60px) - 40px); /* Prevent overflow */
    overflow-y: visible;
    overflow-x: visible;
}

.blog-post-toc {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.blog-post-toc .toc-heading {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: rgba(31, 28, 26, 0.46);
}

.blog-post-toc .list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.blog-post-toc .list .item {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    color: rgba(31, 28, 26, 0.78);
    text-decoration: none;
    font-size: 18px;
    line-height: 1.8;
    padding: 4px 0;
    transition: color 0.2s ease, font-weight 0.2s ease;
}

.blog-post-toc .list .item::before {
    content: "—";
    color: rgba(31, 28, 26, 0.5);
    font-weight: 500;
    transition: color 0.2s ease, transform 0.2s ease;
}

.blog-post-toc .list .item:hover,
.blog-post-toc .list .item:focus-visible {
    color: var(--friedso-black);
    font-weight: 600;
}

.blog-post-toc .list .item:hover::before,
.blog-post-toc .list .item:focus-visible::before {
    color: #f36c21;
    transform: translateX(4px);
}

.blog_post_article {
    max-width: min(1400px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 3.5vw, 40px);
    font-size: 18px;
    line-height: 1.75;
    color: rgba(31, 28, 26, 0.88);
}

.blog_post_article h1,
.blog_post_article h2,
.blog_post_article h3 {
    margin-bottom: 12px;
    line-height: 1.2;
    color: var(--friedso-black);
    scroll-margin-top: 64px; /* Account for sticky header height - position headings right below header */
}

.blog_post_article h1 {
    font-size: clamp(32px, 4vw, 56px);
    letter-spacing: -0.01em;
}

.blog_post_article h2 {
    font-size: clamp(24px, 3vw, 34px);
}

.blog_post_article h3 {
    font-size: clamp(18px, 2.1vw, 22px);
    letter-spacing: 0.01em;
    margin-top: 6px;
}

.blog_post_article p {
    margin: 0 0 12px 0;
}

.blog_post_article blockquote {
    padding: 24px;
    border-left: 4px solid var(--friedso-black);
    background: rgba(245, 240, 230, 0.4);
    border-radius: 16px;
    font-style: italic;
    margin: 16px 0 18px 0; /* extra breathing space before/after quotes */
}

.blog_post_article ul,
.blog_post_article ol {
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.blog_post_article a {
    color: var(--friedso-black);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(31, 28, 26, 0.4);
    text-decoration-thickness: 1.5px;
}

.blog_post_article figure {
    margin: 24px 0;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--friedso-divider);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
}

.blog_post_article figure img {
    width: 100%;
    display: block;
    height: auto;
}

.blog_post_article figcaption {
    padding: 16px 24px;
    font-size: 14px;
    color: rgba(31, 28, 26, 0.64);
    line-height: 1.5;
    text-align: left;
}

.blog-footer {
    padding: clamp(32px, 8vw, 80px) clamp(24px, 6vw, 80px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: rgba(31, 28, 26, 0.64);
}

.apps-hero {
    padding: clamp(32px, 8vw, 64px) clamp(24px, 8vw, 120px) clamp(24px, 4vw, 40px) clamp(24px, 8vw, 120px);
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: linear-gradient(135deg, rgba(245, 240, 230, 0.85), rgba(255, 255, 255, 0.9));
    color: var(--friedso-black);
}

.apps-hero h1 {
    font-size: clamp(32px, 5vw, 60px);
    margin: 0;
}

.apps-hero p {
    max-width: 560px;
    font-size: 18px;
    line-height: 1.6;
    margin: 0;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    padding: clamp(16px, 3vw, 32px) clamp(24px, 6vw, 64px) clamp(24px, 6vw, 64px);
}

.app-card {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 18px;
    padding: 24px;
    border: 1px solid var(--friedso-divider);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    color: var(--friedso-black);
    text-decoration: none;
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.08);
}

.app-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.14);
}

.app-card h2 {
    margin: 0;
    font-size: 22px;
}

.app-card p {
    margin: 0;
    font-size: 15px;
    color: rgba(31, 28, 26, 0.7);
}

.app-card span {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(31, 28, 26, 0.55);
}

/* ========================================
   BLOG RESPONSIVE
   ======================================== */

@media (max-width: 1200px) {
    .blog-layout {
        gap: clamp(24px, 5vw, 48px);
    }
}

@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .blog_post_sidebar {
        position: relative;
        top: 0;
        order: 1;
        margin-top: 32px;
        margin-bottom: 0;
    }

    .blog_post_article {
        order: -1;
    }
}

@media (max-width: 640px) {
    .blog-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .blog-footer {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .hero-tiles {
        gap: clamp(16px, 6vw, 24px);
    }
}

html[data-device="handheld"][data-orientation="portrait"] .apps-grid,
.viewport-wrapper.sim-handheld .apps-grid {
    grid-template-columns: 1fr;
    gap: clamp(20px, 6vh, 36px);
    padding-inline: clamp(20px, 7vw, 40px);
}

html[data-device="handheld"][data-orientation="portrait"] .blog-layout,
.viewport-wrapper.sim-handheld .blog-layout {
    grid-template-columns: 1fr;
    gap: clamp(24px, 6vh, 48px);
}

html[data-device="handheld"][data-orientation="portrait"] .blog_post_sidebar,
.viewport-wrapper.sim-handheld .blog_post_sidebar {
    order: 1;
    margin-top: 32px;
    margin-bottom: 0;
}

html[data-device="handheld"][data-orientation="portrait"] .blog_post_article,
.viewport-wrapper.sim-handheld .blog_post_article {
    order: -1;
}

html[data-device="handheld"][data-orientation="portrait"] .blog-footer,
.viewport-wrapper.sim-handheld .blog-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}


/* removed: NSA overlay styles */

/* ========================================
   Embedded Gist - Dark Code Theme
   ======================================== */
.gist {
    background: #0b0b0c !important;
    border: 1px solid var(--friedso-divider) !important;
    border-radius: 14px !important;
    overflow: auto;
    max-width: 100%;
}
.gist .gist-file {
    border-color: rgba(255, 255, 255, 0.14) !important;
    background: transparent !important;
}
.gist .highlight,
.gist .blob-code,
.gist .blob-code-inner,
.gist pre {
    background: transparent !important;
    color: #e8e8e8 !important;
}
.gist .blob-num {
    color: #a7a7a7 !important;
    background: transparent !important;
}
.gist a {
    color: #d6d6ff !important;
    text-decoration-color: rgba(214, 214, 255, 0.5) !important;
}

/* Scoped dark theme when wrapped with .gist-dark */
.gist-dark {
    background: #0b0b0c;
    border: 1px solid var(--friedso-divider);
    border-radius: 14px;
    overflow: hidden;
}
.gist-dark .gist,
.gist-dark .gist-file,
.gist-dark .gist-data,
.gist-dark .blob-wrapper,
.gist-dark .highlight,
.gist-dark pre {
    background: transparent !important;
}
.gist-dark .gist,
.gist-dark .gist * {
    color: #e8e8e8 !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
}
.gist-dark .blob-num {
    color: #a7a7a7 !important;
}
.gist-dark a {
    color: #d6d6ff !important;
    text-decoration-color: rgba(214, 214, 255, 0.5) !important;
}
.gist-dark table {
    background: transparent !important;
}
.gist-dark .blob-code-inner {
    background: transparent !important;
}

