/* ============================================================
   vscode.css — a VS Code "Dark Modern"-style shell (Windows layout)
   for the Projects section. Dark editor + gold/amber accent.
   Main readable text uses the handwritten Thebestfont.
   ============================================================ */

@font-face {
  font-family: "Thebestfont";
  src: url("../assets/fonts/ThebestfontRegular.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Shades of Purple (Super Dark) — sampled from Del's editor */
  --vsc-editor:   #1e1e3f;
  --vsc-chrome:   #191933;   /* title bar / activity bar (a touch darker) */
  --vsc-sidebar:  #1e1e3f;
  --vsc-tab-bar:  #191933;
  --vsc-text:     #ffffff;
  --vsc-muted:    #a599e9;   /* lavender — file names, line numbers, secondary text */
  --vsc-faint:    #6a6799;
  --vsc-border:   #2d2b55;   /* medium purple used for borders/dividers */
  --vsc-hover:    #2d2b55;   /* list hover / selection purple */
  --vsc-active:   #2d2b55;
  --accent:       #fad000;   /* signature Shades-of-Purple gold */
  --accent-deep:  #ff9d00;
  --sel-purple:   #6943ff;
  --icon-html:    #ff9d00;
  --icon-css:     #9effff;
  --syntax-comment: #b362ff;
  --hand: "Thebestfont", "Segoe Script", cursive;
  --ui: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "Consolas", "SF Mono", monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }
body.vscode {
  margin: 0;
  background: var(--vsc-editor);
  color: var(--vsc-text);
  font-family: var(--ui);
  font-size: 13px;
  overflow: hidden;
}

.vsc-window {
  display: grid;
  grid-template-rows: 35px 1fr 22px;
  height: 100vh;
}

/* ============================================================
   Title bar — Windows layout: menu (left) · search (center) ·
   layout toggles + min/max/close (right)
   ============================================================ */
.vsc-titlebar {
  background: var(--vsc-chrome);
  display: flex;
  align-items: center;
  height: 100%;
  border-bottom: 1px solid #1a1a1a;
  -webkit-user-select: none;
  user-select: none;
}
.tb-left { display: flex; align-items: center; gap: 12px; padding-left: 10px; flex: 1; min-width: 0; }
.app-logo { display: inline-flex; width: 20px; height: 20px; color: var(--accent); flex: 0 0 auto; }
.app-logo svg { width: 20px; height: 20px; }

/* Plain-language "back to the room" affordance, sitting next to the
   app-branding badge above (which links to the same place but reads as
   decorative theming, not navigation). .tb-left's flex gap spaces it out. */
.home-link { display: inline-flex; width: 18px; height: 18px; color: var(--vsc-faint); flex: 0 0 auto; transition: color 0.15s ease; }
.home-link svg { width: 18px; height: 18px; }
.home-link:hover, .home-link:focus-visible { color: var(--accent); }
.vsc-menu { display: flex; gap: 13px; }
.vsc-menu span { color: var(--vsc-text); font-size: 12px; opacity: 0.9; }

.tb-center { display: flex; align-items: center; gap: 6px; flex: 0 1 480px; justify-content: center; }
.nav-arrow { background: none; border: 0; color: var(--vsc-faint); font-size: 18px; line-height: 1; width: 22px; height: 24px; cursor: default; }
.vsc-search {
  flex: 1; max-width: 440px; height: 25px;
  background: #14122b; border: 1px solid #2d2b55; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  color: var(--vsc-muted); font-size: 12px;
}
.vsc-search svg { width: 13px; height: 13px; }

.tb-right { display: flex; align-items: center; flex: 1; justify-content: flex-end; height: 100%; }
.tb-layout { display: flex; gap: 12px; padding-right: 12px; color: var(--vsc-muted); }
.tb-layout svg { width: 17px; height: 17px; }
.win-controls { display: flex; height: 100%; }
.wc { width: 46px; height: 100%; display: flex; align-items: center; justify-content: center; background: none; border: 0; color: var(--vsc-text); }
.wc svg { width: 11px; height: 11px; }
.wc:hover { background: rgba(255, 255, 255, 0.08); }
.wc.close:hover { background: #c42b1c; color: #fff; }

/* ============================================================
   Body: activity bar · sidebar · editor
   ============================================================ */
.vsc-body { display: grid; grid-template-columns: 48px 250px 1fr; min-height: 0; }

.vsc-activity {
  background: var(--vsc-chrome);
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 0;
}
.vsc-activity .spacer { flex: 1; }
.vsc-act {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  color: #868686; position: relative;
  background: none; border: 0; cursor: pointer; text-decoration: none;
}
.vsc-act:hover { color: #ffffff; }
.vsc-act.active { color: #ffffff; }
.vsc-act.active::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 2px; background: var(--accent);
}
.vsc-act svg { width: 24px; height: 24px; }

/* Sidebar / Explorer */
.vsc-sidebar { background: var(--vsc-sidebar); border-right: 1px solid var(--vsc-border); overflow-y: auto; min-width: 0; }
.vsc-sidebar-head { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--vsc-muted); padding: 10px 20px 6px; }
.vsc-project-head { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--vsc-text); padding: 6px 12px 6px 20px; }

.tree summary {
  list-style: none; display: flex; align-items: center; gap: 4px;
  padding: 3px 12px 3px 18px; cursor: pointer; color: var(--vsc-text);
}
.tree summary::-webkit-details-marker { display: none; }
.tree summary:hover { background: var(--vsc-hover); }
.tree .chevron { width: 16px; height: 16px; flex: 0 0 16px; transition: transform 0.12s ease; color: var(--vsc-muted); }
.tree details[open] > summary .chevron { transform: rotate(90deg); }
.tree .folder-name, .tree .file-name { font-family: var(--hand); font-size: 17px; line-height: 1.1; }
.tree .icon { width: 16px; height: 16px; flex: 0 0 16px; }

.tree .file { display: flex; align-items: center; gap: 6px; padding: 3px 12px 3px 42px; color: var(--vsc-text); text-decoration: none; }
/* Top-level file (no parent folder): align its icon with the folder icons above. */
.tree .file.root { padding-left: 38px; }
.tree .file:hover { background: var(--vsc-hover); }
.tree .file.active { background: #2d2b55; box-shadow: inset 0 0 0 1px #4b4790; color: #ffffff; }
.tree .file .icon.html { color: var(--icon-html); }
.tree .file .icon.css { color: var(--icon-css); }

/* Editor */
.vsc-editor { display: flex; flex-direction: column; min-width: 0; background: var(--vsc-editor); }
.vsc-tabs { display: flex; background: var(--vsc-tab-bar); border-bottom: 1px solid var(--vsc-border); height: 35px; }
.vsc-tab { display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 100%; background: var(--vsc-tab-bar); color: var(--vsc-muted); border-right: 1px solid var(--vsc-border); font-family: var(--mono); font-size: 12.5px; position: relative; }
.vsc-tab.active { background: var(--vsc-editor); color: var(--vsc-text); }
.vsc-tab.active::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--accent); }
.vsc-tab .icon { width: 15px; height: 15px; }
.vsc-tab .icon.html { color: var(--icon-html); }
.vsc-tab .icon.css { color: var(--icon-css); }

