/* tokens */
:root {
    --ink: #0a0a0c;
    --elevated: #121116;
    --line: #232028;
    --bone: #e8e6ea;
    --soft: #a8a5ad;
    --muted: #6b6873;
    --pink: #ff5c8a;
    --pink-soft: rgba(255, 92, 138, 0.12);
    --pink-glow: rgba(255, 92, 138, 0.35);
    --violet: rgba(130, 70, 190, 0.16);
    --grid: rgba(255, 255, 255, 0.025);
    --font-body: "Geist", system-ui, -apple-system, sans-serif;
    --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
    --font-pixel: "DotGothic16", var(--font-mono);
    --sidebar: 236px;
}

/* reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--ink);
    color: var(--bone);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
}

::selection { background: var(--pink); color: var(--ink); }

a { color: inherit; text-decoration: none; }

a:focus-visible, button:focus-visible {
    outline: 2px solid var(--pink);
    outline-offset: 3px;
    border-radius: 2px;
}

/* page transitions */
@view-transition { navigation: auto; }

::view-transition-old(root) { animation: vt-out 0.16s ease both; }
::view-transition-new(root) { animation: vt-in 0.26s ease both; }

@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }

/* bg */
.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 44px 44px;
}

.bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% 40%, transparent 30%, var(--ink) 100%);
}

.blob {
    position: absolute;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.5;
}

.blob-1 {
    background: var(--violet);
    top: -160px;
    left: 12%;
    animation: drift-1 26s ease-in-out infinite alternate;
}

.blob-2 {
    background: var(--pink-soft);
    bottom: -200px;
    right: 4%;
    animation: drift-2 32s ease-in-out infinite alternate;
}

@keyframes drift-1 {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(120px, 80px) scale(1.15); }
}

@keyframes drift-2 {
    from { transform: translate(0, 0) scale(1.1); }
    to { transform: translate(-140px, -70px) scale(0.95); }
}

/* sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar);
    padding: 32px 18px 24px;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(10, 10, 12, 0.7);
    z-index: 10;
}

.side-logo {
    font-family: var(--font-pixel);
    font-size: 20px;
    color: var(--pink);
    text-shadow: 0 0 18px var(--pink-glow);
    padding: 0 12px 22px;
    display: block;
    width: fit-content;
}

.side-nav { display: flex; flex-direction: column; gap: 2px; }

.side-nav a {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--soft);
    padding: 8px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.side-nav a::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.35;
    transition: opacity 0.18s ease, box-shadow 0.18s ease;
}

.side-nav a:hover {
    color: var(--bone);
    background: var(--elevated);
    transform: translateX(2px);
}

.side-nav a.active {
    color: var(--pink);
    background: var(--pink-soft);
    view-transition-name: active-pill;
}

.side-nav a.active::before {
    opacity: 1;
    box-shadow: 0 0 8px var(--pink-glow);
}

::view-transition-group(active-pill) {
    animation-duration: 0.3s;
    animation-timing-function: cubic-bezier(0.3, 0.9, 0.3, 1);
}

.side-spacer { flex: 1; }

/* discord card */
.presence[hidden] { display: none; }

.presence {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    gap: 11px;
    background: rgba(18, 17, 22, 0.65);
    margin-bottom: 12px;
    min-height: 60px;
}

.presence-avatar {
    position: relative;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}

.presence-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
    background: var(--elevated);
}

.presence-dot {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 3px solid var(--ink);
    background: #80848e;
}

.presence-dot.online { background: #23a55a; }
.presence-dot.idle { background: #f0b232; }
.presence-dot.dnd { background: #f23f43; }

.presence-info { min-width: 0; }

.presence-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--bone);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.presence-status {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* sidebar socials */
.side-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    padding: 0 12px;
    font-family: var(--font-mono);
    font-size: 12px;
}

.side-socials a {
    color: var(--muted);
    transition: color 0.18s ease;
}

.side-socials a:hover { color: var(--pink); }

.side-socials span { color: var(--muted); opacity: 0.7; }

/* layout */
.layout { margin-left: var(--sidebar); }

.content {
    max-width: 640px;
    margin: 0 auto;
    padding: 72px 32px 110px;
}

/* footer */
.footer {
    margin-top: 72px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
}

/* view counter */
.views-pill {
    position: fixed;
    right: 16px;
    bottom: 14px;
    z-index: 20;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--muted);
    background: rgba(18, 17, 22, 0.85);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.views-pill.show { opacity: 1; }

.views-pill svg { width: 13px; height: 13px; opacity: 0.7; }

/* hero (home) */
.hero { padding: 40px 0 8px; }

.hero-name {
    font-family: var(--font-pixel);
    font-weight: 400;
    font-size: clamp(52px, 9vw, 78px);
    line-height: 1;
    color: var(--pink);
    text-shadow: 0 0 32px var(--pink-glow), 0 0 90px var(--pink-soft);
    letter-spacing: 0.02em;
}

.hero-kana {
    font-family: var(--font-pixel);
    font-size: 13px;
    color: var(--muted);
    margin-top: 12px;
    letter-spacing: 0.5em;
}

.hero-line {
    margin-top: 26px;
    font-size: 17px;
    font-weight: 500;
    color: var(--bone);
}

.hero-sub {
    margin-top: 6px;
    font-size: 14px;
    color: var(--soft);
}

/* page heading */
.page-title {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--pink);
    letter-spacing: 0.12em;
    margin-bottom: 30px;
}

.section { padding: 34px 0 0; }

.eyebrow {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--pink);
    letter-spacing: 0.12em;
    margin-bottom: 18px;
}

