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

body {
    background-color: #ffffff;
    color: #000000;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    padding: 20px;
}

/* Splash Screen Styles */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 1s ease-out;
}

#splash-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

#ascii-calligraphy {
    font-family: 'Courier New', monospace;
    font-size: 3px;
    line-height: 1;
    color: #000000;
    white-space: pre;
    overflow: auto;
    max-width: 95vw;
    max-height: 95vh;
    animation: splashFadeIn 0.8s ease-in;
}

@keyframes splashFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hide main content initially */
.container {
    max-width: 800px;
    margin: 0 auto;
    opacity: 0;
}

/* Show content after splash screen */
.container.show-content {
    animation: containerFadeIn 1s ease-in forwards;
}

@keyframes containerFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.ascii-art {
    margin-bottom: 20px;
    font-size: 16px;
    overflow: hidden;
    width: 100%;
    opacity: 0;
}

.container.show-content .ascii-art {
    animation: fadeIn 1s ease-in forwards;
}

.scroll-container {
    overflow: hidden;
    white-space: nowrap;
    margin: 5px 0;
}

/* Create rhythm with varied font sizes - English > Chinese > Japanese */
.ascii-art .scroll-container:nth-child(1) {
    font-size: 22px; /* Chenyu Li - English (most emphasis) */
}

.ascii-art .scroll-container:nth-child(2) {
    font-size: 18px; /* 李宸宇 - Chinese (second emphasis) */
}

.ascii-art .scroll-container:nth-child(3) {
    font-size: 14px; /* リシンウ - Japanese */
}

.ascii-art .scroll-container:nth-child(4) {
    font-size: 20px; /* Chenyu Li - English */
}

.ascii-art .scroll-container:nth-child(5) {
    font-size: 16px; /* 李宸宇 - Chinese */
}

.ascii-art .scroll-container:nth-child(6) {
    font-size: 14px; /* Investment ticker */
}

.scroll-text {
    display: inline-block;
    white-space: nowrap;
}

.scroll-text span {
    display: inline-block;
}

.scroll-left {
    animation: none;
}

.scroll-right {
    animation: none;
}

.container.show-content .scroll-left {
    animation: scrollLeft 20s linear infinite;
}

.container.show-content .scroll-right {
    animation: scrollRight 20s linear infinite;
}

.prompt {
    margin-top: 15px;
    margin-bottom: 5px;
    opacity: 0;
}

/* Content prompts and input-line wait for .show class from JavaScript */
.prompt:not(.help-prompt).show {
    animation: fadeInSlide 0.5s ease-out forwards;
}

/* Help prompt keeps its special behavior */
.container.show-content .prompt.help-prompt {
    animation: none;
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

.user {
    color: #000000;
    font-weight: bold;
}

.path {
    color: #000000;
    font-weight: bold;
}

.output {
    margin-left: 0;
    margin-bottom: 10px;
    opacity: 0;
}

.output.show {
    animation: typeIn 0.3s ease-out forwards;
}

.output p {
    margin-bottom: 5px;
}

a {
    color: #000000;
    text-decoration: underline;
}

a:hover {
    background-color: #000000;
    color: #ffffff;
}

.cursor {
    animation: blink 1s infinite;
}

#command-input {
    background: transparent;
    border: none;
    color: #000000;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    outline: none;
    width: calc(100% - 200px);
    padding: 0;
    margin: 0;
}

#command-input::selection {
    background: #000000;
    color: #ffffff;
}

/* Input line now controlled by JavaScript animation */
.input-line:not(.show) {
    opacity: 0;
    animation: none;
}

#terminal-output .prompt {
    opacity: 1;
    animation: none;
}

.container.show-content .help-prompt {
    animation-delay: 3.8s !important;
}

.help-hint {
    color: #666666;
    font-style: italic;
}

.clickable-command {
    background-color: #000000;
    color: #ffffff;
    padding: 2px 4px;
    cursor: pointer;
    font-style: normal;
}

.clickable-command:hover {
    background-color: #ffffff;
    color: #000000;
    outline: 2px solid #000000;
}

.ticker-scroll {
    font-size: 14px;
    font-weight: bold;
}

