/* Kanagawa Wave theme */

:root {
    --background: #1F1F28;
    --foreground: #DCD7BA;
    --muted: #727169;
    --border: #363646;
    --primary: #7E9CD8;
    --accent: #7E9CD8;
    --secondary: #957FB8;
    --link: #7FB4CA;
    --success: #98BB6C;
    --warning: #E6C384;
    --error: #FF5D62;

    /* Surface colors */
    --surface-0: #1F1F28;
    --surface-1: #2A2A37;
    --surface-2: #363646;

    /* Extra palette for badges/tags */
    --sakura-pink: #D27E99;
    --surimi-orange: #FFA066;
    --wave-aqua: #7AA89F;
    --spring-green: #98BB6C;
    --crystal-blue: #7E9CD8;
    --oni-violet: #957FB8;
}

/* Base styles */
* {
    box-sizing: border-box;
}

html {
    background-color: var(--background);
    color: var(--foreground);
    font-family: "IBM Plex Mono", "Fira Code", "JetBrains Mono", "Cascadia Code", monospace;
    font-size: 15px;
    line-height: 1.7;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    color: var(--primary);
}

/* Navigation */
.nav {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--surface-1);
}

.nav-brand {
    color: var(--primary);
    font-weight: bold;
    font-size: 1.1rem;
    text-decoration: none;
}

.nav-brand:hover {
    color: var(--foreground);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--foreground);
}

/* Layout */
.container {
    padding: 2rem 1.5rem 0.5rem;
}

/* Sections */
.section {
    margin-bottom: 3rem;
}

.section:last-child {
    margin-bottom: 0;
}