.section p, .prose p { color: var(--soft); max-width: 58ch; }
.section p + p, .prose p + p { margin-top: 14px; }

/* chips */
.chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 26px;
}

.chips li {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--soft);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 3px 10px;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.chips li:hover { border-color: var(--pink); color: var(--bone); }

/* projects */
.projects { list-style: none; }

.project {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 12px;
    margin: 0 -12px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.project:hover { background: var(--elevated); }

.project-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.project-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--bone);
    transition: color 0.2s ease;
}

.project:hover .project-name { color: var(--pink); }

.project-desc { font-size: 13px; color: var(--muted); line-height: 1.55; }

.project-meta {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.lang-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pink);
    opacity: 0.7;
}

/* blog list */
.post-list { list-style: none; }

.post-item a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    padding: 13px 12px;
    margin: 0 -12px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.post-item a:hover { background: var(--elevated); }

.post-title {
    font-weight: 500;
    font-size: 14px;
    color: var(--bone);
    transition: color 0.2s ease;
}

.post-item a:hover .post-title { color: var(--pink); }

.post-date {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

.post-empty { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }

/* home recent posts */
.home-recent { margin-top: 44px; }

.home-more {
    display: inline-block;
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    transition: color 0.18s ease;
}

.home-more:hover { color: var(--pink); }

/* socials row (home hero) */
.socials {
    margin-top: 28px;
    display: flex;
    align-items: center;
    gap: 18px;
    font-family: var(--font-mono);
    font-size: 13px;
}

.socials a {
    color: var(--soft);
    border-bottom: 1px solid var(--line);
    padding-bottom: 1px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.socials a:hover { color: var(--pink); border-color: var(--pink); }

.social-static { color: var(--muted); }

/* post page */
.post-back {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--soft);
    display: inline-block;
    margin-bottom: 36px;
    transition: color 0.2s ease;
}

.post-back:hover { color: var(--pink); }

.post-header { margin-bottom: 36px; }

.post-page-title {
    font-size: clamp(26px, 6vw, 34px);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.post-page-date {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    margin-top: 10px;
    display: block;
}

/* markdown body */
.md { color: var(--soft); }

.md h1, .md h2, .md h3 {
    color: var(--bone);
    font-weight: 600;
    line-height: 1.3;
    margin: 32px 0 12px;
}

.md h1 { font-size: 24px; }
.md h2 { font-size: 19px; }
.md h3 { font-size: 16px; }

.md p { margin: 14px 0; }

.md a { color: var(--pink); border-bottom: 1px solid var(--pink-soft); transition: border-color 0.2s ease; }
.md a:hover { border-color: var(--pink); }

.md code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--elevated);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 1px 6px;
}

.md pre {
    background: var(--elevated);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin: 18px 0;
}

.md pre code { background: none; border: none; padding: 0; font-size: 13px; line-height: 1.6; }

.md blockquote {
    border-left: 2px solid var(--pink);
    padding-left: 16px;
    margin: 18px 0;
    color: var(--muted);
}

.md ul, .md ol { margin: 14px 0; padding-left: 24px; }
.md li { margin: 5px 0; }

.md img { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); margin: 18px 0; }

.md hr { border: none; border-top: 1px solid var(--line); margin: 28px 0; }

.md u { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--pink); }

.md del { color: var(--muted); }

.md mark {
    background: var(--pink-soft);
    color: var(--pink);
    padding: 0 4px;
    border-radius: 3px;
}

.md .txt-lg { font-size: 1.35em; font-weight: 600; color: var(--bone); }

/* reveal animation */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in { opacity: 1; transform: none; }

/* mobile */
@media (max-width: 820px) {
    .sidebar {
        position: static;
        width: auto;
        border-right: none;
        border-bottom: 1px solid var(--line);
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px 10px;
        padding: 14px 16px;
    }

    .side-logo { padding: 0 8px 0 0; font-size: 17px; }

    .side-nav { flex-direction: row; gap: 2px; }
    .side-nav a { padding: 6px 10px; }
    .side-nav a::before { display: none; }

    .side-spacer { display: none; }

    .presence {
        order: 5;
        width: 100%;
        margin: 8px 0 0;
        min-height: 0;
        padding: 8px 10px;
    }

    .presence-avatar { width: 30px; height: 30px; }

    .side-socials { display: none; }

    .layout { margin-left: 0; }

    .content { padding: 44px 20px 110px; }

    .hero { padding: 12px 0 8px; }

    .project { flex-direction: column; gap: 6px; }
    .project-meta { align-self: flex-start; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .blob-1, .blob-2 { animation: none; }
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
