/* Classic Mac OS (System 7.5.5) Black and White Theme CSS */
@import url('https://fonts.googleapis.com/css2?family=Silkscreen&display=swap');

@font-face {
  font-family: 'Sysfont';
      src: url('assets/sysfont.woff2') format('woff2'),
         url('assets/sysfont.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

/* CSS Custom Properties for Classic Mac OS B&W Theme */
:root {
    /* Classic Mac OS B&W Colors */
    --mac-black: #000000;
    --mac-white: #FFFFFF;
    
    /* Desktop Background */
    --desktop-bg: var(--mac-white);
    --desktop-pattern: 
        repeating-conic-gradient(from 0deg, var(--mac-black) 0% 25%, var(--mac-white) 25% 50%);
    
    /* Window Colors */
    --window-bg: var(--mac-white);
    --window-border: var(--mac-black);
    --window-title-lines: repeating-linear-gradient(
        0deg,
        var(--mac-white) 0px,
        var(--mac-white) 1px,
        var(--mac-black) 1px,
        var(--mac-black) 2px,
        var(--mac-white) 2px,
        var(--mac-white) 3px,
        var(--mac-black) 3px,
        var(--mac-black) 4px,
        var(--mac-white) 4px,
        var(--mac-white) 5px,
        var(--mac-black) 5px,
        var(--mac-black) 6px
    );
    --window-shadow: 2px 2px 0px var(--mac-black);
    
    /* Typography */
    --font-mac-pixel: 'Sysfont', 'Geneva', 'Helvetica', 'Arial', sans-serif;
    
    /* Transitions */
    --transition-classic: none; /* No transitions for retro feel */
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow: hidden;
    height: 100%;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
}

body {
    font-family: var(--font-mac-pixel);
    line-height: 1.2;
    color: var(--mac-black);
    background-color: var(--desktop-bg);
    background-image: var(--desktop-pattern);
    background-size: 2px 2px;
    overflow: hidden;
    cursor: default;
    min-height: 100vh;
    height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    user-select: none;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    image-rendering: pixelated;
    -webkit-overflow-scrolling: touch;
    touch-action: none;
    font-weight: bold;
}

/* Desktop Icons */
.desktop-icon {
    position: absolute;
    width: 100px;
    height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    text-align: center;
    color: var(--mac-black);
    font-size: 14px;
    font-weight: bold;
    padding: 8px;
    border: 1px solid transparent;
    background: transparent;
}

.desktop-icon:active {
    background: var(--mac-black);
    color: var(--mac-white);
}

.desktop-icon:active img {
    filter: invert(1);
}

.desktop-icon img {
    width: 52px;
    height: 52px;
    margin-bottom: 8px;
}

.spotify-icon {
    width: 56px;
    height: 56px;
}

.desktop-icon span {
    max-width: 90px;
    word-wrap: break-word;
    line-height: 1.2;
    font-weight: bold;
    background: transparent;
    padding: 0 4px;
}

.desktop-icon:hover span {
    background: var(--mac-black);
    color: var(--mac-white);
}

/* Icon Positions */
.icon-finder { top: 40px; right: 20px; }
.icon-safari { top: 160px; right: 20px; }
.icon-mail { top: 280px; right: 20px; }
.icon-itunes { top: 400px; right: 20px; }
.icon-photoshop { top: 40px; right: 130px; }
.icon-terminal { top: 160px; right: 130px; }
.icon-xcode { top: 280px; right: 130px; }
.icon-github { top: 400px; right: 130px; }
.icon-notes { top: 40px; right: 240px; }

/* Classic Mac OS Window */
.mac-window {
    position: absolute;
    background: var(--window-bg);
    border: 2px solid var(--window-border);
    box-shadow: none;
    min-width: 450px;
    min-height: 250px;
    overflow: hidden;
    z-index: 100;
}

.window-titlebar {
    background: var(--window-bg);
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border-bottom: 2px solid var(--window-border);
    cursor: move;
    user-select: none;
    position: relative;
}

.window-titlebar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 12px;
    background-image: var(--window-title-lines);
    z-index: 1;
    transform: translateY(-50%);
}

.window-controls {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 0;
    z-index: 3;
}

.window-control {
    width: 12px;
    height: 12px;
    border: 1px solid var(--mac-black);
    background: var(--mac-white);
    cursor: pointer;
    position: relative;
    z-index: 3;
    box-shadow: 0 0 0 2px var(--mac-white);
}

.window-control.close:active::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 1px;
    background: var(--mac-black);
    transform: translate(-50%, -50%) rotate(45deg);
}

