/* ============================================= */
/* ---------- BASE & RESET ---------- */
/* ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: "Noto Serif KR", "Apple SD Gothic Neo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f8f6f2; /* Warm off-white background */
    color: #1a1a1a;     /* Dark gray for text */
}

/* Set line height and anti-aliasing for smoother text rendering */
body {
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* Styling for anchor links */
a {
    color: #2f3a4a;      /* Dark slate gray for links */
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================= */
/* ---------- LAYOUT & CONTAINERS ---------- */
/* ============================================= */
/* Main container for centering content */
.container {
    width: min(1100px, 92vw); /* Responsive width, max 92% of viewport */
    margin: 0 auto;
}

/* Sections use consistent vertical padding and relative positioning */
section {
    padding: 80px 0;
    position: relative;
}

/* Section titles use a decorative font for visual appeal */
.section-title {
    font-family: "Playwrite NO", cursive; /* Decorative cursive font */
    font-size: 1.4rem;
    letter-spacing: 0.12em;
    margin-bottom: 32px;
    color: #3a2f2a; /* Dark brown for titles */
    text-align: left; /* Ensure alignment is consistent */
}

/* ============================================= */
/* ---------- HERO SECTION ---------- */
/* ============================================= */
.hero {
    min-height: 100vh; /* Full viewport height */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-top: 60px !important; /* Override for hero section */
}

/* Background overlay for hero section */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('./background.webp');
    opacity: 0.1; /* Subtle background overlay */
    pointer-events: none;
}

/* Hero content container with animation */
.hero-inner {
    position: relative;
    text-align: center;
    width: 100%;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 3s ease, transform 3s ease;
}

/* Animate hero content on visibility */
.hero-inner.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Calligraphic text for hero */
.hero-calligraphy {
    font-family: "Apple SD Gothic Neo", "Noto Serif KR", serif;
    font-size: 1.1rem;
    margin-bottom: 40px;
    color: #3a2f2a; /* Dark brown for calligraphy */
    padding-top: 2em;
}

/* Scroll animation for hero */
.hero-scroll, .hero-scroll-mobile {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #777;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: default;
}

.hero-scroll-mobile {
    display: none;
    margin-bottom: 2em;
}

/* Scroll arrow animation */
.hero-scroll-arrow {
    width: 1px;
    height: 40px;
    background: #777;
    position: relative;
    overflow: hidden;
}

.hero-scroll-arrow::after {
    content: "";
    position: absolute;
    top: -40px;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(to bottom, transparent, #777);
    animation: scrollArrow 2.8s infinite;
}

@keyframes scrollArrow {
    0% {
        transform: translateY(0);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        transform: translateY(40px);
        opacity: 0;
    }
}

/* ============================================= */
/* ---------- CHARACTER SECTION ---------- */
/* ============================================= */
/* Date bar for timeline */
.date {
    text-align: center;
    font-size: 1.5em;
    display: flex;
    width: min(1100px, 92vw);
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 3em;
    flex-direction: row;
    justify-content: space-between;
}

.date hr {
    width: 20%;
    height: 0;
    margin-top: auto;
    margin-bottom: auto;
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Separator between character sections */
.character {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Grid layout for character image and description */
.character-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
    gap: 40px;
    align-items: center;
}

/* Responsive grid for mobile */
@media (max-width: 800px) {
    .character-grid {
        grid-template-columns: 1fr;
    }
}

/* Character image container */
.character-image {
    background-image: url('./old/images/storyline_item.jpg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: 135%;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 320px;
}

/* Note for character image */
.character-note {
    font-family: "Playwrite NO", cursive;
    position: absolute;
    top: 18px;
    left: 18px;
    font-size: 1rem;
    color: orangered; /* Highlight color for notes */
    font-style: italic;
    text-shadow: 1px 1px 1.5px black;
}

/* Character text titles */
.character-text-title {
    font-family: "Apple SD Gothic Neo", "Noto Serif KR", serif;
    font-size: 1.6rem;
    margin-bottom: 10px;
}

/* Character subtitle */
.character-text-sub {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 24px;
}

/* Character body text */
.character-text-body {
    text-align: justify;
}

.character-text-body p+p {
    margin-top: 12px;
}

/* ============================================= */
/* ---------- NOTES & SCRAPS SECTION ---------- */
/* ============================================= */
/* Section separator for notes */
.notes {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Grid for notes cards */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
}

/* Individual note card styling */
.note-card {
    background: #fdfbf7; /* Light beige background */
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 18px 18px 20px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.03);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    overflow: hidden;
    cursor: pointer;
}

/* Hover effects for note cards */
.note-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 10% 0%, rgba(0, 0, 0, 0.04), transparent 55%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.note-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
}

.note-card:hover::before {
    opacity: 1;
}

/* Note label (e.g., "info", "arcanium") */
.note-label {
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #a18b6f; /* Light brown for labels */
    margin-bottom: 8px;
}

/* Note title */
.note-title {
    font-family: "Apple SD Gothic Neo", "Noto Serif KR", serif;
    font-size: 1rem;
    margin-bottom: 8px;
    color: #3a2f2a;
}

/* Note body */
.note-body {
    font-size: 0.85rem;
    color: #555;
    white-space: pre-line;
    text-align: justify;
}

/* ============================================= */
/* ---------- STORIES SECTION ---------- */
/* ============================================= */
/* Section separator for stories */
.stories {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* List of stories */
.story-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Individual story item */
.story-item {
    padding: 14px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Story title */
.story-title {
    font-family: "Apple SD Gothic Neo", "Noto Serif KR", serif;
    font-size: 1.05rem;
    color: #3a2f2a;
}

/* Story metadata (e.g., type and word count) */
.story-meta {
    font-size: 0.75rem;
    color: #999;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Story excerpt */
.story-excerpt {
    font-size: 0.85rem;
    color: #555;
}

/* Hover effect for stories */
.story-item:hover .story-title {
    text-decoration: underline;
}

/* ============================================= */
/* ---------- MODAL ---------- */
/* ============================================= */
/* Modal backdrop for fullscreen stories */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-backdrop.visible {
    display: flex;
}

/* Modal dialog box */
.modal {
    background: #fdfbf7; /* Light beige background */
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    width: min(720px, 92vw);
    max-height: 80vh;
    overflow: auto;
    padding: 26px 26px 22px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
    position: relative;
}

/* Close button for modal */
.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    border: none;
    background: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: #777;
}

/* Modal title */
.modal-title {
    font-family: "Apple SD Gothic Neo", "Noto Serif KR", serif;
    font-size: 1.3rem;
    margin-bottom: 6px;
    color: #3a2f2a;
}

/* Modal metadata */
.modal-meta {
    font-size: 0.75rem;
    color: #999;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

/* Modal body paragraphs */
.modal-body p+p {
    margin-top: 12px;
}

/* ============================================= */
/* ---------- FOOTER ---------- */
/* ============================================= */
/* Footer with subtle top border */
footer {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 40px 0 50px;
    font-size: 0.85rem;
    color: #777;
}

/* Footer inner content */
.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
}

/* Calligraphy text for footer */
.footer-calligraphy {
    font-family: "Apple SD Gothic Neo", "Noto Serif KR", serif;
    font-size: 1rem;
    color: #3a2f2a;
}

/* Footer links */
.footer-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

/* Footer link styling */
.footer-link {
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    padding-bottom: 2px;
    font-size: 0.8rem;
    cursor: pointer;
}

/* Footer meta information */
.footer-meta {
    font-size: 0.75rem;
    color: #aaa;
}

/* ============================================= */
/* ---------- MANUSCRIPT & WONGOJI (PAPER) ---------- */
/* ============================================= */
/* Traditional Korean manuscript styling */
.wongoji {
    padding: 2em;
    width: 826px;
    margin-left: auto;
    margin-right: auto;
    background-image: url('paper.jpg');
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
}

/* Framework for the manuscript */
.wongoji-frame {
    display: grid;
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Empty line for spacing in manuscript */
.wongoji-empty-line {
    height: 1em;
}

/* Box for individual characters */
.wongoji-box {
    width: 38px;
    height: 38px;
    font-size: 24px;
    text-align: center;
    vertical-align: middle;
    font-family: 'NanumHarABeoJiEuiNaNum';
    color: rgba(0, 0, 0, 0);
    border: 1px solid #E13E43; /* Traditional red for manuscript */
}

/* Line for characters in manuscript */
.wongoji-text-line {
    display: flex;
    flex-direction: row;
}

/* Grid framework for manuscript */
.wongoji-frame,
.wongoji-empty-line,
.wongoji-box {
    border: 1px solid #E13E43; /* Traditional red for manuscript */
}

/* Modern manuscript styling (for mobile) */
.manuscript {
    position: relative;
    margin: 0;
    text-align: justify;
    font-size: 1.5em;
    line-height: 2em;
    border-top: 2px solid #E13E43; /* Traditional red */
    border-bottom: 1px solid #E13E43;
    background-image: repeating-linear-gradient(to bottom,
            transparent 0,
            transparent calc(2em - 1px),
            #E13E43 calc(2em - 1px),
            #E13E43 2em);
    background-size: 100% 2em;
    background-origin: content-box;
    background-position: left top;
}

.concept-text-pc {
    display: block;
}


.concept-text-mobile {
    display: none;
}

/* ============================================= */
/* ---------- Retractable Menus ---------- */
/* ============================================= */
/* Retractable Menu - Modal-like Design */
#retractable-menu-backdrop {
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#retractable-menu-backdrop.visible {
    display: flex;
}

#retractable-menu {
    max-width: 80vw;
    width: 720px;
    max-height: 70vh;
    overflow-y: auto;
}

.retractable-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.retractable-menu-list li {
    margin-bottom: 12px;
    padding: 8px 0;
}

.retractable-menu-list li a {
    color: #3a2d20;
    text-decoration: none;
    font-family: "Noto Serif KR", "Apple SD Gothic Neo", serif;
    font-size: 0.95rem;
    display: block;
    transition: all 0.2s ease;
}

.retractable-menu-list li a:hover {
    color: #5a4a3a;
    text-decoration: underline;
}

/* Update the menu link styles to match site design */
#more-menu {
    display: inline-block;
    font-family: "Noto Serif KR", "Apple SD Gothic Neo", serif;
    font-size: 0.9rem;
    color: #3a2f2a;
    cursor: pointer;
    transition: color 0.2s ease;
    margin-bottom: 15px;
}

#more-menu:hover {
    color: #5a4a3a;
    text-decoration: underline;
}

/* Media queries for responsive design */
@media (max-width: 940px) {
    /* Hide PC manuscript text on mobile */
    .concept-text-pc {
        display: none;
    }

    /* Show mobile manuscript text */
    .concept-text-mobile {
        display: block;
    }

    .hero-calligraphy
    {
        width: 90%;
        margin-right: auto;
        margin-left: auto;
    }

    .hero-scroll {
        display: none;
    }

    .hero-scroll-mobile {
        display: inline-flex;
    }
}