/* ==========================================================================
   Social Media Manager Portfolio - Custom Styles
   ========================================================================== */

/* CSS Custom Properties */
:root {
  --color-charcoal: #2D2926;
  --color-cream: #FDF8F4;
  --color-coral: #E07A5F;
  --color-terracotta: #C4634F;
  --color-warmgray: #8B8178;

  --font-display: 'Playfair Display', serif;
  --font-sans: 'DM Sans', sans-serif;

  --transition-base: 0.3s ease;
  --transition-slow: 0.6s ease;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: var(--color-coral);
  color: var(--color-cream);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-cream);
}

::-webkit-scrollbar-thumb {
  background: var(--color-warmgray);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-charcoal);
}

/* ==========================================================================
   Loading State - Editorial Entrance
   ========================================================================== */

/* Subtle noise texture overlay */
.loading-bg-texture {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* Corner decorative accents */
.loading-corner {
  position: absolute;
  width: 60px;
  height: 60px;
  border: 1px solid var(--color-warmgray);
  opacity: 0;
  animation: cornerFadeIn 1s ease forwards;
}

.loading-corner-tl {
  top: 24px;
  left: 24px;
  border-right: none;
  border-bottom: none;
  animation-delay: 0.5s;
}

.loading-corner-br {
  bottom: 24px;
  right: 24px;
  border-left: none;
  border-top: none;
  animation-delay: 0.7s;
}

@keyframes cornerFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 0.3;
    transform: scale(1);
  }
}

/* Top decorative line */
.loading-line-top {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--color-warmgray));
  margin: 0 auto 24px;
  opacity: 0;
  animation: lineGrow 0.8s ease forwards 0.2s;
}

@keyframes lineGrow {
  from {
    opacity: 0;
    height: 0;
  }
  to {
    opacity: 0.4;
    height: 40px;
  }
}

/* Subtitle animation */
.loading-subtitle {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 0.6s ease forwards 0.4s;
}

/* Title animation */
.loading-title {
  opacity: 0;
  transform: translateY(15px);
  animation: fadeUp 0.8s ease forwards 0.6s;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animated underline */
.loading-underline-container {
  width: 120px;
  height: 2px;
  margin: 0 auto;
  background: rgba(139, 129, 120, 0.15);
  overflow: hidden;
  opacity: 0;
  animation: fadeIn 0.4s ease forwards 0.9s;
}

.loading-underline {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--color-coral), var(--color-terracotta));
  transform: translateX(-100%);
  animation: underlineSlide 2s ease-in-out infinite 1.1s;
}

@keyframes underlineSlide {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(100%);
  }
  50.01% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Status text */
.loading-status {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards 1.2s;
}

/* Animated dots */
.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
  100% { content: ''; }
}

/* ==========================================================================
   Error State - Editorial Style
   ========================================================================== */

.error-bg-texture {
  position: absolute;
  inset: 0;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* Broken decorative line */
.error-broken-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.error-broken-line span {
  width: 30px;
  height: 1px;
  background: var(--color-warmgray);
  opacity: 0.4;
}

.error-broken-line span:first-child {
  transform: rotate(-15deg);
}

.error-broken-line span:last-child {
  transform: rotate(15deg);
}

/* Error icon */
.error-icon-container {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-coral);
  position: relative;
}

.error-icon-container::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--color-coral);
  opacity: 0.3;
  border-radius: 50%;
  animation: errorPulse 2s ease-in-out infinite;
}

@keyframes errorPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.1;
  }
}

/* Retry button */
.error-retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--color-charcoal);
  color: var(--color-cream);
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.error-retry-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-coral);
  transform: translateX(-101%);
  transition: transform 0.4s ease;
}

.error-retry-btn:hover::before {
  transform: translateX(0);
}

.error-retry-text,
.error-retry-arrow {
  position: relative;
  z-index: 1;
}

.error-retry-arrow {
  display: flex;
  transition: transform 0.3s ease;
}