.window-control.minimize,
.window-control.maximize {
    display: none; /* Not present in the reference image */
}

.window-control.close:active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 1px;
    background: var(--mac-black);
    transform: translate(-50%, -50%) rotate(-45deg);
}

.window-title {
    font-family: var(--font-mac-pixel);
    font-size: 12px;
    font-weight: bold;
    color: var(--mac-black);
    text-align: center;
    background: var(--mac-white);
    padding: 2px 6px;
    position: relative;
    z-index: 2;
    display: inline-block;
    line-height: 1.2;
}

.window-content {
    padding: 10px;
    height: calc(100% - 22px);
    overflow: auto;
}

.notes-window .window-content {
    overflow: hidden;
    padding: 0;
}

/* About Me Window */
.about-window {
    top: 100px;
    left: 100px;
    width: 520px;
    height: 320px;
}

.notes-window {
    width: 350px;
    height: 250px;
}

.notes-textarea {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    font-family: var(--font-mac-pixel);
    font-size: 12px;
    color: var(--mac-black);
    resize: none;
    padding: 0;
    margin: 0;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.notes-textarea:focus {
    outline: none;
}

.notes-textarea::-webkit-scrollbar {
    width: 16px;
    background: var(--mac-white);
    border-left: 2px solid var(--mac-black);
}

.notes-textarea::-webkit-scrollbar-track {
    background-image: repeating-conic-gradient(from 0deg, #ccc 0% 25%, var(--mac-white) 25% 50%);
    background-size: 4px 4px;
}

.notes-textarea::-webkit-scrollbar-thumb {
    background: var(--mac-white);
    border: 2px solid var(--mac-black);
    box-shadow: none;
}

.about-content {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 15px;
    height: 100%;
}

.about-right-pane {
    display: flex;
    flex-direction: column;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border: 2px solid var(--mac-black);
    box-shadow: none;
    object-fit: cover;
    border-radius: 0;
}

.profile-name {
    font-size: 18px;
    font-weight: 400;
    color: var(--mac-black);
    margin-bottom: 4px;
}

.profile-title {
    font-size: 14px;
    color: var(--mac-black);
    margin-bottom: 15px;
}

.info-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
    color: var(--mac-black);
    font-size: 12px;
    font-weight: 400;
}

.info-item:hover {
    background: var(--mac-black);
    color: var(--mac-white);
}

.info-item:active {
    box-shadow: none;
}

.info-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.info-text {
    font-size: 14px;
    font-weight: 400;
}

.info-item .info-text {
    margin-left: 34px; /* Default margin for items with icons */
}

.info-item:has(> .info-text:only-child) .info-text {
    margin-left: 0; /* No margin if there's no icon */
}

/* Menu Bar */
.menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 26px;
    background: var(--mac-white);
    border-bottom: 2px solid var(--mac-black);
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 14px;
    font-weight: bold;
    color: var(--mac-black);
    z-index: 1000;
    box-shadow: none;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.menu-bar::-webkit-scrollbar {
    display: none;
}

.menu-item {
    margin-right: 20px;
    cursor: pointer;
    font-weight: bold;
    padding: 2px 6px;
    border: 1px solid transparent;
}

.menu-item:hover {
    background: var(--mac-black);
    color: var(--mac-white);
    border: 1px solid transparent;
}

.about-menu {
    font-weight: bold;
}

.menu-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.time {
    font-size: 14px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-mac-pixel);
    font-weight: 400;
    color: var(--mac-black);
    margin-bottom: 8px;
}

