@font-face {
        font-family: 'DOS/V re. JPN24';
        src: url('Px437_IBM_PS-55_re.ttf') format('truetype');
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'DOS/V re. JPN24', 'Share Tech Mono', 'Courier New', monospace;
            background-color: #f5f5f5;
            color: #333;
            line-height: 1.6;
            font-size: 16px;
            text-align: justify;
        }

        .p body {
            text-indent: 15px;

        }
        .dark-mode {
            background-color: #1a1a1a;
            color: #e0e0e0;
        }

        a {
            color: #333;
            text-decoration: none;
        }

        .dark-mode a {
            color: #e0e0e0;
            text-decoration: none;
        }
        
        .web-counter {
            text-align: center;
            margin-bottom: 10px;
        }

        .nav-bar {
            background: transparent;
            backdrop-filter: blur(5.5px);
            -webkit-backdrop-filter: blur(5.5px);
            padding: 15px 0;
            text-align: center;
            position: sticky;
            top: 0;
            z-index: 100;
            transition: all 0.3s ease;
        }

        .nav-bar.scrolled {
            padding: 8px 0;
        }

        .nav-bar.minimized {
            transform: translateY(-100%);
        }

        .nav-sanctuary {
            display: none;
            position: fixed;
            top: 10px;
            left: 20px;
            padding: 8px 15px;
            font-size: 13px;
            text-decoration: underline;
            text-transform: uppercase;
            letter-spacing: 1px;
            z-index: 101;
        }

        .nav-sanctuary.active {
            display: block;
        }
        
        .nav-container {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 40px;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
            transition: top 0.3s ease;
            transition: color 0.3s ease;
        }
        
        .nav-name {
            font-size: 18px;
            font-weight: bold;
            text-transform: uppercase;
        }
        
        .nav-links {
            display: flex;
            gap: 30px;
        }
        
        .nav-links a {
            color: inherit;
            text-decoration: none;
            text-transform: uppercase;
            font-size: 14px;
            letter-spacing: 1px;
        }
        
        .nav-links a:hover {
            text-decoration: underline;
        }
        
        .theme-toggle {
            position: absolute;
            top: 20px;
            right: 20px;
            background: none;
            border: 1px solid #333;
            color: inherit;
            padding: 5px 10px;
            font-family: inherit;
            font-size: 12px;
            cursor: pointer;
            pointer-events: auto;
            z-index: 1000;
        }
        
        .dark-mode .theme-toggle {
            border-color: #ccc;
        }
        
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 40px 20px;
            display: grid;
            grid-template-columns: 300px 1fr 250px;
            gap: 60px;
        }
        
        .section-title {
            text-transform: uppercase;
            font-size: 19px;
            margin-bottom: 20px;
            letter-spacing: 1px;
        }
  
        .section-subtitle {
            text-transform: uppercase;
            font-size: 15px;
        }
        .left-column {
            position: sticky;
            height: fit-content;
            top: 80px;
            align-self: start;
            height: fit-content;
        }
        
        .about-section {
            margin-bottom: 40px;
        }
        
        .about-content {
            text-align: justify;
        }
        
        .categories {
            margin-bottom: 40px;
        }
        
        .category-item {
            display: flex;
            justify-content: space-between;
            margin-bottom: 8px;
            cursor: pointer;
        }
        
        .category-item:hover {
            text-decoration: underline;
        }
        
        .category-count {
            font-weight: bold;
        }
        
        .contact-info {
            line-height: 1.8;
        }
        
        .center-column {
            min-height: 70vh;
        }
        
        .main-title {
            font-size: 32px;
            margin-bottom: 10px;
            text-transform: uppercase;
            letter-spacing: 2px;
        }
        
        .subtitle {
            font-size: 14px;
            margin-bottom: 40px;
            text-transform: uppercase;
            letter-spacing: 1px;
            opacity: 0.7;
        }
        
        .posts-container {
            display: none;
        }
        
        .posts-container.active {
            display: block;
        }
        
        .post-list {
            list-style: none;
        }
        
        .post-item {
            margin-bottom: 30px;
            padding-bottom: 20px;
            border-bottom: 1px solid #ddd;
        }
        
        .dark-mode .post-item {
            border-bottom-color: #444;
        }
        
        .post-title {
            font-size: 19px;
            margin-bottom: 8px;
            cursor: pointer;
        }
        
        .post-title:hover {
            text-decoration: underline;
        }
        
        .post-meta {
            font-size: 13px;
            margin-bottom: 10px;
            opacity: 0.7;
            text-transform: uppercase;
            letter-spacing: 1px;
        }
        
        .post-excerpt {
            font-size: 13px;
            line-height: 1.6;
        }
        
        .post-content {
            display: none;
            margin-top: 20px;
            line-height: 1.8;
        }
        
        .post-content.active {
            display: block;
        }
        
        .post-content img {
            max-width: 100%;
            margin: 20px 0;
            image-rendering: -moz-crisp-edges;
            image-rendering: -webkit-crisp-edges;
            image-rendering: pixelated;
            image-rendering: crisp-edges;
            filter: grayscale(100%) contrast(150%) brightness(0.8);
            transition: filter 0.3s ease, image-rendering 0.3s ease;
            transform: scale(0.98);
        }

        .post-content img:hover {
            image-rendering: auto;
            filter: none;
            transform: scale(1);
        }

        .post-content img.dramatic-duotone {
            filter: 
                grayscale(100%) 
                contrast(200%) 
                brightness(0.7)
                sepia(100%) 
                hue-rotate(220deg) 
                saturate(0%);
        }

        .post-content img.dramatic-duotone:hover {
            filter: none;
        }
        
        .post-content h1 {
            text-align: center;
            text-transform: uppercase;  
            line-height: 1.3;
            padding-left: 15%;
            padding-right: 15%;
            margin-bottom: 30px;
            margin-top: 30px;
        }
        
        .post-content h2 {
            font-size: 24px;
            margin: 25px 0 10px 0;
        }
        
        .post-content h3 {
            font-size: 19px;
            margin: 20px 0 10px 0;
        }
        
        .post-content p {
            margin-bottom: 19px;
        }
        
        .post-content code {
            background-color: #f0f0f0;
            padding: 2px 4px;
            font-family: 'DOS/V re. JPN24', 'Share Tech Mono', 'Courier New', monospace;
        }
        
        .dark-mode .post-content code {
            background-color: #333;
        }
        
        .post-content pre {
            background-color: #f0f0f0;
            padding: 15px;
            margin: 15px 0;
            overflow-x: auto;
        }
        
        .dark-mode .post-content pre {
            background-color: #333;
        }

        .right-column {
            font-size: 13px;
        }
        
        .archive-list {
            list-style: none;
        }
        
        .archive-item {
            margin-bottom: 15px;
            cursor: pointer;
        }
        
        .archive-item:hover {
            text-decoration: underline;
        }
        
        .archive-date {
            opacity: 0.7;
            margin-bottom: 5px;
            text-transform: uppercase;
            letter-spacing: 1px;
        }
        
        .back-button {
            display: none;
            background: none;
            border: 1px solid #333;
            color: inherit;
            padding: 8px 15px;
            font-family: inherit;
            font-size: 12px;
            cursor: pointer;
            margin-bottom: 20px;
            text-transform: uppercase;
            letter-spacing: 1px;
        }
        
        .dark-mode .back-button {
            border-color: #ccc;
        }

        .status-bar {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 4px 8px;
            font-size: 15px;
            z-index: 1000;
        }
        
        .back-button.active {
            display: inline-block;
        }
        
        /* ── Mobile / Tablet ─────────────────────────────── */
        @media (max-width: 768px) {

            /* Nav */
            .nav-bar {
                padding: 10px 0;
            }

            .nav-container {
                flex-direction: column;
                gap: 10px;
                padding: 0 12px;
            }

            .nav-name {
                font-size: 15px;
                order: -1; /* title first */
            }

            .nav-links {
                gap: 16px;
                flex-wrap: wrap;
                justify-content: center;
            }

            .nav-links a {
                font-size: 12px;
            }

            /* Theme toggle – keep it tucked in the corner without overlapping nav */
            .theme-toggle {
                position: fixed;
                top: auto;
                bottom: 12px;
                right: 12px;
                font-size: 11px;
                padding: 4px 8px;
                z-index: 1001;
            }

            /* 3-col grid → single column, sidebar goes last */
            .container {
                grid-template-columns: 1fr;
                gap: 24px;
                padding: 20px 14px;
            }

            /* Move the sidebar below the main content */
            .left-column {
                order: 2;
                position: static;
                display: grid;
                grid-template-columns: 1fr 1fr;
                gap: 20px;
            }

            .about-section {
                grid-column: 1 / -1; /* full width */
                margin-bottom: 0;
            }

            .categories {
                margin-bottom: 0;
            }

            .center-column {
                order: 1;
            }

            .right-column {
                order: 3;
            }

            /* Main title */
            .main-title {
                font-size: 22px;
                letter-spacing: 1px;
            }

            /* About page – stop image from floating awkwardly */
            #about-content img[style*="float"] {
                float: none !important;
                display: block;
                margin: 0 auto 20px auto !important;
                max-width: 180px;
            }

            /* Project items – wrap text on small screens */
            .project-item {
                flex-direction: column;
                gap: 2px;
            }

            .project-status {
                font-size: 12px;
            }

            /* Reading columns single-col */
            .reading-columns {
                grid-template-columns: 1fr;
            }

            /* Stats grid single-col */
            .stats-grid {
                grid-template-columns: 1fr 1fr;
            }
        }

        /* ── Small phones ─────────────────────────────────── */
        @media (max-width: 480px) {

            .nav-name {
                font-size: 13px;
            }

            .nav-links {
                gap: 12px;
            }

            .main-title {
                font-size: 18px;
            }

            /* Sidebar full-width stacked */
            .left-column {
                grid-template-columns: 1fr;
            }

            /* Stats single col */
            .stats-grid {
                grid-template-columns: 1fr;
            }

            /* Post content headings */
            .post-content h1 {
                padding-left: 0;
                padding-right: 0;
                font-size: 18px;
            }

            .post-content h2 {
                font-size: 18px;
            }
        }
        
        .home-content {
            text-align: justify;
            line-height: 1.8;
        }
        
        .home-content p {
            margin-bottom: 20px;
        }
        
        #pet {
            width: 64px;
            height: 64px;
            position: fixed;
            z-index: 1000;
            cursor: url(cursors/drag.cur), auto;
            user-select: none;
            transition: none;
        }

        #pet:active {
            cursor: grabbing;
        }

        #pet img {
            width: 100%;
            height: 100%;
            image-rendering: pixelated;
        }

        /* pet and bookshelf small-phone tweaks */
        @media (max-width: 480px) {
            #pet {
                width: 48px;
                height: 48px;
            }

            .book-spine {
                width: 20px;
                height: 100px;
            }

            .book-title {
                font-size: 8px;
            }
        }

                body {
            cursor: url('cursors/default.cur'), auto;
        }

        a:hover {
            cursor: url('cursors/link.cur'), auto;
            text-decoration: underline;
        }
        
        button:hover {
            cursor: url('cursors/link.cur'), auto;
        }

        .category-item {
            cursor: url('cursors/link.cur'), auto;
        }
        
        .post-title:hover {
            cursor: url('cursors/link.cur'), auto;
        }

        .archive-list ul:hover {
            cursor: url('cursors/link.cur'), auto;
        }

        p:hover {
            cursor: url('cursors/text-select.cur'), auto;
        }

        .disabled:hover {
            cursor: url('cursors/disabled.cur'), auto;
        }

        img:hover {
            cursor: url('cursors/info.cur'), auto;
        }
        
        /* Bookshelf Styles */
        .bookshelf-section {
            display: flex;
            align-items: flex-start;
            gap: 20px;
            margin: 20px 0;
        }

        .shelf-container {
            border: 1px solid #333;
            padding: 2px;
            display: inline-block;
            background-color: transparent;
        }

        .bookshelf {
            display: flex;
            align-items: flex-end;
            gap: 2px;
            padding: 2px;
        }

        .book {
            position: relative;
            cursor: pointer;
            transition: none;
        }

        .book:hover {
            transform: rotate(-1deg);
        }

        .book:nth-child(2n) {
            transform: rotate(1deg);
        }

        .book:nth-child(2n):hover {
            transform: rotate(2deg);
        }

        .book:nth-child(3n) {
            transform: rotate(-1deg);
        }

        .book:nth-child(3n):hover {
            transform: rotate(-2deg);
        }

        .book-spine {
            width: 28px;
            height: 170px;
            border: 1px solid #333;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }

        .book-title {
            writing-mode: vertical-rl;
            text-orientation: mixed;
            font-size: 14px;
            color: #333;
            font-weight: normal;
        }

        .dark-mode .book-title {
            writing-mode: vertical-rl;
            text-orientation: mixed;
            font-size: 14px;
            color: #e0e0e0;
            font-weight: normal;
        }

        .book-content {
            position: absolute;
            top: 120%;
            left: 50%;
            transform: translateX(-50%);
            background-color: #eee;
            border: 1px solid #333;
            padding: 3px;
            width: fit-content;
            height: fit-content;
            display: none;
            z-index: 100;
            margin-top: 5px;
        }

        .dark-mode .book-content {
            position: absolute;
            top: 120%;
            left: 50%;
            transform: translateX(-50%);
            background-color: #333;
            border: 1px solid #eee;
            padding: 8px;
            width: fit-content;
            height: fit-content;
            display: none;
            z-index: 100;
            margin-top: 5px;
        }

        .book-content.show {
            display: block;
        }

        .book-content h4 {
            margin: 0 0 8px 0;
            font-size: 12px;
            font-weight: normal;
        }

        .content-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1px;
        }

        .content-item {
            width: 45px;
            height: 45px;
            border: 1px solid #333;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            text-align: center;
        }

        @media (max-width: 768px) {
            .bookshelf-section {
                flex-direction: column;
            }
            
            .content-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            
            .book-content {
                width: 140px;
                /* prevent overflow off screen edges */
                left: 0;
                transform: none;
            }
        }

        .basic-info {
        margin-bottom: 15px;
        color: #666;
        font-size: 13px;
        }

        .interests-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        }

        .interest-tag {
        font-size: 11px;
        color: #555;
        text-decoration: underline;
        }

        .section {
        margin-bottom: 25px;
        }

        .section-header {
        font-size: 16px;
        margin-bottom: 10px;
        text-decoration: underline;
        color: #333;
        text-transform: lowercase;
        }

        .section-content {
        color: #555;
        text-align: justify;
        }

        .stats-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
        margin: 25px 0;
        }

        .stat-box {
        text-align: center;
        padding: 15px;
        border: 1px solid #333;
        }

        .stat-number {
        font-size: 20px;
        color: #333;
        margin-bottom: 5px;
        }

        .stat-label {
        font-size: 11px;
        color: #666;
        text-transform: lowercase;
        }

        .project-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        }

        .project-item {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid #eee;
        }

        .project-name {
        color: #333;
        }

        .project-status {
        color: #666;
        font-size: 14px;
        font-style: italic;
        }

        .reading-columns {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        }

        .reading-header {
        font-size: 13px;
        margin-bottom: 8px;
        color: #333;
        }

        .reading-list {
        font-size: 12px;
        color: #666;
        line-height: 1.6;
        }

        .contact-section {
        border-top: 1px solid #eee;
        padding-top: 20px;
        }

        .contact-info {
        font-size: 12px;
        color: #666;
        line-height: 1.6;
        }

        /* Dark mode */
        .dark-mode .profile-card {
        background: #2a2a2a;
        }

        .dark-mode .name-line,
        .dark-mode .section-header,
        .dark-mode .stat-number,
        .dark-mode .project-name,
        .dark-mode .reading-header {
        color: #eee;
        }

        .dark-mode .basic-info,
        .dark-mode .section-content,
        .dark-mode .stat-label,
        .dark-mode .project-status,
        .dark-mode .reading-list,
        .dark-mode .contact-info {
        color: #ccc;
        }

        .dark-mode .interest-tag {
        background: #444;
        color: #ccc;
        }

        .dark-mode .placeholder-img {
        background: #444;
        color: #aaa;
        }

        .dark-mode .stat-box {
        background: #2a2a2a;
        }

        .dark-mode .project-item {
        border-bottom-color: #444;
        }

        .dark-mode .contact-section {
        border-top-color: #444;
        }

        /* profile-card mobile handled in 768px block above */