.error-retry-btn:hover .error-retry-arrow {
  transform: translateX(4px);
}

/* Footer decorative element */
.error-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 48px;
}

.error-footer-line {
  width: 40px;
  height: 1px;
  background: var(--color-warmgray);
  opacity: 0.25;
}

.error-footer-diamond {
  width: 6px;
  height: 6px;
  background: var(--color-coral);
  transform: rotate(45deg);
  opacity: 0.6;
}

/* Mobile adjustments for loading/error states */
@media (max-width: 640px) {
  .loading-corner {
    width: 40px;
    height: 40px;
  }

  .loading-corner-tl {
    top: 16px;
    left: 16px;
  }

  .loading-corner-br {
    bottom: 16px;
    right: 16px;
  }

  .loading-line-top {
    height: 30px;
    margin-bottom: 20px;
  }

  @keyframes lineGrow {
    to {
      opacity: 0.4;
      height: 30px;
    }
  }

  .error-icon-container {
    width: 48px;
    height: 48px;
  }

  .error-retry-btn {
    padding: 12px 24px;
    font-size: 0.75rem;
  }

  .error-footer {
    margin-top: 36px;
  }
}

/* ==========================================================================
   Hero Card - Floating Container
   ========================================================================== */

.hero-card {
  background: rgba(253, 248, 244, 0.7);
  border: 1px solid rgba(139, 129, 120, 0.15);
  border-radius: 1rem;
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
}

/* Noise texture overlay (matches loading state) */
.hero-card .hero-texture {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.hero-card > *:not(.hero-texture) {
  position: relative;
  z-index: 1;
}

@media (min-width: 640px) {
  .hero-card {
    padding: 3rem 2.5rem;
  }
}

/* Corner accents */
.hero-card::before,
.hero-card::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border: 1px solid var(--color-warmgray);
  opacity: 0.25;
  z-index: 2;
}

.hero-card::before {
  top: 8px;
  left: 8px;
  border-right: none;
  border-bottom: none;
}

.hero-card::after {
  bottom: 8px;
  right: 8px;
  border-left: none;
  border-top: none;
}

/* ==========================================================================
   Hero Scroll Animation
   ========================================================================== */

:root {
  --hero-scroll-progress: 0;
}

.hero-scroll-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  pointer-events: none;
  will-change: transform, opacity;
  /* Solid background to prevent portfolio showing through */
  background: var(--color-cream);
  /* Animation based on scroll progress */
  transform: translateY(calc(var(--hero-scroll-progress) * -60vh))
             scale(calc(1.1 - var(--hero-scroll-progress) * 0.1));
  opacity: calc(1 - var(--hero-scroll-progress) * 0.1);
}

/* Enable pointer events on interactive elements inside hero */
.hero-scroll-container #hero {
  pointer-events: auto;
}

/* Spacer creates the scrollable area */
.hero-scroll-spacer {
  height: 60vh;
  pointer-events: none;
  position: relative;
  z-index: 1;
}

/* Portfolio section should stay behind hero during animation */
#portfolio {
  position: relative;
  z-index: 5;
}

/* When scroll animation is complete, switch to normal flow */
.hero-scroll-container.scroll-complete {
  position: relative;
  height: auto;
  transform: none;
  opacity: 1;
  z-index: 1;
  background: transparent;
}

.hero-scroll-container.scroll-complete + .hero-scroll-spacer {
  display: none;
}

/* Tablet adjustments */
@media (max-width: 1024px) {
  .hero-scroll-container {
    transform: translateY(calc(var(--hero-scroll-progress) * -50vh))
               scale(calc(1.08 - var(--hero-scroll-progress) * 0.08));
  }

  .hero-scroll-spacer {
    height: 50vh;
  }
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .hero-scroll-container {
    transform: translateY(calc(var(--hero-scroll-progress) * -40vh))
               scale(calc(1.05 - var(--hero-scroll-progress) * 0.05));
  }

  .hero-scroll-spacer {
    height: 40vh;
  }
}

