/* style.css - Chunky Pixel-Perfect Apple Macintosh System 1 (1984) Stylesheet */

/* --- Authentic Minecraft Font with Complete French Accents (Monocraft Local) --- */
@font-face {
  font-family: 'Minecraft';
  src: url('./fonts/Monocraft.otf') format('opentype'),
       url('./fonts/Monocraft.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Minecraft';
  src: url('./fonts/Monocraft.otf') format('opentype'),
       url('./fonts/Monocraft.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@500;600;700&family=Silkscreen:wght@400;700&family=VT323&display=swap');

/* --- CSS Variables & Theme Palettes --- */
:root {
  --sys-black: #000000;
  --sys-white: #ffffff;
  --sys-gray: #666666;
  --sys-border: #000000;
  --sys-text: #000000;
  --sys-bg: #ffffff;
  --desktop-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2'%3E%3Crect width='1' height='1' fill='%23000'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23000'/%3E%3Crect x='1' y='0' width='1' height='1' fill='%23fff'/%3E%3Crect x='0' y='1' width='1' height='1' fill='%23fff'/%3E%3C/svg%3E");
  --font-system: 'Minecraft', 'Pixelify Sans', 'Chicago', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-pixel: 'Minecraft', 'Pixelify Sans', 'Silkscreen', monospace;
  --font-mono: 'Minecraft', 'VT323', Monaco, 'Courier New', monospace;
  --chassis-bg: #dcd3be;
  --chassis-shadow: #b5a990;
  --scale-font: 16px;
  --scale-menu: 34px;
}

[data-scale="large"] {
  --scale-font: 18px;
  --scale-menu: 38px;
}
[data-scale="large"] .desktop-icon .icon-img-wrap {
  width: 62px;
  height: 62px;
}
[data-scale="large"] .desktop-icon .icon-img-wrap svg {
  width: 58px;
  height: 58px;
}
[data-scale="large"] .desktop-icon .icon-label {
  font-size: 17px;
  max-width: 125px;
}
[data-scale="large"] .window-title {
  font-size: 18px;
}
[data-scale="large"] .sys-btn {
  font-size: 16px;
  padding: 5px 14px;
}

[data-scale="xlarge"] {
  --scale-font: 20px;
  --scale-menu: 44px;
}
[data-scale="xlarge"] .desktop-icon .icon-img-wrap {
  width: 72px;
  height: 72px;
}
[data-scale="xlarge"] .desktop-icon .icon-img-wrap svg {
  width: 66px;
  height: 66px;
}
[data-scale="xlarge"] .desktop-icon .icon-label {
  font-size: 19px;
  max-width: 145px;
}
[data-scale="xlarge"] .window-title {
  font-size: 20px;
}
[data-scale="xlarge"] .sys-btn {
  font-size: 18px;
  padding: 6px 18px;
}

[data-theme="platinum"] {
  --sys-black: #111111;
  --sys-white: #eaeef2;
  --sys-gray: #778899;
  --sys-border: #111111;
  --sys-text: #111111;
  --sys-bg: #eaeef2;
  --desktop-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2'%3E%3Crect width='1' height='1' fill='%23607080'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23607080'/%3E%3Crect x='1' y='0' width='1' height='1' fill='%23d8e2ec'/%3E%3Crect x='0' y='1' width='1' height='1' fill='%23d8e2ec'/%3E%3C/svg%3E");
}

[data-theme="dark"] {
  --sys-black: #ffffff;
  --sys-white: #0c0c0c;
  --sys-gray: #888888;
  --sys-border: #ffffff;
  --sys-text: #ffffff;
  --sys-bg: #0c0c0c;
  --desktop-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2'%3E%3Crect width='1' height='1' fill='%23111'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23111'/%3E%3Crect x='1' y='0' width='1' height='1' fill='%23383838'/%3E%3Crect x='0' y='1' width='1' height='1' fill='%23383838'/%3E%3C/svg%3E");
}

[data-theme="green"] {
  --sys-black: #33ff33;
  --sys-white: #041404;
  --sys-gray: #1b661b;
  --sys-border: #33ff33;
  --sys-text: #33ff33;
  --sys-bg: #041404;
  --desktop-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2'%3E%3Crect width='1' height='1' fill='%23082608'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23082608'/%3E%3Crect x='1' y='0' width='1' height='1' fill='%23020b02'/%3E%3Crect x='0' y='1' width='1' height='1' fill='%23020b02'/%3E%3C/svg%3E");
}

[data-theme="amber"] {
  --sys-black: #ffb000;
  --sys-white: #160a00;
  --sys-gray: #884d00;
  --sys-border: #ffb000;
  --sys-text: #ffb000;
  --sys-bg: #160a00;
  --desktop-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2'%3E%3Crect width='1' height='1' fill='%23381a00'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23381a00'/%3E%3Crect x='1' y='0' width='1' height='1' fill='%23120600'/%3E%3Crect x='0' y='1' width='1' height='1' fill='%23120600'/%3E%3C/svg%3E");
}

/* --- Base Reset & Crisp Typography --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

/* Clear antialiasing for text readability */
body, input, textarea, button, select {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Apply pixelated rendering ONLY to icons & graphics */
.pixel-icon, canvas, .desktop-pattern, .mac-size-box, #selection-marquee, .proj-render-img {
  image-rendering: pixelated;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-system);
  font-size: var(--scale-font);
  line-height: 1.5;
  color: var(--sys-text);
  background-color: #000;
  letter-spacing: 0.2px;
}

/* --- Screen Shell & Chassis Wrapper --- */
#screen-shell {
  width: 100vw;
  height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--sys-white);
  overflow: hidden;
}