h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }

p {
    color: var(--mac-black);
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.language-item {
    text-indent: 1em;
}

/* Classic Scrollbar */
::-webkit-scrollbar {
    width: 16px;
    background: var(--mac-white);
    border-left: 2px solid var(--mac-black);
}

::-webkit-scrollbar-track {
    background-image: repeating-conic-gradient(from 0deg, #ccc 0% 25%, var(--mac-white) 25% 50%);
    background-size: 4px 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--mac-white);
    border: 2px solid var(--mac-black);
    box-shadow: none;
}

::-webkit-scrollbar-thumb:hover {
    background: #e6e6e6;
}

::-webkit-scrollbar-button {
    height: 16px;
    background: var(--mac-white);
    border: 2px solid var(--mac-black);
    display: block;
}

::-webkit-scrollbar-button:vertical:start:decrement {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16'><path d='M8 4 L12 10 L4 10 Z' fill='black'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
}

::-webkit-scrollbar-button:vertical:end:increment {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16'><path d='M8 12 L12 6 L4 6 Z' fill='black'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
}

/* Remove responsive changes for fixed retro layout */
@media (max-width: 768px) {
    /* Scale entire window slightly for tablet */
    .mac-window {
        transform: scale(0.85);
        transform-origin: top left;
    }
    
    /* Mobile menu bar adjustments */
    .menu-bar {
        height: 32px;
        font-size: 16px;
        padding: 0 8px;
    }
    

    
    /* Make app icons and text larger */
    .desktop-icon {
        width: 80px;
        height: 92px;
        font-size: 14px;
        padding: 7px;
    }
    .desktop-icon img {
        width: 44px;
        height: 44px;
        margin-bottom: 7px;
    }
    
    /* Adjust icon positions for mobile - fit within viewport */
    .icon-finder { top: 45px; right: 10px; }
    .icon-safari { top: 130px; right: 10px; }
    .icon-mail { top: 215px; right: 10px; }
    .icon-itunes { top: 300px; right: 10px; }
    .icon-photoshop { top: 45px; right: 95px; }
    .icon-terminal { top: 130px; right: 95px; }
    .icon-xcode { top: 215px; right: 95px; }
    .icon-github { top: 300px; right: 95px; }
    .icon-notes { top: 45px; right: 180px; }
    
    /* Proportional close window button - smaller viewport-scaled square */
    .window-control {
        width: 1.8vw;
        height: 1.8vw;
        min-width: 6px;
        min-height: 6px;
        max-width: 10px;
        max-height: 10px;
        border-radius: 0;
        border-width: 1px;
    }
    .window-control.close:active::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 6px;
        height: 1px;
        background: var(--mac-black);
        transform: translate(-50%, -50%) rotate(45deg);
    }
    .window-titlebar {
        height: 2em;
        font-size: 1em;
    }
    /* App icon and menu bar active/click effect - square */
    .desktop-icon:active, .desktop-icon.active {
        background: var(--mac-black);
        color: var(--mac-white);
        border-radius: 0;
    }
    .desktop-icon:active img, .desktop-icon.active img {
        filter: invert(1);
    }
    .desktop-icon:active span, .desktop-icon.active span {
        color: var(--mac-white);
    }
    .menu-item:active, .menu-item.active {
        background: var(--mac-black);
        color: var(--mac-white);
        border-radius: 0;
    }
    .spotify-icon {
        width: 48px;
        height: 48px;
    }
    /* Stack avatar on top in About window */
    .about-content {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto !important;
    }
    .about-left-pane {
        display: flex;
        justify-content: center;
        margin-bottom: 8px;
    }
    
    /* Enable scrolling for About window on mobile */
    .about-window .window-content {
        overflow-y: auto;
        scroll-behavior: smooth;
    }
}

