@font-face {
  font-family: "W95FA"; /* A name you choose to reference the font */
  src: url("/nostalgia/w95fa.woff2") format("woff2"), /* Primary font file */
       url("/nostalgia/w95fa.woff") format("woff");  /* Fallback font file */
       font-display: swap;
}
/* Modern Organization via CSS Layers */
@layer reset, base, layout, components;

@layer reset {
  * {
    box-sizing: border-box;
  }

::-webkit-scrollbar {
  width: 16px;
  height: 16px;
  background: #ccc;
}

::-webkit-scrollbar-track {
  background-color: var(--pink-light);
  border-top: 2px solid var(--pink-dark);
  border-left: 2px solid var(--pink-dark);
  border-right: 2px solid var(--pink-bright);
  border-bottom: 2px solid var(--pink-bright);
  background: repeating-conic-gradient(var(--pink-light) 0deg, var(--pink-light) 90deg, var(--pink-dark) 90deg, var(--pink-dark) 180deg);
  background-size: 4px 4px;
}

::-webkit-scrollbar-thumb {
    background-color: var(--yellow-light);
    border-top: 2px solid var(--yellow-bright);
    border-left: 2px solid var(--yellow-bright);
    border-right: 2px solid var(--yellow-dark);
    border-bottom: 2px solid var(--yellow-dark);
}


::-webkit-scrollbar-button {
    background-color: var(--yellow-light);
    border-top: 2px solid var(--yellow-bright);
    border-left: 2px solid var(--yellow-bright);
    border-right: 2px solid var(--yellow-dark);
    border-bottom: 2px solid var(--yellow-dark);
  background-size: 8px;
  background-repeat: no-repeat;
}
::-webkit-scrollbar-button:single-button:vertical:decrement {
  height: 16px;
  width: 16px;
  background-position: center 4px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23c96'><polygon points='50,00 0,50 100,50'/></svg>");
}
::-webkit-scrollbar-button:single-button:vertical:increment {
  height: 16px;
  width: 16px;
  background-position: center 4px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23c96'><polygon points='0,0 100,0 50,50'/></svg>");
}
:root{height: 100svh}

  body {
    margin: 0;
    padding: clamp(0px, calc((100vw - 762px) / 2), 38px);
    background-color: #6cc;
    background-image: linear-gradient(#9ff 2px, transparent 2px), linear-gradient(90deg, #9ff 2px, transparent 2px);
    background-size: 40px 40px;
    background-position: calc(50% - 1px) -2px;
    font-family: W95FA;
    height: 100%;
  }
  img{
    image-rendering: pixelated;
  }
}

@layer base {
  :root {
    --pink-bright: #fff;
    --pink-light: #fcc;
    --pink-dark: #f99;
    
    --yellow-bright: #ff9;
    --yellow-light: #fc6;
    --yellow-dark: #c96;
    
    --aqua-bright: #9ff;
    --aqua-light: #6fc;
    --aqua-dark: #6c9;
  }

  h1 {
    color: #fff;
    text-shadow: 2px 2px var(--pink-dark);
    text-align: center;
  }
  h2, h3 {
    color: #00f;
    text-shadow: 2px 2px var(--pink-dark);
    text-align: center;
  }
}

@layer layout {
  body{
    display: flex;
    gap: 40px;
  }
  .main-wrapper {
    width: min(100%, 762px);
    margin: 0 auto;
    background-color: var(--pink-light);
    border: 6px double var(--pink-dark);
    display: grid;
    grid-template-rows: max-content max-content 1fr max-content;
    height: 100%;
    min-height: 400px;
    overflow: clip;
    isolation: isolate;
  }
  
  .window-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 22px;
    line-height: 16px;
    background-color: var(--pink-dark);
    grid-column: 1 / -1;
    font-size: 12px;
  }
  
  .main-area{
    display: flex;
    box-sizing: content-box;
    transition:margin-left .3s;
    flex-grow: 1;
    overflow: hidden;
  }
  .tray-toggle {
    display: none;
    position: absolute;
    right: 0;
    top: 16px;
    width: 22px;
    height: 24px;
    background: var(--yellow-light);
    color: var(--bg);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid var(--yellow-dark);
    border-top: 2px solid var(--yellow-bright);
    border-left: none;
    z-index: 99;
    transition: right .3s;
		& > svg{
			transform: rotate(-90deg);
			transition: transform .3s;
		}
	}



  .sidebar {
    vertical-align: top;
    padding: 8px;
    background: repeating-conic-gradient(var(--pink-light) 0deg, var(--pink-light) 90deg, var(--pink-dark) 90deg, var(--pink-dark) 180deg);
    background-size: 8px 8px;
    transition: transform .3s;
    z-index: 100;
    border-right: 2px solid var(--pink-dark);
  }

  .content {
    vertical-align: top;
    padding: 16px;
    background-color: #fff;
    overflow-y: scroll;
    overflow-x: clip;
    min-height: 0;
    flex: 1;
  }
  .footer{
    grid-column: 1 / -1;
    border-top: 2px solid var(--pink-dark);
  }
  @media(max-width: 768px){
    body{
      flex-direction:column;
    }
    .main-area{
      margin-left: -124px;
    }
    .sidebar.active{
      transform: translateX(124px);
    }
    .tray-toggle{
    right: -24px;
    display: flex;
    }
    .sidebar.active .tray-toggle{
  		& > svg{
  			transform: rotate(90deg);
  			transition: transform .3s;
  		}
    }
  }
}

