/* ================================================
   ANEMOIA — personal homepage
   Color scheme & starfield ported from anemoia.moe
   ================================================ */

@font-face {
    font-family: silkscreen;
    src: url('/silkscreen.ttf');
}

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

/* ── Animated starfield background ─────────────── */
/* Ported directly from anemoia.moe +layout.svelte  */
body {
    background-color: #38373b;
    background-image:
        radial-gradient(#dc844a, rgba(255,255,255,0.2) 2px, transparent 1px),
        radial-gradient(#dc844a, rgba(255,255,255,0.15) 2px, transparent 1px),
        radial-gradient(#dc844a, rgba(255,255,255,0.1) 2px, transparent 1px),
        radial-gradient(rgba(255,255,255,0.4), rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 550px 550px, 350px 350px, 250px 250px, 150px 150px;
    background-position: 0 0, 40px 60px, 130px 270px, 70px 100px;
    animation: twinkle 10s ease-in-out infinite alternate;
    color: #cfb49b;
    font-family: 'MS UI Gothic', 'MUmePlus', sans-serif;
    font-size: 14px;
    letter-spacing: 1px;
    min-height: 100vh;
}

@keyframes twinkle {
    0%   { background-position: 0 0,      40px 60px,   130px 270px, 70px 100px; }
    100% { background-position: -50px -50px, -10px 10px, 180px 320px, 120px 150px; }
}

/* ── Site wrapper ──────────────────────────────── */
.site-wrapper {
    max-width: 820px;
    margin: 12px auto;
    border: 2px solid #dc844a;
    background-color: rgba(50, 48, 54, 0.97);
}

/* ── Header ────────────────────────────────────── */
header.site-header {
    text-align: center;
    padding: 22px 16px 16px;
    background-color: #2a2930;
    border-bottom: 2px solid #dc844a;
}

.site-banner {
    max-width: 100%;
    display: block;
    margin: 0 auto 8px;
    image-rendering: pixelated;
}

header.site-header .subtitle {
    color: #646c66;
    font-size: 0.85em;
}

/* Scrolling marquee bar */
.marquee-bar {
    background: #1e1d22;
    border-top: 1px solid #dc844a;
    border-bottom: 1px solid #dc844a;
    padding: 3px 0;
    overflow: hidden;
    white-space: nowrap;
}

.marquee-inner {
    display: inline-block;
    animation: scroll-left 20s linear infinite;
    color: #dc844a;
    font-size: 0.85em;
    opacity: 0.8;
}

@keyframes scroll-left {
    from { transform: translateX(50vw); }
    to   { transform: translateX(-100%); }
}

/* ── Navigation ────────────────────────────────── */
nav.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 14px;
    padding: 8px 10px;
    background-color: #646c66;
    border: 3px outset grey;
    text-shadow: 1px 1px 1px black;
}

.nav-link {
    color: #cfb49b;
    text-decoration: none;
    font-size: 1em;
    cursor: pointer;
}

.nav-link:hover {
    color: #dc844a;
    text-decoration: underline;
}

/* ── Main content area ─────────────────────────── */
main#content {
    padding: 24px 20px;
    min-height: 320px;
    background-color: #323036;
}

/* ── Home / welcome ────────────────────────────── */
.welcome {
    text-align: center;
}

.welcome h2 {
    font-size: 1.4em;
    color: #dc844a;
    margin-bottom: 16px;
}

.welcome p {
    color: #cfb49b;
    margin: 10px 0;
    line-height: 1.7;
}

/* ── Page content (about / projects / contact) ─── */
.page-content h2 {
    color: #dc844a;
    font-size: 1.2em;
    border-bottom: 1px solid #dc844a;
    padding-bottom: 6px;
    margin-bottom: 16px;
}

.page-content p {
    color: #cfb49b;
    line-height: 1.7;
    margin: 10px 0;
}

.page-content ul {
    padding-left: 22px;
    margin: 10px 0;
}

.page-content li {
    color: #cfb49b;
    margin: 8px 0;
    line-height: 1.5;
}

.page-content strong {
    color: #dc844a;
}

/* ── Footer ────────────────────────────────────── */
footer.site-footer {
    text-align: center;
    padding: 14px;
    background-color: #2a2930;
    border-top: 2px solid #dc844a;
    color: #646c66;
    font-size: 0.78em;
    line-height: 1.8;
}

footer.site-footer a {
    color: #cfb49b;
}

/* 88x31 web buttons */
.web-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    margin: 10px 0 6px;
}

.web-buttons a img {
    width: 88px;
    height: 31px;
    image-rendering: pixelated;
    display: block;
}

/* ── Shared utilities ──────────────────────────── */

.blink {
    animation: blink 1s step-start infinite;
}

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

.hr-fancy {
    border: none;
    border-top: 1px solid #dc844a;
    margin: 18px 0;
    opacity: 0.5;
}

/* ── Projects page ─────────────────────────────── */
.projects-page {
    position: relative;
}

.projects-page .tux {
    position: absolute;
    top: 0;
    right: 0;
    image-rendering: pixelated;
}

.projects-group {
    margin-bottom: 28px;
}

.projects-group h4 {
    color: #dc844a;
    margin-bottom: 8px;
}

.project-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin: 16px 0;
    padding: 10px;
    border: 1px solid #4a4850;
    background-color: rgba(42, 41, 48, 0.6);
}

