/* ==========================================================================
   THE KYOTO EDITORIAL (PREMIUM TEXTURED EDITION)
   ========================================================================== */

:root {
    --bg: #fcfaf6;           /* Creamy Washi Paper Tone */
    --text: #191816;         /* Soft Charcoal Black */
    --text-muted: #6e6a64;   /* Muted Soft Clay */
    --accent: #b43e12;       /* Rich Terracotta / Rust Red */
    --border: #e6e0d4;       /* Paper-crease tone line separations */
    --surface-tint: #f5efe6; /* Slightly deeper warm clay for blocks & badges */
}

/* Custom Text Highlight styling */
::-selection {
    background-color: var(--accent);
    color: #ffffff;
}
::-moz-selection {
    background-color: var(--accent);
    color: #ffffff;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: "Georgia", "Times New Roman", Times, serif;
    font-size: 1.15rem;
    line-height: 1.8;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

.site-container {
    max-width: 660px;
    margin: 0 auto;
    padding: 6rem 1.5rem;
}

/* ==========================================================================
   Header & Page Title Frames (Fixed the "Plain" Layout)
   ========================================================================== */
.site-header {
    border-bottom: 1px solid var(--text);
    padding-bottom: 1.5rem;
    margin-bottom: 5rem;
    text-align: left;
}

.site-title {
    margin: 0;
}

.site-title a {
    color: var(--text);
    text-decoration: none;
    font-size: 2.8rem;
    font-weight: 400;
    font-style: italic;
    letter-spacing: -0.03em;
}

/* Framed page headers for subpages */
.page-header {
    margin-bottom: 4rem;
    padding-left: 1.25rem;
    border-left: 3px solid var(--text); /* Solid architectural accent anchor */
}

.page-title {
    font-size: 2.2rem;
    font-weight: 400;
    font-style: italic;
    margin: 0 0 0.5rem 0;
    color: var(--text);
    letter-spacing: -0.01em;
}

.page-meta {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.8 /rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin: 0;
}

/* ==========================================================================
   Section Layouts & The Drop-Cap
   ========================================================================== */
.section {
    margin-bottom: 4.5rem;
}

.section-title {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.section-title .num {
    color: var(--accent);
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Elegant line dividers under subpage h3 sections */
.site-main h3.section-title {
    font-size: 0.9rem;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 0.5rem;
    margin-top: 3rem;
}

/* Biography block formatting context */
.intro-p p:first-child {
    display: flow-root; 
    margin-bottom: 2rem;
}

.intro-p p:first-child::first-letter {
    font-family: "Georgia", serif;
    font-size: 4.2rem;
    float: left;
    line-height: 0.8;
    margin-top: 0.15rem;
    margin-right: 0.75rem;
    font-weight: 400;
    color: var(--accent);
}

p {
    margin: 0 0 1.5rem 0;
}

/* Enhanced Editorial Blockquote */
blockquote {
    margin: 2.5rem 0;
    padding: 1.5rem;
    background-color: rgba(245, 239, 230, 0.4); /* Faint paper texture background */
    border-left: 3px solid var(--accent);
    font-style: italic;
    color: var(--text);
    border-radius: 0 4px 4px 0;
}

/* ==========================================================================
   Links & Custom Interactivity
   ========================================================================== */
a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.25s ease;
}

.inline-link {
    font-weight: 500;
    box-shadow: inset 0 -3px 0 var(--border);
    padding: 0 2px;
    transition: background-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

.inline-link:hover {
    color: #fff;
    background-color: var(--accent);
    box-shadow: inset 0 -20px 0 var(--accent);
}

/* ==========================================================================
   Projects Component Layout
   ========================================================================== */
.projects-grid {
    margin-top: 1.5rem;
}

.project-card {
    margin-bottom: 2.5rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--border);
    transition: border-left-color 0.3s ease;
}

.project-card:hover { border-left-color: var(--accent); }
.project-card h3 { margin: 0 0 0.35rem 0; font-size: 1.35rem; font-weight: 400; }
.project-card h3 a { transition: color 0.2s ease; }
.project-card h3 a:hover { color: var(--accent); }
.project-card p { font-size: 1rem; color: var(--text-muted); margin: 0 0 0.5rem 0; }
.project-tag { font-size: 0.85rem; font-style: italic; color: var(--accent); }
.project-tag a { color: var(--accent); text-decoration: underline; }

/* ==========================================================================
   Archival Tables: Articles & The Engineering Changelog Timeline
   ========================================================================== */
.article-index {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-index li {
    display: flex;
    align-items: baseline;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s ease, padding 0.2s ease;
}

.article-index li:hover {
    background-color: rgba(180, 62, 18, 0.01);
    padding-left: 0.5rem;
}

.entry-meta {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    width: 90px;
    flex-shrink: 0;
}

.entry-title {
    font-size: 1.25rem;
    color: var(--text);
    font-weight: 400;
    text-decoration: none;
    position: relative;
    transition: color 0.2s ease;
}

.article-index li:hover .entry-title { color: var(--accent); }

.entry-title::after {
    content: " ↗";
    font-size: 0.9rem;
    opacity: 0;
    color: var(--accent);
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: inline-block;
    transform: translate(-4px, 2px);
}

.article-index li:hover .entry-title::after {
    opacity: 1;
    transform: translate(4px, -2px);
}

/* --- Subpage Log Layout (High-End Vertical Timeline Ledger) --- */
.log-index {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}

/* Beautiful structural timeline spine running down the log dates */
.log-index::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 130px; /* Aligns neatly between the date column and text block */
    width: 1px;
    background-color: var(--border);
}

.log-index li {
    display: flex;
    align-items: baseline;
    padding: 1.25rem 0;
    position: relative;
}

.log-date {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 0.8rem;
    color: var(--accent); /* Dates pop clearly in terracotta */
    width: 115px;
    flex-shrink: 0;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.log-text {
    font-size: 1.1rem;
    color: var(--text);
    padding-left: 35px; /* Creates perfect architectural breathing space around the spine */
    position: relative;
}

/* Small geographic node marking each log step on the vertical line */
.log-text::before {
    content: "";
    position: absolute;
    left: -24px; /* Perfectly positions the dot onto the background axis line */
    top: 0.6rem;
    width: 7px;
    height: 7px;
    background-color: var(--bg);
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    transition: border-color 0.2s, background-color 0.2s;
}

.log-index li:hover .log-text::before {
    border-color: var(--accent);
    background-color: var(--accent); /* Lit-up node highlight on row hover */
}

/* ==========================================================================
   Archived Muted Content Cards (Breaks Up Monotone Pages)
   ========================================================================== */
.archived-timeline {
    margin-top: 6rem;
    background-color: rgba(245, 239, 230, 0.35); /* Soft visual layout break */
    border: 1px solid var(--border);
    padding: 2rem 1.75rem;
    border-radius: 6px;
}

.archive-label {
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    background-color: var(--surface-tint); /* Styled archival asset tag */
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    margin-bottom: 2rem;
    font-weight: 600;
}

.archived-section {
    opacity: 0.65;
    transition: opacity 0.25s ease;
    margin-bottom: 2rem;
}

.archived-section:last-of-type {
    margin-bottom: 0;
}

.archived-section:hover {
    opacity: 1; /* Completely brings the text block to life on hover focus */
}

/* ==========================================================================
   Footer Layout
   ========================================================================== */
.site-footer {
    margin-top: 7rem;
    border-top: 1px solid var(--border);
    padding-top: 3rem;
    font-size: 1rem;
    color: var(--text-muted);
}

.footer-title {
    font-family: "Georgia", serif;
    font-style: italic;
    font-weight: 400;
    font-size: 1.4rem;
    color: var(--text);
    margin: 0 0 1rem 0;
}

/* ==========================================================================
   Responsive Adaptation Layer
   ========================================================================== */
@media (max-width: 500px) {
    .site-container { padding: 4rem 1rem; }
    .site-title a { font-size: 2.2rem; }
    
    .article-index li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        padding: 0.85rem 0;
    }
    
    /* Destroys the complex log vertical timeline on mobile to keep scrolling neat */
    .log-index::before { display: none; }
    .log-index li {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 0;
        border-bottom: 1px dashed var(--border);
    }
    .log-text { padding-left: 0; }
    .log-text::before { display: none; }

    .entry-meta, .log-date { width: auto; font-size: 0.7rem; }
    .entry-title, .log-text { font-size: 1.15rem; }
    
    .archived-timeline { padding: 1.5rem 1rem; }
}
/* ==========================================================================
   Book Stream Layout Addition
   ========================================================================== */
.books-stream {
    margin-top: 2rem;
}

.book-item {
    margin-bottom: 3.5rem;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 2rem;
}

.book-item:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.book-title {
    font-size: 1.4rem;
    font-weight: 400;
    margin: 0 0 0.25rem 0 !important;
}

.book-title a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.book-title a:hover {
    color: var(--accent);
}

.book-author {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.book-item p {
    font-size: 1.05rem;
    color: var(--text);
    margin: 0;
}

/* ==========================================================================
   Essay & Reading Logs Texturing Layout Additions
   ========================================================================== */

/* Top-level prominent epigraph formatting */
blockquote.epigraph {
    font-size: 1.35rem;
    line-height: 1.6;
    text-align: center;
    border-left: none;
    padding: 1rem 2rem;
    margin: 3rem 0;
    font-style: italic;
    color: var(--accent);
}

/* Tidy indented markers for inline conceptual definitions */
.editorial-list {
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    list-style-type: square;
}

.editorial-list li {
    margin-bottom: 0.5rem;
    color: var(--text);
}

/* Polished Aphorism Index layout for core quotes streams */
.aphorism-index {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0 0;
}

.aphorism-index li {
    font-size: 1.05rem;
    color: var(--text);
    padding: 1.1rem 0 1.1rem 1.75rem;
    border-bottom: 1px solid var(--border);
    position: relative;
    line-height: 1.7;
}

/* Custom geometric minimal numbering node for each quote row */
.aphorism-index li::before {
    content: "▫";
    position: absolute;
    left: 0.25rem;
    top: 1.1rem;
    color: var(--accent);
    font-size: 0.8rem;
}

.aphorism-index li:hover {
    color: var(--text);
    background-color: rgba(180, 62, 18, 0.01);
}

/* ==========================================================================
   Editorial Figure & Image Showcases
   ========================================================================== */
.editorial-figure {
    margin: 2.5rem 0;
    padding: 0;
    background-color: transparent;
}

.editorial-figure img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--border);
    /* Subtle overlay blend to help images sit organically on creamy paper */
    filter: sepia(0.08) contrast(0.96); 
    box-shadow: 0 1px 3px rgba(25, 24, 22, 0.03);
}

.editorial-figure figcaption {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    line-height: 1.5;
    padding-left: 0.25rem;
    border-left: 2px solid var(--border);
}

/* ==========================================================================
   Poetry Layout & Typography
   ========================================================================== */
.poem-body {
    padding-left: 1.25rem;
    border-left: 1px solid var(--border);
    margin: 1.75rem 0;
}

.poem-body p {
    font-family: "PingFang HK", "Heiti TC", "Georgia", serif;
    font-size: 1.25rem;
    letter-spacing: 0.12em; /* Gives classical characters premium breathing room */
    margin: 0 0 0.6rem 0;  /* Binds the verses together textually */
    color: var(--text);
}

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

/* ==========================================================================
   Questionnaire Ledger Layout Addition
   ========================================================================== */
.questionnaire-ledger {
    margin-top: 2rem;
    border-top: 1px solid var(--border);
}

.ledger-row {
    padding: 1.25rem 0;
    border-bottom: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: background-color 0.2s ease;
}

.ledger-row:hover {
    background-color: rgba(180, 62, 18, 0.01); /* Faint highlight tint on hover focus */
}

.ledger-question {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.ledger-answer {
    font-size: 1.2rem;
    color: var(--text);
    margin: 0;
    line-height: 1.6;
}

@media (max-width: 500px) {
    .ledger-row {
        padding: 1rem 0;
    }
    .ledger-answer {
        font-size: 1.1rem;
    }
}