/* Vintage Macintosh 128K Chassis Mode */
body.mac-chassis-mode {
  background-color: #1e1b18;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.mac-chassis-mode #screen-shell {
  width: 980px;
  height: 720px;
  max-width: 96vw;
  max-height: 94vh;
  border: 30px solid var(--chassis-bg);
  border-bottom-width: 76px;
  border-radius: 16px;
  box-shadow: 
    inset 0 0 25px rgba(0,0,0,0.65),
    0 15px 50px rgba(0,0,0,0.85),
    0 0 0 3px var(--chassis-shadow);
}

body.mac-chassis-mode #screen-shell::after {
  content: '';
  position: absolute;
  bottom: -56px;
  right: 60px;
  width: 180px;
  height: 10px;
  background: #111;
  border-radius: 2px;
  box-shadow: inset 0 2px 3px #000;
  z-index: 9999;
}

/* --- Top Menu Bar (Chunky & Legible 34px) --- */
#menu-bar {
  height: var(--scale-menu);
  background-color: var(--sys-white);
  border-bottom: 2px solid var(--sys-black);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  position: relative;
  z-index: 10000;
  font-size: var(--scale-font);
}

.menu-items-left {
  display: flex;
  align-items: center;
  height: 100%;
}

.menu-items-right {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 10px;
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: bold;
}

.menu-sound-pill {
  cursor: pointer;
  padding: 3px 8px;
  font-size: 18px;
}

.menu-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.menu-title {
  padding: 3px 14px;
  cursor: default;
  height: 100%;
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 16px;
}

.menu-title.apple-logo {
  padding: 3px 12px;
  font-size: 20px;
}

.menu-item.active .menu-title {
  background-color: var(--sys-black);
  color: var(--sys-white);
}

.menu-item.active .menu-title svg {
  fill: var(--sys-white) !important;
}

/* Dropdown Menus */
.menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--sys-white);
  border: 2px solid var(--sys-black);
  box-shadow: 4px 4px 0px var(--sys-black);
  min-width: 240px;
  padding: 4px 0;
  z-index: 10001;
}

.menu-item.active .menu-dropdown {
  display: block;
}

.dropdown-item {
  padding: 6px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: default;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 600;
}