.section-title {
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

/* Hero */
.hero {
    padding: 1rem 0 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.hero-intro {
    color: var(--secondary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.hero-title {
    color: var(--foreground);
    font-size: 2rem;
    margin: 0.25rem 0;
}

.hero-subtitle {
    color: var(--primary);
    font-size: 1.1rem;
}

.hero-content {
    color: var(--muted);
    max-width: 40rem;
}

/* Badges / Tags */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 0.8rem;
    margin: 0.15rem;
    color: var(--foreground);
    background-color: var(--surface-2);
}

.badge:nth-child(6n+1) { color: var(--crystal-blue); border-color: var(--crystal-blue); }
.badge:nth-child(6n+2) { color: var(--spring-green); border-color: var(--spring-green); }
.badge:nth-child(6n+3) { color: var(--sakura-pink); border-color: var(--sakura-pink); }
.badge:nth-child(6n+4) { color: var(--surimi-orange); border-color: var(--surimi-orange); }
.badge:nth-child(6n+5) { color: var(--oni-violet); border-color: var(--oni-violet); }
.badge:nth-child(6n+6) { color: var(--wave-aqua); border-color: var(--wave-aqua); }

/* apt list --installed */
.apt-list {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    font-size: 0.875rem;
    line-height: 1.8;
}

.apt-cmd { color: var(--muted); }
.apt-listing { color: var(--muted); }
.apt-name { color: var(--primary); }
.apt-installed { color: var(--success); }

.src-list { margin-top: 1rem; }
.src-name  { color: var(--primary); }

/* Blog post cards */
.post-card {
    border: 1px solid var(--border);
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: var(--surface-1);
    display: flex;
    gap: 1rem;
    transition: border-color 0.2s;
}

.post-card:hover {
    border-color: var(--primary);
}

.post-card a {
    text-decoration: none;
    color: inherit;
}

.post-card-image {
    width: 160px;
    min-width: 160px;
    height: 110px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.post-card-body {
    flex: 1;
    min-width: 0;
}

.post-card-title {
    color: var(--primary);
    font-size: 1.05rem;
    margin: 0 0 0.25rem 0;
}

.post-card-date {
    color: var(--muted);
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
}

.post-card-desc {
    color: var(--foreground);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

/* Blog post page */
.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.post-title {
    color: var(--foreground);
    font-size: 1.8rem;
    margin: 0 0 0.5rem 0;
}

.post-meta {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.post-featured-image {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.post-featured-image.img-loaded {
    opacity: 1;
}

/* Markdown content */
.post-content h2 {
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.35rem;
    margin-top: 2rem;
}

.post-content h3 {
    color: var(--secondary);
    margin-top: 1.5rem;
}

.post-content p {
    margin: 0.75rem 0;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    margin: 1rem 0;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.post-content img.img-loaded {
    opacity: 1;
}

.post-content ul,
.post-content ol {
    padding-left: 1.5rem;
}

.post-content li {
    margin: 0.25rem 0;
}

.post-content code {
    background-color: var(--surface-2);
    padding: 0.1rem 0.35rem;
    border-radius: 2px;
    font-size: 0.9em;
}

.post-content pre {
    background-color: var(--surface-1);
    border: 1px solid var(--border);
    padding: 1rem;
    overflow-x: auto;
    line-height: 1.5;
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-content blockquote {
    border-left: 3px solid var(--secondary);
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    color: var(--muted);
}

.post-content a {
    color: var(--link);
}

.post-content a:hover {
    color: var(--primary);
}

/* Pygments / codehilite overrides for Kanagawa */
.highlight {
    background-color: var(--surface-1) !important;
    border: 1px solid var(--border);
    padding: 1rem;
    overflow-x: auto;
    line-height: 1.5;
}

.highlight pre {
    background: none !important;
    border: none;
    padding: 0;
    margin: 0;
}

/* Kanagawa Wave token colors */
.highlight .c,
.highlight .c1,
.highlight .cm,
.highlight .ch  { color: #727169; font-style: italic; }   /* Comment */
.highlight .cp   { color: #FF9E3B; font-weight: bold; }   /* Comment.Preproc */
.highlight .cs   { color: #727169; font-style: italic; font-weight: bold; }

.highlight .k,
.highlight .kc,
.highlight .kd,
.highlight .kp,
.highlight .kr  { color: #7E9CD8; }                       /* Keyword */
.highlight .kn  { color: #7E9CD8; }                       /* Keyword.Namespace (import) */
.highlight .kt  { color: #7AA89F; }                       /* Keyword.Type */
.highlight .ow  { color: #7E9CD8; }                       /* Operator.Word (and, or, not) */

.highlight .n   { color: #DCD7BA; }                       /* Name */
.highlight .na  { color: #7AA89F; }                       /* Name.Attribute */
.highlight .nb  { color: #FFA066; }                       /* Name.Builtin */
.highlight .bp  { color: #E6C384; }                       /* Name.Builtin.Pseudo (self, cls) */
.highlight .nc  { color: #7AA89F; }                       /* Name.Class */
.highlight .nd  { color: #FFA066; }                       /* Name.Decorator */
.highlight .ne  { color: #FF5D62; }                       /* Name.Exception */
.highlight .nf,
.highlight .nx  { color: #7E9CD8; }                       /* Name.Function */
.highlight .ni  { color: #DCD7BA; }                       /* Name.Entity */
.highlight .nl  { color: #DCD7BA; }                       /* Name.Label */
.highlight .nn  { color: #7AA89F; }                       /* Name.Namespace */
.highlight .no  { color: #D27E99; }                       /* Name.Constant */
.highlight .nt  { color: #957FB8; }                       /* Name.Tag */
.highlight .nv,
.highlight .vi,
.highlight .vg,
.highlight .vc  { color: #DCD7BA; }                       /* Name.Variable */

.highlight .o   { color: #9CABCA; }                       /* Operator */
.highlight .p   { color: #9CABCA; }                       /* Punctuation */

.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .sb,
.highlight .sc,
.highlight .sf,
.highlight .sh,
.highlight .sx  { color: #98BB6C; }                       /* String */
.highlight .sd  { color: #98BB6C; font-style: italic; }   /* String.Doc */
.highlight .se  { color: #E6C384; }                       /* String.Escape */
.highlight .si  { color: #E6C384; }                       /* String.Interpol */
.highlight .sr  { color: #7AA89F; }                       /* String.Regex */
.highlight .ss  { color: #E6C384; }                       /* String.Symbol */

.highlight .m,
.highlight .mf,
.highlight .mh,
.highlight .mi,
.highlight .mo,
.highlight .mb,
.highlight .il  { color: #D27E99; }                       /* Number */

.highlight .err { color: #FF5D62; background: none; }     /* Error */
.highlight .w   { color: #DCD7BA; }                       /* Whitespace */
.highlight .hll { background-color: #363646; }

/* TOC permalink */
.post-content .headerlink {
    color: var(--muted);
    font-size: 0.8em;
    margin-left: 0.3rem;
    text-decoration: none;
}

.post-content .headerlink:hover {
    color: var(--primary);
}

/* Blinking cursor */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.typing-cursor {
    color: var(--foreground);
    animation: blink 1s step-end infinite;
}

.typing-error {
    color: var(--error);
}

.typing-logout {
    color: var(--muted);
}

/* > bullets on lists */
.section ul li::marker,
.post-content ul li::marker {
    content: "> ";
    color: var(--muted);
}

/* Blog post cat command header */
.post-cmd {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

/* ls -la blog listing */
.ls-header {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.ls-total {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.ls-entry {
    display: grid;
    grid-template-columns: 10ch 8ch 12ch 22ch 1fr;
    gap: 0.75rem;
    padding: 0.15rem 0;
    color: var(--foreground);
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.6;
}

.ls-entry:hover {
    text-decoration: none;
}

.ls-entry:hover .ls-name {
    color: var(--foreground);
    text-decoration: underline;
}

.ls-perms { color: var(--muted); }
.ls-owner { color: var(--success); }
.ls-date  { color: var(--warning); }
.ls-name  { color: var(--primary); }
.ls-title { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Terminal window chrome */
.terminal-window {
    max-width: 56rem;
    margin: 2rem auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background-color: var(--surface-0);
    overflow: hidden;
}

.terminal-titlebar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 1rem;
    background-color: var(--surface-2);
    border-bottom: 1px solid var(--border);
    user-select: none;
}

.terminal-dots {
    display: flex;
    gap: 0.4rem;
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.terminal-dot-red    { background-color: #FF5D62; }
.terminal-dot-yellow { background-color: #E6C384; }
.terminal-dot-green  { background-color: #98BB6C; }

.terminal-path {
    color: var(--muted);
    font-size: 0.8rem;
    flex: 1;
    text-align: center;
}

/* Tmux status bar */
.tmux-bar {
    display: flex;
    align-items: center;
    background-color: #16161e;
    padding: 0.1rem 0.75rem;
    gap: 0.6rem;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--foreground);
    user-select: none;
}

.tmux-session {
    color: #7E9CD8;
}

.tmux-sep {
    color: #E6C384;
}

.tmux-win {
    color: var(--foreground);
    text-decoration: none;
    cursor: default;
}

.tmux-win:hover {
    color: var(--foreground);
    text-decoration: none;
}


.tmux-win-active {
    color: #E6C384;
}

.tmux-win-active:hover {
    color: #E6C384;
    text-decoration: none;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 3rem;
}

.footer a {
    color: var(--link);
}

/* Shell input on blog list */
#shell-history {
    margin-top: 1.25rem;
}

.shell-line {
    display: flex;
    align-items: center;
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.7;
}

.shell-prompt {
    color: var(--muted);
    white-space: pre;
    flex-shrink: 0;
}

.shell-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--foreground);
    font-family: inherit;
    font-size: inherit;
    caret-color: var(--foreground);
    flex: 1;
    padding: 0;
    width: 100%;
}

.shell-completions {
    color: var(--primary);
    font-size: 0.85rem;
    margin-top: 0.2rem;
    min-height: 1.4em;
    padding-left: 0.1rem;
}

.shell-typed {
    color: var(--foreground);
}

.shell-error {
    color: var(--error);
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.7;
}

/* Responsive */
@media (max-width: 640px) {
    .terminal-window {
        margin: 0.75rem;
    }

    .post-card {
        flex-direction: column;
    }

    .post-card-image {
        width: 100%;
        min-width: unset;
        height: 160px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .ls-entry {
        grid-template-columns: 1fr;
        gap: 0.1rem;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border);
    }

    .ls-perms, .ls-owner { display: none; }
}