.positive {
    color: #008000;
}

.negative {
    color: #ff0000;
}

.output strong {
    font-weight: bold;
}

.output em {
    font-style: italic;
}

.output code {
    background-color: #f0f0f0;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

@keyframes blink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

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

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

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

@media (max-width: 600px) {
    body {
        font-size: 12px;
    }

    .ascii-art {
        font-size: 12px;
    }

    /* Maintain rhythm on mobile - English > Chinese > Japanese */
    .ascii-art .scroll-container:nth-child(1) {
        font-size: 16px; /* English - most emphasis */
    }

    .ascii-art .scroll-container:nth-child(2) {
        font-size: 14px; /* Chinese - second emphasis */
    }

    .ascii-art .scroll-container:nth-child(3) {
        font-size: 11px; /* Japanese */
    }

    .ascii-art .scroll-container:nth-child(4) {
        font-size: 15px; /* English */
    }

    .ascii-art .scroll-container:nth-child(5) {
        font-size: 13px; /* Chinese */
    }

    .ascii-art .scroll-container:nth-child(6) {
        font-size: 11px; /* Investment ticker */
    }

    /* Mobile splash screen adjustments */
    #ascii-calligraphy {
        font-size: 2px;
        max-width: 98vw;
        max-height: 98vh;
    }
}

/* Additional mobile breakpoint for very small screens */
@media (max-width: 400px) {
    #ascii-calligraphy {
        font-size: 1.5px;
    }
}

/* Blog Page Styles */
.blog-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    opacity: 1;
}

.blog-nav {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.back-link {
    text-decoration: none;
    color: #000;
    font-weight: bold;
}

.back-link:hover {
    background-color: #000;
    color: #fff;
}

#lang-selector {
    font-size: 14px;
}

.lang-link {
    text-decoration: none;
    color: #000;
    padding: 0 8px;
}

.lang-link.active {
    font-weight: bold;
    text-decoration: underline;
}

.lang-link:hover {
    background-color: #000;
    color: #fff;
}

#blog-content h1 {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    margin-bottom: 30px;
    font-weight: bold;
}

.blog-text {
    font-family: 'Courier New', monospace;
    font-size: 15px;
    line-height: 1.8;
}

.blog-text p {
    margin-bottom: 20px;
}

/* Japanese quotations - Mincho font for 河出文庫 style */
.jp-quote {
    font-family: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", "MS Mincho", serif;
    font-size: 0.95em;
}

/* Dot underline emphasis (傍点) */
.bouten {
    text-emphasis: dot;
    text-emphasis-position: under right;
    -webkit-text-emphasis: dot;
    -webkit-text-emphasis-position: under right;
}

/* Blockquote for quotations - light visual separation */
.blog-text blockquote {
    margin: 30px 0 35px 0;
    padding: 0 0 0 20px;
    border-left: 1px solid #ccc;
    background-color: transparent;
    font-family: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", "MS Mincho", serif;
}

/* Paragraph spacing inside blockquotes */
.blog-text blockquote p {
    margin-bottom: 20px;
    font-family: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", "MS Mincho", serif;
}

.blog-text blockquote p:last-child {
    margin-bottom: 0;
}

/* Source citation */
.blog-text .source {
    font-size: 0.9em;
    margin-top: 15px;
    margin-bottom: 0;
    color: #666;
}

#post-nav {
    margin-top: 60px;
}

.post-nav-links {
    padding-top: 20px;
    border-top: 1px solid #000;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.nav-link {
    text-decoration: none;
    color: #000;
    font-weight: bold;
    max-width: 45%;
}

.nav-link:hover {
    background-color: #000;
    color: #fff;
}

/* Mobile responsiveness for blog pages */
@media (max-width: 600px) {
    .blog-container {
        padding: 15px;
    }

    .blog-nav {
        flex-direction: column;
        align-items: flex-start;
    }

    #blog-content h1 {
        font-size: 20px;
    }

    .blog-text {
        font-size: 14px;
    }

    .post-nav-links {
        flex-direction: column;
        gap: 15px;
    }

    .nav-link {
        max-width: 100%;
    }
}