.vsc-breadcrumb { padding: 5px 18px; color: var(--vsc-faint); font-family: var(--mono); font-size: 12px; border-bottom: 1px solid var(--vsc-border); }

.vsc-content { padding: 34px 40px 60px; overflow-y: auto; flex: 1; }
.vsc-content .inner { max-width: 900px; margin: 0 auto; }

.hand { font-family: var(--hand); }
.vsc-content h1 { font-family: var(--hand); font-weight: 400; font-size: 52px; line-height: 1.05; margin: 0 0 6px; color: #ffffff; }
.vsc-content h2 { font-family: var(--hand); font-weight: 400; font-size: 32px; margin: 40px 0 14px; color: var(--vsc-text); }
.vsc-content .lead { font-family: var(--hand); font-size: 22px; color: var(--vsc-muted); margin: 0 0 8px; }
.vsc-content p { color: var(--vsc-muted); line-height: 1.6; max-width: 62ch; }
.vsc-content a { color: var(--accent); }
.vsc-content strong { color: #e6e6e6; }

.code-comment { font-family: var(--mono); color: var(--syntax-comment); font-size: 13px; margin: 0 0 24px; }

.file-cta-row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 26px; }
.file-cta { display: flex; align-items: center; gap: 12px; background: #201f3d; border: 1px solid var(--vsc-border); border-radius: 8px; padding: 16px 18px; text-decoration: none; color: var(--vsc-text); min-width: 260px; transition: border-color 0.15s, background 0.15s; }
.file-cta:hover { border-color: var(--accent); background: #2a2850; }
.file-cta .icon { width: 26px; height: 26px; flex: 0 0 26px; }
.file-cta .icon.html { color: var(--icon-html); }
.file-cta .icon.css { color: var(--icon-css); }
.file-cta .cta-file { font-family: var(--mono); font-size: 14px; color: #fff; }
.file-cta .cta-desc { font-family: var(--hand); font-size: 17px; color: var(--vsc-muted); }

.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 18px 0 10px; }
.proj-card { background: #201f3d; border: 1px solid var(--vsc-border); border-radius: 8px; overflow: hidden; text-decoration: none; color: var(--vsc-text); transition: transform 0.15s, border-color 0.15s; }
.proj-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.proj-thumb { aspect-ratio: 4/3; background: #2d2b55; display: flex; align-items: center; justify-content: center; color: var(--vsc-muted); font-family: var(--mono); font-size: 12px; }
.proj-title { padding: 10px 12px; font-family: var(--hand); font-size: 18px; }
.proj-meta { padding: 0 12px 12px; margin: -6px 0 0; font-family: var(--ui); font-size: 12px; color: var(--vsc-muted); }

/* Live mini-preview thumbnails: the real deployed site, scaled down to fit
   the 4:3 card window. `width/height:400%` + `scale(.25)` keeps the preview
   proportional at any card width without hardcoding pixel sizes. Purely
   decorative (the card itself is the link), so it's inert to pointer/AT. */
.proj-thumb.live-embed { position: relative; overflow: hidden; padding: 0; background: #fff; }
.proj-thumb.live-embed iframe {
  position: absolute; top: 0; left: 0; width: 400%; height: 400%;
  border: 0; transform: scale(0.25); transform-origin: 0 0;
  pointer-events: none;
}
.proj-thumb.live-embed .live-badge {
  position: absolute; bottom: 6px; left: 7px; z-index: 2;
  background: rgba(10, 9, 25, 0.72); color: #fff;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em;
  padding: 2px 7px; border-radius: 20px; display: flex; align-items: center; gap: 5px;
}
.proj-thumb.live-embed .live-dot { width: 6px; height: 6px; border-radius: 50%; background: #3ec6a8; display: inline-block; }

/* ============================================================
   "Simple Browser" panel — a mock in-editor browser tab (VS Code's
   Live Preview extension) used on project detail pages to embed the
   actual deployed site full-size, with a fake address bar for context.
   ============================================================ */
.sim-browser { background: #14122b; border: 1px solid var(--vsc-border); border-radius: 10px; overflow: hidden; margin: 6px 0 28px; }
.sim-browser-bar { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #201f3d; border-bottom: 1px solid var(--vsc-border); }
.sim-browser-dots { display: flex; gap: 6px; flex: 0 0 auto; }
.sim-browser-dots span { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.sim-browser-dots span:nth-child(1) { background: #e5484d; }
.sim-browser-dots span:nth-child(2) { background: #ffb238; }
.sim-browser-dots span:nth-child(3) { background: #3ec6a8; }
.sim-browser-url {
  flex: 1; min-width: 0; background: #0e0d20; border: 1px solid var(--vsc-border);
  border-radius: 6px; padding: 6px 12px; font-family: var(--mono); font-size: 12px;
  color: var(--vsc-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sim-browser-open { flex: 0 0 auto; font-family: var(--mono); font-size: 12px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.sim-browser-open:hover { text-decoration: underline; }
.sim-browser iframe { display: block; width: 100%; height: 1100px; border: 0; background: #fff; }
.sim-browser-fallback { padding: 10px 14px; font-family: var(--mono); font-size: 11.5px; color: var(--vsc-faint); border-top: 1px solid var(--vsc-border); }
.sim-browser-fallback a { color: var(--accent); }

.case-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 22px; }
.case-tag { font-family: var(--mono); font-size: 11px; color: var(--vsc-muted); background: #201f3d; border: 1px solid var(--vsc-border); border-radius: 20px; padding: 4px 11px; }

.case-actions { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 34px; }
.case-btn { font-family: var(--hand); font-size: 17px; padding: 10px 20px; border-radius: 8px; text-decoration: none; border: 1px solid var(--vsc-border); color: var(--vsc-text); transition: border-color 0.15s, background 0.15s; }
.case-btn:hover { border-color: var(--accent); background: #2a2850; }
.case-btn.primary { background: var(--accent); color: #1a1300; border-color: var(--accent); font-weight: 600; }
.case-btn.primary:hover { background: #ffd84d; }

.case-back { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; color: var(--vsc-muted); text-decoration: none; margin-bottom: 18px; }
.case-back:hover { color: var(--accent); }

@media (max-width: 760px) {
  .sim-browser iframe { height: 700px; }
}

/* Status bar */
.vsc-statusbar { background: var(--vsc-chrome); border-top: 1px solid #1a1a1a; display: flex; align-items: center; gap: 14px; padding: 0 12px; color: var(--vsc-muted); font-size: 12px; }
.vsc-statusbar .right { margin-left: auto; display: flex; gap: 14px; }

/* ============================================================
   Illustrator "dock/taskbar" app icon — hops for attention like a
   Windows app with a pending update, and links back to the design
   page. Pure CSS; markup lives at the bottom of web_projects.html.
   ============================================================ */
.ai-dock {
  position: fixed;
  left: 24px;
  bottom: 40px;              /* clears the 22px status bar */
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  z-index: 9998;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.5));
  animation: ai-dock-hop 2.8s cubic-bezier(0.28, 0.84, 0.42, 1) infinite;
}
.ai-dock-icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  background: #310e00; border: 1.5px solid #7a3d00; border-radius: 11px;
  color: #ff9a2e; font-weight: 800; font-size: 20px; letter-spacing: -0.5px;
}
.ai-dock:hover .ai-dock-icon { border-color: #ff9a2e; }
.ai-dock-badge {
  position: absolute; top: -3px; right: -3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #e5484d; box-shadow: 0 0 0 2px var(--vsc-editor);
}

/* Bounce twice, then rest for the remainder of the cycle (dock-style). */
@keyframes ai-dock-hop {
  0%   { transform: translateY(0); }
  8%   { transform: translateY(-16px); }
  16%  { transform: translateY(0); }
  22%  { transform: translateY(-7px); }
  28%  { transform: translateY(0); }
  100% { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .ai-dock { animation: none; }
}

/* ---- Responsive ---- */
@media (max-width: 760px) {
  body.vscode { overflow: auto; }
  .vsc-window { grid-template-rows: 35px auto 22px; height: auto; min-height: 100vh; }
  .tb-center { display: none; }
  .tb-layout { display: none; }
  .vsc-menu span:nth-child(n+5) { display: none; }
  .vsc-body { display: block; }
  .vsc-activity { flex-direction: row; justify-content: flex-start; padding: 2px 4px; }
  .vsc-act { width: 42px; height: 40px; }
  .vsc-activity .spacer { display: none; }
  .vsc-sidebar { border-right: 0; border-bottom: 1px solid var(--vsc-border); max-height: 38vh; }
  .proj-grid { grid-template-columns: 1fr 1fr; }
  .vsc-content { padding: 24px 20px 48px; }
  .vsc-content h1 { font-size: 40px; }
}