/* Reduced motion - show final state immediately */
@media (prefers-reduced-motion: reduce) {
  .hero-scroll-container {
    position: relative;
    height: auto;
    transform: none;
    opacity: 1;
    background: transparent;
  }

  .hero-scroll-spacer {
    display: none;
  }
}

/* ==========================================================================
   Organic Blob Shapes
   ========================================================================== */

.blob-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  pointer-events: none;
  z-index: -1;
}

.blob-1 {
  width: 600px;
  height: 600px;
  background: linear-gradient(135deg, var(--color-coral) 0%, var(--color-terracotta) 100%);
  top: -200px;
  right: -200px;
  animation: float 20s ease-in-out infinite;
}

.blob-2 {
  width: 400px;
  height: 400px;
  background: linear-gradient(225deg, var(--color-coral) 0%, transparent 70%);
  bottom: 10%;
  left: -100px;
  animation: float 15s ease-in-out infinite reverse;
}

.blob-3 {
  width: 500px;
  height: 500px;
  background: linear-gradient(45deg, var(--color-coral) 0%, var(--color-terracotta) 100%);
  top: 20%;
  right: -150px;
  opacity: 0.2;
  animation: float 18s ease-in-out infinite;
}

.blob-4 {
  width: 700px;
  height: 700px;
  background: linear-gradient(135deg, var(--color-coral) 0%, transparent 60%);
  bottom: -200px;
  left: -200px;
  opacity: 0.15;
  animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -30px) scale(1.05);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.95);
  }
}

/* ==========================================================================
   Profile Image Container
   ========================================================================== */

.profile-image-container {
  position: relative;
  overflow: hidden;
}

.profile-image-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, var(--color-charcoal) 100%);
  opacity: 0.1;
  z-index: 1;
  pointer-events: none;
}

/* ==========================================================================
   Scroll Reveal Animations
   ========================================================================== */

.reveal-element {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-element.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal-element:nth-child(1) { transition-delay: 0s; }
.reveal-element:nth-child(2) { transition-delay: 0.1s; }
.reveal-element:nth-child(3) { transition-delay: 0.2s; }
.reveal-element:nth-child(4) { transition-delay: 0.3s; }
.reveal-element:nth-child(5) { transition-delay: 0.4s; }
.reveal-element:nth-child(6) { transition-delay: 0.5s; }

/* ==========================================================================
   Portfolio List Item (Editorial Style)
   ========================================================================== */

.portfolio-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(45, 41, 38, 0.1);
  cursor: pointer;
  transition: background var(--transition-base);
}

.portfolio-item:first-child {
  border-top: 1px solid rgba(45, 41, 38, 0.1);
}

.portfolio-item:hover {
  background: rgba(45, 41, 38, 0.02);
}

.portfolio-item-thumbnail {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--color-warmgray);
}

.portfolio-item-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portfolio-item-content {
  flex: 1;
  min-width: 0;
}

.portfolio-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.portfolio-item-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.3;
}

.portfolio-item-client {
  font-size: 0.8125rem;
  color: var(--color-warmgray);
}

.portfolio-item-metrics {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.portfolio-item-metric {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  font-size: 0.8125rem;
}

.portfolio-item-metric-value {
  font-weight: 600;
  color: var(--color-coral);
}

.portfolio-item-metric-label {
  color: var(--color-warmgray);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.portfolio-item-expand-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-warmgray);
  transition: transform var(--transition-base), color var(--transition-base);
}

.portfolio-item.expanded .portfolio-item-expand-icon {
  transform: rotate(180deg);
  color: var(--color-coral);
}

/* Expandable detail panel */
.portfolio-item-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 0 0 calc(80px + 1rem);
}

.portfolio-item.expanded .portfolio-item-details {
  max-height: 300px;
  padding-top: 1rem;
}