.project-image img {
    max-width: 120px;
    image-rendering: pixelated;
}

.project-info h3 {
    color: #dc844a;
    margin: 0 0 2px 0;
    font-size: 1em;
}

.project-info h5 {
    color: #646c66;
    margin: 0 0 6px 0;
    font-weight: normal;
    font-size: 0.85em;
}

.project-info p {
    color: #cfb49b;
    margin: 0 0 8px 0;
    font-size: 0.9em;
    line-height: 1.5;
}

.project-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.project-links a {
    font-size: 0.85em;
    font-weight: bold;
}

.demo-text {
    color: #646c66;
    font-size: 0.85em;
}

/* ── Sprite visit counter ──────────────────────── */
.visit-counter {
    margin: 6px 0;
}

.counter-digits {
    display: inline-flex;
    gap: 1px;
    border: 2px inset #444;
    padding: 3px 5px;
    background: #000;
}

.digit {
    width: 16px;
    height: 21px;
    background-image: url('/images/count.png');
    background-repeat: no-repeat;
    image-rendering: pixelated;
}

.digit[data-digit="0"] { background-position:    0px 0; }
.digit[data-digit="1"] { background-position:  -32px 0; }
.digit[data-digit="2"] { background-position:  -64px 0; }
.digit[data-digit="3"] { background-position:  -96px 0; }
.digit[data-digit="4"] { background-position: -128px 0; }
.digit[data-digit="5"] { background-position: -160px 0; }
.digit[data-digit="6"] { background-position: -192px 0; }
.digit[data-digit="7"] { background-position: -224px 0; }
.digit[data-digit="8"] { background-position: -256px 0; }
.digit[data-digit="9"] { background-position: -288px 0; }

/* ── Home page ─────────────────────────────────── */
.home-page h3 {
    color: #dc844a;
    font-size: 0.9em;
    margin-bottom: 6px;
}

.home-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.home-links li {
    margin-bottom: 4px;
}

/* ── Blog page ─────────────────────────────────── */
.blog-page {
    position: relative;
}

.write-img {
    position: absolute;
    top: 24px;
    right: 20px;
}

.blog-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-item {
    margin-bottom: 6px;
}

.blog-item a {
    text-decoration: none;
    cursor: pointer;
}

.blog-item a:hover {
    color: #dc844a;
}

.blog-item img {
    vertical-align: middle;
    image-rendering: pixelated;
}

/* Blog post content */
.blog-post h2 {
    color: #dc844a;
    font-size: 1.2em;
    margin: 8px 0 4px;
}

.post-content {
    line-height: 1.8;
    color: #cfb49b;
}

.post-content h1,
.post-content h2,
.post-content h3 {
    color: #dc844a;
    margin: 20px 0 8px;
}

.post-content h1 { font-size: 1.1em; }
.post-content h2 { font-size: 1em; }
.post-content h3 { font-size: 0.9em; }

.post-content p {
    margin: 10px 0;
}

.post-content a {
    color: #cfb49b;
}

.post-content code {
    background: #1e1d22;
    padding: 1px 5px;
    font-size: 0.9em;
    border: 1px solid #4a4850;
}

.post-content pre {
    background: #1e1d22;
    border: 1px solid #4a4850;
    padding: 12px;
    overflow-x: auto;
    margin: 12px 0;
}

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