.dropdown-item:hover {
  background-color: var(--sys-black);
  color: var(--sys-white);
}

.dropdown-item.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.dropdown-shortcut {
  margin-left: 24px;
  font-family: var(--font-mono);
  font-size: 16px;
}

.dropdown-divider {
  height: 2px;
  background-color: var(--sys-black);
  margin: 5px 0;
}

/* --- Desktop Workspace --- */
#desktop {
  flex: 1;
  position: relative;
  background-image: var(--desktop-pattern);
  background-repeat: repeat;
  overflow: hidden;
  cursor: default;
}

#desktop-icons {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Desktop Icons (Generous & Legible) */
.desktop-icon {
  position: absolute;
  width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: default;
  pointer-events: auto;
  padding: 6px;
}

.icon-img-wrap {
  width: 54px;
  height: 54px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-img-wrap svg {
  width: 50px;
  height: 50px;
}

.icon-label {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  padding: 3px 6px;
  background-color: var(--sys-white);
  border: 2px solid var(--sys-black);
  color: var(--sys-black);
  max-width: 104px;
  word-wrap: break-word;
  border-radius: 2px;
}

/* Selected Desktop Icon */
.desktop-icon.selected .icon-img-wrap {
  filter: invert(1);
}

.desktop-icon.selected .icon-label {
  background-color: var(--sys-black);
  color: var(--sys-white);
  border-color: var(--sys-white);
}

/* Trash Hover Effect */
.desktop-icon.trash-hover .icon-img-wrap {
  transform: scale(1.2);
}

/* Selection Marquee Box */
#selection-marquee {
  display: none;
  position: absolute;
  border: 2px dashed var(--sys-black);
  background-color: rgba(255, 255, 255, 0.25);
  pointer-events: none;
  z-index: 9000;
}

/* --- Macintosh Windows --- */
#windows-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.mac-window {
  position: absolute;
  background-color: var(--sys-white);
  border: 2px solid var(--sys-black);
  box-shadow: 4px 4px 0px var(--sys-black);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  overflow: hidden;
}

/* Window Title Bar (30px) */
.mac-titlebar {
  height: 30px;
  background-color: var(--sys-white);
  border-bottom: 2px solid var(--sys-black);
  display: flex;
  align-items: center;
  padding: 0 8px;
  cursor: default;
  position: relative;
}

.mac-close-box {
  width: 16px;
  height: 16px;
  border: 2px solid var(--sys-black);
  background-color: var(--sys-white);
  cursor: default;
  margin-right: 10px;
  position: relative;
  flex-shrink: 0;
}

.mac-window:not(.active) .mac-close-box {
  border-color: transparent;
  background-color: transparent;
}

.mac-close-box.pressed {
  background-color: var(--sys-black);
}

.mac-pinstripes {
  flex: 1;
  height: 14px;
  margin: 0 8px;
}

/* 6 Bold Pinstripes in Active Title Bar */
.mac-window.active .mac-pinstripes {
  background: repeating-linear-gradient(
    to bottom,
    var(--sys-black) 0px,
    var(--sys-black) 2px,
    transparent 2px,
    transparent 4px
  );
}

.mac-title-text {
  font-weight: 700;
  font-size: 16px;
  padding: 0 10px;
  background-color: var(--sys-white);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 72%;
  flex-shrink: 0;
}

/* Inactive Window Dimming */
.mac-window:not(.active) .mac-title-text {
  color: var(--sys-gray);
}

/* Window Content Container */
.mac-window-content {
  flex: 1;
  background-color: var(--sys-white);
  color: var(--sys-black);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px;
  position: relative;
  font-size: 15px;
  line-height: 1.6;
}

/* Resizing Size Box (Bottom-Right) */
.mac-size-box {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 22px;
  height: 22px;
  cursor: nwse-resize;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Crect x='4' y='4' width='14' height='14' fill='none' stroke='%23000' stroke-width='2'/%3E%3Crect x='9' y='9' width='9' height='9' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  z-index: 10;
}