@media (max-width: 480px) {
    /* Scale entire window more for small mobile */
    .mac-window {
        transform: scale(0.75);
        transform-origin: top left;
    }
    
    /* Small mobile adjustments */
    .menu-bar {
        height: 36px;
        font-size: 18px;
    }
    

    
    /* Make app icons and text larger for small mobile */
    .desktop-icon {
        width: 70px;
        height: 80px;
        font-size: 13px;
        padding: 6px;
    }
    .desktop-icon img {
        width: 38px;
        height: 38px;
        margin-bottom: 6px;
    }
    
    /* Even smaller close window button for small mobile - smaller viewport-scaled square */
    .window-control {
        width: 2vw;
        height: 2vw;
        min-width: 5px;
        min-height: 5px;
        max-width: 8px;
        max-height: 8px;
        border-radius: 0;
        border-width: 1px;
    }
    .window-control.close:active::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 6px;
        height: 1px;
        background: var(--mac-black);
        transform: translate(-50%, -50%) rotate(45deg);
    }
    .window-control.close:active::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 6px;
        height: 1px;
        background: var(--mac-black);
        transform: translate(-50%, -50%) rotate(-45deg);
    }
    .window-titlebar {
        height: 1.7em;
        font-size: 0.95em;
    }
    /* App icon and menu bar active/click effect - square */
    .desktop-icon:active, .desktop-icon.active {
        border-radius: 0;
    }
    .menu-item:active, .menu-item.active {
        border-radius: 0;
    }
    .spotify-icon {
        width: 40px;
        height: 40px;
    }
    /* Constrain window width for small mobile */
    .mac-window {
        width: 85vw !important;
        min-width: 0 !important;
        max-width: 90vw;
    }
    .window-content {
        max-height: 70vh;
    }
    .profile-avatar {
        width: 100%;
        height: auto;
    }
    /* same stacking rules */
    .about-content {
        grid-template-columns: 1fr !important;
    }
    .about-left-pane {
        margin-bottom: 6px;
    }
}

/* Extra small mobile devices */
@media (max-width: 360px) {
    /* Scale entire window even more for extra-small devices */
    .mac-window {
        transform: scale(0.65);
        transform-origin: top left;
    }
    
    .desktop-icon {
        width: 50px;
        height: 60px;
        font-size: 10px;
        padding: 2px;
    }
    
    .desktop-icon img {
        width: 28px;
        height: 28px;
        margin-bottom: 2px;
    }
    
    /* Even more compact positioning */
    .icon-finder { top: 45px; right: 5px; }
    .icon-safari { top: 110px; right: 5px; }
    .icon-mail { top: 175px; right: 5px; }
    .icon-itunes { top: 240px; right: 5px; }
    .icon-photoshop { top: 45px; right: 60px; }
    .icon-terminal { top: 110px; right: 60px; }
    .icon-xcode { top: 175px; right: 60px; }
    .icon-github { top: 240px; right: 60px; }
    .icon-notes { top: 45px; right: 115px; }
    
    .watermark {
        font-size: 10px;
        padding: 4px 6px;
        bottom: 8px;
        right: 8px ;
    }
    

    .spotify-icon {
        width: 30px;
        height: 30px;
    }
    /* Constrain window width for extra-small mobile */
    .mac-window {
        width: 90vw !important;
        min-width: 0 !important;
        max-width: 95vw;
    }
    .profile-avatar {
        width: 100%;
        height: auto;
    }
    /* same stacking */
    .about-content {
        grid-template-columns: 1fr !important;
    }
    .about-left-pane {
        margin-bottom: 5px;
    }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    /* Adjust window controls positioning for mobile */
    .window-controls {
        left: 15px;
    }
    
    /* Mobile devices with touch - close button sized to match 6-line pattern with invisible touch area */
    .window-control {
        width: 10px !important;
        height: 10px !important;
        border: 1px solid var(--mac-black) !important;
        border-radius: 0 !important;
        background: var(--mac-white) !important;
        box-shadow: 0 0 0 1px var(--mac-white) !important;
        padding: 6px !important;
        margin: -6px !important;
        position: relative !important;
        min-width: auto !important;
        min-height: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .window-control::after {
        content: '';
        position: absolute;
        top: -6px;
        left: -6px;
        right: -6px;
        bottom: -6px;
        background: transparent;
        border-radius: 0;
    }
    
    .window-control.close:active::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 6px;
        height: 1px;
        background: var(--mac-black);
        transform: translate(-50%, -50%) rotate(45deg);
    }
    
    .window-control.close:active::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 6px;
        height: 1px;
        background: var(--mac-black);
        transform: translate(-50%, -50%) rotate(-45deg);
    }
    
    /* Increase touch targets */
    .desktop-icon {
        min-height: 44px;
        padding: 8px;
    }
    
    .menu-item {
        min-height: 44px;
        display: flex;
        align-items: center;
        -webkit-tap-highlight-color: transparent !important;
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        outline: none !important;
        border: 1px solid transparent !important;
        background: transparent !important;
    }
    
    .info-item {
        min-height: 44px;
        display: flex;
        align-items: center;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Completely disable hover effects and default styles on touch devices */
    .desktop-icon:hover span {
        background: transparent !important;
        color: var(--mac-black) !important;
    }
    
    .menu-item:hover {
        background: transparent !important;
        color: var(--mac-black) !important;
        border: 1px solid transparent !important;
        outline: none !important;
    }
    
    .menu-item:focus {
        background: transparent !important;
        color: var(--mac-black) !important;
        border: 1px solid transparent !important;
        outline: none !important;
    }
    
    .menu-item:active:not(.active) {
        background: transparent !important;
        color: var(--mac-black) !important;
        border: 1px solid transparent !important;
    }
    
    .info-item:hover {
        background: transparent;
        color: var(--mac-black);
    }
    
    /* Ensure only our custom black rectangle shows */
    .menu-item.active {
        background: var(--mac-black) !important;
        color: var(--mac-white) !important;
        border: 1px solid transparent !important;
        border-radius: 0 !important;
        outline: none !important;
    }
}

