/* ─────────────────────────────────────────────
   Thanh 97 — Windows 97 portfolio
   Win97-style UI font + readable resume document font
   ───────────────────────────────────────────── */

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

:root {
  --gray:        #c0c0c0;
  --gray-light:  #dfdfdf;
  --gray-dark:   #808080;
  --gray-darker: #404040;
  --white:       #ffffff;
  --black:       #000000;
  --blue:        #000080;
  --blue-light:  #1084d0;
  --teal:        #008080;
  --yellow:      #fffec7;
  --select:      #000080;

  --ff-ui:   "VT323", "MS Sans Serif", "Microsoft Sans Serif", "Tahoma", "Geneva", sans-serif;
  --ff-doc:  "Tahoma", "Geneva", "Verdana", "Microsoft Sans Serif", sans-serif;
  --ff-mono: "VT323", "Lucida Console", "Courier New", monospace;
  --fs-ui: 18px;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--ff-ui);
  font-size: var(--fs-ui);
  line-height: 1.4;
  color: var(--black);
  background: var(--teal);
  user-select: none;
  -webkit-user-select: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#section-experience,
#section-experience * {
  font-family: var(--ff-doc);
}

#section-experience {
  font-size: 15px;
}

#section-experience .section-head h2 {
  font-size: 28px;
}

#section-experience .meta-line,
#section-experience .job-date {
  font-size: 13px;
}

#section-experience .job-head h3 {
  font-size: 18px;
}

#section-experience .job-company,
#section-experience .bullets {
  font-size: 14px;
}

button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img, svg { image-rendering: pixelated; }

/* ─── Desktop ─── */
.desktop {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 60%, #00a0a0 0%, var(--teal) 60%, #006666 100%);
}

/* Desktop icons */
.desktop-icons {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 1;
}
.desk-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 88px;
  padding: 4px;
  background: transparent;
  color: var(--white);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.85);
  font-family: var(--ff-ui);
  font-weight: 500;
}
.desk-icon:hover .icon-pix { filter: brightness(1.12) drop-shadow(0 0 2px rgba(255,255,255,0.4)); }
.desk-icon:focus { outline: none; }
.desk-icon:focus .icon-label {
  background: var(--blue);
  outline: 1px dotted var(--white);
  color: var(--white);
}
.desk-icon:active .icon-pix { filter: brightness(0.85); }