/* --- Retro System 1 UI Elements --- */
.sys-btn {
  font-family: var(--font-system);
  font-size: 15px;
  font-weight: 700;
  background-color: var(--sys-white);
  color: var(--sys-black);
  border: 2px solid var(--sys-black);
  padding: 6px 16px;
  cursor: default;
  border-radius: 3px;
  box-shadow: 2px 2px 0px var(--sys-black);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sys-btn:active {
  background-color: var(--sys-black);
  color: var(--sys-white);
  box-shadow: none;
  transform: translate(2px, 2px);
}

/* Steve Jobs Default Double-Bordered Button */
.sys-btn-default, .sys-btn-primary {
  border: 3px solid var(--sys-black);
  outline: 2px solid var(--sys-black);
  outline-offset: 1px;
  border-radius: 4px;
}

/* Checkbox & Radio */
.sys-checkbox, .sys-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
}

.sys-checkbox input, .sys-radio input {
  accent-color: var(--sys-black);
  transform: scale(1.3);
}

.sys-slider {
  accent-color: var(--sys-black);
  height: 6px;
}

/* --- Project Window Layout --- */
.project-window-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.proj-header-card {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 2px solid var(--sys-black);
  padding-bottom: 12px;
}

.proj-header-icon svg {
  width: 56px;
  height: 56px;
}

.proj-title-bar {
  font-size: 20px;
  font-weight: 700;
}

.proj-sub {
  font-size: 14px;
  color: var(--sys-gray);
  font-weight: 600;
}

.proj-status-badge {
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
}

.proj-summary-box {
  background-color: var(--sys-white);
  border: 2px solid var(--sys-black);
  padding: 12px;
  font-weight: 600;
  line-height: 1.6;
  font-size: 15px;
}

.proj-image-box {
  border: 2px solid var(--sys-black);
  padding: 8px;
  background-color: #000;
  text-align: center;
}

.proj-image-label {
  color: #fff;
  font-size: 14px;
  margin-bottom: 6px;
  font-family: var(--font-mono);
}

.proj-render-img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid #444;
}

.proj-section-heading {
  font-weight: 700;
  font-size: 16px;
  border-bottom: 2px dashed var(--sys-black);
  padding-bottom: 4px;
  margin-bottom: 10px;
}

.tech-pills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-pill {
  font-size: 13px;
  font-weight: 700;
  border: 2px solid var(--sys-black);
  padding: 3px 10px;
  background-color: var(--sys-white);
  border-radius: 2px;
}

.proj-desc-text {
  font-size: 15px;
  line-height: 1.65;
}

.proj-footer-bar {
  display: flex;
  gap: 12px;
  border-top: 2px solid var(--sys-black);
  padding-top: 12px;
}

/* --- Real Terminal Mirroring Component --- */
.real-terminal-app {
  border: 2px solid var(--sys-black);
  background-color: #0c0d0e;
  color: #f0f0f0;
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  box-shadow: 3px 3px 0px var(--sys-black);
}

