/* Modern CSS reset for better cross-browser consistency */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Variables with fallbacks for older browsers */
:root {
  --primary: #FF5722;
  --secondary: #2A9D8F;
  --neutral-dark: #264653;
  --neutral-light: #F4F1DE;
  --accent: #E9C46A;
  --base-font-size: 16px;
  --header-spacing: clamp(1.5rem, 4vw, 2.5rem);
  --content-padding: clamp(1rem, 5vw, 2rem);
}

/* System font stack for better performance */
body {
  max-width: min(90%, 60em);
  margin: 0 auto;
  padding: var(--content-padding);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 
               Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
  font-size: var(--base-font-size);
  line-height: 1.8;
  background-color: var(--neutral-light);
  color: var(--neutral-dark);
  
  /* Enable smooth scrolling */
  scroll-behavior: smooth;
  
  /* Improve text rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Fluid typography using clamp */
h1, h2, h3 {
  font-family: Futura, system-ui, sans-serif;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: var(--header-spacing);
  line-height: 1.2;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--primary);
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--secondary);
}

h3 {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  color: var(--neutral-dark);
}

/* Optimized images */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem 0;
}

/* Performance optimized links */
a {
  text-decoration: none;
  border-bottom: 2px solid var(--primary);
  transition: color 0.2s ease, background-color 0.2s ease;
  padding: 0.1em 0.2em;
}

a:link, a:visited {
  color: var(--neutral-dark);
}

a:hover {
  color: var(--primary);
  background-color: rgba(255, 87, 34, 0.1);
}

a:active {
  color: var(--secondary);
}

/* Responsive main content */
main {
  border-left: 4px solid var(--accent);
  padding-left: clamp(1rem, 3vw, 2rem);
  width: 100%;
}

/* Optimized blockquotes */
blockquote {
  margin: clamp(1.5rem, 4vw, 2rem) 0;
  padding: clamp(1rem, 3vw, 2rem);
  border-left: 4px solid var(--secondary);
  background-color: rgba(42, 157, 143, 0.1);
}

/* Gradient HR with reduced paint complexity */
hr {
  border: none;
  height: 2px;
  background: var(--primary);
  margin: clamp(1.5rem, 4vw, 2rem) 0;
  opacity: 0.8;
}