.portfolio-item-description {
  font-size: 0.9375rem;
  color: var(--color-warmgray);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.portfolio-item-full-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.portfolio-item-full-metric {
  text-align: left;
}

.portfolio-item-full-metric-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-coral);
  line-height: 1;
}

.portfolio-item-full-metric-label {
  font-size: 0.6875rem;
  color: var(--color-warmgray);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
}

@media (max-width: 640px) {
  .portfolio-item {
    flex-wrap: nowrap;
    padding: 1rem 0;
    gap: 0.75rem;
  }

  .portfolio-item-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 0.375rem;
  }

  .portfolio-item-header {
    flex-direction: column;
    gap: 0.25rem;
  }

  .portfolio-item-title {
    font-size: 1rem;
  }

  .portfolio-item-client {
    font-size: 0.75rem;
  }

  .portfolio-item-metrics {
    display: none;
  }

  .portfolio-item-expand-icon {
    width: 20px;
    height: 20px;
    align-self: center;
  }

  .portfolio-item-details {
    padding-left: 0;
  }

  .portfolio-item.expanded .portfolio-item-details {
    padding-left: 0;
    padding-top: 0.75rem;
    max-height: 400px;
  }

  .portfolio-item-description {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
  }

  .portfolio-item-full-metrics {
    gap: 1rem;
  }

  .portfolio-item-full-metric-value {
    font-size: 1.25rem;
  }

  .portfolio-item-full-metric-label {
    font-size: 0.625rem;
  }
}

/* ==========================================================================
   Blog Carousel
   ========================================================================== */

.blog-carousel {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-padding-left: 1.5rem;
  /* Smooth momentum scrolling on iOS */
  -webkit-overflow-scrolling: touch;
  /* Prevent pull-to-refresh interference */
  overscroll-behavior-x: contain;
}

.blog-carousel::-webkit-scrollbar {
  display: none;
}

/* Mobile scroll hint gradient */
@media (max-width: 768px) {
  .blog-carousel {
    scroll-padding-left: 1rem;
    /* Add fade hint on right edge */
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
  }
}

/* ==========================================================================
   Blog Card
   ========================================================================== */

.blog-card {
  flex-shrink: 0;
  width: min(300px, 85vw);
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: transform var(--transition-base), background var(--transition-base), border-color var(--transition-base);
  /* Improve touch scrolling */
  -webkit-tap-highlight-color: transparent;
}

.blog-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-coral);
}

/* Add padding after last card for scroll */
.blog-carousel::after {
  content: '';
  flex-shrink: 0;
  width: 1px;
}

.blog-card-image {
  aspect-ratio: 16/10;
  overflow: hidden;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.05);
}

.blog-card-content {
  padding: 1.5rem;
}

.blog-card-date {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-coral);
  margin-bottom: 0.75rem;
}

.blog-card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  transition: color var(--transition-base);
}

.blog-card:hover .blog-card-title {
  color: var(--color-coral);
}

.blog-card-excerpt {
  color: var(--color-warmgray);
  font-size: 0.875rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.blog-tag {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: rgba(224, 122, 95, 0.2);
  color: var(--color-coral);
}

/* ==========================================================================
   Social Link Icons
   ========================================================================== */

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-charcoal);
  color: var(--color-cream);
  transition: background var(--transition-base), transform var(--transition-base);
}

.social-link:hover {
  background: var(--color-coral);
  transform: translateY(-2px);
}

.social-link svg {
  width: 16px;
  height: 16px;
}

/* Footer social links (inverted) */
footer .social-link {
  background: rgba(255, 255, 255, 0.1);
}

footer .social-link:hover {
  background: var(--color-coral);
}

/* ==========================================================================
   Modal Styles
   ========================================================================== */

.modal-backdrop {
  opacity: 0;
  transition: opacity var(--transition-base);
}

#blog-modal.active .modal-backdrop {
  opacity: 1;
}

.modal-content {
  opacity: 0;
  transform: translateY(40px) scale(0.95);
  transition: opacity var(--transition-base), transform var(--transition-base);
}