.real-term-header {
  background-color: #1a1c20;
  padding: 8px 12px;
  border-bottom: 2px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.real-term-title {
  font-family: var(--font-pixel);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.term-clear-btn {
  padding: 3px 10px;
  font-size: 13px;
}

.term-presets-bar {
  background-color: #15161a;
  border-bottom: 1px solid #282a30;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.term-presets-label {
  font-size: 13px;
  color: #bbb;
  font-family: var(--font-pixel);
}

.term-presets-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.term-preset-btn {
  font-size: 13px;
  padding: 4px 12px;
  background-color: #222;
  color: #fff;
  border-color: #555;
  cursor: pointer;
}

.term-preset-btn:hover {
  background-color: #fff;
  color: #000;
}

.real-term-output {
  height: 230px;
  overflow-y: auto;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 19px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background-color: #050608;
}

.term-line-cmd { color: #33ff33; font-weight: bold; }
.term-line-out { color: #e6e6e6; white-space: pre-wrap; word-break: break-all; }
.term-line-err { color: #ff5555; white-space: pre-wrap; font-weight: bold; }
.term-line-sys { color: #8899aa; font-style: italic; font-size: 16px; }
.term-line-info { color: #ffff44; }

.real-term-input-row {
  display: flex;
  align-items: center;
  background-color: #111317;
  border-top: 2px solid #222;
  padding: 6px 10px;
  gap: 10px;
}

.term-prompt {
  font-family: var(--font-mono);
  font-size: 19px;
  color: #33ff33;
  font-weight: bold;
}

.real-term-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 19px;
}

.term-run-btn {
  padding: 4px 14px;
  font-size: 14px;
}

/* --- Folder Windows --- */
.folder-header-stats {
  display: flex;
  justify-content: space-around;
  border-bottom: 2px solid var(--sys-black);
  padding: 8px 0;
  font-size: 16px;
  font-family: var(--font-mono);
  font-weight: bold;
  margin-bottom: 12px;
}

.folder-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 20px;
  padding: 8px;
}

.folder-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  padding: 8px;
}

.folder-icon-item:hover .f-icon {
  filter: invert(1);
}

.folder-icon-item:hover .f-name {
  background-color: var(--sys-black);
  color: var(--sys-white);
}

.f-icon svg {
  width: 48px;
  height: 48px;
}

.f-name {
  font-size: 14px;
  font-weight: 700;
  margin-top: 6px;
  padding: 2px 5px;
}

/* Finder List View Table */
.finder-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.finder-list-table th {
  text-align: left;
  border-bottom: 2px solid var(--sys-black);
  padding: 6px 10px;
  font-weight: 700;
}

.finder-list-row {
  cursor: pointer;
}

.finder-list-row:hover {
  background-color: var(--sys-black);
  color: var(--sys-white);
}

.finder-list-row td {
  padding: 6px 10px;
}

.finder-list-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-icon svg {
  width: 24px;
  height: 24px;
}

/* --- About Ivan & CV --- */
.about-window-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.about-top {
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 2px solid var(--sys-black);
  padding-bottom: 14px;
}

/* --- Retro Pixel Photo Widget (1984 Macintosh Dithering Frame) --- */
.retro-photo-wrapper {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background-color: var(--sys-white);
  padding: 5px;
  border: 2px solid var(--sys-black);
  box-shadow: 2px 2px 0 var(--sys-black);
  flex-shrink: 0;
}

.retro-photo-frame {
  position: relative;
  border: 2px solid var(--sys-black);
  background-color: #000;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.retro-photo-canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.retro-photo-original {
  display: block;
  image-rendering: auto;
}

.retro-photo-scanline-fx {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: 
    linear-gradient(rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.16) 50%),
    linear-gradient(90deg, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.08) 50%);
  background-size: 100% 3px, 3px 100%;
  opacity: 0.16;
}

.retro-photo-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 4px;
  padding: 1px 2px 0 2px;
}

.retro-photo-caption {
  font-size: 12px;
  font-weight: 700;
  color: var(--sys-black);
  white-space: nowrap;
}

.retro-mode-badge {
  font-size: 11px;
  padding: 2px 5px;
  cursor: pointer;
  background-color: var(--sys-white);
  border: 1px solid var(--sys-black);
  color: var(--sys-black);
  box-shadow: 1px 1px 0 var(--sys-black);
}

.retro-mode-badge:hover {
  background-color: var(--sys-black);
  color: var(--sys-white);
}

.about-mac-icon svg {
  width: 64px;
  height: 64px;
}

.about-id-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.about-name {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}

.about-title {
  font-size: 16px;
  font-weight: 600;
}

.about-status {
  font-size: 14px;
  color: var(--sys-gray);
  font-weight: 600;
}

.about-tagline {
  font-size: 13px;
  color: var(--sys-text);
  opacity: 0.85;
  margin-top: 4px;
  line-height: 1.3;
}

.about-bio-box {
  line-height: 1.7;
  font-size: 15px;
}

.about-links-row {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.cv-window-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cv-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--sys-black);
  padding-bottom: 10px;
}

