/**
 * Kenny Portfolio Theme - Optimized CSS
 * Version: 2.0.0
 * Optimizations: Reduced file size, improved performance, better organization
 */

/* ==========================================================================
   CSS CUSTOM PROPERTIES
   ========================================================================== */

   :root {
    /* Color System */
    --color-bg: #DCDCDC;
    --color-fg: #000000;
    --color-surface: #C8BEB7;
    --color-muted: #5C5652;
    --color-accent: #E62727;
    --color-accent2: #FF9A00;
    --color-line: rgba(255, 255, 255, 0.08);
    --color-error: #e74c3c;
    
    /* Gradients */
    --gradient-accent: linear-gradient(135deg, var(--color-accent), var(--color-accent2));
    
    /* Layout & Spacing */
    --radius: 18px;
    --radius-small: 12px;
    --radius-large: 24px;
    --radius-full: 50%;
    --work-card-height: 220px;
    
    /* Animation */
    --transition: 0.35s ease;
    --transition-fast: 0.15s ease;
    
    /* Typography */
    --font-primary: 'Poppins', sans-serif;
    --font-display: 'Cal Sans', sans-serif;
    
    /* Z-Index Scale */
    --z-header: 1050;
    --z-modal: 1060;
    --z-tooltip: 1070;
  }
  
  /* Dark mode adjustments */
  @media (prefers-color-scheme: dark) {
    :root {
      --color-bg: #1a1a1a;
      --color-fg: #ffffff;
      --color-surface: #2a2a2a;
      --color-muted: #888888;
    }
  }
  
  /* Responsive breakpoint adjustments */
  @media (max-width: 576px) {
    :root {
      --work-card-height: 180px;
      --radius: 14px;
    }
  }
  
  @media (min-width: 1200px) {
    :root {
      --work-card-height: 240px;
      --radius: 20px;
    }
  }
  
  /* ==========================================================================
     BASE STYLES
     ========================================================================== */
  
  html {
    scroll-behavior: smooth;
  }
  
  body {
    background: var(--color-bg);
    color: var(--color-fg);
    font-family: var(--font-primary);
    line-height: 1.6;
    margin: 0;
  }
  
  /* Typography */
  h1, h2, h3, h4, h5, h6,
  .display-1, .display-2 {
    font-family: var(--font-display);
    line-height: 1.2;
    margin: 0;
  }
  
  a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
  }
  
  /* Utility Classes */
  .text-muted { color: var(--color-muted) !important; }
  .bg-accent { background: var(--gradient-accent); }
  
  /* ==========================================================================
     HEADER & NAVIGATION
     ========================================================================== */
  
  .nav-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-header);
    background: rgba(20, 18, 17, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-line);
    text-transform: uppercase;
  }
  
  .nav-pills .nav-link {
    border-radius: var(--radius-full);
    padding: 0.5rem 1rem;
    position: relative;
    overflow: hidden;
    transition: 
      transform var(--transition),
      background-color var(--transition),
      color var(--transition);
    color: #d0d0d0;
  }
  
  .nav-pills .nav-link:hover {
    color: #fff;
    transform: translateY(-1px);
    border-color: transparent;
  }
  
  .nav-pills .nav-link::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(120px 120px at var(--mx, 0) var(--my, 0), 
                rgba(255, 255, 255, 0.15), transparent 60%);
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
  }
  
  .nav-pills .nav-link:hover::after {
    opacity: 1;
  }
  
  .nav-pills .nav-link.active {
    color: #000;
    background: var(--gradient-accent);
    border-color: transparent;
    box-shadow: 0 6px 22px rgba(138, 43, 226, 0.35);
  }
  
  /* ==========================================================================
     HERO SECTIONS
     ========================================================================== */
  
  .hero {
    min-height: 85vh;
    padding-top: 80px;
    position: relative;
    background: 
      linear-gradient(135deg,
        rgba(191, 64, 32, 0.07),
        rgba(1, 186, 239, 0.07) 70%
      ),
      url('../img/bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }
  
  .hero-title {
    font-family: var(--font-display);
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.1;
  }
  
  .hero-intro {
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 1.3rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 0.5px;
  }
  
  /* Hero with animated waves */
  .hero.hero-curves {
    min-height: 85vh;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: 6rem 1rem 0;
  }
  
  .wavefield {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.35;
  }
  
  .wave {
    fill: none;
    stroke: url(#waveStroke);
    stroke-width: 2.2;
    stroke-linecap: round;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.25));
    opacity: 0.65;
  }
  
  .flow {
    transform: translateZ(0);
  }
  
  .flow-1 {
    animation: waveSlide 16s linear infinite;
  }
  
  .flow-2 {
    animation: waveSlide 22s linear infinite reverse;
    opacity: 0.55;
  }
  
  @keyframes waveSlide {
    0% { transform: translateX(0); }
    100% { transform: translateX(-1440px); }
  }
  
  /* ==========================================================================
     LAYOUT SECTIONS
     ========================================================================== */
  
  section {
    padding: 5rem 0;
  }
  
  .section-title {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-accent);
    margin-bottom: 2rem;
  }
  
  /* ==========================================================================
     ABOUT SECTION
     ========================================================================== */
  
  .about-photo-wrap {
    display: inline-block;
    padding: 5px;
    background: var(--gradient-accent);
    border-radius: var(--radius-full);
  }
  
  .about-photo {
    width: 220px;
    height: 220px;
    border-radius: var(--radius-full);
    object-fit: cover;
    display: block;
  }
  
  /* ==========================================================================
     WORK GRID
     ========================================================================== */
  
  .work-card {
    border-radius: var(--radius);
    border: 1px solid var(--color-line);
    overflow: hidden;
    background: var(--color-surface);
    transition: 
      transform 0.3s ease,
      box-shadow 0.3s ease;
    position: relative;
  }
  
  .work-media {
    height: var(--work-card-height);
    aspect-ratio: 16 / 9;
    background: #000;
    position: relative;
    overflow: hidden;
  }
  
  .work-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform, filter;
    transition: 
      transform 0.4s ease,
      filter 0.4s ease;
    filter: grayscale(100%) contrast(1.05) brightness(0.9);
  }
  
  .work-card:hover .work-img {
    transform: scale(1.06);
    filter: none;
  }
  
  /* Featured work cards */
  .work-card-featured {
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    transition: 
      transform 0.3s ease,
      box-shadow 0.3s ease;
  }
  
  .work-card-featured::after {
    content: "";
    position: absolute;
    inset: 0;
    background: 
      radial-gradient(100% 150% at 100% 0%, rgba(1, 186, 239, 0.18), transparent 70%),
      radial-gradient(100% 150% at 0% 100%, rgba(32, 191, 85, 0.16), transparent 70%);
    opacity: 0.2;
    z-index: 0;
    pointer-events: none;
  }
  
  .work-card-featured:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
  }
  
  .work-card-featured .p-4 {
    position: relative;
    z-index: 1;
  }
  
  /* ==========================================================================
     BLOG CARDS
     ========================================================================== */
  
  .blog-card {
    border-radius: var(--radius);
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    transition: 
      transform var(--transition),
      border-color var(--transition);
  }
  
  .blog-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.15);
  }
  
  /* ==========================================================================
     CONTACT SECTION
     ========================================================================== */
  
  .contact-accent {
    background: var(--gradient-accent);
    padding: 5rem 0;
    color: #111;
  }
  
  .contact-card {
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
  }
  
  .contact-card .form-control {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #000;
    transition: 
      border-color var(--transition-fast),
      box-shadow var(--transition-fast);
  }
  
  .contact-card .form-control:focus {
    border-color: var(--color-accent2);
    box-shadow: 0 0 0 0.25rem rgba(1, 186, 239, 0.25);
  }
  
  .contact-card label {
    color: #444;
  }
  
  /* Form Status Messages */
  .form-status {
    min-height: 1.25rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  
  .form-status.show { opacity: 1; }
  .form-status.success { color: var(--color-accent); }
  .form-status.error { color: var(--color-error); }
  
  .form-status .progress {
    height: 4px;
    background: var(--color-line);
    border-radius: 2px;
    overflow: hidden;
  }
  
  .form-status .progress-bar {
    height: 100%;
    width: 100%;
    background: var(--gradient-accent);
    animation: progress-stripes 1s linear infinite;
    background-size: 200% 100%;
  }
  
  @keyframes progress-stripes {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
  }
  
  /* Availability Card */
  .availability-card {
    background: rgba(255, 255, 255, 0.85);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
  }
  
  .alt-contact {
    text-align: center;
    font-size: 0.95rem;
    color: #fff;
  }
  
  .alt-contact a {
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px dashed var(--color-accent);
    transition: 
      color var(--transition-fast),
      border-color var(--transition-fast);
  }
  
  .alt-contact a:hover {
    color: #000;
    border-color: currentColor;
  }
  
  /* Copy Tooltip */
  .copy-tooltip {
    position: absolute;
    top: -2.2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-accent);
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: 
      opacity 0.25s ease,
      transform 0.25s ease;
    z-index: var(--z-tooltip);
  }
  
  .copy-tooltip.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
  }
  
  /* ==========================================================================
     UI COMPONENTS
     ========================================================================== */
  
  /* Badges & Chips */
  .badge-accent {
    background: var(--gradient-accent);
    color: #000;
    border: none;
  }
  
  .mini-badge {
    display: inline-block;
    font-size: 0.82rem;
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.06);
    font-weight: 600;
    color: #111;
  }
  
  .mini-badge.muted {
    opacity: 0.7;
  }
  
  .chip {
    display: inline-block;
    font-size: 0.82rem;
    border-radius: var(--radius-full);
    padding: 0.45rem 0.65rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-fg);
    text-decoration: none;
    transition: 
      background var(--transition-fast),
      border-color var(--transition-fast),
      transform var(--transition-fast);
  }
  
  .chip-role:hover {
    background: var(--color-accent2);
    border-color: transparent;
    color: #000;
    transform: translateY(-1px);
  }
  
  .chip-role.active {
    background: var(--gradient-accent);
    border-color: transparent;
    color: #000;
  }
  
  .chip-light {
    background: #fff;
    color: #000;
    border: 1px solid rgba(0, 0, 0, 0.06);
  }
  
  .chip-outline {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
  }
  
  /* Buttons */
  .btn-card {
    background: var(--gradient-accent);
    color: #000;
    border: none;
    border-radius: var(--radius-full);
    padding: 0.5rem 0.9rem;
    font-weight: 700;
    transition: 
      transform var(--transition-fast),
      box-shadow var(--transition-fast);
  }
  
  .btn-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(1, 186, 239, 0.25);
  }
  
  .btn-accent {
    background: #000;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    transition: 
      background var(--transition-fast),
      transform var(--transition-fast);
  }
  
  .btn-accent:hover {
    transform: translateY(-1px);
    background: #f2f0ee;
    color: #232121;
  }
  
  /* ==========================================================================
     FOOTER
     ========================================================================== */
  
  .footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #050505;
  }
  
  .social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    transition: 
      transform var(--transition),
      border-color var(--transition),
      background var(--transition);
  }
  
  .social a:hover,
  .share-link:hover {
    transform: translateY(-2px);
  }
  
  .share-link {
    transition: 
      transform var(--transition),
      border-color var(--transition),
      background var(--transition);
  }
  
  /* ==========================================================================
     MODALS
     ========================================================================== */
  
  .modal-dark .modal-content {
    background: #0b0b0b;
    color: #f4f4f4;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-large);
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  }
  
  .modal-dark .modal-header {
    border: 0;
    background: var(--gradient-accent);
    color: #000;
  }
  
  .modal-dark .btn-close {
    filter: invert(1) grayscale(1);
    opacity: 0.7;
  }
  
  .modal-dark .modal-body {
    padding: 1.25rem 1.25rem 1.75rem;
  }
  
  .modal-title {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.01em;
  }
  
  .role-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .role-badges .badge {
    background: var(--gradient-accent);
    color: #000;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-full);
    font-weight: 600;
  }
  
  .hr-soft {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.12), transparent);
    margin: 1rem 0 1.25rem;
  }
  
  /* ==========================================================================
     PROJECT PAGES
     ========================================================================== */
  
  .project-hero {
    position: relative;
    isolation: isolate;
    min-height: 50vh;
    display: grid;
    place-items: center;
    overflow: hidden;
    text-align: center;
  }
  
  .ph-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.4);
    transform: scale(1.1);
  }
  
  .ph-logo-wrap {
    position: relative;
    z-index: 1;
    width: 180px;
    height: 180px;
    border-radius: var(--radius-full);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0 auto;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  }
  
  .ph-logo-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }
  
  .ph-wrap {
    display: grid;
    gap: 1rem;
  }
  
  .ph-cover {
    margin: 0;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--color-line);
  }
  
  .ph-cover img {
    width: 100%;
    height: 48vh;
    min-height: 260px;
    object-fit: cover;
    display: block;
  }
  
  .ph-head {
    padding-top: 0.5rem;
  }
  
  .ph-title {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.01em;
    font-size: clamp(1.6rem, 3.4vw, 2.6rem);
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  
  .ph-cap {
    color: #fff;
    margin: 0.25rem 0 0;
  }
  
  .ph-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
  }
  
  .project-body {
    background: var(--color-surface);
    padding: 2rem 0 3rem;
    border-top: 1px solid var(--color-line);
    min-height: 80vh;
  }
  
  .proj-nav .back {
    color: var(--color-fg);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    transition: border-color var(--transition-fast);
  }
  
  .proj-nav .back:hover {
    border-bottom-color: rgba(255, 255, 255, 0.35);
  }
  
  /* ==========================================================================
     MEDIA COMPONENTS
     ========================================================================== */
  
  .media-card {
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: 0.75rem;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
  }
  
  .embed-16by9 {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    border-radius: calc(var(--radius) - 4px);
  }
  
  .embed-16by9 iframe,
  .embed-16by9 video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
  }
  
  .audio-wrap audio {
    width: 100%;
  }
  
  /* ==========================================================================
     CUSTOM AUDIO PLAYER
     ========================================================================== */
  
  .ap {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.75rem 1rem;
    align-items: center;
    isolation: isolate;
  }
  
  .ap-btn {
    grid-row: 1 / span 2;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--color-accent2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 
      transform var(--transition-fast),
      box-shadow 0.25s ease,
      background 0.25s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  }
  
  .ap-btn i {
    font-size: 2rem;
    line-height: 1;
  }
  
  .ap-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4);
  }
  
  .ap-btn .bi-pause-fill {
    display: none;
  }
  
  .ap.playing .ap-btn .bi-play-fill {
    display: none;
  }
  
  .ap.playing .ap-btn .bi-pause-fill {
    display: inline;
  }
  
  .ap-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
  }
  
  .ap-title {
    font-weight: 700;
    letter-spacing: 0.02em;
  }
  
  .ap-time {
    font-variant-numeric: tabular-nums;
    color: var(--color-muted);
    font-size: 0.95rem;
  }
  
  .ap-bar {
    grid-column: 2 / 4;
    height: 10px;
    border-radius: var(--radius-full);
    position: relative;
    cursor: pointer;
    background: color-mix(in oklab, var(--color-surface) 60%, #fff 8%);
    border: 1px solid var(--color-line);
  }
  
  .ap-progress {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    background: var(--gradient-accent);
    border-radius: var(--radius-full);
    box-shadow: 0 6px 18px color-mix(in oklab, var(--color-accent) 25%, transparent);
  }
  
  .ap-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: #000;
    border: 2px solid color-mix(in oklab, var(--color-accent2) 70%, #fff 0%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    left: 0%;
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
  }
  
  .ap:hover .ap-handle {
    opacity: 1;
  }
  
  .ap .ap-audio {
    width: 100%;
    display: none;
  }
  
  .no-ap .ap .ap-audio {
    display: block;
  }
  
  /* ==========================================================================
     BLOG & ARTICLE STYLES
     ========================================================================== */
  
  .post-hero {
    padding: 8rem 0 3rem;
    background: 
      linear-gradient(135deg,
        rgba(191, 64, 32, 0.07),
        rgba(1, 186, 239, 0.07) 70%
      ),
      url('../img/bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }
  
  .post-cover {
    margin: 0 0 1.5rem;
    overflow: hidden;
    border-radius: var(--radius);
  }
  
  .post-cover img {
    width: 100%;
    height: 52vh;
    min-height: 280px;
    object-fit: cover;
    display: block;
  }
  
  .post-head {
    color: #fff;
    margin-bottom: 1.5rem;
  }
  
  .post-head .eyebrow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
  }
  
  .post-head .sep {
    opacity: 0.6;
    color: #bfbfbf;
  }
  
  .post-title {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.01em;
    font-size: clamp(1.8rem, 3vw, 3rem);
    margin: 0.25rem 0 0.5rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  
  .post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  
  .post-meta .avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
  }
  
  .post-meta .byline {
    color: #d9d9d9;
    font-size: 0.95rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.6rem;
    align-items: center;
  }
  
  .post-meta .dot {
    opacity: 0.6;
  }
  
  .post-meta .updated {
    opacity: 0.8;
  }
  
  .post-body {
    background: #f7f8fb;
    padding: 2.5rem 0 4rem;
  }
  
  /* Prose Styles */
  .prose {
    max-width: 760px;
    margin: 0 auto;
    color: var(--color-fg);
  }
  
  .prose p {
    line-height: 1.7;
    margin: 1rem 0;
    color: color-mix(in oklab, var(--color-fg) 85%, #000 15%);
  }
  
  .prose h2, .prose h3, .prose h4 {
    font-family: var(--font-display);
    margin: 2rem 0 0.75rem;
    color: #0b0b0c;
  }
  
  .prose h2 {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
  }
  
  .prose h3 {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
  }
  
  .prose h4 {
    font-size: 1.1rem;
  }
  
  .prose a {
    color: #0a3d5e;
    text-decoration: underline;
    text-decoration-color: rgba(1, 186, 239, 0.5);
    transition: text-decoration-thickness var(--transition-fast);
  }
  
  .prose a:hover {
    text-decoration-thickness: 2px;
  }
  
  .prose img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-small);
  }
  
  .prose figure {
    margin: 1.5rem 0;
  }
  
  .prose figcaption {
    font-size: 0.9rem;
    color: #555;
    margin-top: 0.4rem;
  }
  
  .prose blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.2rem;
    position: relative;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
  }
  
  .prose blockquote:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: var(--gradient-accent);
    border-radius: 14px 0 0 14px;
  }
  
  .prose blockquote p {
    margin: 0;
    font-size: 1.05rem;
  }
  
  .prose pre,
  .prose code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  }
  
  .prose pre {
    background: #0f1220;
    color: #e7e7ff;
    padding: 1rem;
    border-radius: var(--radius-small);
    overflow: auto;
    border: 1px solid rgba(0, 0, 0, 0.1);
  }
  
  .prose code {
    background: rgba(0, 0, 0, 0.08);
    padding: 0.1rem 0.25rem;
    border-radius: 6px;
  }
  
  .prose ul,
  .prose ol {
    padding-left: 1.25rem;
  }
  
  .prose li {
    margin: 0.35rem 0;
  }
  
  .prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
  }
  
  .prose th,
  .prose td {
    padding: 0.6rem 0.7rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }
  
  .prose thead th {
    background: #fff;
  }
  
  .post-footer {
    max-width: 900px;
    margin: 2.2rem auto 0;
  }
  
  .tags a,
  .tags span {
    display: inline-block;
    margin: 0 0.35rem 0.35rem 0;
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius-full);
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #111;
    font-size: 0.85rem;
    font-weight: 600;
  }
  
  .share {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0 0;
  }
  
  .share .label {
    opacity: 0.7;
  }
  
  .share-link {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-full);
    padding: 0.35rem 0.7rem;
  }
  
  .author-card {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    margin-top: 1.5rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 1rem 1.1rem;
  }
  
  .author-card .avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    object-fit: cover;
  }
  
  .author-card .name {
    font-weight: 700;
  }
  
  .author-card .bio {
    margin: 0.25rem 0 0;
    color: #333;
  }
  
  .post-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
  }
  
  .post-nav a {
    color: #0a3d5e;
    text-decoration: none;
    border-bottom: 1px solid rgba(1, 186, 239, 0.35);
    transition: border-bottom-width var(--transition-fast);
  }
  
  .post-nav a:hover {
    border-bottom-width: 2px;
  }
  
  /* ==========================================================================
     PAGE STYLES
     ========================================================================== */
  
  .page-spacer {
    height:6rem;
  }
  
  .page-hero {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-line);
    padding: 2.25rem 0 1.25rem;
  }
  
  .page-title {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.01em;
    font-size: clamp(1.8rem, 3.2vw, 2.6rem);
    color: var(--color-fg);
  }
  
  .page-subtitle {
    color: var(--color-muted);
    margin-top: 0.35rem;
  }
  
  .page-body {
    background: var(--color-surface);
    padding: 2rem 0 3rem;
  }
  
  .page-content {
    color: var(--color-fg);
  }
  
  .page-content .alignwide {
    max-width: min(1200px, 92vw);
    margin-left: auto;
    margin-right: auto;
  }
  
  .page-content .alignfull {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }
  
  .page-content a {
    color: color-mix(in oklab, var(--color-accent) 65%, #6b3a10);
    text-decoration: underline;
    text-decoration-color: color-mix(in oklab, var(--color-accent2) 55%, transparent);
  }
  
  .page-content h2 {
    font-size: clamp(1.2rem, 2.2vw, 1.6rem);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--color-muted);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
  }
  
  .page-hero-media img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin-top: 0.75rem;
  }
  
  /* ==========================================================================
     LANGUAGE SWITCHER
     ========================================================================== */
  
  .lang-switch .btn.current-lang {
    background: #fff;
    color: #000;
    border-color: transparent;
  }
  
  /* ==========================================================================
     UTILITY HELPERS
     ========================================================================== */
  
  .bs-scrollspy .nav-link.active {
    background: var(--gradient-accent);
    color: #000;
  }
  
  .track-mouse {
    position: relative;
  }
  
  /* No JavaScript fallback */
  .no-ap .ap .ap-audio {
    display: block;
  }
  
  /* ==========================================================================
     RESPONSIVE DESIGN
     ========================================================================== */
  
  @media (max-width: 992px) {
    .ph-cover img {
      height: 38vh;
    }
  }
  
  @media (max-width: 768px) {
    .post-meta .byline {
      font-size: 0.9rem;
    }
    
    .post-cover img {
      height: 40vh;
    }
    
    .hero {
      padding-top: 60px;
    }
    
    section {
      padding: 3rem 0;
    }
  }
  
  @media (max-width: 576px) {
    .ap-btn {
      width: 56px;
      height: 56px;
    }
    
    .ap-handle {
      width: 16px;
      height: 16px;
    }
    
    .about-photo {
      width: 180px;
      height: 180px;
    }
  }
  
  /* ==========================================================================
     PERFORMANCE OPTIMIZATIONS
     ========================================================================== */
  
  /* Reduce motion for users who prefer it */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
    
    .wave {
      animation: none;
    }
  }
  
  /* High contrast mode support */
  @media (prefers-contrast: high) {
    :root {
      --color-line: rgba(255, 255, 255, 0.3);
    }
    
    .work-img {
      filter: none;
    }
  }
  
  /* Print styles */
  @media print {
    .nav-wrap,
    .footer,
    .share,
    .btn-card,
    .btn-accent {
      display: none;
    }
    
    .hero {
      min-height: auto;
      padding: 2rem 0;
    }
    
    body {
      background: #fff;
      color: #000;
    }
  }