#blog-modal.active .modal-content {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Prose styles for blog content */
.prose {
  color: var(--color-charcoal);
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.75em;
}

.prose h1 { font-size: 2rem; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.25rem; }
.prose h4 { font-size: 1.125rem; }

.prose p {
  margin-bottom: 1.25em;
  line-height: 1.8;
}

.prose a {
  color: var(--color-coral);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

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

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

.prose blockquote {
  border-left: 4px solid var(--color-coral);
  padding-left: 1.5rem;
  margin: 1.5em 0;
  font-style: italic;
  color: var(--color-warmgray);
}

.prose img {
  border-radius: 1rem;
  margin: 2em 0;
}

.prose code {
  background: rgba(45, 41, 38, 0.05);
  padding: 0.125em 0.375em;
  border-radius: 0.25em;
  font-size: 0.875em;
}

.prose pre {
  background: var(--color-charcoal);
  color: var(--color-cream);
  padding: 1.5rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin: 1.5em 0;
}

.prose pre code {
  background: transparent;
  padding: 0;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
  .blob-shape {
    filter: blur(60px);
    opacity: 0.3;
  }

  .blob-1 {
    width: 400px;
    height: 400px;
    top: -150px;
    right: -150px;
  }

  .blob-2 {
    width: 300px;
    height: 300px;
  }

  .portfolio-card-title {
    font-size: 1.25rem;
  }

  .portfolio-metrics {
    gap: 0.75rem;
  }

  .portfolio-metric-value {
    font-size: 1.125rem;
  }

  /* Blog card mobile refinements */
  .blog-card-content {
    padding: 1.25rem;
  }

  .blog-card-title {
    font-size: 1.125rem;
  }

  .blog-card-excerpt {
    font-size: 0.8125rem;
    -webkit-line-clamp: 2;
  }
}

@media (max-width: 640px) {
  .reveal-element {
    transform: translateY(30px);
  }

  #blog-modal .modal-content {
    margin: 0;
    border-radius: 1rem 1rem 0 0;
    min-height: 100vh;
  }

  /* Modal mobile improvements */
  #blog-modal .modal-content .p-8 {
    padding: 1.5rem;
  }

  .prose h1 { font-size: 1.5rem; }
  .prose h2 { font-size: 1.25rem; }
  .prose h3 { font-size: 1.125rem; }
  .prose p { font-size: 0.9375rem; }
}

/* Extra small screens */
@media (max-width: 375px) {
  .blog-card {
    width: 90vw;
  }

  .social-link {
    width: 32px;
    height: 32px;
  }

  .social-link svg {
    width: 14px;
    height: 14px;
  }
}

/* ==========================================================================
   Mobile Touch & Safe Areas
   ========================================================================== */

/* Safe area support for notched devices */
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }

  footer {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }

  #blog-modal .modal-content {
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }
}

/* Improve touch targets */
@media (hover: none) and (pointer: coarse) {
  .social-link {
    min-width: 44px;
    min-height: 44px;
  }

  .portfolio-item {
    min-height: 72px;
  }

  .blog-card:hover {
    transform: none;
  }

  .blog-card:active {
    transform: scale(0.98);
    opacity: 0.9;
  }

  .portfolio-item:hover {
    background: transparent;
  }

  .portfolio-item:active {
    background: rgba(45, 41, 38, 0.04);
  }
}

/* Prevent text selection on interactive elements for touch */
.portfolio-item,
.blog-card,
.social-link {
  -webkit-user-select: none;
  user-select: none;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .reveal-element {
    opacity: 1;
    transform: none;
  }
}

/* Focus styles for keyboard navigation */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-coral);
  outline-offset: 3px;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 1rem 2rem;
  background: var(--color-coral);
  color: var(--color-cream);
  border-radius: 0 0 0.5rem 0.5rem;
  z-index: 9999;
  transition: top var(--transition-base);
}

.skip-link:focus {
  top: 0;
}