.cv-file-info {
  font-size: 14px;
  font-weight: 600;
}

.cv-header {
  text-align: center;
  border-bottom: 2px solid var(--sys-black);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.cv-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
}

.cv-subtitle {
  font-size: 16px;
  margin-top: 3px;
  font-weight: 600;
}

.cv-contact-line {
  font-size: 15px;
  font-family: var(--font-mono);
  margin-top: 6px;
}

.cv-section-block {
  margin-bottom: 16px;
}

.cv-block-title {
  font-weight: 700;
  font-size: 17px;
  border-bottom: 2px solid var(--sys-black);
  margin-bottom: 10px;
  padding-bottom: 3px;
}

.cv-item {
  margin-bottom: 12px;
}

.cv-item-title {
  font-weight: 700;
  font-size: 15px;
}

.cv-type-tag {
  font-size: 13px;
  font-weight: normal;
}

.cv-item-sub {
  font-size: 13px;
  font-style: italic;
  margin-bottom: 3px;
}

.cv-item-desc {
  font-size: 15px;
  line-height: 1.6;
}

.cv-tech-mini {
  font-size: 15px;
  font-family: var(--font-mono);
  margin-top: 4px;
}

.cv-skill-row {
  font-size: 15px;
  margin-bottom: 5px;
}

/* --- 1984 Calculator App --- */
.calculator-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.calc-display-container {
  width: 100%;
  border: 2px solid var(--sys-black);
  background-color: var(--sys-white);
  padding: 8px 10px;
  box-shadow: inset 1px 1px 3px rgba(0,0,0,0.3);
}

.calc-display {
  font-family: var(--font-mono);
  font-size: 26px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calc-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}

.calc-btn {
  font-family: var(--font-system);
  font-size: 18px;
  font-weight: 700;
  padding: 10px 0;
  background-color: var(--sys-white);
  border: 2px solid var(--sys-black);
  box-shadow: 2px 2px 0px var(--sys-black);
  cursor: pointer;
}

.calc-btn:active {
  background-color: var(--sys-black);
  color: var(--sys-white);
  transform: translate(2px, 2px);
  box-shadow: none;
}

.calc-btn.btn-tall {
  grid-row: span 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calc-btn.btn-wide {
  grid-column: span 2;
}

/* --- Note Pad App --- */
.notepad-app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.notepad-header {
  font-size: 15px;
  font-family: var(--font-mono);
  font-weight: bold;
  border-bottom: 2px solid var(--sys-black);
  padding-bottom: 6px;
  margin-bottom: 10px;
  text-align: right;
}

.notepad-body {
  flex: 1;
}

.notepad-textarea {
  width: 100%;
  height: 240px;
  border: none;
  outline: none;
  resize: none;
  font-family: var(--font-system);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.7;
  background-color: transparent;
  color: var(--sys-black);
}

.notepad-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 2px solid var(--sys-black);
  padding-top: 10px;
}

.notepad-dogear {
  width: 24px;
  height: 24px;
  border-left: 2px solid var(--sys-black);
  border-top: 2px solid var(--sys-black);
  cursor: pointer;
  background: linear-gradient(135deg, transparent 50%, var(--sys-black) 50%);
}

/* --- Puzzle 15 App --- */
.puzzle-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.puzzle-header {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

.puzzle-title {
  font-weight: 700;
  font-size: 17px;
}

.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(4, 52px);
  grid-template-rows: repeat(4, 52px);
  gap: 4px;
  border: 3px solid var(--sys-black);
  background-color: var(--sys-black);
  padding: 4px;
}