.post-content blockquote {
    border-left: 3px solid #dc844a;
    margin: 10px 0;
    padding-left: 14px;
    color: #9e8a72;
}

.post-content ul,
.post-content ol {
    padding-left: 22px;
    margin: 10px 0;
}

.post-content table {
    border-collapse: collapse;
    margin: 12px 0;
    width: 100%;
}

.post-content th,
.post-content td {
    border: 1px solid #4a4850;
    padding: 6px 10px;
    text-align: left;
}

.post-content th {
    background: #2a2930;
    color: #dc844a;
}

/* ── Guestbook page ────────────────────────────── */
.gb-form-wrap {
    width: 60%;
    margin: 0 auto;
    text-align: center;
}

.form-field {
    margin: 8px 0;
}

.form-field input,
.form-field textarea {
    width: 250px;
    background: #1e1d22;
    color: #cfb49b;
    border: 1px solid #4a4850;
    padding: 4px 6px;
    font-family: 'MS UI Gothic', sans-serif;
    font-size: 13px;
    resize: none;
}

.form-field input:focus,
.form-field textarea:focus {
    outline: 1px solid #dc844a;
}

.gb-submit {
    background-color: #c0c0c0;
    color: #000;
    border: 3px outset #ffffff;
    padding: 4px 12px;
    font-family: 'MS UI Gothic', sans-serif;
    font-size: 0.85em;
    cursor: pointer;
    margin: 6px 0;
}

.gb-submit:hover { background-color: #d4d0c8; }
.gb-submit:active { border-style: inset; }

.guestbook-page small {
    color: #646c66;
}

.gb-error {
    color: #e05555;
    font-size: 0.85em;
    margin: 4px 0;
}

.gb-success {
    color: #6abf6a;
    font-size: 0.85em;
    margin: 4px 0;
}

#messages {
    max-height: 50vh;
    overflow-y: auto;
    border: 2px inset #808080;
    background: #1a191e;
    padding: 4px;
    scrollbar-width: thin;
    scrollbar-color: #c0c0c0 #808080;
}

#messages::-webkit-scrollbar {
    width: 16px;
}

#messages::-webkit-scrollbar-track {
    background: #c0c0c0;
    border-left: 1px solid #808080;
}

#messages::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
}

#messages::-webkit-scrollbar-thumb:active {
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
}

#messages::-webkit-scrollbar-button {
    background: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    height: 16px;
    display: block;
}

#messages::-webkit-scrollbar-button:active {
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
}

.gb-message {
    border: 1px solid #4a4850;
    padding: 6px 10px;
    margin: 6px auto;
    width: 80%;
}

.gb-message h5 {
    margin: 2px 0 4px;
    color: #dc844a;
}

.gb-message p {
    margin: 0;
    color: #cfb49b;
    line-height: 1.5;
}

.gb-date {
    color: #646c66;
    font-weight: normal;
}

/* ── Goals ─────────────────────────────────────── */
.goals-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.goal-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    margin-bottom: 3px;
    color: #cfb49b;
}

.goal-bar {
    width: 100%;
    height: 14px;
    background: #1e1d22;
    border: 1px solid #4a4850;
}

.goal-fill {
    height: 100%;
    background-color: #dc844a;
    transition: width 0.3s ease-in-out;
}

/* ── Links page ────────────────────────────────── */
.links-page h3 {
    margin-top: 16px;
    margin-bottom: 4px;
    color: #dc844a;
    font-size: 0.9em;
}

.links-section {
    margin-bottom: 20px;
}

.link-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.link-buttons img {
    width: 88px;
    height: 31px;
    image-rendering: pixelated;
    display: block;
}

.link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 4px 0;
}

.wwwimage {
    float: right;
    margin: 0 30px 10px 10px;
}

.my88x31 {
    margin: 8px 0 20px;
}

.my88x31 input {
    width: 72%;
    background: #1e1d22;
    color: #cfb49b;
    border: 1px solid #4a4850;
    padding: 3px 6px;
    font-size: 0.8em;
    margin-top: 4px;
}

/* ── Misc ──────────────────────────────────────── */
.small {
    color: #646c66;
    font-size: 0.8em;
}

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

a:visited {
    color: #9e8a72;
}

a:hover {
    color: #dc844a;
}

.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline;
    color: #dc844a;
}