.icon-pix {
  width: 38px;
  height: 38px;
  display: block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.icon-label {
  font-size: 16px;
  text-align: center;
  line-height: 1.2;
  padding: 1px 4px;
  word-wrap: break-word;
  max-width: 88px;
}

/* ─── Pixel icons (SVG data URIs) ─── */
.icon-mycomputer {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Cpath d='M4 6h22v14H4z' fill='%23c0c0c0' stroke='%23000' stroke-width='1'/%3E%3Cpath d='M6 8h18v10H6z' fill='%23008080'/%3E%3Cpath d='M10 22h10v2H10z' fill='%23c0c0c0' stroke='%23000'/%3E%3Cpath d='M8 24h14v2H8z' fill='%23c0c0c0' stroke='%23000'/%3E%3Crect x='7' y='9' width='2' height='2' fill='%23ffff00'/%3E%3C/svg%3E");
}
.icon-folder-yellow {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Cpath d='M2 10h10l2 2h16v16H2z' fill='%23ffcc44' stroke='%23000'/%3E%3Cpath d='M2 10h10l2 2h16' fill='none' stroke='%23000'/%3E%3Cpath d='M3 13h26' stroke='%23ffe999'/%3E%3C/svg%3E");
}
.icon-doc {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Cpath d='M6 3h14l6 6v20H6z' fill='%23ffffff' stroke='%23000'/%3E%3Cpath d='M20 3v6h6' fill='%23dddddd' stroke='%23000'/%3E%3Cpath d='M10 14h12M10 18h12M10 22h8' stroke='%23000080' stroke-width='1'/%3E%3C/svg%3E");
}
.icon-mail {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Crect x='3' y='8' width='26' height='18' fill='%23ffffff' stroke='%23000'/%3E%3Cpath d='M3 8 L16 19 L29 8' fill='none' stroke='%23000'/%3E%3Cpath d='M3 26 L13 16 M29 26 L19 16' stroke='%23000'/%3E%3C/svg%3E");
}
.icon-recycle {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Cpath d='M7 8h18l-2 20H9z' fill='%23dde4ec' stroke='%23000'/%3E%3Cpath d='M5 6h22v2H5z' fill='%23c0c0c0' stroke='%23000'/%3E%3Cpath d='M12 12v12M16 12v12M20 12v12' stroke='%23808080'/%3E%3C/svg%3E");
}

/* Big icons in section headers */
.big-icon {
  width: 48px;
  height: 48px;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  flex-shrink: 0;
}
.big-doc    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Cpath d='M6 3h14l6 6v20H6z' fill='%23fff' stroke='%23000'/%3E%3Cpath d='M20 3v6h6' fill='%23ddd' stroke='%23000'/%3E%3Cpath d='M10 14h12M10 18h12M10 22h8' stroke='%23000080'/%3E%3C/svg%3E"); }
.big-word   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Cpath d='M6 3h14l6 6v20H6z' fill='%231c5fb8' stroke='%23000'/%3E%3Cpath d='M20 3v6h6' fill='%23165294' stroke='%23000'/%3E%3Ctext x='16' y='22' font-family='serif' font-weight='bold' font-size='12' fill='%23fff' text-anchor='middle'%3EW%3C/text%3E%3C/svg%3E"); }
.big-folder { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Cpath d='M2 10h10l2 2h16v16H2z' fill='%23ffcc44' stroke='%23000'/%3E%3C/svg%3E"); }
.big-cog    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Cpath d='M16 4l2 3 3-1 1 3 3 1-1 3 3 2-3 2 1 3-3 1-1 3-3-1-2 3-2-3-3 1-1-3-3-1 1-3-3-2 3-2-1-3 3-1 1-3 3 1z' fill='%23c0c0c0' stroke='%23000'/%3E%3Ccircle cx='16' cy='16' r='5' fill='%23fff' stroke='%23000'/%3E%3C/svg%3E"); }
.big-mail   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Crect x='3' y='8' width='26' height='18' fill='%23fff' stroke='%23000'/%3E%3Cpath d='M3 8 L16 19 L29 8' fill='none' stroke='%23000'/%3E%3C/svg%3E"); }

/* File grid icons (Projects) */
.file-icon {
  width: 48px; height: 48px;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}
.f-db    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Cellipse cx='16' cy='8' rx='10' ry='3' fill='%2349b6e5' stroke='%23000'/%3E%3Cpath d='M6 8v8c0 2 4 3 10 3s10-1 10-3V8' fill='%2349b6e5' stroke='%23000'/%3E%3Cpath d='M6 16v8c0 2 4 3 10 3s10-1 10-3v-8' fill='%2349b6e5' stroke='%23000'/%3E%3C/svg%3E"); }
.f-game  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Crect x='3' y='9' width='26' height='15' rx='3' fill='%2370a040' stroke='%23000'/%3E%3Crect x='7' y='15' width='3' height='3' fill='%23fff'/%3E%3Crect x='12' y='12' width='3' height='3' fill='%23fff'/%3E%3Crect x='17' y='15' width='3' height='3' fill='%23fff'/%3E%3Crect x='22' y='12' width='3' height='3' fill='%23ff0000'/%3E%3C/svg%3E"); }
.f-globe { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Ccircle cx='16' cy='16' r='12' fill='%234fb0d8' stroke='%23000'/%3E%3Cpath d='M16 4v24M4 16h24M8 8c4 5 4 11 0 16M24 8c-4 5-4 11 0 16' fill='none' stroke='%23000'/%3E%3C/svg%3E"); }
.f-fire  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Cpath d='M16 4c2 4 6 6 6 12s-3 12-6 12-6-6-6-12c0-3 2-6 4-6 0 2 1 4 2 6 0-4 0-8 0-12z' fill='%23ff6622' stroke='%23000'/%3E%3Cpath d='M16 14c1 2 3 3 3 6s-1.5 5-3 5-3-2-3-5c0-1 1-2 1.5-2 0 1 0.5 1.5 1 2 0-2 0.5-4 0.5-6z' fill='%23ffdd33'/%3E%3C/svg%3E"); }
.f-music { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Ccircle cx='10' cy='24' r='4' fill='%23000'/%3E%3Ccircle cx='22' cy='22' r='4' fill='%23000'/%3E%3Cpath d='M14 24V6l12-2v16' stroke='%23000' fill='none' stroke-width='2'/%3E%3C/svg%3E"); }

/* Tree icons */
.tree-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  flex-shrink: 0;
}
.t-mycomp { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath d='M2 3h12v8H2z' fill='%23c0c0c0' stroke='%23000'/%3E%3Cpath d='M3 4h10v6H3z' fill='%23008080'/%3E%3Cpath d='M5 12h6v1H5zM4 13h8v1H4z' fill='%23c0c0c0' stroke='%23000'/%3E%3C/svg%3E"); }
.t-folder { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath d='M1 5h5l1 1h8v8H1z' fill='%23ffcc44' stroke='%23000'/%3E%3C/svg%3E"); }
.t-doc { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath d='M3 2h7l3 3v10H3z' fill='%23fff' stroke='%23000'/%3E%3Cpath d='M10 2v3h3' stroke='%23000' fill='none'/%3E%3Cpath d='M5 8h6M5 10h6M5 12h4' stroke='%23000080'/%3E%3C/svg%3E"); }
.t-word { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath d='M3 2h7l3 3v10H3z' fill='%231c5fb8' stroke='%23000'/%3E%3Ctext x='8' y='11' font-family='serif' font-weight='bold' font-size='7' fill='%23fff' text-anchor='middle'%3EW%3C/text%3E%3C/svg%3E"); }
.t-cog { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath d='M8 2l1 1.5 1.5-.5.5 1.5 1.5.5-.5 1.5 1.5 1.5-1.5 1.5.5 1.5-1.5.5-.5 1.5-1.5-.5L8 14l-1-1.5-1.5.5-.5-1.5-1.5-.5.5-1.5L2 8l1.5-1.5-.5-1.5 1.5-.5.5-1.5 1.5.5z' fill='%23c0c0c0' stroke='%23000'/%3E%3Ccircle cx='8' cy='8' r='2.5' fill='%23fff' stroke='%23000'/%3E%3C/svg%3E"); }
.t-mail { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect x='2' y='4' width='12' height='9' fill='%23fff' stroke='%23000'/%3E%3Cpath d='M2 4 L8 9 L14 4' fill='none' stroke='%23000'/%3E%3C/svg%3E"); }

/* Title bar pixel icons */
.title-pix {
  width: 18px; height: 18px;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath d='M2 3h12v8H2z' fill='%23c0c0c0' stroke='%23000'/%3E%3Cpath d='M3 4h10v6H3z' fill='%23008080'/%3E%3Cpath d='M5 12h6v1H5zM4 13h8v1H4z' fill='%23c0c0c0' stroke='%23000'/%3E%3C/svg%3E");
}
.title-pix.title-note {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath d='M3 2h7l3 3v10H3z' fill='%23fff' stroke='%23000'/%3E%3Cpath d='M10 2v3h3' stroke='%23000' fill='none'/%3E%3Cpath d='M5 8h6M5 10h6M5 12h4' stroke='%23000'/%3E%3C/svg%3E");
}

/* Address bar folder icon */
.addr-folder {
  width: 18px; height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath d='M1 5h5l1 1h8v8H1z' fill='%23ffcc44' stroke='%23000'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  flex-shrink: 0;
}

/* ─── Generic window ─── */
.window {
  background: var(--gray);
  border: 1px solid;
  border-color: var(--gray-light) var(--gray-darker) var(--gray-darker) var(--gray-light);
  box-shadow:
    inset -1px -1px 0 var(--gray-dark),
    inset  1px  1px 0 var(--white),
    2px 2px 8px rgba(0,0,0,0.25);
  padding: 2px;
  position: absolute;
}
.window.dragging {
  box-shadow:
    inset -1px -1px 0 var(--gray-dark),
    inset  1px  1px 0 var(--white),
    4px 4px 16px rgba(0,0,0,0.4);
}

/* Title bar */
.title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 3px 3px 5px;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue-light) 100%);
  color: var(--white);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.3px;
  cursor: move;
}
.title-bar.dragging { cursor: grabbing; }
.title-bar.inactive {
  background: linear-gradient(90deg, #808080 0%, #b0b0b0 100%);
}
.title-text {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
  padding-left: 1px;
}
.title-controls { display: flex; gap: 2px; cursor: default; }

.title-btn {
  width: 20px;
  height: 18px;
  background: var(--gray);
  border: 1px solid;
  border-color: var(--white) var(--gray-darker) var(--gray-darker) var(--white);
  box-shadow:
    inset -1px -1px 0 var(--gray-dark),
    inset  1px  1px 0 var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.title-btn:active {
  border-color: var(--gray-darker) var(--white) var(--white) var(--gray-darker);
  box-shadow:
    inset 1px 1px 0 var(--gray-dark),
    inset -1px -1px 0 var(--gray-light);
}
.title-btn svg { display: block; width: 10px; height: 10px; }
.title-btn.close { margin-left: 2px; }
.title-btn.disabled,
.title-btn:disabled {
  cursor: default;
  opacity: 0.55;
}
.title-btn.disabled:active,
.title-btn:disabled:active {
  border-color: var(--white) var(--gray-darker) var(--gray-darker) var(--white);
  box-shadow:
    inset -1px -1px 0 var(--gray-dark),
    inset  1px  1px 0 var(--gray-light);
}

/* Menu bar */
.menu-bar {
  display: flex;
  gap: 1px;
  padding: 2px 3px 0;
  background: var(--gray);
  font-size: 17px;
}
.menu-bar.tight { padding: 1px 2px 0; }
.menu-item {
  padding: 3px 9px;
  cursor: default;
  font-weight: 500;
}
.menu-item:hover {
  background: var(--blue);
  color: var(--white);
}
.menu-item u { text-decoration: underline; }

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 5px;
  background: var(--gray);
}
.tool-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  background: var(--gray);
  border: 1px solid transparent;
  font-size: 17px;
  color: var(--black);
  font-weight: 500;
}
.tool-btn:hover {
  border-color: var(--white) var(--gray-darker) var(--gray-darker) var(--white);
}
.tool-btn:active {
  border-color: var(--gray-darker) var(--white) var(--white) var(--gray-darker);
}
.tool-glyph { font-size: 18px; line-height: 1; }
.tool-sep {
  width: 2px;
  height: 22px;
  background: linear-gradient(to right, var(--gray-dark), var(--white));
  margin: 0 3px;
}

/* Address bar */
.addr-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 5px 5px;
  background: var(--gray);
  font-size: 17px;
}
.addr-label { padding: 0 2px; font-weight: 500; }
.addr-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 6px;
  background: var(--white);
  border: 1px solid;
  border-color: var(--gray-darker) var(--white) var(--white) var(--gray-darker);
  box-shadow: inset 1px 1px 0 var(--gray-dark);
  font-size: 17px;
  min-height: 22px;
}
.addr-path { flex: 1; color: var(--black); }
.addr-caret {
  color: var(--gray-darker);
  background: var(--gray);
  padding: 1px 8px;
  font-size: 11px;
  border: 1px solid;
  border-color: var(--white) var(--gray-darker) var(--gray-darker) var(--white);
  box-shadow:
    inset -1px -1px 0 var(--gray-dark),
    inset  1px  1px 0 var(--gray-light);
}

/* Window body */
.window-body {
  display: flex;
  background: var(--white);
  border: 1px solid;
  border-color: var(--gray-darker) var(--white) var(--white) var(--gray-darker);
  box-shadow: inset 1px 1px 0 var(--gray-dark);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Explorer pane (tree) */
.explorer-pane {
  width: 240px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--gray);
  overflow-y: auto;
  font-size: 17px;
}
.pane-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  background: var(--gray);
  font-weight: 600;
  font-size: 16px;
  border-bottom: 1px solid var(--gray-dark);
}
.pane-x { cursor: pointer; font-size: 12px; }
.tree { padding: 6px 0; }
.tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 8px;
  cursor: pointer;
  font-size: 17px;
}
.tree-row.depth-1 { padding-left: 24px; }
.tree-row.depth-2 { padding-left: 42px; }
.tree-toggle {
  display: inline-block;
  width: 10px;
  font-family: var(--ff-ui);
  font-size: 17px;
  line-height: 1;
  color: var(--gray-darker);
}
.tree-row:hover { background: rgba(0,0,128,0.06); }
.tree-row.active { background: var(--blue); color: var(--white); }

/* Content pane */
.content-pane {
  flex: 1;
  background: var(--white);
  overflow-y: auto;
  padding: 22px 24px;
  font-size: 18px;
  color: var(--black);
  user-select: text;
  -webkit-user-select: text;
}

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

/* Scrollbars (Win97 style) */
::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track {
  background:
    repeating-conic-gradient(from 45deg, var(--gray) 0% 25%, #d4d4d4 25% 50%) 0 0/2px 2px;
}
::-webkit-scrollbar-thumb {
  background: var(--gray);
  border: 1px solid;
  border-color: var(--white) var(--gray-darker) var(--gray-darker) var(--white);
  box-shadow:
    inset -1px -1px 0 var(--gray-dark),
    inset  1px  1px 0 var(--gray-light);
}
::-webkit-scrollbar-button:single-button:vertical:decrement,
::-webkit-scrollbar-button:single-button:vertical:increment,
::-webkit-scrollbar-button:single-button:horizontal:decrement,
::-webkit-scrollbar-button:single-button:horizontal:increment {
  background: var(--gray);
  border: 1px solid;
  border-color: var(--white) var(--gray-darker) var(--gray-darker) var(--white);
  box-shadow:
    inset -1px -1px 0 var(--gray-dark),
    inset  1px  1px 0 var(--gray-light);
  height: 16px;
  width: 16px;
  display: block;
}

/* Section transitions */
.section { display: none; animation: fadeIn 180ms ease-out; }
.section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: translateY(0); } }

.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray);
}
.section-head h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
  line-height: 1;
}
.meta-line { font-size: 16px; color: var(--gray-dark); font-weight: 500; }