.puzzle-tile {
  background-color: var(--sys-white);
  color: var(--sys-black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
}

.puzzle-tile.empty {
  background-color: var(--sys-black);
  cursor: default;
}

.puzzle-status {
  font-size: 15px;
  font-weight: 700;
  height: 22px;
}

/* --- Control Panel App --- */
.control-panel-app {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cp-section {
  border: 2px solid var(--sys-black);
  padding: 12px;
  position: relative;
}

.cp-section-title {
  position: absolute;
  top: -12px;
  left: 14px;
  background-color: var(--sys-white);
  padding: 0 8px;
  font-weight: 700;
  font-size: 15px;
}

.cp-radio-group, .cp-checkbox-group {
  margin-top: 8px;
}

.cp-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

/* --- System Modal Dialogs & Shutdown --- */
.mac-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
}

.mac-dialog-box {
  background-color: var(--sys-white);
  border: 3px solid var(--sys-black);
  box-shadow: 5px 5px 0px var(--sys-black);
  padding: 16px;
  max-width: 460px;
}

.mac-dialog-inner {
  border: 2px solid var(--sys-black);
  padding: 18px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.mac-dialog-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}

.mac-dialog-text {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.mac-dialog-actions {
  text-align: right;
}

/* Boot Screen (Happy Mac) */
#boot-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #888888;
  background-image: var(--desktop-pattern);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 30000;
  transition: opacity 0.5s ease;
}

#boot-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

#boot-icon svg {
  width: 80px;
  height: 80px;
  filter: drop-shadow(4px 4px 0px #000);
}

.boot-text {
  margin-top: 18px;
  font-size: 16px;
  font-weight: 700;
  background: #fff;
  border: 2px solid #000;
  padding: 4px 14px;
}

/* Shutdown Screen */
.shutdown-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40000;
}

.shutdown-dialog {
  background-color: #fff;
  border: 4px solid #000;
  padding: 26px;
  text-align: center;
  max-width: 440px;
  box-shadow: 6px 6px 0px #fff;
}

.shutdown-text {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* --- CRT Effects Layer --- */
.crt-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15000;
}

body.crt-scanlines .crt-overlay::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.18) 50%);
  background-size: 100% 3px;
  z-index: 15001;
}

body.crt-curvature .crt-overlay::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: radial-gradient(circle at center, transparent 70%, rgba(0, 0, 0, 0.3) 100%);
  z-index: 15002;
}

/* --- 2.5D Raycaster Mini-Engine (cub3D) --- */
.raycaster-widget {
  background-color: #000;
  border: 2px solid var(--sys-black);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #fff;
  box-shadow: inset 1px 1px 3px rgba(0,0,0,0.5);
}

.raycaster-toolbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-pixel);
  font-size: 13px;
  padding-bottom: 6px;
  border-bottom: 1px solid #333;
}

.raycaster-label {
  color: #33ff33;
  font-weight: 700;
}

.raycaster-stats {
  font-family: var(--font-mono);
  font-size: 15px;
  color: #aaa;
}

.raycaster-canvas-wrap {
  border: 2px solid #555;
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  overflow: hidden;
}

#raycaster-canvas {
  width: 100%;
  max-width: 440px;
  height: auto;
  aspect-ratio: 280 / 150;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}

.raycaster-controls {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.raycaster-hint {
  font-size: 13px;
  font-family: var(--font-pixel);
  color: #ccc;
}

.ray-btn-pad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.ray-btn-row {
  display: flex;
  gap: 3px;
}

.ray-btn {
  padding: 4px 10px !important;
  font-size: 14px !important;
  min-width: 34px;
  text-align: center;
}

/* --- Interactive IRC Client (IRC_ircserv) --- */
.irc-terminal-app {
  border: 2px solid var(--sys-black);
  background-color: #0d1117;
  color: #e6edf3;
  display: flex;
  flex-direction: column;
  margin-top: 6px;
  box-shadow: 2px 2px 0px var(--sys-black);
}

.irc-term-header {
  background-color: #161b22;
  padding: 6px 12px;
  border-bottom: 2px solid #30363d;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-pixel);
  font-size: 13px;
}

.irc-term-title {
  color: #58a6ff;
  font-weight: 700;
}

.irc-term-status {
  font-family: var(--font-mono);
  font-size: 15px;
  color: #8b949e;
}

.irc-log {
  height: 220px;
  overflow-y: auto;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 17px;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background-color: #0b0e14;
}

.irc-line-sys {
  color: #8b949e;
  font-style: italic;
}

.irc-line-info {
  color: #3fb950;
}

.irc-line-bot {
  color: #d29922;
  font-weight: 700;
}

.irc-line-user {
  color: #58a6ff;
}

.irc-line-err {
  color: #f85149;
  font-weight: 700;
}

.irc-input-line {
  display: flex;
  align-items: center;
  background-color: #161b22;
  border-top: 1px solid #30363d;
  padding: 6px 10px;
  gap: 8px;
}

.irc-prompt {
  font-family: var(--font-mono);
  font-size: 18px;
  color: #3fb950;
  font-weight: 700;
}

.irc-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 17px;
}

