/* Local font declarations */
@font-face {
  font-family: 'Ysabeau Office';
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url('fonts/ysabeau-office-italic-300.ttf') format('truetype');
}
@font-face {
  font-family: 'Ysabeau Office';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ysabeau-office-italic-400.ttf') format('truetype');
}
@font-face {
  font-family: 'Ysabeau Office';
  font-style: normal;
  font-weight: 200;
  font-display: swap;
  src: url('fonts/ysabeau-office-normal-200.ttf') format('truetype');
}
@font-face {
  font-family: 'Ysabeau Office';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('fonts/ysabeau-office-normal-300.ttf') format('truetype');
}
@font-face {
  font-family: 'Ysabeau Office';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ysabeau-office-normal-400.ttf') format('truetype');
}
@font-face {
  font-family: 'Ysabeau Office';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/ysabeau-office-normal-600.ttf') format('truetype');
}

/* Core Design System Variables */
:root {
    --bg-color: #0f0f11;
    --text-primary: #e5e5e5;
    --text-secondary: #a1a1aa;
    --accent: #d4af37;
    --font-main: 'Ysabeau Office', Georgia, serif;
}

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

/* Base Body Styles */
body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Article Page Layout Alignment */
body.article-page {
    align-items: center;
}

/* Unified Layout Components */
.site-header {
    width: 100%;
    padding: 2.5rem 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 2rem;
}

.site-header a {
    font-size: 1.2rem;
    letter-spacing: 0.25em;
    color: var(--text-secondary);
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.3s ease;
    font-weight: 300;
}

.site-header a:hover {
    color: var(--text-primary);
}

.container {
    max-width: 800px;
    width: 100%;
    flex: 1;
    padding: 0 2rem;
}

.container header {
    text-align: center;
    margin-bottom: 4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 2.5rem;
}

.container h1 {
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Unified Text Styles */
.novel-text, .dialogue-text {
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--text-primary);
    text-align: justify;
}

.novel-text {
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.novel-text p {
    margin-bottom: 1.5rem;
    text-indent: 2.5rem;
}

.novel-text p:first-of-type {
    text-indent: 0;
}

/* Hamlet-specific Dialogue Layouts */
.stage-direction {
    color: var(--text-secondary);
    font-style: italic;
    margin: 3rem 0;
    text-align: center;
    padding: 0 2rem;
    opacity: 0.8;
    font-size: 1.15rem;
    line-height: 1.9;
}

.dialogue {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.character {
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85em;
    margin-bottom: 0.2rem;
}

.action {
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0.8;
}

/* Backstory & Separator Styles */
.separator {
    width: 40px;
    height: 1px;
    background-color: var(--accent);
    margin: 5rem auto;
    opacity: 0.3;
}

.backstory {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    text-align: justify;
}

.backstory p {
    margin-bottom: 1.2rem;
}

/* Site Footer */
.site-footer {
    width: 100%;
    text-align: center;
    padding: 2rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 4rem;
}

.site-footer a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.site-footer a:hover {
    opacity: 0.8;
}

/* Home Page Layout styling */
.home-page .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    animation: fadeIn 2s ease-out forwards;
}

.home-page .links-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 2.5rem;
}

.home-page .top-link {
    font-size: 1.05rem;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    position: relative;
    font-weight: 400;
    text-align: center;
    animation: faintPulse 2.5s infinite alternate ease-in-out;
    transition: all 0.3s ease;
}

.home-page .top-link:hover {
    color: var(--text-primary);
    opacity: 1 !important;
    animation-play-state: paused;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.home-page .top-link:nth-child(1) {
    animation-delay: 0s;
}

.home-page .top-link:nth-child(2) {
    animation-delay: -1.66s;
}

.home-page .top-link:nth-child(3) {
    animation-delay: -3.33s;
}

.home-page .horizontal-spacer {
    width: 5px;
    height: 5px;
    background-color: var(--accent);
    transform: rotate(45deg);
    margin-bottom: 3rem;
    opacity: 0.5;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.home-page .name-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.home-page h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 200;
    letter-spacing: 0.25em;
    color: var(--text-primary);
    text-transform: uppercase;
    margin-right: -0.25em;
    user-select: none;
}

.home-page .subtitle {
    font-size: clamp(0.8rem, 1.8vw, 1.05rem);
    font-weight: 200;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    text-transform: lowercase;
    position: relative;
    user-select: none;
}

.home-page .subtitle::before {
    content: '';
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 1px;
    background-color: var(--accent);
    opacity: 0.5;
}

/* Animations */
@keyframes faintPulse {
    0% { opacity: 0.55; }
    100% { opacity: 0.95; }
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(15px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Responsiveness adjustments */
@media (max-width: 600px) {
    .container h1 {
        font-size: 1.8rem;
    }
    .novel-text, .dialogue-text {
        font-size: 1.05rem;
        padding: 0;
    }
    .stage-direction {
        padding: 0;
        font-size: 1.05rem;
    }
}