.prose p {
  margin-bottom: 14px;
  font-size: 19px;
  line-height: 1.55;
}
.prose b { font-weight: 700; color: var(--blue); }

.callout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--yellow);
  border: 1px solid var(--black);
  font-size: 17px;
  margin-top: 12px;
  line-height: 1.5;
}
.callout-icon { font-size: 18px; color: #b06a00; }

/* Experience */
.experience-list { display: flex; flex-direction: column; gap: 16px; }
.job {
  padding: 14px 16px;
  background: #f6f6f6;
  border: 1px solid;
  border-color: var(--gray-darker) var(--white) var(--white) var(--gray-darker);
  box-shadow: inset 1px 1px 0 var(--gray-dark);
}
.job-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.job-head h3 { font-size: 18px; font-weight: 700; letter-spacing: 0.2px; }
.job-date { font-size: 13px; color: var(--gray-darker); font-weight: 500; }
.job-company {
  font-size: 14px;
  color: var(--blue);
  font-style: italic;
  margin-bottom: 10px;
  font-weight: 500;
}

.bullets {
  margin-left: 20px;
  font-size: 17px;
  line-height: 1.55;
  list-style: square;
  color: var(--black);
}
.bullets li { margin-bottom: 5px; padding-left: 5px; }

/* Project file grid */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 22px 16px;
  padding: 8px 0 24px;
}
.file-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 148px;
  padding: 10px 8px;
  background: transparent;
  border: 1px solid transparent;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  color: var(--black);
}
.file-item:hover { border: 1px dotted var(--gray-darker); }
.file-item.selected { border: 1px dotted var(--white); }
.file-item.selected .file-icon { filter: brightness(0.92); }
.file-item.selected .file-name {
  display: inline-block;
  background: var(--blue);
  color: var(--white);
  padding: 2px 8px 3px;
}
.file-name {
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  max-width: 165px;
  line-height: 1.45;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-wrap: balance;
}
.file-info {
  font-size: 15px;
  color: var(--gray-darker);
  text-align: center;
  font-weight: 500;
  max-width: 165px;
  line-height: 1.35;
}