.irc-send-btn {
  padding: 3px 12px !important;
  font-size: 13px !important;
}

/* --- Comprehensive Responsive & Screen Adaptation --- */

/* 720p Displays / Small Height Screens (<= 768px height) */
@media (max-height: 768px) {
  .mac-window {
    max-height: calc(100vh - 40px) !important;
  }
  .mac-window-content {
    max-height: calc(100vh - 80px) !important;
    padding: 10px;
  }
  .real-term-output {
    height: 160px;
  }
  .irc-log {
    height: 160px;
  }
  .notepad-textarea {
    height: 170px;
  }
  .desktop-icon {
    width: 90px;
    margin-bottom: 8px;
  }
  .desktop-icon .icon-img svg {
    width: 44px;
    height: 44px;
  }
}

/* Tablet Screens (<= 840px width) */
@media (max-width: 840px) {
  .mac-window {
    max-width: 95vw !important;
  }
  .project-header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .proj-meta-grid {
    grid-template-columns: 1fr;
  }
  .cv-actions-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* Mobile Screens (<= 640px width) */
@media (max-width: 640px) {
  #menu-bar {
    font-size: 13px;
    padding: 0 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    scrollbar-width: none;
  }
  #menu-bar::-webkit-scrollbar {
    display: none;
  }
  .menu-title {
    padding: 2px 7px;
    font-size: 13px;
  }
  .menu-clock {
    font-size: 12px;
    padding-right: 6px;
  }
  
  /* On mobile, open windows act like full-screen retro cards */
  .mac-window {
    width: calc(100vw - 10px) !important;
    max-width: calc(100vw - 10px) !important;
    left: 5px !important;
    top: 36px !important;
    height: calc(100vh - 44px) !important;
    max-height: calc(100vh - 44px) !important;
  }
  .mac-window-content {
    max-height: calc(100vh - 84px) !important;
    padding: 10px 8px;
  }

  .mac-titlebar {
    height: 28px;
    padding: 0 6px;
  }
  .mac-title-text {
    font-size: 14px;
    padding: 0 6px;
  }
  .mac-close-box {
    width: 14px;
    height: 14px;
  }

  /* Raycaster & Terminal controls on mobile */
  .raycaster-controls {
    flex-direction: column;
    gap: 8px;
    align-items: center;
  }
  .raycaster-hint {
    text-align: center;
  }
  .real-term-output {
    height: 160px;
    font-size: 15px;
  }
  .real-term-input {
    font-size: 16px;
  }
  .term-prompt {
    font-size: 16px;
  }
  
  /* Calculator & Puzzle on mobile */
  .calc-keys {
    gap: 5px;
  }
  .calc-btn {
    font-size: 16px;
    padding: 8px 0;
  }
  .puzzle-grid {
    grid-template-columns: repeat(4, 44px);
    grid-template-rows: repeat(4, 44px);
  }
  .puzzle-tile {
    font-size: 16px;
  }

  /* Desktop icon sizing on small mobile */
  .desktop-icon {
    width: 86px;
  }
  .desktop-icon .icon-label {
    font-size: 13px;
  }
}