/* Mobile-first media queries */
@media screen and (max-width: 768px) {
  body {
    padding: var(--content-padding);
  }
  
  main {
    border-left-width: 2px;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Print styles */
@media print {
  body {
    background: none;
    color: black;
    font-size: 12pt;
  }
  
  a {
    border-bottom: none;
    color: black;
  }
  
  main {
    border: none;
    padding: 0;
  }
}

/* High contrast mode */
@media (prefers-color-scheme: dark) {
  :root {
    --neutral-light: #1a1a1a;
    --neutral-dark: #f4f1de;
  }
}

/* Header styles */
header {
    margin-bottom: var(--header-spacing);
}

header h1 a {
    border-bottom: none;
    color: var(--primary);
}

header h1 a:hover {
    background-color: transparent;
    opacity: 0.9;
}

/* Story section styles */
.story {
    margin: 2rem 0;
}

.story h3 {
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.story-content {
    max-width: 65ch;
    margin: 0 auto;
}

.story-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

/* Footer styles */
footer {
    margin-top: 4rem;
    text-align: center;
}

footer hr {
    width: 50%;
    margin: 2rem auto;
}

footer p {
    font-size: 0.9em;
    color: var(--neutral-dark);
    opacity: 0.8;
}

footer .copyright {
    font-size: 0.8em;
    margin-top: 2rem;
}

/* Print-specific adjustments */
@media print {
    .story-content {
        max-width: none;
    }
    
    footer hr {
        display: none;
    }
}
/* Interactive navigation styling */
.site-navigation {
    margin: 2rem 0;
    position: relative;
}

.site-navigation h2 {
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.site-navigation h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.site-navigation h2:hover::after {
    width: 100%;
}

.site-navigation ul {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 1.5rem;
}

.site-navigation li {
    position: relative;
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.site-navigation a {
    display: inline-block;
    padding: 0.8rem 1.2rem;
    border: 2px solid transparent;
    border-radius: 2px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background: transparent;
}

.site-navigation a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary);
    opacity: 0.1;
    transition: transform 0.3s ease;
    transform: skewX(-20deg);
}

.site-navigation a:hover {
    border-color: var(--primary);
    transform: translateX(10px);
}

.site-navigation a:hover::before {
    transform: translateX(200%) skewX(-20deg);
}

/* Interactive header */
header h1 a {
    position: relative;
    display: inline-block;
    transition: transform 0.3s ease;
}

header h1 a::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

header h1 a:hover {
    transform: translateY(-2px);
}

header h1 a:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

/* Interactive intro section */
.intro p {
    position: relative;
    padding-left: 1rem;
    transition: padding 0.3s ease;
}

.intro p::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 0;
    background: var(--secondary);
    transition: height 0.3s ease;
}

.intro p:hover {
    padding-left: 1.5rem;
}

.intro p:hover::before {
    height: 100%;
}

/* Footer interactions */
footer a {
    position: relative;
    display: inline-block;
    padding: 0.2em 0.4em;
    transition: all 0.3s ease;
}

footer a::after {
    content: '→';
    position: absolute;
    right: -1.5em;
    opacity: 0;
    transition: all 0.3s ease;
}

footer a:hover {
    padding-right: 1.5em;
}

footer a:hover::after {
    opacity: 1;
    right: 0;
}

/* Responsive hover effects */
@media (hover: hover) {
    .site-navigation li:hover {
        transform: scale(1.02);
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .site-navigation a,
    .site-navigation li,
    header h1 a,
    footer a,
    .intro p,
    *::before,
    *::after {
        transition: none !important;
        transform: none !important;
    }
}
/* Now page specific styles */
.now-page {
    max-width: 65ch;
    margin: 0 auto;
}

.hero-image {
    margin: 2rem 0 3rem;
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}

.hero-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.hero-image:hover img {
    transform: scale(1.02);
}

.now-section {
    margin: 3rem 0;
    position: relative;
}

.now-section h3 {
    display: inline-block;
    position: relative;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.now-section h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 2rem;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.now-section:hover h3::after {
    width: 100%;
}

.content {
    padding-left: 1rem;
    border-left: 2px solid transparent;
    transition: all 0.3s ease;
}

.now-section:hover .content {
    padding-left: 1.5rem;
    border-left-color: var(--secondary);
}

.content p {
    margin-bottom: 1.2rem;
    line-height: 1.8;
}

.content a {
    font-weight: 500;
}

.last-updated {
    margin: 4rem 0 2rem;
    padding: 1rem;
    background-color: rgba(var(--primary-rgb), 0.05);
    border-radius: 2px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--neutral-dark);
}

/* Add a CSS variable for RGB values of primary color */
:root {
    --primary-rgb: 255, 87, 34;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .now-section {
        margin: 2rem 0;
    }

    .content {
        padding-left: 0.5rem;
    }

    .now-section:hover .content {
        padding-left: 1rem;
    }
}

/* Print styles */
@media print {
    .hero-image {
        margin: 1rem 0;
    }

    .content {
        padding-left: 0;
        border-left: none;
    }

    .last-updated {
        background: none;
        padding: 0;
    }
}

/* Poetry collection styles */
.poetry-collection {
    max-width: 40ch;
    margin: 0 auto;
    padding: 2rem 0;
}

/* Poem section */
.poem {
    margin: 3rem 0;
    position: relative;
    padding: 2rem;
    background-color: rgba(var(--primary-rgb), 0.02);
    border-radius: 2px;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.poem:hover {
    transform: translateY(-2px);
    background-color: rgba(var(--primary-rgb), 0.04);
}

/* Poem title */
.poem h3 {
    color: var(--primary);
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.poem h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 2rem;
    height: 1px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.poem:hover h3::after {
    width: 100%;
}

/* Poem content */
.poem-content {
    position: relative;
    padding-left: 1rem;
}

.poem-content::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background-color: var(--secondary);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s ease;
}

.poem:hover .poem-content::before {
    transform: scaleY(1);
}

/* Poem lines */
.poem-content p {
    margin: 0 0 1.2rem;
    line-height: 1.6;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.poem-content p:last-child {
    margin-bottom: 0;
}

/* Line hover effect */
.poem-content p:hover {
    transform: translateX(0.5rem);
    color: var(--primary);
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .poetry-collection {
        padding: 1rem;
    }

    .poem {
        padding: 1.5rem;
        margin: 2rem 0;
    }

    .poem-content {
        padding-left: 0.5rem;
    }
}

/* Print styles */
@media print {
    .poem {
        padding: 0;
        background: none;
        page-break-inside: avoid;
    }

    .poem-content::before {
        display: none;
    }

    .poem-content p {
        margin-bottom: 1rem;
    }
}