@layer components {
  /* Beveled "Button" Look */
.btn-retro {
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
    font-weight: bold;
    color: #000;
    background-color: var(--yellow-light);
    border-top: 2px solid var(--yellow-bright);
    border-left: 2px solid var(--yellow-bright);
    border-right: 2px solid var(--yellow-dark);
    border-bottom: 2px solid var(--yellow-dark);
    &:hover{
      background-color: var(--yellow-bright);
    }
  }
.btn-window{
    display: inline-block;
    padding: 4px 6px;
    margin: 2px;
    line-height: 4px;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    color: #000;
    background-color: var(--pink-light);
    border-top: 2px solid var(--pink-bright);
    border-left: 2px solid var(--pink-bright);
    border-right: 2px solid var(--pink-dark);
    border-bottom: 2px solid var(--pink-dark);
}

  .marquee-box {
    border: 2px inset #f9c;
    padding: 4px;
    background: #000;
    color: #0f0; /* Matrix-style green text */
    /*font-family: monospace;*/
  }
          .window {
            position: absolute;
            width: 300px;
            height: 200px;
            min-width: 150px;
            min-height: 100px;
            box-shadow: 0 10px 25px rgba(0,0,0,0.1);
            touch-action: none;
            user-select: none;
            display: flex;
            flex-direction: column;
            
    background-color: var(--pink-light);
    border: 6px double var(--pink-dark);
    overflow: clip;
    isolation: isolate;
        }

        .window-header {
            cursor: move;
            display: flex;
            justify-content: space-between;
            align-items: center;
            color: #333;
            height: 22px;
            line-height: 16px;
            background-color: var(--pink-dark);
            grid-column: 1 / -1;
            font-size: 12px;
        }

        .window-content {
            padding: 15px;
            flex: 1;
            overflow: auto;
            background-color: var(--pink-bright);
            color: var(--pink-dark);
            line-height: 1.5;
        }

        .window.dragging {
            opacity: 0.9;
            box-shadow: 0 15px 35px rgba(0,0,0,0.15);
            transform: scale(1.02);
            transition: transform 0.1s ease;
        }

        .window.resizing {
            border-color: #3b82f6;
        }

        .status-bar {
            position: fixed;
            bottom: 20px;
            left: 20px;
            background: rgba(0,0,0,0.8);
            color: white;
            padding: 8px 15px;
            border-radius: 20px;
            font-size: 12px;
            pointer-events: none;
        }
}