/* Project detail */
.project-detail {
  margin-top: 10px;
  padding: 14px 16px;
  background: var(--yellow);
  border: 1px solid;
  border-color: var(--gray-darker) var(--white) var(--white) var(--gray-darker);
  box-shadow: inset 1px 1px 0 var(--gray-dark);
  display: none;
}
.project-detail.open { display: block; animation: fadeIn 200ms; }
.pd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.pd-head h3 { font-size: 19px; font-weight: 700; }
.pd-close {
  width: 22px; height: 18px;
  background: var(--gray);
  border: 1px solid;
  border-color: var(--white) var(--gray-darker) var(--gray-darker) var(--white);
  box-shadow:
    inset -1px -1px 0 var(--gray-dark),
    inset  1px  1px 0 var(--gray-light);
  font-size: 12px;
}
.pd-close:active {
  border-color: var(--gray-darker) var(--white) var(--white) var(--gray-darker);
}

/* INI block — VT323 mono, compact to fit without scroll */
.ini-block {
  background: #f8f8f8;
  border: 1px solid;
  border-color: var(--gray-darker) var(--white) var(--white) var(--gray-darker);
  box-shadow: inset 1px 1px 0 var(--gray-dark);
  padding: 12px 16px;
  font-family: var(--ff-mono);
  font-size: 19px;
  white-space: pre-wrap;
  line-height: 1.25;
  color: var(--black);
  letter-spacing: 0.3px;
}
.ini-header { color: var(--blue); font-weight: 600; }
.ini-comment { color: #607060; font-style: italic; }

/* Contact table */
.contact-table {
  width: 100%;
  font-size: 18px;
  border-collapse: collapse;
  margin-bottom: 14px;
}
.contact-table tr:nth-child(odd) { background: #f6f6f6; }
.contact-table td {
  padding: 10px 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--gray);
}
.contact-table td.key {
  font-weight: 600;
  width: 110px;
  color: var(--gray-darker);
  text-transform: uppercase;
  font-size: 15px;
  letter-spacing: 0.8px;
}
.contact-table a {
  color: var(--blue);
  text-decoration: underline;
  font-weight: 500;
}
.contact-table a:hover { color: #0a3aff; }

/* Status bar */
.status-bar {
  display: flex;
  gap: 2px;
  padding: 3px 0 0;
  background: var(--gray);
  font-size: 16px;
}
.status-cell {
  background: var(--gray);
  padding: 3px 10px;
  border: 1px solid;
  border-color: var(--gray-darker) var(--white) var(--white) var(--gray-darker);
  box-shadow: inset 1px 1px 0 var(--gray-dark);
  min-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.status-cell.stretch { flex: 1; min-width: 0; }

/* ─── Main window position ─── */
.main-window {
  /* anchored top-left after the icons; sized to leave a clean right column
     plus a comfortable gap, so windows never collide and there's open
     desktop to drag things around in. */
  width: min(960px, calc(100vw - 520px));
  height: min(760px, calc(100vh - 56px));
  top: 16px;
  left: 112px;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

/* ─── Notepad window ─── */
.note-window {
  width: 340px;
  bottom: 42px;
  right: 20px;
  z-index: 5;
}
.notepad-body {
  background: var(--white);
  border: 1px solid;
  border-color: var(--gray-darker) var(--white) var(--white) var(--gray-darker);
  box-shadow: inset 1px 1px 0 var(--gray-dark);
  padding: 10px 12px;
  font-family: var(--ff-mono);
  font-size: 17px;
  color: var(--black);
  line-height: 1.35;
  white-space: pre-wrap;
  min-height: 110px;
  letter-spacing: 0.3px;
  user-select: text;
  -webkit-user-select: text;
}
.cursor-blink { animation: blink 1.1s steps(2) infinite; }
@keyframes blink { to { opacity: 0; } }

/* ─── Winamp-style music player (Spotify embed inside) ─── */
.music-window {
  width: 340px;
  top: 16px;
  right: 20px;
  z-index: 8;
}
.spotify-embed {
  display: block;
  width: 100%;
  height: 380px;
  border: 0;
  background: #000;
}
.title-pix.title-music {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect x='1' y='1' width='14' height='14' fill='%23222'/%3E%3Cpath d='M3 5 L6 5 L8 3 L8 13 L6 11 L3 11 z' fill='%23ffcc00'/%3E%3Cpath d='M10 5 c1.5 0 1.5 6 0 6 M12 3 c2.5 0 2.5 10 0 10' fill='none' stroke='%23ffcc00'/%3E%3C/svg%3E");
}
.ti-music {
  width: 16px; height: 16px;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect x='1' y='1' width='14' height='14' fill='%23222'/%3E%3Cpath d='M3 5 L6 5 L8 3 L8 13 L6 11 L3 11 z' fill='%23ffcc00'/%3E%3Cpath d='M10 5 c1.5 0 1.5 6 0 6 M12 3 c2.5 0 2.5 10 0 10' fill='none' stroke='%23ffcc00'/%3E%3C/svg%3E");
}

.music-body {
  background: #000;
  border: 1px solid;
  border-color: var(--gray-darker) var(--white) var(--white) var(--gray-darker);
  box-shadow: inset 1px 1px 0 var(--gray-dark);
  padding: 4px;
}
.mini-player { display: none; }

.music-display {
  background: #000;
  border: 1px solid #111;
  box-shadow: inset 0 0 8px rgba(0,255,102,0.08);
  padding: 6px 10px 22px;
  position: relative;
  margin-bottom: 6px;
}
.music-time {
  font-family: var(--ff-mono);
  font-size: 30px;
  color: #00ff66;
  line-height: 1;
  letter-spacing: 2px;
  text-shadow: 0 0 6px rgba(0,255,102,0.55);
}
.music-bitrate {
  font-family: var(--ff-mono);
  font-size: 13px;
  color: #00aa44;
  margin-top: 2px;
  letter-spacing: 1px;
}
.music-marquee {
  position: absolute;
  bottom: 4px; left: 10px; right: 10px;
  height: 18px;
  overflow: hidden;
}
.music-track {
  font-family: var(--ff-mono);
  font-size: 17px;
  white-space: nowrap;
  color: #00ff66;
  text-shadow: 0 0 5px rgba(0,255,102,0.5);
  letter-spacing: 0.5px;
  animation: marquee 18s linear infinite;
  padding-left: 100%;
  display: inline-block;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

.music-viz {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 28px;
  background: #000;
  border: 1px solid #111;
  padding: 2px 3px;
  margin-bottom: 4px;
  box-shadow: inset 0 0 8px rgba(0,255,102,0.08);
}
.viz-col {
  flex: 1;
  position: relative;
  min-width: 0;
}
.viz-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 8%;
  background: linear-gradient(to top, #00cc44 0%, #00ff66 35%, #ffe600 78%, #ff3300 100%);
  transition: height 105ms ease-out;
}
.viz-cap {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  bottom: 8%;
  background: #d8ffe8;
  box-shadow: 0 0 4px rgba(0,255,140,0.85);
  transition: bottom 190ms linear;
}

.music-controls {
  display: flex;
  align-items: center;
  gap: 3px;
}
.m-btn {
  width: 30px;
  height: 24px;
  background: var(--gray);
  border: 1px solid;
  border-color: var(--white) var(--gray-darker) var(--gray-darker) var(--white);
  box-shadow:
    inset -1px -1px 0 var(--gray-dark),
    inset  1px  1px 0 var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
  padding: 0;
}
.m-btn:active,
.m-btn.pressed {
  border-color: var(--gray-darker) var(--white) var(--white) var(--gray-darker);
  box-shadow:
    inset 1px 1px 0 var(--gray-dark),
    inset -1px -1px 0 var(--gray-light);
}
.m-btn svg { display: block; }
.m-spacer { flex: 1; }

.m-vol {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #000;
  padding: 4px 8px;
  border: 1px solid #111;
}
.m-vol-label {
  font-family: var(--ff-mono);
  font-size: 14px;
  color: #00ff66;
  letter-spacing: 1px;
  line-height: 1;
}
.m-vol-bar {
  width: 56px;
  height: 5px;
  background: #001500;
  position: relative;
  cursor: pointer;
  border: 1px solid #002a00;
}
.m-vol-fill {
  height: 100%;
  background: linear-gradient(to right, #00aa44, #00ff66);
  box-shadow: 0 0 5px rgba(0,255,102,0.7);
}

/* ─── Taskbar ─── */
.taskbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 34px;
  background: var(--gray);
  border-top: 1px solid var(--white);
  box-shadow: inset 0 1px 0 var(--gray-light);
  display: flex;
  align-items: center;
  padding: 3px;
  gap: 3px;
  z-index: 1000;
}

.start-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 5px;
  background: var(--gray);
  border: 1px solid;
  border-color: var(--white) var(--gray-darker) var(--gray-darker) var(--white);
  box-shadow:
    inset -1px -1px 0 var(--gray-dark),
    inset  1px  1px 0 var(--gray-light);
  font-size: 15px;
  font-weight: 700;
  height: 28px;
  letter-spacing: 0.3px;
}
.start-btn.active {
  border-color: var(--gray-darker) var(--white) var(--white) var(--gray-darker);
  box-shadow:
    inset 1px 1px 0 var(--gray-dark),
    inset -1px -1px 0 var(--gray-light);
}
.start-btn u { text-decoration: underline; }

.start-logo {
  width: 18px; height: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
  transform: skewX(-8deg);
}
.lg { display: block; }
.lg-r { background: #ed1c24; }
.lg-g { background: #00a651; }
.lg-b { background: #00aeef; }
.lg-y { background: #fff200; }

.taskbar-sep {
  width: 2px;
  height: 28px;
  background: linear-gradient(to right, var(--gray-dark), var(--white));
  margin: 0 3px;
}

.taskbar-apps {
  display: flex;
  gap: 3px;
  flex: 1;
  overflow-x: auto;
}
.taskbar-apps::-webkit-scrollbar { display: none; }

.task-app {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px;
  background: var(--gray);
  border: 1px solid;
  border-color: var(--white) var(--gray-darker) var(--gray-darker) var(--white);
  box-shadow:
    inset -1px -1px 0 var(--gray-dark),
    inset  1px  1px 0 var(--gray-light);
  font-size: 13px;
  font-weight: 500;
  height: 28px;
  max-width: 220px;
  overflow: hidden;
  white-space: nowrap;
}
.task-app.active {
  border-color: var(--gray-darker) var(--white) var(--white) var(--gray-darker);
  box-shadow:
    inset  1px  1px 0 var(--gray-dark),
    inset -1px -1px 0 var(--gray-light);
  background:
    repeating-conic-gradient(from 45deg, var(--gray) 0% 25%, #d4d4d4 25% 50%) 0 0/2px 2px;
}
.task-app.closed { display: none; }
.mobile-section-app { display: none; }
.task-icon {
  width: 16px; height: 16px;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  flex-shrink: 0;
}
.ti-folder {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath d='M1 5h5l1 1h8v8H1z' fill='%23ffcc44' stroke='%23000'/%3E%3C/svg%3E");
}
.ti-note {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath d='M3 2h7l3 3v10H3z' fill='%23fff' stroke='%23000'/%3E%3Cpath d='M10 2v3h3' stroke='%23000' fill='none'/%3E%3Cpath d='M5 8h6M5 10h6M5 12h4' stroke='%23000'/%3E%3C/svg%3E");
}

/* System tray */
.system-tray {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  height: 28px;
  border: 1px solid;
  border-color: var(--gray-darker) var(--white) var(--white) var(--gray-darker);
  box-shadow: inset 1px 1px 0 var(--gray-dark);
}
.tray-icon {
  width: 18px; height: 18px;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}
.ti-sound {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath d='M2 6h3l4-3v10l-4-3H2z' fill='%23ffffaa' stroke='%23000'/%3E%3Cpath d='M11 5c1 1 1 5 0 6M13 3c2 2 2 8 0 10' stroke='%23000' fill='none'/%3E%3C/svg%3E");
}
.ti-net {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect x='1' y='5' width='9' height='6' fill='%23c0c0c0' stroke='%23000'/%3E%3Crect x='7' y='3' width='8' height='8' fill='%23c0c0c0' stroke='%23000'/%3E%3Cpath d='M3 7 L8 7 M3 9 L8 9 M9 5 L13 5 M9 7 L13 7' stroke='%23000'/%3E%3C/svg%3E");
}
.clock {
  font-size: 14px;
  font-weight: 500;
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid var(--gray-dark);
  min-width: 72px;
  text-align: right;
}

/* ─── Start menu ─── */
.start-menu {
  position: fixed;
  bottom: 34px;
  left: 3px;
  width: 240px;
  background: var(--gray);
  border: 1px solid;
  border-color: var(--white) var(--gray-darker) var(--gray-darker) var(--white);
  box-shadow:
    inset -1px -1px 0 var(--gray-dark),
    inset  1px  1px 0 var(--gray-light),
    3px 3px 10px rgba(0,0,0,0.4);
  z-index: 999;
  display: none;
}
.start-menu.open { display: flex; }

.start-banner {
  width: 34px;
  background: linear-gradient(to bottom, #000080 0%, #1084d0 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10px 0;
  position: relative;
}
.banner-text {
  color: var(--white);
  font-weight: 700;
  font-size: 18px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 2px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
}
.banner-97 { color: #b3d4ff; font-weight: 500; }

.start-items {
  flex: 1;
  padding: 3px;
}
.start-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  font-size: 15px;
  text-align: left;
  color: var(--black);
  font-weight: 500;
}
.start-item:hover {
  background: var(--blue);
  color: var(--white);
}
.start-item:hover .si-ico { filter: brightness(1.05); }
.si-ico {
  width: 26px; height: 26px;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  flex-shrink: 0;
}
.si-doc    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' shape-rendering='crispEdges'%3E%3Cpath d='M4 2h10l4 4v14H4z' fill='%23fff' stroke='%23000'/%3E%3Cpath d='M14 2v4h4' stroke='%23000' fill='none'/%3E%3Cpath d='M7 10h8M7 13h8M7 16h5' stroke='%23000080'/%3E%3C/svg%3E"); }
.si-word   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' shape-rendering='crispEdges'%3E%3Cpath d='M4 2h10l4 4v14H4z' fill='%231c5fb8' stroke='%23000'/%3E%3Ctext x='11' y='16' font-family='serif' font-weight='bold' font-size='10' fill='%23fff' text-anchor='middle'%3EW%3C/text%3E%3C/svg%3E"); }
.si-folder { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' shape-rendering='crispEdges'%3E%3Cpath d='M2 6h7l1 1h10v12H2z' fill='%23ffcc44' stroke='%23000'/%3E%3C/svg%3E"); }
.si-cog    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' shape-rendering='crispEdges'%3E%3Cpath d='M11 3l1.5 1.5L14 4l.5 1.5L16 5l-.5 2L17 8.5l-1 1.5 1 1.5-1.5 1.5.5 1.5L14 14l-.5 1.5L12 15l-1 2-1-2-1.5 1.5L8 14l-1.5.5L6 13l-1.5-1.5L5 10 4 8.5 5.5 7 5 5.5 6.5 5 6 4l1.5.5L9 3z' fill='%23c0c0c0' stroke='%23000'/%3E%3Ccircle cx='11' cy='11' r='3' fill='%23fff' stroke='%23000'/%3E%3C/svg%3E"); }
.si-mail   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' shape-rendering='crispEdges'%3E%3Crect x='3' y='6' width='16' height='10' fill='%23fff' stroke='%23000'/%3E%3Cpath d='M3 6 L11 12 L19 6' fill='none' stroke='%23000'/%3E%3C/svg%3E"); }
.si-globe  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' shape-rendering='crispEdges'%3E%3Ccircle cx='11' cy='11' r='8' fill='%234fb0d8' stroke='%23000'/%3E%3Cpath d='M11 3v16M3 11h16M5 6c3 4 3 6 0 10M17 6c-3 4-3 6 0 10' fill='none' stroke='%23000'/%3E%3C/svg%3E"); }
.si-music  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' shape-rendering='crispEdges'%3E%3Crect x='2' y='3' width='18' height='16' fill='%23222' stroke='%23000'/%3E%3Cpath d='M5 9h4l3-3v10l-3-3H5z' fill='%23ffcc00'/%3E%3Cpath d='M15 8c1.5 1.5 1.5 4.5 0 6M17 6c2.5 2.5 2.5 7.5 0 10' fill='none' stroke='%23ffcc00'/%3E%3C/svg%3E"); }
.si-shutdown { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' shape-rendering='crispEdges'%3E%3Cpath d='M7 5 A7 7 0 1 0 15 5' fill='none' stroke='%23000' stroke-width='2'/%3E%3Cpath d='M11 2 v8' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E"); }

.start-divider {
  height: 0;
  border-top: 1px solid var(--gray-dark);
  border-bottom: 1px solid var(--white);
  margin: 5px 3px;
}

/* ─── Responsive: keep the desktop metaphor, simplify only the small screens ─── */
/* ─── Mobile phone shell — hidden on desktop/tablet, shown ≤720px ─── */
.phone-shell { display: none; }
.mobile-section-app { display: none !important; }
.ph-icon { background-repeat: no-repeat; background-size: contain; background-position: center; }
.ph-i-comp   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Cpath d='M4 6h22v14H4z' fill='%23c0c0c0' stroke='%23000'/%3E%3Cpath d='M6 8h18v10H6z' fill='%23008080'/%3E%3Cpath d='M10 22h10v2H10z' fill='%23c0c0c0' stroke='%23000'/%3E%3Cpath d='M8 24h14v2H8z' fill='%23c0c0c0' stroke='%23000'/%3E%3Crect x='7' y='9' width='2' height='2' fill='%23ffff00'/%3E%3C/svg%3E"); }
.ph-i-doc    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Cpath d='M6 3h14l6 6v20H6z' fill='%23fff' stroke='%23000'/%3E%3Cpath d='M20 3v6h6' fill='%23ddd' stroke='%23000'/%3E%3Cpath d='M10 14h12M10 18h12M10 22h8' stroke='%23000080'/%3E%3C/svg%3E"); }
.ph-i-folder { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Cpath d='M2 10h10l2 2h16v16H2z' fill='%23ffcc44' stroke='%23000'/%3E%3C/svg%3E"); }
.ph-i-cog    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Cpath d='M16 4l2 3 3-1 1 3 3 1-1 3 3 2-3 2 1 3-3 1-1 3-3-1-2 3-2-3-3 1-1-3-3-1 1-3-3-2 3-2-1-3 3-1 1-3 3 1z' fill='%23c0c0c0' stroke='%23000'/%3E%3Ccircle cx='16' cy='16' r='5' fill='%23fff' stroke='%23000'/%3E%3C/svg%3E"); }
.ph-i-mail   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Crect x='3' y='8' width='26' height='18' fill='%23fff' stroke='%23000'/%3E%3Cpath d='M3 8 L16 19 L29 8' fill='none' stroke='%23000'/%3E%3C/svg%3E"); }
.ph-i-music  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Crect x='2' y='2' width='28' height='28' fill='%23222'/%3E%3Cpath d='M6 10 L12 10 L16 6 L16 26 L12 22 L6 22 z' fill='%23ffcc00'/%3E%3Cpath d='M20 10 c3 0 3 12 0 12 M24 6 c5 0 5 20 0 20' fill='none' stroke='%23ffcc00' stroke-width='1.5'/%3E%3C/svg%3E"); }
.ph-i-note   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Cpath d='M6 3h14l6 6v20H6z' fill='%23fff' stroke='%23000'/%3E%3Cpath d='M20 3v6h6' fill='%23ddd' stroke='%23000'/%3E%3Cpath d='M10 14h12M10 18h12M10 22h6' stroke='%23000'/%3E%3C/svg%3E"); }

@media (max-width: 1080px) {
  html, body {
    height: 100%;
    min-height: 100dvh;
    overflow: hidden;
  }

  .desktop {
    min-height: 100dvh;
  }

  .desktop-icons {
    display: flex;
  }

  .main-window {
    width: min(760px, calc(100vw - 132px));
    min-width: 0;
    height: min(700px, calc(100dvh - 488px));
    max-height: calc(100dvh - 488px);
    top: 16px;
    left: 112px;
    right: auto;
    bottom: auto;
  }

  .note-window {
    display: none;
    width: min(380px, calc(100vw - 24px));
    max-height: calc(100dvh - 56px);
    top: 12px;
    right: 12px;
    bottom: auto;
    left: auto;
    overflow: hidden;
  }

  .notepad-body {
    max-height: calc(100dvh - 134px);
    overflow-y: auto;
  }

  .music-window {
    display: block;
    width: min(340px, calc(100vw - 132px));
    top: auto;
    right: 20px;
    left: auto;
    bottom: 42px;
    overflow: hidden;
  }

  .spotify-embed {
    height: 300px;
  }

  .window-body {
    height: auto;
    flex: 1;
  }

  .title-bar {
    cursor: default;
  }

  .toolbar,
  .menu-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tool-btn {
    flex-shrink: 0;
  }

  .addr-path {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }

  .explorer-pane {
    width: 190px;
  }

  .content-pane {
    padding: 18px;
  }

  .task-app {
    max-width: 170px;
  }
}

@media (min-width: 721px) and (max-width: 1080px) and (orientation: landscape) {
  .main-window {
    width: calc(100vw - 444px);
    height: calc(100dvh - 56px);
    max-height: calc(100dvh - 56px);
  }

  .music-window {
    width: 280px;
    top: 16px;
    right: 20px;
    bottom: auto;
  }

  .spotify-embed {
    height: min(300px, calc(100dvh - 98px));
  }
}

@media (max-width: 720px) {
  body { font-size: 15px; }

  /* The desktop metaphor doesn't fit a phone — hide it entirely. */
  .desktop-icons,
  .taskbar,
  .start-menu { display: none !important; }

  /* Windows stay hidden until launched as a fullscreen "app". */
  .main-window,
  .note-window,
  .music-window { display: none; }

  /* ===== Phone shell ===== */
  .phone-shell {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    z-index: 400;
    background: var(--teal);
  }

  .phone-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 30px;
    padding: 0 12px;
    background: linear-gradient(90deg, var(--blue), var(--blue-light));
    color: #fff;
    font-weight: bold;
    font-size: 15px;
    flex-shrink: 0;
    box-shadow: 0 1px 0 rgba(0,0,0,0.3);
  }
  .ph-start { display: flex; align-items: center; gap: 6px; letter-spacing: 0.3px; }
  .ph-start b { font-weight: 400; color: #b3d4ff; }
  .ph-clock { font-variant-numeric: tabular-nums; }

  /* ===== Home screen ===== */
  .phone-home {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 14px 28px;
    background: radial-gradient(circle at 50% 30%, #00a0a0 0%, var(--teal) 70%);
  }

  .phone-greeting {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 20px;
    background: var(--gray);
    border: 1px solid;
    border-color: var(--gray-light) var(--gray-darker) var(--gray-darker) var(--gray-light);
    box-shadow: inset -1px -1px 0 var(--gray-dark), inset 1px 1px 0 var(--white);
  }
  .ph-avatar {
    width: 52px; height: 52px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 30% 25%, #2ce877, #0a5d2b);
    color: #062814; font-weight: 900; font-size: 22px;
    border: 1px solid var(--gray-darker);
  }
  .ph-hi { font-size: 19px; font-weight: bold; line-height: 1.1; }
  .ph-sub { font-size: 13px; color: var(--gray-darker); margin-top: 3px; }

  .phone-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 6px;
  }
  .ph-app {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 12px 4px;
    background: transparent;
    border: 1px solid transparent;
    color: #fff;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.9);
    font-family: var(--ff-mono);   /* VT323 — retro terminal vibe, phone only */
    font-size: 18px;
    letter-spacing: 0.5px;
    line-height: 1.05;
  }
  .ph-app:active {
    background: rgba(255,255,255,0.14);
    border-style: dotted;
    border-color: #fff;
  }
  .ph-app .ph-icon { width: 48px; height: 48px; }

  /* ===== Bottom command bar (only while an app is open) ===== */
  .phone-navbar { display: none; }
  body.phone-app-open .phone-navbar {
    display: flex; align-items: center; gap: 12px;
    position: fixed; left: 0; right: 0; bottom: 0;
    height: 48px; z-index: 700;
    padding: 0 8px;
    background: var(--gray);
    border-top: 1px solid var(--white);
    box-shadow: inset 0 1px 0 var(--gray-light);
  }
  .ph-home {
    display: flex; align-items: center; gap: 6px;
    height: 36px; padding: 0 18px;
    background: var(--gray);
    border: 1px solid;
    border-color: var(--white) var(--gray-darker) var(--gray-darker) var(--white);
    box-shadow: inset -1px -1px 0 var(--gray-dark), inset 1px 1px 0 var(--gray-light);
    font-weight: bold; font-size: 15px;
  }
  .ph-home:active {
    border-color: var(--gray-darker) var(--white) var(--white) var(--gray-darker);
    box-shadow: inset 1px 1px 0 var(--gray-dark), inset -1px -1px 0 var(--gray-light);
  }
  .ph-appname { font-size: 15px; font-weight: bold; color: var(--gray-darker); }

  /* ===== Welcome notification — small auto-dismissing balloon ===== */
  .phone-toast {
    position: fixed;
    left: 16px; right: 16px; bottom: 24px;
    z-index: 800;
    display: flex; align-items: center; gap: 9px;
    padding: 8px 11px;
    background: #fffce0;
    border: 1px solid #000;
    box-shadow: 3px 4px 0 rgba(0,0,0,0.22);
    animation: toastPop 460ms cubic-bezier(.34,1.56,.64,1) both;
  }
  .phone-toast.out  { animation: toastOut 400ms cubic-bezier(.4,0,1,1) forwards; }
  .phone-toast.dismissed { display: none; }
  body.phone-app-open .phone-toast { display: none; }
  @keyframes toastPop {
    from { opacity: 0; transform: translateY(48px) scale(0.9); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }
  @keyframes toastOut {
    to { opacity: 0; transform: translateY(48px) scale(0.95); }
  }
  .toast-icon {
    width: 26px; height: 26px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--blue), var(--blue-light));
    color: #fff; font-size: 13px;
    border: 1px solid #000;
  }
  .toast-body { flex: 1; min-width: 0; }
  .toast-title { display: block; font-weight: bold; font-size: 13px; margin-bottom: 1px; color: #000; }
  .toast-text  { display: block; font-size: 11.5px; line-height: 1.35; color: #444; }

  /* ===== App open: fullscreen window above the home screen ===== */
  body.phone-app-open .phone-statusbar,
  body.phone-app-open .phone-home { display: none; }

  body.phone-app-open .main-window.app-active,
  body.phone-app-open .note-window.app-active,
  body.phone-app-open .music-window.app-active {
    /* !important beats the INLINE styles the desktop window-manager JS sets:
       z-index from focusWindow() (which sat the window BEHIND the teal shell),
       plus left/top/width/transform from dragging. */
    display: flex !important;
    flex-direction: column;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 48px !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    transform: none !important;
    margin: 0 !important;
    z-index: 900 !important;
  }
  body.phone-app-open .app-active .title-controls { display: none; }
  body.phone-app-open .app-active .title-bar { cursor: default; }

  /* Main window as an app — strip the explorer chrome, content fills */
  body.phone-app-open .main-window.app-active .menu-bar,
  body.phone-app-open .main-window.app-active .toolbar,
  body.phone-app-open .main-window.app-active .addr-bar,
  body.phone-app-open .main-window.app-active .explorer-pane,
  body.phone-app-open .main-window.app-active .status-bar { display: none; }
  body.phone-app-open .main-window.app-active .window-body {
    flex: 1; min-height: 0; flex-direction: column;
  }
  body.phone-app-open .main-window.app-active .content-pane {
    flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  }

  /* Music app — real Spotify embed fills, EQ strip on top */
  body.phone-app-open .music-window.app-active .music-body {
    display: flex; flex-direction: column;
    flex: 1; height: auto; padding: 4px;
  }
  body.phone-app-open .music-window.app-active .mini-player { display: none; }
  body.phone-app-open .music-window.app-active .music-viz {
    display: flex; height: 30px; margin: 0 0 4px;
  }
  body.phone-app-open .music-window.app-active .spotify-embed {
    display: block; flex: 1; width: 100%; height: auto; min-height: 0;
  }

  /* Notepad app fills */
  body.phone-app-open .note-window.app-active .notepad-body {
    flex: 1; max-height: none;
  }

  /* ===== Content styling inside the apps ===== */
  .content-pane { padding: 16px; font-size: 15px; }
  .section-head { gap: 12px; margin-bottom: 16px; padding-bottom: 12px; }
  .section-head h2 { font-size: 24px; }
  .big-icon { width: 40px; height: 40px; }
  .prose p { font-size: 15px; }
  .callout { padding: 12px; align-items: flex-start; }
  .job { padding: 12px; }
  .bullets { margin-left: 16px; }
  .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 8px; }
  .file-name { max-width: 100%; }
  .contact-table,
  .contact-table tbody,
  .contact-table tr,
  .contact-table td { display: block; width: 100%; }
  .contact-table td { padding: 8px 10px; }
  .contact-table td.key { width: 100%; padding-bottom: 2px; }
  .contact-table a { overflow-wrap: anywhere; }
  .ini-block { font-size: 18px; }
}

@media (max-width: 390px) {
  .phone-grid { gap: 14px 6px; }
  .ph-app { font-size: 16px; }
  .ph-app .ph-icon { width: 44px; height: 44px; }
  .content-pane { padding: 13px 11px; }
  .section-head h2 { font-size: 21px; }
  .file-grid { grid-template-columns: 1fr; }
  .ini-block { font-size: 17px; }
}