a:focus,
button:focus,
.classic-button:focus,
.desktop-icon:focus,
.info-item:focus {
    outline: 2px dotted var(--mac-black);
    outline-offset: 2px;
}

::selection {
    background-color: var(--mac-black);
    color: var(--mac-white);
}

body {
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

a, button, .classic-button, .desktop-icon, .info-item {
    transition: none;
}

/* Notes Window */
.notes-window {
    width: 350px;
    height: 250px;
}

.notes-textarea {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    font-family: var(--font-mac-pixel);
    font-size: 12px;
    color: var(--mac-black);
    resize: none;
    padding: 0;
    margin: 0;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.notes-textarea:focus {
    outline: none;
}

.x-icon {
    width: 52px;
    height: 52px;
    object-fit: scale-down;
    background: transparent;
}

/* Watermark */
.watermark {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-family: var(--font-mac-pixel);
    font-size: 14px;
    color: var(--mac-black);
    background: var(--mac-white);
    padding: 8px 12px;
    border: 1px solid var(--mac-black);
    z-index: 1;
    pointer-events: none;
    user-select: none;
}

/* Pokémon Window */
.pokemon-window {
    width: 400px;
    height: 300px;
}

.pokemon-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 10px;
}

.pokemon-gif {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Mobile notes window */
.notes-window {
    width: 280px;
    height: 180px;
}

.notes-textarea {
    font-size: 14px;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
    -webkit-tap-highlight-color: transparent;
}

/* Mobile Pokémon window */
.pokemon-window {
    width: 320px;
    height: 240px;
}

.pokemon-gif {
    max-width: 100%;
    max-height: 100%;
}

/* Universal: ensure .active class works for JS click/tap feedback */
.desktop-icon.active, .menu-item.active {
    background: var(--mac-black) !important;
    color: var(--mac-white) !important;
}
.desktop-icon.active img {
    filter: invert(1);
}
.desktop-icon.active span {
    color: var(--mac-white) !important;
}
.menu-item.active {
    color: var(--mac-white) !important;
} 